Repository navigation
fix(server): keep PR reads cached after text-only turns - #44190
juliusmarminge wants to merge 3 commits into
Conversation
A fresh completed turn with no tool or background activity does not need to invalidate shared PR reads. Keep the existing refresh for turns that may have written to the host, including external git and gh commands.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Drop the watch-reactor reader assertion, which covers existing behavior this change does not touch, and fold the tool rows of the post-turn refresh table into one. 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:
|
|
The automated pipeline ran the reported steps in the real app without this change, and the slowness could not be measured: the commit before this change was as fast. So it cannot show that this change fixes anything. What was run on For each commit, create a GitHub-backed project and text-only replay thread; open PR 44184's detail panel on Timeline and wait for activity to load. Keep it open while submitting seven text-only prompts 40 seconds apart over five minutes. Repeat on fresh state, giving 14 measured turns per commit. Measure CLI action duration, blanket refresh calls, actual GraphQL executions, and PR-reader ancestry during the second beginning at the same final-events boundary on both commits. After the second window, run a replayed shell-tool control. All text turns completed with matching replies; the shell-tool control completed and triggered one blanket refresh on each commit. How: Real Electron desktop builds on the same leased macOS 26 Apple silicon Mac, with fresh synthetic databases, identical light theme and window bounds. Projects were created through the server API. Prompts were submitted through the real server CLI using Replay's text-only multi-turn model. Captured app-only recordings and sanitized server spans. No tests were used as evidence. Closing this pull request. #44178 has been asked for the missing steps; once the problem can be shown this can be reopened, or the fix built again. |
Every finished agent turn dropped all cached pull request reads, so even a turn that only answered in text made the next PR read go back to the forge API. Now a turn that completes with only assistant text, reasoning and user messages keeps the PR cache. Turns that ran tools, subagents or background work, resumed attempts, and failed or interrupted turns still refresh it as before.
Fixes #44178
Supersedes #44184. The change is @kurtextrem's; their commits are kept.
Reproduction on main
On macOS desktop, open an open PR's detail panel in a GitHub-backed project and wait for activity to load. Leave it open while an agent completes a fresh prompt asking only for a short text summary without tools. Compare server traces on main and the patch: count turn-end PullRequestService.refreshAfterTurn calls and GraphQL requests under pullRequests.detail, pullRequests.activity, and file metadata during the second after completion; repeat several turns and compare total requests over five minutes. The claimed fixture result is one blanket refresh on main versus zero with the patch; repeat with a shell or dynamic-tool turn to confirm refreshes remain. These steps were inspected, not executed.
Evidence
Being captured: before and after in the real app. This section is filled in before the pull request can merge.
Tests
vp test run src/orchestration-v2/RunExecutionService.test.ts: 87 passedRunExecutionService.ts,-t "refreshes PR readers": read-only row fails, shell row passes (proves the fix)vp test runon RunFinalizationQueue, RunFinalizationService, RunExecutionService and runtimeLayer tests: 312 passedvp run check:changed: format, lint, knip, graphql, typecheck (3 packages) and tests (2 files) all passNot in this change
Who did the work
Run by the t3code factory in T3 Code.