Repository navigation
fix(server): retained forks keep inherited counts after source deletion - #36640
StiensWout wants to merge 1 commit into
Conversation
…urce is deleted Shell reads walked fork ancestors through the same selector as their targets, which skips deleted threads. Once a fork's source was deleted, readShellSnapshot and getThreadShell fell back to the fork's own items, so visibleItemCount (and the MCP thread list's itemCount) dropped to the fork's local count while its full projection still held the inherited history. Both readers now share one ancestor walk that includes deleted ancestors; target rows still exclude deleted threads. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: GPT 6.1 Sol <codex@openai.com>
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — Retained forks now include deleted ancestors when calculating inherited item counts. Deleted threads remain excluded from returned shell listings, and the change does not modify stored data. You can add or adjust custom eligibility rules. Learn more. |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
|
Thanks for this. #32760 makes the same change and is the one being kept. #32760 already fixes the same deleted-source count mismatch in both shell readers. It makes the smaller production change by enabling deleted-ancestor reads in the existing walks, without extracting a shared traversal. Your regression adds useful coverage for nested forks after source rollback. That coverage could strengthen the existing fix without carrying a second implementation of the same behavior. Closing as a duplicate. |
Deleting a fork's source makes its shell count forget inherited items, so MCP thread listings report too few items even though the full projection retains them.
Both shell readers now share an ancestor walk that includes deleted sources. Target reads still exclude deleted threads; fork cutoffs, rollback handling and ancestor query bounds remain intact.
Found by the GPT 6.1 Sol bughunt and independently confirmed by Claude Opus 5.5 on main. The recorded-provider replay fails before the fix and passes after it. The permanent regression extends the existing projection-store rollback case, covering direct and nested forks through snapshot and single-thread reads, plus deleted-root exclusion. Reverting the fix makes that test fail; restoring it passes.
Validation:
pnpm exec vp run check:changedand the ProjectionStore, ThreadFork.integration, ThreadFork.execution and OrchestratorMcpService test files pass on the pinned Node version in boat.dev. No client-visible defect is claimed, so no browser scenario applies.Size: medium, confined to the projection store and its existing tests, with no schema or storage change. Fast lane. Local cubic found no issues; repository context was unavailable for the fork.
Council review
No blocking findings. Retained nits: deleting a middle ancestor is not separately exercised, and the regression extends a complex existing rollback case. The shared traversal covers deleted ancestors at every depth; the supplied integration replay also proves the original idle-fork failure. Existing duplicated shell assembly and heavy ancestor queries are follow-ups outside this fix.
Created with GPT 6.1 Sol (lead and review) and Claude Opus 5.5 (build, trim and review) in T3 Code through the Codex and Claude harnesses.
Closes #36639