Repository navigation
Conversation
…ter it (Refs #1073) A new-workspace chat holds its first prompt until the engine's worktree.ready event arrives. If the event is lost, the wait lasted 5 minutes and then failed the send, so the prompt showed in the UI and no agent answered. Move the wait into waitForWorktreeReady with a 20 s limit. A time-out now sends the prompt and marks the worktree ready, so later prompts do not wait again. A worktree.failed event still stops the send, and a cancel still restores the input. Refresh the overlay manifest. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Contributor
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
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.
Refs #1073
Finding
The issue says nothing calls
Worktree.ready(). That is not true on current main:handleWorktreeLifecycleEvent(notification-toasts.ts) calls it whenworktree.readyarrives.worktree.readyabout 25 ms after the create call returned. The event'sdirectoryis the worktree path, the same key the app uses.worktree.readycomes beforepending(),pending()does nothing, so that order is safe.I could not reproduce a hang in the real app. The hang can still happen when the event is lost (the event stream reconnects, or the listener is not mounted). The old wait then lasted 5 minutes and failed the send.
Change
worktree-wait.ts:waitForWorktreeReadywaits at most 20 s. It returnsready,timeoutoraborted. It throws the engine's message onworktree.failed. It clears its timer and its abort listener.submit.ts: the inline 5-minute wait uses the helper. Ontimeoutthe prompt is sent, and the worktree is marked ready so later prompts do not wait again.Not done
The issue asks to remove the wait. I kept a bounded wait: without it the first prompt always races
git reset --hardin the new worktree. The "no wait" option stays open if the maintainers prefer it.Test
worktree-wait.test.ts: 11 tests pass (ready, timeout, failed, abort, abort before start, timer cleanup, and checks thatsubmit.tsuses the helper).tsgo -btypecheck passes. Drift gate passes.prompt-inputtests: 1 failure, "keeps auto-accept bound to the submission server". It fails the same way on unchanged main.🤖 Generated with Claude Code