Repository navigation
Conversation
The Codex duplicate merge copied a source's messages and moved its jobs before deleteSession could refuse it, and only published the result after the whole loop. A refusal on a later source left its messages copied into the canonical session and the earlier, already deleted sources unannounced. Check for a refusal before touching each source, and publish messages and session activity as each source completes. Fixes tiann#2706 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
5 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #2706
In
mergeSingleDuplicateCodexSessionGroup, a source's messages were copied and its attached jobs moved beforeengine.deleteSessioncould refuse it. Events and session activity were published only after the whole loop. So a refusal on a later source left that source's messages in the canonical session, and the copies from earlier, already deleted sources were never announced.This takes the smaller of the two directions in the issue (per-source completion, not a whole-group transaction):
SyncEngine: the refusal checks indeleteSession(OpenCode rewind, unconfirmed Codex resume, pending archived fork) move intoassertSessionDeletable, whichdeleteSessionstill calls.message-received, session activity andsession-updatedare published after each completed source instead of once after the loop.Limits
success: falsewhen a source is refused, and the response still does not list the sources already removed. Earlier sources stay merged; the operator can retry once the refusal is resolved.sessionCache.deleteSession: a source that becomes active while an earlier one is being deleted is still refused after its messages were copied.applyReconciledNotifyStateafter it. That call is not onmain, so it is not handled here; whichever lands second needs to move it into the per-source step, and engine test doubles that run a merge needassertSessionDeletable.Testing
codexDesktop.test.ts(realSyncEngine, three duplicates, the last one withcodexResumePending). Onmainit fails: the canonical session has 6 messages instead of 5. With the message and job assertions removed, it also fails onmainon the events (0message-receivedinstead of 2). With the change, the whole file passes (32/32).bun testinhub: 2359 pass, 3 skip, 5 fail. The same 5 tests fail onmainon my Windows machine (threeAcpVerifyProbePATH tests and two~expansion tests for push config).bun typecheckfrom the repo root (cli, web, hub, relay): passes.AI disclosure
Model: Claude Sonnet 5.5 (Claude Code).
Written with Claude Code (AI); tested locally with
bun testinhubandbun typecheckfrom the repo root.🤖 Generated with Claude Code