Skip to content

fix: fixes re-posting bug#7830

Closed
michaelneale wants to merge 1 commit intomainfrom
micn/replay-bug
Closed

fix: fixes re-posting bug#7830
michaelneale wants to merge 1 commit intomainfrom
micn/replay-bug

Conversation

@michaelneale
Copy link
Copy Markdown
Collaborator

@michaelneale michaelneale commented Mar 12, 2026

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.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well if you have this, it spams the backend with every single network change.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and this is unrealistic as it is localhost anyway.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will follow up with retry improvements although the move to ACP may also help there

@jh-block
Copy link
Copy Markdown
Collaborator

closing as similar changes merged in #7831

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants