Repository navigation
fix(chat): send a prompt whose chat was switched away during omp startup - #389
Conversation
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Code Review Roast 🔥Verdict: No Issues Found | Recommendation: Merge Oh wait, this PR is actually clean. I need to sit down. I had my flamethrower warmed up and everything. 📊 Overall: Like finding a unicorn in production — I didn't think clean PRs existed anymore, but here we are. Files Reviewed (5 files)
Reviewed by free · Input: 20.6K · Output: 3.1K · Cached: 182.7K |
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Breezy! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Problem
Sending a message in a session whose omp process had stopped (idle long enough to be reaped), then switching to another chat right away, dropped the send: the text went back into that session's composer and nothing reached omp.
ChatWindowis keyed by session, so the switch unmountsuseAgentSession. The existing-session branch ofhandleSendawaitsget_state(which spawns omp, several seconds) and thenensureEventsConnected, which throwsEventStreamConnectionError("closed")once the hook is unmounted. The send returnedrejectedand the composer restored the draft. Queue/steer were unaffected because omp is already running then.Fix
Same as the new-chat branch already does for
ownerGone: once the chat has unmounted, the prompt is still sent, with no observer opened and no host-tool/roster/entry-snapshot setup, and the send returnsaccepted. A stream failure while the chat is still mounted (or any other error) still rejects as before.AGENTS.md documents the exception next to the readiness-wait rule.
Tests
unmount during the send connection still delivers the prompt(was: must not dispatch): one prompt, no extra observer, noset_host_tools/set_host_uri_schemes/get_subagents.unmount during prompt RPC startup cannot create an observer after teardown: prompt now sent, still no observer; the btw case is unchanged.a send connection that fails while the chat is mounted rejects without dispatching the prompt(fails if the alive check is dropped from the catch).bun test --parallel hooks/: 325 pass.Known limit
Switching away and back to the same chat within the omp startup window: the remounted chat may load before the wrapper exists and so not attach a stream for the run the earlier instance starts (the sidebar badge shows it; a reload shows it). The same applies today to any run started elsewhere on a chat that loaded idle.
Summary by CodeRabbit