Fix web chat streaming reconciliation across reconnects - #362
Conversation
There was a problem hiding this comment.
💡 Codex Review
OpenAgent/packages/web/frontend/src/js/services/chat_domController.ts
Lines 776 to 787 in 55fe8f0
Command entries survive beginRuntimeSession() unless their DOM wrapper has been removed. When a reconnect spins up a fresh agent runtime, the event IDs restart (createRuntimeEmitter uses the same prefix with a counter that resets), so the first command in the new run reuses an eventId that already exists in commandEntries. Because the stale record remains, appendCommand updates the old bubble instead of creating a new row, hiding the new command’s output. Message entries avoid this by dropping final entries, but commands never get pruned. Consider tracking command completion or clearing the command map on session boundaries so IDs from new runtimes cannot collide.
ℹ️ 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".
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".
Summary
Testing
https://chatgpt.com/codex/tasks/task_e_68fb8e5f890c832897eee0613e220054