Repository navigation
perf(server): skip decoding older completed runs when planning turns - #48089
Conversation
Planning a send or queued start decodes the thread's completed history. Skip older completed runs when a visible prompt anchors an idle same-provider thread. Keep the full read for active work and provider changes. Prepared with gpt-6.2-sol through Codex in T3 Code.
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This reduces historical run decoding during turn planning, with guarded eligibility and full-history fallback. Stored history and product defaults remain unchanged. You can add or adjust custom eligibility rules. Learn more. |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Dismissing prior approval to re-evaluate 376f981
|
The automated pipeline stopped on this pull request and will not merge it: the capture step could not show the problem on the base commit, so there is nothing to prove fixed. Checked out merge-base 7b7ca65 and ran It stays open for a person to finish or close. |
|
@juliusmarminge For the capture step, compare the actual orchestrator commands on
|
Problem
Ordinary sends and queued starts decode every historical run while planning the turn. That adds latency on long threads, even when a recent prompt provides the model and conversation context the planner needs.
Change
For an idle same-provider thread with a visible completed prompt, skip decoding completed runs that predate it. Keep runs that can affect queue order, execution order, fresh context, worktree setup, or a named command. Active runs, provider changes, and queued notifications and delegated completions keep the full history.
Scope
Server-only follow-up to #47544. SQLite still filters older run rows. The improvement comes from returning and decoding fewer rows.
Related to #47538.
Verification
Measured the orchestrator on one InstaBox with in-memory SQLite and no provider process. I ran two alternating upstream and patch pairs and reran the final patch after adding the active-run guard. Each case had 36 timed samples per run. Before is the mean of the two upstream medians. After is the final patch median.
The projection test checks that an older queued run, an out-of-order run, fresh context, failures, and named runs keep the history they need. A hidden prompt falls back to full history. All 536 focused tests passed, including provider switching and the restart that needs an older delegated run.
check:changedpassed on InstaBox with Node 26.Prepared with gpt-6.2-sol through Codex in T3 Code.