You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Audit of the vendored TinyAgents harness (vendor/tinyagents, pinned b1f0d82) for concrete improvements to agent reliability, cost, and long-horizon behaviour. Verified against the code at that commit (the crate's own docs/audit.md correctness/security findings are all already resolved; the crate's docs/sdk-gaps.md backlog is partly stale — several items are now implemented). Recurring theme: the harness aborts the whole run on recoverable conditions, and re-does expensive work it should cache/persist.
Improvements/PRs land in the upstream tinyhumansai/tinyagents repo (via the M3gA-Mind fork); this tracker lives here because that's where the TinyAgents migration work is coordinated.
[T1] Unary model calls ignore mid-flight cancellation → billed to completion (streaming path already races the cancel token, unary doesn't). agent_loop/model_call.rs.
[T1] Token estimator counts only text blocks → images / tool-result JSON / reasoning ≈ 0 tokens, so compaction & trim silently never trigger on multimodal/tool-heavy runs. message/mod.rs, summarization/mod.rs.
[T1] Default OpenAI(-compatible) profiles omit context windows → context-window-aware compaction no-ops (a hint table exists but is unused). providers/openai/transport.rs.
[T1] Streamed provider failures collapse to an unstructured Model error → permanent errors (401/quota/bad-request) get retried & fallback-churned. model/mod.rs, retry/mod.rs.
[T2] Compaction never persists to the durable transcript → an LLM summarizer re-runs on the entire growing head every turn once over threshold. middleware/library/context.rs, agent_loop/run_loop.rs.
[T2] Summarizer failure aborts the run (no fallback-trim/degrade policy) — precisely on the longest threads. middleware/library/context.rs.
[T2] Any wrap_tool middleware disables the concurrent tool path → with ≥4 wrap middlewares in prod, multi-tool turns run fully serial. Needs a before_tool short-circuit outcome.
[T3] Execution runtime binding the durable TaskStore to live runs + boot resume — the SDK persists task metadata but never runs/resumes a task, so running_subagents.rs can't be retired.
[T3] Durable status store + events→status listener (in-memory only today) so a UI can attach late and reconstruct a run.
[T3] Async, context-aware tool policy + async approval — SDK policy is name-only/sync and approval is a sync bool that raises a fatal interrupt; classification runs before unknown-tool recovery (mutually exclusive).
Tier 4 — observability & completeness
Field-typed redaction (not just literal secrets) · silent front-trim emits no event · fallback chain skips capability gating · sub-agent stream deltas don't reach the parent · push→pull stream helper (absorb the adapter's #4460 shim) · concurrent-fold drops succeeded siblings on failure · parallel-agent builder over map_reduce · couple compaction threshold to reserved output tokens · no-progress ladder has no SDK loop driver / halt control outcome.
Method: 4 parallel subsystem analyses (tool-path, model/streaming/budget, orchestration/durability, long-horizon), each verifying current state against the code rather than the docs.
Audit of the vendored TinyAgents harness (
vendor/tinyagents, pinnedb1f0d82) for concrete improvements to agent reliability, cost, and long-horizon behaviour. Verified against the code at that commit (the crate's owndocs/audit.mdcorrectness/security findings are all already resolved; the crate'sdocs/sdk-gaps.mdbacklog is partly stale — several items are now implemented). Recurring theme: the harness aborts the whole run on recoverable conditions, and re-does expensive work it should cache/persist.Improvements/PRs land in the upstream
tinyhumansai/tinyagentsrepo (via theM3gA-Mindfork); this tracker lives here because that's where the TinyAgents migration work is coordinated.Tier 1 — quick wins (small, surgical) — PRs in progress
agent_loop/model_call.rs.message/mod.rs,summarization/mod.rs.providers/openai/transport.rs.Modelerror → permanent errors (401/quota/bad-request) get retried & fallback-churned.model/mod.rs,retry/mod.rs.agent_loop/run_loop.rs.Tier 2 — stop aborting recoverable turns; stop re-summarizing
InvalidArgsPolicyto mirror the recoverableUnknownToolPolicy; forces the adapter'sSchemaGuardMiddlewarestub-hack.middleware/library/context.rs,agent_loop/run_loop.rs.middleware/library/context.rs.wrap_toolmiddleware disables the concurrent tool path → with ≥4 wrap middlewares in prod, multi-tool turns run fully serial. Needs abefore_toolshort-circuit outcome.Tier 3 — strategic (durability, orchestration, policy migration)
TaskStoreto live runs + boot resume — the SDK persists task metadata but never runs/resumes a task, sorunning_subagents.rscan't be retired.Tier 4 — observability & completeness
Field-typed redaction (not just literal secrets) · silent front-trim emits no event · fallback chain skips capability gating · sub-agent stream deltas don't reach the parent · push→pull stream helper (absorb the adapter's #4460 shim) · concurrent-fold drops succeeded siblings on failure · parallel-agent builder over
map_reduce· couple compaction threshold to reserved output tokens · no-progress ladder has no SDK loop driver / halt control outcome.Already implemented upstream (don't re-open)
Recoverable
UnknownToolPolicy(sentinel deleted) · fail-closed allowlist composition ·BudgetMiddleware(preflight/reserve/reconcile) · top-level reasoning+tool-arg streaming (ThinkingForwarderretired) · durableJsonlTaskStore+ event journals ·map_reducecombinator ·WorkspaceIsolationprimitive · correct middleware onion ordering.Method: 4 parallel subsystem analyses (tool-path, model/streaming/budget, orchestration/durability, long-horizon), each verifying current state against the code rather than the docs.