refactor(ai-harness, ai-harness-cli, ai-mcp): remove what the harness redesign replaced, with the docs, skills, and changesets of the end state #1829
feat/harness-log-store-v2 fromrefs/pull/1829/head·merged by AlemTuzlak View on GitHubThis PR removes what the harness redesign replaced but did not delete. The old inbox, work-claim, and lease stores were already removed in PR 5 (#1814). An audit of the whole stack found the remaining leftovers: old-data branches, a second way to track running tools, dead helpers, and docs and changesets that describe in-between states. This is PR 16 of the harness redesign stack for #1755. It targets #1825 (feat/harness-final-review).
🎯 Changes#
- Old thread state in
metadata.host.sessions.deleteno longer deletes theharness:usageandharness:revertmetadata rows. Nothing writes them now: the log keeps usage and revert data, anddeleteLogremoves them. - Old snapshot shapes. The snapshot parser drops its "a state with no X gets an empty value" branches. A snapshot with a missing field is not used, and the host folds the log again from the first record.
InputState.seqandLogState.transcriptSeqare required. - Two ways to track running tools. A root turn tracks its running tools only with
harness.tool.startedrecords. It no longer also writespendingToolsto the run checkpoint, and recovery reads one list. Agent runs keep the run checkpoint. - Fallbacks and leaks in the public types.
SessionSnapshot.pendingWaitsis required, so the?? []fallbacks in the harness, CLI, MCP, and E2E routes go.HarnessSessionhidesscrubError,takeOver,scheduleRun, andloggedRun.
- Dead code and old wording. The unused
traceparentOfandformatOnWriteand the--dashboardCLI test are removed. Lease and metadata-checkpoint wording is gone, andtests/leases.test.tsis nowtests/recovery.test.ts.
Docs, skills, and changesets describe the end state only:
- Eight
docs/harness/pages: snapshots in the log, not a "fold checkpoint" inmetadata. The settings and usage totals are in the log. Four more pages readpendingWaitswith no fallback in their samples. - The
ai-mcpandai-persistenceskills: MCP reconnects, a stdio server shared per harness, and secret answers that go through thecredentialsstore. - Changesets: 5 that told the history of unreleased code are removed or folded into the main ones. 7 others now describe only the end state, with no "before" or "changed from 2 to 3".
Kept on purpose, because nothing replaced them:
- The
artifactsandgenerationRunsmedia stores. The log has no media records yet. indexChildinwithPersistencenext to the harnessindexAgent. They index different children (core subagents and harness agent runs).SessionIndexStore.upsert. App code and tests seed entries with it.- The optional compare-and-set methods of
CredentialStore. The design keeps credentials as they are.
✅ Checklist#
- I have followed the steps in the Contributing guide.
- I have tested code changes locally with
pnpm run test:pr, or these tests do not apply to this pull request. - I fully understand the code in this pull request, including any code generated with AI assistance.
- Docs: I updated
docs/for this change, or this change is not user-facing. - Changeset: I added a changeset (
pnpm changeset), or this PR does not change a published package.
🚀 Release Impact#
- This change affects published code, and I have generated a changeset.
- This change is docs/CI/dev-only (no release).
The changesets are edited in place. The harness is not released, so this PR adds no new changeset.
Testing#
Commands run:
- A pnpm build of
ai-harness-cli,ai-mcp,ai-acp, and their dependencies.test:typesofai-harness,ai-harness-cli,ai-mcp,ai-code-mode, andai-acp. All pass. - Vitest with
--maxWorkers=2on 37ai-harnessfiles (the changed tests, plus the tests of the log, snapshots, purge, recovery, views, and waits): 692 tests pass. The changed tests inai-harness-cli(4 files),ai-mcp(harness.test.ts), andai-code-mode(harness.test.ts) pass too. test:oxlintof the 4 changed packages,knip,pnpm test:docs,kiira check(1,924 snippets), andoxfmt --checkon every changed file.
Not run locally: E2E (3 routes lose a ?? []) and coverage. CI runs them.
Manual test:
- Run
pnpm --dir packages/ai-harness exec vitest run tests/log.test.ts tests/purge.test.ts tests/resume.test.ts tests/recovery.test.ts. - Run
git grep -n "fold checkpoint\|pendingWaits ??\|harness:revert\|WorkClaimStore\|InboxStore\|LeaseStore" -- packages docs .changeset. It finds nothing.
How this PR makes testing easy: the snapshot tests in tests/log.test.ts now build a snapshot in the full shape that serialize writes. tests/resume.test.ts reads the harness.tool.started and harness.tool.result records from the log.
Risk / rollback#
Low. The PR removes code and makes types stricter. Snapshots that this harness writes always have every field, so the stricter parser accepts them. To undo, revert this PR.
Public API change#
Before
const [wait] = session.snapshot().pendingWaits ?? []
After
const [wait] = session.snapshot().pendingWaits
Folded onto the reviewed stack#
The stack under this PR (#1809 to #1825) was reviewed, fixed and squash-merged into #1807. I merged that new base into this branch, then re-applied only this PR's own patch on top, so no old-stack code came back.
- Kept from this PR: the old snapshot shapes are no longer read (
InputState.seqandLogState.transcriptSeqare required, and usage totals needbySource), the purge no longer deletes legacy metadata rows, andtraceparentOf,formatOnWriteand the--dashboardtest are removed. The docs and skills use the end-state wording, and 5 changesets are folded into the main ones. - Already done by the stack fixes, so dropped: the
pendingWaits ?? []fallbacks, and theHarnessSessionhide list (it is now an allow-list). - Tests: the CI-flaky test was
oauth-edges"stops listening and leaves no timer when onUrl throws", fixed in #1807. The tests skipped earlier as flaky suspects run again.
Checks: the full unit suites of ai-harness and ai-harness-cli, the harness tests of ai-mcp, ai-acp and ai-code-mode, plus typecheck, lint and kiira. CI runs the rest.
- 1
Important
Review skipped#
Auto reviews are disabled on base/target branches other than the default branch.
Please check the settings in the CodeRabbit UI or the
.coderabbit.yamlfile in this repository. To trigger a single review, invoke the@coderabbitai reviewcommand.⚙️ Run configuration
-
- Configuration used: Repository: TanStack/ai/.coderabbit.yaml
- Review profile: CHILL
- Plan: Advanced
- Run ID:
f1f1b8c4-1cf3-4161-b0ad-4e3592a6753f
You can disable this status message by setting the
reviews.review_statustofalsein the CodeRabbit configuration file.Use the checkbox below for a quick retry:
- 🔍 Trigger review
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment `@coderabbitai help` to get the list of available commands.-
View your CI Pipeline Execution ↗ for commit afa54cf8365d155c65d316907d994dadd7e036f3
Command Status Duration Result nx affected --targets=test:sherif,test:knip,tes...✅ Succeeded 5m 1s View ↗ nx run-many --targets=test:coverage --projects=...✅ Succeeded 1s View ↗ nx run-many --targets=build --exclude=examples/...✅ Succeeded 46s View ↗
☁️ Nx Cloud last updated this comment at
2026-10-20 09:04:30UTC@tanstack/ai
npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai@1829@tanstack/ai-acp
npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-acp@1829@tanstack/ai-angular
npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-angular@1829@tanstack/ai-anthropic
npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-anthropic@1829@tanstack/ai-bedrock
npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-bedrock@1829@tanstack/ai-byteplus
npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-byteplus@1829@tanstack/ai-claude-code
npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-claude-code@1829@tanstack/ai-client
npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-client@1829@tanstack/ai-cloudflare
npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-cloudflare@1829@tanstack/ai-code-mode
npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-code-mode@1829@tanstack/ai-code-mode-snippets
npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-code-mode-snippets@1829@tanstack/ai-codex
npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-codex@1829@tanstack/ai-cohere
npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-cohere@1829@tanstack/ai-compaction
npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-compaction@1829@tanstack/ai-devtools-core
npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-devtools-core@1829@tanstack/ai-durable-stream
npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-durable-stream@1829@tanstack/ai-elevenlabs
npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-elevenlabs@1829@tanstack/ai-event-client
npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-event-client@1829@tanstack/ai-fal
npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-fal@1829@tanstack/ai-gemini
npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-gemini@1829@tanstack/ai-grok
npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-grok@1829@tanstack/ai-grok-build
npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-grok-build@1829@tanstack/ai-groq
npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-groq@1829@tanstack/ai-harness
npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-harness@1829@tanstack/ai-harness-cli
npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-harness-cli@1829@tanstack/ai-isolate-cloudflare
npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-isolate-cloudflare@1829@tanstack/ai-isolate-daytona
npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-isolate-daytona@1829@tanstack/ai-isolate-e2b
npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-isolate-e2b@1829@tanstack/ai-isolate-node
npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-isolate-node@1829@tanstack/ai-isolate-quickjs
npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-isolate-quickjs@1829@tanstack/ai-isolate-quickjs-bun
npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-isolate-quickjs-bun@1829@tanstack/ai-llmgateway
npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-llmgateway@1829@tanstack/ai-lovable
npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-lovable@1829@tanstack/ai-mcp
npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-mcp@1829@tanstack/ai-memory
npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-memory@1829@tanstack/ai-mistral
npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-mistral@1829@tanstack/ai-octane
npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-octane@1829@tanstack/ai-ollama
npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-ollama@1829@tanstack/ai-ollaya
npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-ollaya@1829@tanstack/ai-openai
npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-openai@1829@tanstack/ai-opencode
npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-opencode@1829@tanstack/ai-openrouter
npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-openrouter@1829@tanstack/ai-perplexity
npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-perplexity@1829@tanstack/ai-persistence
npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-persistence@1829@tanstack/ai-preact
npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-preact@1829@tanstack/ai-react
npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-react@1829@tanstack/ai-react-ui
npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-react-ui@1829@tanstack/ai-reactor
npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-reactor@1829@tanstack/ai-remix
npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-remix@1829@tanstack/ai-sandbox
npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-sandbox@1829@tanstack/ai-sandbox-blaxel
npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-sandbox-blaxel@1829@tanstack/ai-sandbox-boxd
npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-sandbox-boxd@1829@tanstack/ai-sandbox-cloudflare
npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-sandbox-cloudflare@1829@tanstack/ai-sandbox-daytona
npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-sandbox-daytona@1829@tanstack/ai-sandbox-docker
npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-sandbox-docker@1829@tanstack/ai-sandbox-e2b
npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-sandbox-e2b@1829@tanstack/ai-sandbox-local-process
npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-sandbox-local-process@1829@tanstack/ai-sandbox-railway
npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-sandbox-railway@1829@tanstack/ai-sandbox-sprites
npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-sandbox-sprites@1829@tanstack/ai-sandbox-upstash-box
npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-sandbox-upstash-box@1829@tanstack/ai-sandbox-vercel
npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-sandbox-vercel@1829@tanstack/ai-skills
npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-skills@1829@tanstack/ai-solid
npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-solid@1829@tanstack/ai-solid-ui
npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-solid-ui@1829@tanstack/ai-svelte
npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-svelte@1829@tanstack/ai-typesafe
npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-typesafe@1829@tanstack/ai-utils
npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-utils@1829@tanstack/ai-vercel-gateway
npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-vercel-gateway@1829@tanstack/ai-vertex
npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-vertex@1829@tanstack/ai-vue
npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-vue@1829@tanstack/ai-vue-ui
npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-vue-ui@1829@tanstack/ai-worldlabs
npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-worldlabs@1829@tanstack/openai-base
npm i https://pkg.pr.new/TanStack/ai/@tanstack/openai-base@1829@tanstack/preact-ai-devtools
npm i https://pkg.pr.new/TanStack/ai/@tanstack/preact-ai-devtools@1829@tanstack/react-ai-devtools
npm i https://pkg.pr.new/TanStack/ai/@tanstack/react-ai-devtools@1829@tanstack/solid-ai-devtools
npm i https://pkg.pr.new/TanStack/ai/@tanstack/solid-ai-devtools@1829@tanstack/svelte-ai-devtools
npm i https://pkg.pr.new/TanStack/ai/@tanstack/svelte-ai-devtools@1829commit:
afa54cfCoverage#
✅ Coverage held across 31 compared package(s).
Each package is measured twice in this job — on this PR and on its merge-base with
main— and compared. A metric fails only when it is at or above 60% on the merge-base and under 60% on this PR. Other drops are listed but do not fail. Packages your PR doesn't affect are not measured and not listed.package statements branches functions lines ai-acp 83.04% (0.00) 71.33% (0.00) 79.01% (0.00) 84.93% (0.00) ok ai-claude-code 88.93% (0.00) 76.88% (0.00) 86.88% (0.00) 90.40% (0.00) ok ai-code-mode 93.12% (0.00) 86.17% (0.00) 89.70% (0.00) 93.82% (0.00) ok ai-code-mode-snippets 87.13% (0.00) 75.67% (0.00) 91.11% (0.00) 88.39% (0.00) ok ai-codex 94.55% (0.00) 85.10% (0.00) 89.28% (0.00) 95.56% (0.00) ok ai-durable-stream 86.70% (0.00) 82.25% (0.00) 92.30% (0.00) 88.72% (0.00) ok ai-grok-build 79.19% (0.00) 63.56% (0.00) 77.39% (0.00) 81.02% (0.00) ok ai-harness 93.68% (+0.05) 87.82% (+0.05) 93.60% (+0.05) 95.51% (+0.04) ok ai-harness-cli 92.00% (0.00) 83.24% (0.00) 87.50% (0.00) 93.19% (0.00) ok ai-isolate-cloudflare 94.11% (0.00) 70.66% (0.00) 100.00% (0.00) 93.96% (0.00) ok ai-isolate-daytona 90.25% (0.00) 80.59% (0.00) 100.00% (0.00) 90.15% (0.00) ok ai-isolate-e2b 92.11% (0.00) 82.22% (0.00) 97.36% (0.00) 95.05% (0.00) ok ai-isolate-node 84.00% (0.00) 43.39% (0.00) 100.00% (0.00) 83.78% (0.00) ok ai-isolate-quickjs 89.07% (0.00) 76.41% (0.00) 90.90% (0.00) 90.30% (0.00) ok ai-isolate-quickjs-bun 7.76% (0.00) 8.08% (0.00) 5.00% (0.00) 8.33% (0.00) ok ai-mcp 95.95% (0.00) 90.59% (0.00) 96.35% (0.00) 98.06% (0.00) ok ai-opencode 69.04% (0.00) 60.82% (0.00) 65.26% (0.00) 70.87% (0.00) ok ai-persistence 91.32% (0.00) 77.93% (0.00) 97.78% (0.00) 95.79% (0.00) ok ai-sandbox 78.51% (0.00) 83.22% (0.00) 75.58% (0.00) 79.05% (0.00) ok ai-sandbox-blaxel 87.64% (0.00) 77.18% (0.00) 82.26% (0.00) 89.71% (0.00) ok ai-sandbox-boxd 95.86% (0.00) 87.12% (0.00) 95.31% (0.00) 98.17% (0.00) ok ai-sandbox-cloudflare 67.91% (0.00) 57.47% (0.00) 71.79% (0.00) 69.62% (0.00) ok ai-sandbox-daytona 82.70% (0.00) 81.89% (0.00) 67.14% (0.00) 85.18% (0.00) ok ai-sandbox-docker 80.15% (0.00) 71.49% (0.00) 77.38% (0.00) 82.13% (0.00) ok ai-sandbox-e2b 94.42% (0.00) 88.97% (0.00) 93.24% (0.00) 98.63% (0.00) ok ai-sandbox-local-process 68.61% (0.00) 53.59% (0.00) 77.01% (0.00) 69.58% (0.00) ok ai-sandbox-railway 94.75% (0.00) 92.68% (0.00) 90.90% (0.00) 97.59% (0.00) ok ai-sandbox-sprites 73.23% (0.00) 59.70% (0.00) 73.83% (0.00) 76.17% (0.00) ok ai-sandbox-upstash-box 94.82% (0.00) 91.52% (0.00) 91.04% (0.00) 97.76% (0.00) ok ai-sandbox-vercel 44.67% (0.00) 38.18% (0.00) 35.18% (0.00) 45.76% (0.00) ok ai-skills 83.94% (0.00) 67.95% (0.00) 88.00% (0.00) 86.03% (0.00) ok github-actions[bot](GitHub profile, opens in a new tab) assignedtombeckenham
github-actions[bot](GitHub profile, opens in a new tab) added labelsmerge-conflicts
github-actions[bot](GitHub profile, opens in a new tab) added labelswaiting-on: author
AlemTuzlak merged this43e90da
AlemTuzlak closed this
Sign in to join this conversation.
⚠️ No Changeset found#
Latest commit: afa54cf8365d155c65d316907d994dadd7e036f3
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
This PR includes changesets to release 53 packages
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR