Skip to content

Refetch the open transcript on web reconnect resync (#929) - #1650

Merged
currentbits merged 2 commits into
mainfrom
coder/web-reconnect-refreshes-the-sidebar-but--ff5d33
Oct 16, 2026
Merged

currentbits merged 2 commits into
mainfrom
coder/web-reconnect-refreshes-the-sidebar-but--ff5d33

Conversation

@currentbits

Copy link
Copy Markdown
Owner

Fixes #929.

Problem

If a run finishes while the web connection is down, the final thread:updated push is lost. On reconnect, wireClient resyncs only threads:list, so the sidebar shows done while the open transcript still says working and lacks the final reply. Sequence-gap recovery needs a later push, which never comes once the run has ended.

Fix

src/useCoder.ts: main always seq-encodes threads:changed (#1475), so a bare-array push is the web reconnect resync. On that push, also reloadDetail(selectedRef.current). This reuses the existing in-flight dedupe and stale-selection guard. threads.get returns messages, workLog and pendingPermission, so pending interaction state converges too.

Test

test/threadPatchWiring.test.tsx: real useCoder with the fake host. The thread starts working with no messages; the host flips to done with a final reply; then a bare-array threads:changed arrives with no further thread:updated. The test asserts the sidebar and transcript both show done, the final reply renders, and threads.get ran exactly once. It fails without the fix.

  • npm run test:renderer: 3073/3073 pass
  • tsc --noEmit: clean

Notes

  • devCoder/fakeCoder also emit bare arrays, so dev mode and tests now do one extra threads.get per list push for the open thread (deduped while in flight).
  • The fix is keyed on push shape, not an explicit reconnect signal. If main ever broadcasts raw arrays again, add a dedicated signal.

🤖 Generated with Claude Code

A run that finishes while the web socket is down loses its final
thread:updated push, and with no later push the seq gap is never seen.
The reconnect resync (wireClient's bare-array threads:changed) now also
reloads the selected thread's detail through reloadDetail, keeping its
in-flight dedupe and stale-selection guard.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-16T07:59:42.821013Z 7ae269a PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@currentbits
currentbits merged commit 3f78321 into main Oct 16, 2026
6 checks passed
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.

Web reconnect refreshes the sidebar but leaves the open transcript stale after a missed final update

1 participant