Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crates/tinyagents-harness-tools/src/scratchpad/store.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//! Persistence for the per-thread scratchpad, on the harness
//! [`Store`](tinyagents_harness::store::Store).
//! [`Store`].
//!
//! One serialized [`Scratchpad`] per thread under [`SCRATCHPAD_NAMESPACE`],
//! keyed by the hex-encoded thread id, written `load → apply → put` under a
Expand Down
2 changes: 1 addition & 1 deletion crates/tinyagents-harness-tools/src/state_block/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
//! and those of its last finished task ([`crate::scratchpad`]), written
//! through the `todo` tool's note arguments;
//! - **the ledger**: facts derived from the run's own tool calls with no model
//! involved ([`ledger`]): the last few failed calls with their exit code and
//! involved (`ledger`): the last few failed calls with their exit code and
//! first stderr line, executables a shell reported missing, and files
//! written by write/edit tools. Facts correct themselves: a later success of
//! the same command clears its failure, and a later successful command that
Expand Down
4 changes: 2 additions & 2 deletions crates/tinyagents-harness/src/agent_loop/tools.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2417,7 +2417,7 @@ impl<State: Send + Sync, Ctx: Send + Sync> AgentHarness<State, Ctx> {
/// Reconciles unresolved tool-effect-ledger rows (B5) before resuming a
/// run from durable transcript `messages`.
///
/// A crash between [`Self::record_tool_effect_started`] and the matching
/// A crash between `Self::record_tool_effect_started` and the matching
/// settle write (or between the settle write and the tool result being
/// folded into `messages`) leaves a `started` row a resumed run must
/// resolve one way or another before it can safely feed `messages` back
Expand Down Expand Up @@ -2456,7 +2456,7 @@ impl<State: Send + Sync, Ctx: Send + Sync> AgentHarness<State, Ctx> {
/// mistake: any call id in it is skipped even if its ledger row is
/// (unexpectedly) still `started` — e.g. the `Deferred` settle write
/// above failed and was only logged (settle writes are best-effort, see
/// [`Self::record_tool_effect_settled`]). [`AgentHarness::resume_deferred`]
/// `Self::record_tool_effect_settled`). [`AgentHarness::resume_deferred`]
/// passes the ids `results` is about to answer; any other caller — a host
/// reconciling a genuine crash, where no `results` exists at all — passes
/// an empty set.
Expand Down
2 changes: 1 addition & 1 deletion crates/tinyagents-harness/src/context/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ impl<Ctx> RunContext<Ctx> {
/// child-specific keys.
///
/// This keeps the child's `Ctx` type identical to the parent's, which is
/// what makes propagating [`Self::host_authority`] sound: the type-erased
/// what makes propagating `Self::host_authority` sound: the type-erased
/// authority installed by a hosted invocation is keyed to the exact
/// `(State, Ctx)` pair it was constructed for, and this method is the only
/// place that carries it forward. A recursive call that needs a
Expand Down
2 changes: 1 addition & 1 deletion crates/tinyagents-harness/src/cost/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ fn select_tier(pricing: &ModelPricing, input_tokens: u64) -> Option<&PriceTier>
/// non-cached/non-reasoning remainder only.
///
/// When `pricing` declares [`ModelPricing::tiers`], the tier matching this
/// call's `usage.input_tokens` (see [`select_tier`]) supplies the input,
/// call's `usage.input_tokens` (see `select_tier`) supplies the input,
/// output, cache-read, and cache-write rates, falling back to the flat
/// [`ModelPricing`] fields for any rate the tier leaves unset. Reasoning
/// tokens are always priced at the flat
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ pub const WEB_BUDGET_EXHAUSTED_INSTRUCTION: &str = "The direct web research budg
/// Consecutive failed web calls after which web access looks blocked.
const BLOCKED_AFTER_FAILURES: usize = 2;

/// The one-time note sent after [`BLOCKED_AFTER_FAILURES`] failed web calls in a
/// The one-time note sent after `BLOCKED_AFTER_FAILURES` failed web calls in a
/// row (a blocked network, an offline sandbox).
pub const WEB_BLOCKED_NOTE: &str = "Web access looks blocked: the last web calls failed. Do not keep retrying web tools; continue the task with your other tools and the information already available.";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ impl ToolAllowlistMiddleware {

/// Returns `true` if `name` is on the allowlist.
///
/// Delegates to [`crate::tool::toolset::tool_name_allowed`] — the exact
/// Delegates to `crate::tool::toolset::tool_name_allowed` — the exact
/// membership test [`crate::tool::toolset::FilteredToolSet::allowing`]
/// uses — so this middleware and its `ToolSet` counterpart cannot drift
/// (`docs/runtime-comparison/pydantic-ai.md` §4).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ fn has_extension(segment: &str) -> bool {
}

/// Absolute paths with a file extension that `text` names, in order, deduped
/// and capped at [`MAX_CANDIDATES`].
/// and capped at `MAX_CANDIDATES`.
///
/// Absolute only: a relative token in prose ("see config/settings.yml") is far
/// more often a reference than a deliverable, and a relative path cannot be
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ impl PostCompactionGuard {
}

/// Records one successful call; `repeating` says whether the pair had
/// already recurred [`REPEATING_AT`] times. Before a compaction only
/// already recurred `REPEATING_AT` times. Before a compaction only
/// repeating pairs are remembered. Returns `true` when the guard is armed
/// and this call repeats a remembered pair (and disarms, so one compaction
/// flags at most one repeat).
Expand Down
2 changes: 1 addition & 1 deletion crates/tinyagents-harness/src/retry/failover.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ impl FailoverReason {
}
}

/// The failover table. Pure; see the [module docs](self) for the rationale.
/// The failover table. Pure; see the module docs for the rationale.
pub fn decide(reason: FailoverReason, state: FailoverState) -> FailoverDecision {
use FailoverReason::*;
match reason {
Expand Down
2 changes: 1 addition & 1 deletion crates/tinyagents-harness/src/steering/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ impl SteeringHandle {
/// - When `ctx` has no [`SteeringHandle`], returns
/// [`SteeringOutcome::Continue`] without emitting anything.
/// - Only commands addressed to this run are drained: see
/// [`SteeringHandle::drain`] and [`SteeringHandle::for_child`]. Commands
/// [`SteeringHandle::drain`] and `SteeringHandle::for_child`. Commands
/// addressed to a different run stay queued for it.
/// - Each command is checked **individually** against the run's
/// [`SteeringPolicy`]. A disallowed command is rejected on its own — an
Expand Down
4 changes: 2 additions & 2 deletions crates/tinyagents-harness/src/steering/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ use tinyinference_llm::message::Message;
/// Every [`SteeringHandle`] clone shares one underlying queue (so an
/// orchestrator can hand a single handle to a deeply nested tree and still
/// reach any run in it), but each level of the tree only *drains* the entries
/// addressed to itself — see [`SteeringHandle::for_child`]. Without this, a
/// addressed to itself — see `SteeringHandle::for_child`. Without this, a
/// command meant for the orchestrating run could be consumed by whichever
/// sub-agent happened to reach a checkpoint first.
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
Expand Down Expand Up @@ -302,7 +302,7 @@ pub struct PauseState {
/// A plain `clone()` is a bare alias: it shares this handle's identity
/// (`run_id`/`is_root`) as well as its queue, so it drains exactly the same
/// commands this handle would. When a run spawns a child,
/// [`crate::context::RunContext::child`] calls [`SteeringHandle::for_child`]
/// [`crate::context::RunContext::child`] calls `SteeringHandle::for_child`
/// (not `clone`) so the child only drains commands addressed to it or to
/// [`SteeringTarget::All`] — see that method's docs.
#[derive(Clone)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const MAX_COMMAND_CHARS: usize = 200;
impl TaskLedger {
/// Folds the facts in `messages` into this ledger (which may carry facts
/// from earlier checkpoints). Files keep most-recent order; commands keep
/// the most recent [`MAX_COMMANDS`].
/// the most recent `MAX_COMMANDS`.
pub fn absorb(&mut self, messages: &[Message]) {
if self.original_task.is_none() {
self.original_task = messages
Expand Down
2 changes: 1 addition & 1 deletion crates/tinyagents-harness/src/title/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ pub fn collapse_whitespace(input: &str) -> String {
/// Rules applied (in order):
/// - split on anything that is not alphanumeric (punctuation, quotes, markdown,
/// and whitespace all become word breaks)
/// - drop [`FILLER_WORDS`], unless that would leave nothing
/// - drop `FILLER_WORDS`, unless that would leave nothing
/// - keep the first [`THREAD_TITLE_MAX_WORDS`] words, and stop early rather
/// than exceed [`THREAD_TITLE_MAX_CHARS`]
///
Expand Down
2 changes: 1 addition & 1 deletion crates/tinyagents-harness/src/tool/deferred/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//! Deferred tool calls: the typed, resumable "the loop paused on a tool"
//! output (A2). See [`types`] for the vocabulary and the agent-loop docs for
//! output (A2). See `types` for the vocabulary and the agent-loop docs for
//! how the loop produces and consumes it.

mod types;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use tinytools::ToolSpec;
/// Mirrors Pydantic AI's `defer_loading`/deferred-tools model
/// (`docs/runtime-comparison/pydantic-ai.md` §3.4, `pi.md` §4.1's
/// transcript-carried tool-loadout changes). It advertises
/// [`Self::schemas`] to the model like any other toolset, but never runs one
/// `Self::schemas` to the model like any other toolset, but never runs one
/// of them locally.
///
/// # Host-integration contract
Expand Down
2 changes: 1 addition & 1 deletion crates/tinyagents-harness/src/tool/toolset/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ where

/// Bridges one [`ToolSet`]-owned tool into the [`crate::tool::ToolDispatch`]
/// the agent loop's admission path already speaks, so a name only a toolset
/// chain exposes (not [`crate::tool::ToolRegistry::model_dispatch`]) can be
/// chain exposes (not `crate::tool::ToolRegistry::model_dispatch`) can be
/// admitted and executed through the exact same call path as a directly
/// registered tool — timeout policy, injected-argument handling, schema
/// validation, and every other admission step in `agent_loop/tools.rs` apply
Expand Down
2 changes: 1 addition & 1 deletion crates/tinyagents-harness/src/tool/toolset/prepared/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ impl<State: Send + Sync, Ctx: Send + Sync> PreparedToolSet<State, Ctx> {

/// Convenience constructor: keeps only the schemas a per-schema
/// predicate accepts, ignoring `ctx`. Built on
/// [`retain_matching_schemas`], the same retain logic
/// `retain_matching_schemas`, the same retain logic
/// [`crate::middleware::library::DynamicToolSelectionMiddleware`] uses.
pub fn filtering(
inner: Arc<dyn ToolSet<State, Ctx>>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ pub type SchemaTransform<Ctx> =
Arc<dyn Fn(&RunContext<Ctx>, Vec<ToolSchema>) -> Vec<ToolSchema> + Send + Sync>;

/// [`ToolSet`] adaptor that applies a caller-supplied, per-step
/// [`SchemaTransform`] to an inner toolset's declared schemas.
/// `SchemaTransform` to an inner toolset's declared schemas.
///
/// This is the same seam [`crate::tool::SchemaPreparation`] occupies for
/// provider projection, generalised to a caller-supplied closure that is
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! Best-effort durable observation of one agent turn's progress stream.
//!
//! The ledger writes each [`AgentProgress`](tinyagents_harness::progress::AgentProgress)
//! The ledger writes each [`AgentProgress`]
//! as an append-only run event and keeps the run status aligned with turn
//! completion. It also preserves subagent task-to-parent-call correlation for
//! host projections whose later lifecycle events omit the parent call id.
Expand Down
2 changes: 1 addition & 1 deletion crates/tinyagents-registry/src/pricing/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ fn normalize(model: &str) -> String {
/// Match order: exact canonical id → id with a leading `vendor/` segment
/// stripped → longest canonical id that the request extends with a snapshot
/// decoration only (`gpt-5.4-mini-2026-05-01`, `claude-sonnet-4-5-20250929`,
/// `gemini-2.5-pro-preview-06-05`; see [`is_decorated_id`]). Returns `None`
/// `gemini-2.5-pro-preview-06-05`; see `is_decorated_id`). Returns `None`
/// for unknown models — callers should fall back to a tier estimate.
///
/// Any other suffix names a different model, not a snapshot of a listed one:
Expand Down
Loading