Repository navigation
fix(ui): queue chat input while reconnecting - #102781
Conversation
Visual reconnect proofOffline: the composer and Send button remain enabled while the Gateway reconnects; the prompt is visibly stored as Waiting for reconnect. Reconnected: the same prompt is delivered once, the queue clears, and the assistant final event renders. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d481ccb2e7
ℹ️ 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".
|
|
||
| ### Fixes | ||
|
|
||
| - **Control UI offline chat:** keep ordinary text and attachment input available during recoverable Gateway disconnects, persist queued sends in the existing session-scoped store, and resume delivery after reconnect. |
There was a problem hiding this comment.
Remove normal-fix changelog entry
Root AGENTS.md says CHANGELOG.md is release-only and must not be edited for normal fixes or direct main changes; release generation derives these entries from merged PRs and direct commits. This fix(ui) change adds a manual changelog line, which can duplicate or skew the generated release notes, so keep this note in the commit/PR metadata instead and remove the changelog edit.
Useful? React with 👍 / 👎.
|
Codex review: found issues before merge. Reviewed July 10, 2026, 12:24 PM ET / 16:24 UTC. Summary PR surface: Source +2940, Tests +5088, Docs +4. Total +8032 across 30 files. Reproducibility: yes. at source level. Current main has two connection gates that disable composition, and the proposed reset-success/history-failure path deterministically reaches durable failed-command persistence. Review metrics: 1 noteworthy metric.
Stored data model Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Security Review findings
Review detailsBest possible solution: Keep the scoped durable reconnect outbox, but treat a successful destructive command mutation as authoritative; surface any subsequent history refresh failure separately and remove the completed command from the outbox. Do we have a high-confidence way to reproduce the issue? Yes at source level. Current main has two connection gates that disable composition, and the proposed reset-success/history-failure path deterministically reaches durable failed-command persistence. Is this the best way to solve the issue? No in its current form. Reusing the existing durable outbox is the right architectural boundary, but destructive command completion must not be reversed by a later read-only refresh failure. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against cbfa7d4aa73c. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +2940, Tests +5088, Docs +4. Total +8032 across 30 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
Review history (3 earlier review cycles)
|
de35b83 to
e040e1a
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e040e1a526
ℹ️ 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".
| clearSideResultTerminalRuns: true, | ||
| clearRunStatus: !hadActiveRun, | ||
| }); | ||
| await loadChatHistory(state); |
There was a problem hiding this comment.
Handle post-reset history reload failures
When sessions.reset succeeds but the follow-up chat.history request rejects (for example during a transient reconnect), this await is now outside the try/catch, so /clear rejects after already clearing/resetting the session. In the durable queued-command path that means the clear item is marked failed/retryable even though the reset happened, and a user retry can clear a later conversation state; keep the history reload failure handled as a post-reset UI refresh error instead of making the command fail.
Useful? React with 👍 / 👎.
e040e1a to
c252e78
Compare
Land-ready proofReviewed exact head:
Known scope limits are intentional and documented in the PR: current-tab |
|
Merged via squash.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c252e78cdf
ℹ️ 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".
| return "failed"; | ||
| } | ||
| removeQueuedMessageWithoutReleasing(host, id, sessionKey); | ||
| const retireOnAck = ack.status === "ok" || storageMode === "memory"; |
There was a problem hiding this comment.
Keep accepted sends visible before terminal events
For ordinary connected sends the Gateway accepts with a nonterminal started ACK, not ok (checked src/gateway/server-methods/chat.ts, where accepted chat.send responds with { status: "started" }). This new gate therefore leaves every durable send in sending instead of appending/materializing the user's turn, and renderChatQueue filters sending rows, so the submitted prompt disappears from both the transcript and visible queue until a final chat event arrives; during streaming the assistant can render without the user message. Please keep accepted nonterminal sends visible while still retaining the durable row for recovery.
Useful? React with 👍 / 👎.
* fix(ui): queue chat input while reconnecting * test(ui): strengthen offline reconnect proof * chore: follow release-only changelog policy * fix(ui): harden offline queue replay * fix(ui): harden offline replay recovery


Closes #102700
What Problem This Solves
The Control UI disabled ordinary chat input whenever the Gateway disconnected. During intermittent connectivity, users could neither keep composing nor safely queue new text and attachments for delivery after reconnect.
Why This Change Was Made
sessionStorage, scoped by Gateway, conversation, and agent.This deliberately reuses current-tab browser storage. It does not add cross-tab synchronization, background sync, or cold offline app launch.
User Impact
An already-loaded Control UI remains writable through an intermittent Gateway outage. Text and attachments show as Waiting for reconnect, survive a same-tab reload when browser storage succeeds, and continue automatically after the socket reconnects. Inputs remain visible with an actionable failure state when delivery or durable admission cannot be proven safe.
Mobile audit, unchanged by this PR:
This PR does not claim mobile parity and changes only the web Control UI.
Evidence
node scripts/run-tsgo.mjs -p tsconfig.core.jsonandnode scripts/run-tsgo.mjs -p test/tsconfig/tsconfig.test.ui.json: passed.oxfmt --checkacross all 29 changed UI TypeScript files, plusgit diff --check: passed.sessionStorageacross reload, observes zero sends while offline, reconnects, verifies onechat.sendwith the stored attachment and idempotency key, and confirms the request count remains exactly one after outbox retirement.c252e78cdf97dedb049b8ff6fed04cc4c7e2e841.c252e78cdf97dedb049b8ff6fed04cc4c7e2e841; the repo-nativeOPENCLAW_TESTBOX=1 scripts/pr prepare-run 102781gate passed inhosted_exact_or_recent_rebasemode and verified the remote PR tree matches the prepared tree.AI Assistance
Codex assisted with implementation, regression tests, mobile/web source audits, and review. No transcript is attached.