Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4e355d9445
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| }, | ||
| throwOnError: true, | ||
| signal: abortControllerRef.current.signal, | ||
| sseMaxRetryAttempts: 1, |
There was a problem hiding this comment.
Treat dropped SSE stream as an error, not a normal finish
Setting sseMaxRetryAttempts: 1 here causes the SSE client to stop immediately on the first transport failure (ui/desktop/src/api/core/serverSentEvents.gen.ts:229), and when that happens streamFromResponse() exits its for await loop and calls onFinish() as if the response completed successfully (ui/desktop/src/hooks/useChatStream.ts, streamFromResponse). In a transient TLS/Electron blip, users can therefore get a truncated assistant message with no error state, which is a correctness regression compared to surfacing a stream failure.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
well if you have this, it spams the backend with every single network change.
There was a problem hiding this comment.
and this is unrealistic as it is localhost anyway.
There was a problem hiding this comment.
if this is happening on localhost we must have another bug surely. can you share any instructions for reproducing it on localhost? I haven't been able to so far
There was a problem hiding this comment.
I can get the broken retry behaviour to happen using goose on one computer and goosed on another and deliberately making the network bad between them. The retries are buggy because we repeat the POST and there's no event deduplication. So there's definitely a bug to fix here, but in case it was a real network problem you would want the user to know that the connection dropped and the response was truncated.
I haven't been able to make it happen on localhost so far, and the localhost case sounds like a slightly different issue since it's unlikely to be a real network problem.
There was a problem hiding this comment.
I was able to reproduce the localhost issue, it's a bad interaction of some Chromium behaviour and some Chromium bugs + our broken retry logic. more details on Slack but I've merged in a fix plus some user feedback in #7831
There was a problem hiding this comment.
will follow up with retry improvements although the move to ACP may also help there
|
closing as similar changes merged in #7831 |
urgent patch to stop the destlop client reposting to the agent anytime there is a blip with TLS/connection to electron.
Seems to be an issue since TLS.
This was causing unusable retries for me, and gets session into a really never ending stuck state.