Repository navigation
test(server): replay scenarios no longer run checkpoints against the real checkout - #41192
juliusmarminge wants to merge 1 commit into
Conversation
…real checkout A replay scenario whose thread had no worktree fell back to process.cwd(), so checkpoint capture ran git against the checkout running the tests. In a repository with many refs and worktrees, one `git log --walk-reflogs --all` there takes ~45s, so turns stayed `waiting` past the scenario's 60s wait and tests such as "persists a todo_list from inline Claude task-tool frames" failed intermittently. It also wrote checkpoint refs into that repository. The replay harness now gives each scenario a temporary git repository as the default workspace, removed when the scenario's scope closes. Threads with their own worktreePath and scenarios with an explicit cwd override keep theirs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Other scenariosAll 64 scenario measurements match All 64 scenario measurements
Baseline: Scenario and decoded snapshot size10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
ClaudeAdapterV2 background wake turns > persists a todo_list from inline Claude task-tool framesfailed intermittently. The run stayedwaitinguntil the scenario's 60s idle wait gave up.Cause. A replay scenario whose thread has no worktree got
cwd: nullfrom the stubRuntimePolicy.layer, so the Orchestrator fell back toprocess.cwd(). The post-turn checkpoint capture then ran git against the checkout running the tests. On a machine where that repository has many refs and worktrees (29k refs and 597 worktrees here), onegit log --walk-reflogs --all --max-age=…fromlistImportedCommitstakes about 45s. A capture runs several of these, so the run did not reachcompletedwithin the 60s idle wait. The test also wrote checkpoint refs into the developer's repository on every run. It was not an adapter bug.Fix.
layerWithRegistrynow gives each scenario a temporary git repository (checkpointWorkspace, removed when the scenario scope closes) as the default workspace. Threads that set their ownworktreePathand scenarios with an explicitruntimePolicyOverride.cwdkeep their workspace. The stubRuntimePolicy.layerhad no other users, so it is deleted.No replay test needed the real tree, so there is no opt-in. All 46 test files that use the replay harness pass: 1,557 tests.
Proof (
vp test run src/orchestration-v2/Adapters/ClaudeAdapterV2.test.ts -t "persists a todo_list"):The reflog walk's cost in large repositories is a separate product performance issue, handled outside this PR.
Model: Claude Opus 5.5, harness: Claude Code (in T3 Code).
🤖 Generated with Claude Code