feat(agent): tinyagents 1.5 migration wave — vendored SDK, dual-write sessions, goals/todos shadows, journals, middleware dedupe#4473
Conversation
…os, no-progress, session cutover) Ground-truth audit of post-tinyhumansai#4249 main + re-inventory of tinyagents 1.4.0/1.5.0. Re-evaluates the deletion ledger's 'never delete' list, adds thread goals / thread tasks migration onto graph::goals / graph::todos, and sequences the remaining ~29k-line reclaim (C0-C7). Claude-Session: https://claude.ai/code/session_013uVSkcdR2eP7hW4xm54wb4
…iles Adds verdicts for extract_tool/handoff, the four task-local context carriers, turn_checkpoint, memory_protocol, definition loader/builtins, and subagent_runner residuals; wires the carriers into C6. Claude-Session: https://claude.ai/code/session_013uVSkcdR2eP7hW4xm54wb4
…ignore Bumps the tinyagents dependency from 1.3.0 to 1.5.0 across Cargo.toml and Cargo.lock files. Updates related documentation to reflect the new version. Additionally, adds *.diff to .gitignore to exclude diff files from version control.
…to in-tree source vendor/tinyagents pinned at v1.5.0 (matches the crates.io requirement); [patch.crates-io] path override in root and app/src-tauri manifests so migration agents can modify SDK source in-tree and PR upstream from the submodule. Both worlds resolve tinyagents v1.5.0 (path); crate checks clean. Claude-Session: https://claude.ai/code/session_013uVSkcdR2eP7hW4xm54wb4
…NoProgressTracker Rewrite the repeated-tool-failure circuit breaker as a thin driver over tinyagents 1.5.0 harness::no_progress::NoProgressTracker instead of the in-house identical/varied/hard-reject failure ladder it replaces. The middleware now owns only OpenHuman-side policy: capture the per-call argument fingerprint in before_tool, feed each outcome into NoProgressTracker::record, and lower the returned NoProgress verdict into steering — Nudge -> SteeringCommand::Redirect (structured 'no progress since step X' corrective), Halt -> record root-cause summary in HaltSummarySlot + SteeringCommand::Pause + tracker.reset(). Continue is a no-op. Deletes the duplicated crate-side ladder constants/logic (NO_PROGRESS_FAILURE_THRESHOLD, HARD_REJECT_REPEAT_THRESHOLD, inline same_count/consecutive counters + summary wording). Unit tests adapted to the tracker-driven behavior (halt now emits Pause; a nudge Redirect precedes it). Claude-Session: https://claude.ai/code/session_013uVSkcdR2eP7hW4xm54wb4
The [patch.crates-io] path override made vendor/tinyagents part of the cargo graph; the Dockerfile now COPYs vendor/ (needed already at the dep-cache stage) and both docker jobs init just that submodule after checkout (targeted init skips the large tauri-cef fork the core image does not need). All other cargo-running CI jobs already checkout with submodules: recursive/true; the mobile crates do not depend on the core crate, so their submodules:false stays. Claude-Session: https://claude.ai/code/session_013uVSkcdR2eP7hW4xm54wb4
…ion + spawn-parallel graphs Adopt tinyagents 1.5.0 CompiledGraph::with_node_retry(RetryPolicy) on the delegation graph (build_delegation_graph) and the live spawn-parallel execution graph (run_spawn_parallel_execution_graph). Adapter-first and behavior-preserving: neither graph carried bespoke retry glue, so the policy is RetryPolicy::default().with_max_attempts(1) — a single attempt, identical to today's semantics — with backoff sleeping left off (the default). This lands the crate seam so raising the attempt cap or enabling backoff becomes a one-line gated follow-up rather than a rewrite. Claude-Session: https://claude.ai/code/session_013uVSkcdR2eP7hW4xm54wb4
…perseded, unknown-tool already done Claude-Session: https://claude.ai/code/session_013uVSkcdR2eP7hW4xm54wb4
📝 WalkthroughWalkthroughThis PR vendors the tinyagents SDK as a git submodule, updates CI workflows and the Dockerfile to initialize it, patches Cargo manifests to resolve tinyagents from the vendored path, bumps the dependency to 1.5.0, adopts new crate retry and no-progress-tracker APIs in graph/middleware code, and updates migration documentation. ChangesVendoring, build wiring, and crate upgrade
Crate API adoption in graph/middleware code
Estimated code review effort: 3 (Moderate) | ~30 minutes Sequence Diagram(s)sequenceDiagram
participant Tool as Tool Call
participant Middleware as RepeatedToolFailureMiddleware
participant Tracker as NoProgressTracker
participant Steering as SteeringHandle
Tool->>Middleware: after_tool(result/error)
Middleware->>Tracker: record(step, ToolAttempt)
Tracker-->>Middleware: NoProgress::Continue/Nudge/Halt
alt Nudge
Middleware->>Steering: SteeringCommand::Redirect
else Halt
Middleware->>Middleware: store halt summary
Middleware->>Steering: SteeringCommand::Pause
Middleware->>Tracker: reset
end
Possibly related issues
Possibly related PRs
Suggested labels: Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5a1227ddf2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| # immediately, and PR the diff upstream from the submodule. Keep the submodule | ||
| # version in lockstep with the `tinyagents` requirement above. After cloning: | ||
| # `git submodule update --init vendor/tinyagents` (worktrees included). | ||
| tinyagents = { path = "vendor/tinyagents" } |
There was a problem hiding this comment.
Run Rust CI when vendored TinyAgents changes
Because this patch makes both Cargo worlds resolve tinyagents from vendor/tinyagents, SDK changes can now change the compiled product without touching Cargo.toml, Cargo.lock, or src/**. I checked the PR CI path filters in .github/workflows/pr-ci.yml and they do not include vendor/tinyagents or .gitmodules, so a PR that only bumps the submodule pointer would skip the Rust quality/coverage lanes and the Playwright artifact build/cache despite changing a compiled dependency. Add the submodule path (and usually .gitmodules) to the Rust/Tauri/playwright filters and related artifact cache keys so vendored SDK updates are actually built and tested.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
Cargo.toml (1)
334-339: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winAutomate the tinyagents lockstep check
The submodule pin and
tinyagents = "1.5.0"requirement are coupled only by comment today; add a CI assertion that comparesvendor/tinyagents/Cargo.toml’s version with the root andapp/src-tauri/Cargo.tomlrequirements.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@Cargo.toml` around lines 334 - 339, Add a CI assertion for the tinyagents lockstep contract so it no longer relies on the comment in Cargo.toml. Create a check that reads the version from vendor/tinyagents/Cargo.toml and compares it against both the root tinyagents requirement and the app/src-tauri/Cargo.toml requirement, failing the build when they diverge. Use the existing tinyagents dependency declarations and the vendored submodule path as the identifiers to wire this into the current CI/test flow.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/tinyagents-full-migration-plan/00-baseline.md`:
- Around line 3-18: Update the baseline doc to match the current tinyagents
1.5.0 state: the section still references a 1.3.0 delta and an inventory
refreshed against 1.3.0, so rename that delta section in 00-baseline.md and
revise the gap notes for the newer API surface. Make sure the updated plan
explicitly covers the 1.4/1.5 additions referenced by the review, including
CompiledGraph::with_node_retry and NoProgressTracker.
In `@docs/tinyagents-full-migration-plan/CONTINUATION-2026-07.md`:
- Around line 15-19: The plan text is inconsistent with the repo’s pinned
baseline: the 00 baseline row and the C0 wording still reference 1.3.0/1.4/1.5
migration steps. Update the `CONTINUATION-2026-07` markdown so the baseline
section and any surrounding “ground truth” notes reflect the already-pinned
`tinyagents = 1.5.0`, and remove or rephrase the stale bump language to match
the current state. Focus on the baseline table entries and any adjacent
narrative that describes the version target.
---
Nitpick comments:
In `@Cargo.toml`:
- Around line 334-339: Add a CI assertion for the tinyagents lockstep contract
so it no longer relies on the comment in Cargo.toml. Create a check that reads
the version from vendor/tinyagents/Cargo.toml and compares it against both the
root tinyagents requirement and the app/src-tauri/Cargo.toml requirement,
failing the build when they diverge. Use the existing tinyagents dependency
declarations and the vendored submodule path as the identifiers to wire this
into the current CI/test flow.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: c011176f-f29e-406f-a23f-cc273e072b5c
⛔ Files ignored due to path filters (2)
Cargo.lockis excluded by!**/*.lockapp/src-tauri/Cargo.lockis excluded by!**/*.lock
📒 Files selected for processing (21)
.github/workflows/release-production.yml.github/workflows/release-staging.yml.gitignore.gitmodulesCargo.tomlDockerfileapp/src-tauri/Cargo.tomldocs/tinyagents-full-migration-plan/00-baseline.mddocs/tinyagents-full-migration-plan/01-tooling/README.mddocs/tinyagents-full-migration-plan/04-sessions/03-checkpointer.mddocs/tinyagents-full-migration-plan/10-registry.mddocs/tinyagents-full-migration-plan/CONTINUATION-2026-07.mddocs/tinyagents-full-migration-plan/HANDOFF-2026-07-03.mddocs/tinyagents-full-migration-plan/README.mddocs/tinyagents-migration-spec.mddocs/tinyagents-session-migration-design.mdgitbooks/developing/architecture/agent-harness.mdsrc/openhuman/agent_orchestration/spawn_parallel_graph.rssrc/openhuman/tinyagents/delegation.rssrc/openhuman/tinyagents/middleware.rsvendor/tinyagents
| Current status (2026-07-03): baseline dependency alignment is complete in both | ||
| Cargo worlds. `tinyagents 1.5.0` is resolved with the `sqlite` feature, | ||
| OpenHuman pins `rusqlite = "=0.40.0"`, both worlds patch through | ||
| `vendor/rusqlite-0.40.0` and `vendor/libsqlite3-sys-0.38.0`, and the SDK-gaps | ||
| inventory has been refreshed against the published 1.3.0 crate source. | ||
|
|
||
| ## Steps | ||
|
|
||
| 1. **Bump `tinyagents` to `"1.3"`** (done in both Cargo worlds — root and | ||
| 1. **Bump `tinyagents` to `"1.5.0"`** (done in both Cargo worlds — root and | ||
| `app/src-tauri/`). Known 1.1→1.2 break already handled | ||
| (`MessageDelta::text` ctor). Note: the `openai` crate feature was removed | ||
| after 1.2.0 (1.2.1+ features are only `sqlite`/`repl`) — we never enabled | ||
| it, so no impact. See "1.3.0 delta" below for new API this plan uses. | ||
| 2. **Align rusqlite to 0.40** in both worlds (`Cargo.toml` root and | ||
| `app/src-tauri/Cargo.toml`). OpenHuman pins `rusqlite = "=0.40.0"` and | ||
| enables `tinyagents = { version = "1.3", features = ["sqlite"] }`. | ||
| enables `tinyagents = { version = "1.5.0", features = ["sqlite"] }`. |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
rg -n 'NoProgressTracker|with_node_retry|1\.4\.0|1\.5\.0' docs/tinyagents-full-migration-plan/CONTINUATION-2026-07.md docs/tinyagents-full-migration-plan/HANDOFF-2026-07-03.md 2>/dev/nullRepository: tinyhumansai/openhuman
Length of output: 4144
🏁 Script executed:
#!/bin/bash
set -euo pipefail
printf '\n== baseline excerpts ==\n'
sed -n '1,120p' docs/tinyagents-full-migration-plan/00-baseline.md | cat -n
printf '\n== continuation excerpts ==\n'
sed -n '1,120p' docs/tinyagents-full-migration-plan/CONTINUATION-2026-07.md | cat -n
printf '\n== handoff excerpts ==\n'
sed -n '1,120p' docs/tinyagents-full-migration-plan/HANDOFF-2026-07-03.md | cat -nRepository: tinyhumansai/openhuman
Length of output: 31494
🏁 Script executed:
#!/bin/bash
set -euo pipefail
printf '\n== baseline references to delta/gaps ==\n'
rg -n '1\.3\.0 delta|SDK-gaps|NoProgressTracker|with_node_retry|1\.4\.0|1\.5\.0' docs/tinyagents-full-migration-plan/00-baseline.md docs/tinyagents-full-migration-plan/CONTINUATION-2026-07.md docs/tinyagents-full-migration-plan/HANDOFF-2026-07-03.mdRepository: tinyhumansai/openhuman
Length of output: 5066
Update 00-baseline.md to the 1.4/1.5 delta.
The baseline still points readers to a 1.3.0 delta and says the SDK-gaps inventory was refreshed against 1.3.0, but this plan is already on tinyagents 1.5.0. Rename that section and refresh the gap notes so the newer APIs (CompiledGraph::with_node_retry, NoProgressTracker) are covered.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@docs/tinyagents-full-migration-plan/00-baseline.md` around lines 3 - 18,
Update the baseline doc to match the current tinyagents 1.5.0 state: the section
still references a 1.3.0 delta and an inventory refreshed against 1.3.0, so
rename that delta section in 00-baseline.md and revise the gap notes for the
newer API surface. Make sure the updated plan explicitly covers the 1.4/1.5
additions referenced by the review, including CompiledGraph::with_node_retry and
NoProgressTracker.
| | 00 baseline | Done (1.3.0 + sqlite, rusqlite 0.40) — **needs re-bump to 1.4/1.5** | | ||
| | 01 tooling | Mostly done. Live: crate-internal tool side-lookup (01.1), `tool_filter.rs` 299 + `tool_prep.rs` 344 (01.3) | | ||
| | 02 models | Mostly done. Live: `reliable.rs` 900 (gated on re-architecture), `ThinkingForwarder` residual seams | | ||
| | 03 context/cache | Done. `context/` is 1.3k of product prompt/stats state | | ||
| | 04 sessions | **Primary unfinished work.** Live path is 100% legacy: `transcript.rs` 1347, `migration.rs` 373, `session_io.rs` 463, `session_db/` 4.5k, `subagent_sessions/` 653, `session_import/` 1.9k. Crate `Store`/`AppendStore` used only by the write-only importer. 04.3 checkpointer swap IS done in code (`tinyagents/checkpoint.rs` deleted) — the 04.3 doc text is stale | |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Update the plan text to match the already-pinned 1.5.0 baseline.
This still describes C0 as a 1.4 bump / later 1.5 bump and labels 00 baseline as 1.3.0, but the repo and handoff already pin tinyagents = 1.5.0. That makes the “ground truth” section self-contradictory for the next reader.
Also applies to: 135-143
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@docs/tinyagents-full-migration-plan/CONTINUATION-2026-07.md` around lines 15
- 19, The plan text is inconsistent with the repo’s pinned baseline: the 00
baseline row and the C0 wording still reference 1.3.0/1.4/1.5 migration steps.
Update the `CONTINUATION-2026-07` markdown so the baseline section and any
surrounding “ground truth” notes reflect the already-pinned `tinyagents =
1.5.0`, and remove or rephrase the stale bump language to match the current
state. Focus on the baseline table entries and any adjacent narrative that
describes the version target.
Summary
docs/tinyagents-full-migration-plan/CONTINUATION-2026-07.md(C0 baseline + parallel adapter-first slices), all landing in this PR.tinyagents1.3 → 1.5.0, vendors the SDK as a submodule atvendor/tinyagentswith[patch.crates-io]in both Cargo worlds;RepeatedToolFailureMiddlewarebecomes a thin driver over crateNoProgressTracker; cratewith_node_retryseam on delegation + spawn-parallel graphs; docker CI carries the submodule.session.{stem}.messages+ descriptor), flagagent.session_dual_write(default ON) with env kill switch; write-side parity test proves legacy JSONL ↔ store render identical transcripts.graph.goals(byte-identical keys, idempotent migration helper) and task board mirrored into crategraph.todoswithclaim_cardCAS shadow — both shadow-mode, legacy authoritative, divergence warn-logged.CacheAlignMiddlewaredeleted (−147 lines; crate cache guard already installed). Microcompact deletion refused — NOT crate-superseded (corrected in plan); unknown-tool sentinel already gone,ReturnToolErrorkept deliberately (fix(tinyagents): keep attempted tool name in the timeline for unavailable tools #4419 UX).{run_id}-evt-{offset}journal event ids, durable status store answeringlist_by_thread, late-attach replay proven from the store alone.Problem
The tinyagents migration (#4249) landed on 1.3; the crate has since shipped 1.4/1.5 with primitives that replace in-house code (
graph::goals,graph::todos,NoProgressTracker, resumable graph failures, durable journals). Remaining migration work also needs to modify SDK source and test against OpenHuman in one tree.Solution
v1.5.0; path patch keeps manifest requirement and vendored source in lockstep. Agents/devs can change SDK source in-tree and PR upstream from the submodule.max_attempts=1, tracker-driven nudge/halt with identical steering semantics) adopted now; escalation later.Submission Checklist
N/A: adapter-first mirrors + dependency vendoring; no user-facing feature rows added/removed## Related—N/A: no matrix rows affectedN/A: shadow/dual-write paths flag-gated with kill switches; legacy paths authoritativeCloses #NNNin the## Relatedsection —N/A: follow-up wave to #4249; no dedicated issueImpact
OPENHUMAN_SESSION_DUAL_WRITE, shadow flags default OFF where risky).tinyagents v1.5.0 (path: vendor/tinyagents); fresh clones/worktrees needgit submodule update --init vendor/tinyagents; docker core image build handled in release workflows.Related
docs/tinyagents-full-migration-plan/CONTINUATION-2026-07.md· Handoff:HANDOFF-2026-07-03.mdhttps://claude.ai/code/session_013uVSkcdR2eP7hW4xm54wb4