fix(thread-startup): recover creation after reconnect - #1764
Merged
Merged
Conversation
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.
What
agent.createAndSendwith the original startup ID after reconnect. The server binds that ID to one task and rejects a changed request.Why
Production logs showed the push guard closing sockets with 18–35 MiB buffered during task creation. A lost reply then made the UI report failure; Retry could start a second task with a fresh startup ID.
Evidence
Failed to create threadand retained a separate Draft. After the patch, the app sent two RPCs on different sockets with the same startup ID, showed no false failure or extra Draft, and displayed one task and its fixture answer after reload.runtime worktree-setup --confirm-cleanupjourney verified one startup, task, managed worktree, queued first turn, and persisted prompt after a lost reply. It cancelled Setup before any provider call and cleaned the owned fixture.UI Changes
The screenshots use only the repository fixture project. The first shows the extra Draft in the controlled pre-fix run. The second shows one task and its answer after reconnect and reload.
Review Notes