Skip to content

fix(ui): show reconnecting messages only once - #146466

Merged
steipete merged 3 commits into
mainfrom
codex/fix-reconnect-message-duplication
Sep 12, 2026
Merged

steipete merged 3 commits into
mainfrom
codex/fix-reconnect-message-duplication

Conversation

@steipete

@steipete steipete commented Sep 12, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes a message appearing in both the transcript and the composer queue when the Gateway disconnects during delivery.

User Impact

Attempted messages now appear once, with Waiting for reconnect and a local Discard action beside the bubble. Messages submitted while offline remain editable in the queue. Discard removes the local pending copy; it does not cancel delivery already accepted by the Gateway.

Why This Change Was Made

The transcript and queue both claimed reconnecting sends. They now share the inline-state decision, distinguish actual delivery attempts from an offline submission timestamp, and use submission identity to hide retained copies already represented by accepted input or history. Two intentionally identical sends remain separate. Reorder actions target message IDs, and the full outbox retains hidden messages as barriers, so reordering visible messages cannot move them ahead of an attempted send. Delivery storage and retry authority are unchanged.

Evidence

  • Reproduced the duplicate in the bundled Control UI with a synthetic Gateway: the new regression failed on the original code with one transcript bubble and one queue row.
  • 934 focused rendering/state tests, 15 browser scenarios covering reconnect, retry, discard, offline replay, history recovery and pending custody, plus two light/dark footer checks passed.
  • The reorder regression failed before the follow-up by persisting C/A/B instead of A/C/B. The final follow-up passed 838 focused tests and 12 browser scenarios on current dependencies, including keyboard and drag reordering, persisted order, hidden custody barriers and unchanged send count.
  • Changed-file checks passed, including TypeScript, lint, formatting, i18n and dead-export guards. Independent Codex review found no actionable findings.
  • The first hosted run passed all seven UI E2E shards, all three UI test shards, UI performance and i18n, but encountered an unrelated Gateway startup type error also present in main CI. The prerequisite was repaired by fix(gateway): register TLS renewal with sidecar owner #146412. The patch-identical rebase passed its full hosted CI run. Later runs encountered two independently reproduced main-baseline failures: startup budget and type-test shard capacity. Repairs chore(ui): refresh the Control UI startup budget baseline #146526 and fix: restore core test shard headroom #146538 are now merged; the final branch contains both, and all three fix commits remained patch-identical through that rebase. Final exact-head CI passed, including the real-Gateway UI lane. The native workflow merged the reviewed head as bf95f2b23c639247123e4c01cc5892b550b99187.
  • Inspected synthetic before/after captures attached below. The running Gateway and live browser session were not modified.

Before: the same pending message appears in the transcript and queue

After: one message with reconnect status and local discard

@clawsweeper

clawsweeper Bot commented Sep 12, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@steipete
steipete marked this pull request as ready for review September 12, 2026 20:52
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui size: S maintainer Maintainer-authored PR labels Sep 12, 2026
@steipete steipete self-assigned this Sep 12, 2026
@steipete
steipete force-pushed the codex/fix-reconnect-message-duplication branch from 9866bed to 45d41fa Compare September 12, 2026 21:17
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 12, 2026
@clawsweeper

clawsweeper Bot commented Sep 12, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 12, 2026, 7:23 PM ET / 23:23 UTC (Revision 4).

ClawSweeper review

What this changes

The Control UI displays reconnecting messages once, keeps unattempted messages in the composer queue, and preserves delivery order when users reorder visible queued messages.

Merge readiness

✅ Ready for maintainer review

This remains a useful fix for behavior still present on main. The earlier reorder finding is resolved, the reviewed head passes the previously blocking performance check, and no actionable patch defects remain.

Priority: P2
Reviewed head: fa257734adaca1c66c3137f8c8a3ae3ef4e0a8dc

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused repair with clear visual evidence, meaningful regression coverage, and no remaining actionable finding.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (screenshot): Inspected before/after captures of the bundled Control UI with a synthetic Gateway directly show the repaired duplicate display and inline reconnect status. Reported browser regressions additionally cover persisted reorder barriers and unchanged send count; these are UI-boundary observations, not live-provider delivery proof.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (screenshot): Inspected before/after captures of the bundled Control UI with a synthetic Gateway directly show the repaired duplicate display and inline reconnect status. Reported browser regressions additionally cover persisted reorder barriers and unchanged send count; these are UI-boundary observations, not live-provider delivery proof.
Evidence reviewed 7 items Main still contains the duplicate-display mechanism: At the pinned main revision, waiting-reconnect messages qualify for transcript rendering but are not classified as inline states, so the composer also retains them.
One display decision with preserved delivery ownership: The branch distinguishes delivery attempts from offline submission timestamps, reuses the existing submission-identity selector for the composer, and retains the full outbox for ordering. No delivery storage format, authorization contract, dependency, or configuration changes are introduced.
Earlier reorder finding resolved: Reorder callbacks now use target message IDs; the owner resolves both IDs within a movable segment and rejects crossed edit barriers. Browser regressions check keyboard and drag moves preserve A/C/B in storage with one send request.
Findings None None.
Security None None.

How this fits together

The Control UI combines local pending messages with Gateway acknowledgments and transcript history. Its display projection decides where each message appears, while the existing outbox owns delivery and retry state.

flowchart TD
  A[User submits message] --> B[Local outbox]
  C[Gateway acknowledgments and history] --> D[Message display selection]
  B --> D
  D --> E[Transcript with delivery status]
  D --> F[Unattempted composer queue]
  F --> G[Reorder by message identity]
  G --> B
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +13, Tests +161, Docs +1. Total +175 across 27 files.

View PR surface stats
Area Files Added Removed Net
Source 15 79 66 +13
Tests 11 224 63 +161
Docs 1 1 0 +1
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 27 304 129 +175

Review metrics

None.

Technical review

Best possible solution:

Keep one identity-based display projection while preserving the existing outbox’s retry payloads, delivery barriers, and local-only discard behavior.

Do we have a high-confidence way to reproduce the issue?

Yes, from source: disconnecting after a send attempt makes main render the pending message in both the transcript and queue. Supplied before/after captures support this mechanism; no tests were executed during this read-only review.

Is this the best way to solve the issue?

Yes. The patch extends existing display and ordering owners, preserves submission identity, and addresses the filtering-induced reorder regression without changing persisted formats or delivery authority.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against d569fcdba8bd.

Labels

Label justifications:

  • P2: Duplicate pending-message presentation during reconnect is a bounded chat usability defect.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (screenshot): Inspected before/after captures of the bundled Control UI with a synthetic Gateway directly show the repaired duplicate display and inline reconnect status. Reported browser regressions additionally cover persisted reorder barriers and unchanged send count; these are UI-boundary observations, not live-provider delivery proof.
  • proof: sufficient: Contributor real behavior proof is sufficient. Inspected before/after captures of the bundled Control UI with a synthetic Gateway directly show the repaired duplicate display and inline reconnect status. Reported browser regressions additionally cover persisted reorder barriers and unchanged send count; these are UI-boundary observations, not live-provider delivery proof.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. Inspected before/after captures of the bundled Control UI with a synthetic Gateway directly show the repaired duplicate display and inline reconnect status. Reported browser regressions additionally cover persisted reorder barriers and unchanged send count; these are UI-boundary observations, not live-provider delivery proof.

Evidence

What I checked:

Likely related people:

  • vyctorbrzezowski: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
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.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (3 earlier review cycles)
  • reviewed 2026-09-12T21:25:06.550Z sha 45d41fa :: blocked before merge. :: [P2] Preserve reorder coordinates when hiding reconnecting sends
  • reviewed 2026-09-12T22:15:02.647Z sha 9cae2da :: needs maintainer review before merge. :: none
  • reviewed 2026-09-12T22:31:02.903Z sha 157c47e :: blocked before merge. :: none

@steipete

Copy link
Copy Markdown
Contributor Author

Fixed the reorder finding in 9cae2da. Reorder callbacks now carry a stable target message ID. Attempted sends remain nonmovable, and the composer keeps the full outbox for barrier segmentation while deriving its display subset separately.

The keyboard regression reproduced the reported C/A/B persisted order before the repair. Keyboard and drag regressions now preserve A/C/B with exactly one chat.send; hidden accepted-input barriers and peer edit conflicts are covered too. The final follow-up passed 838 focused tests, 12 browser scenarios, changed-file checks and a fresh independent review.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 12, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 12, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

The reorder review is now clear. Commit 157c47e additionally removes a redundant queue scan: check the crossed rows for edit conflicts, then reuse the already identified movable segment. This preserves the existing ordering and edit barriers.

The local comparison build passes the unchanged startup budget at 355,025 gzip bytes versus the 355,116-byte enforcement limit; 37 focused reorder/edit tests, changed-file checks and independent review pass. Fresh CI is running for this final commit.

@steipete

Copy link
Copy Markdown
Contributor Author

The remaining startup-size failure was reproduced on the exact CI base without this PR: a9d273d builds to 355,138 gzip bytes against the former 355,116-byte limit. The PR merge snapshot was slightly smaller at 355,134 bytes. None of the changed source files is in the eight startup assets; deferred chunk hashes account for the small compressed-size difference.

Main's baseline repair #146526 has now merged. The separate plugins-platform test inventory overflow is being repaired by #146538. This PR will consume those completed prerequisites and rerun exact-head CI before landing; its reconnect and reorder reviews are clear.

Keep attempted reconnect sends in the transcript with delivery status and local discard. Preserve unattempted offline sends in the composer queue, and filter retained custody by submission identity without collapsing intentional identical sends.
Use stable message IDs for reorder targets, retain hidden rows as delivery barriers, and keep attempted messages fixed in the outbox. Cover keyboard and drag controls against persisted order, with the reconnecting head preserved and no resend.
Check only the crossed rows for edit conflicts and split the already identified movable segment. Preserve reorder behavior while keeping the startup bundle within its existing budget.
@steipete
steipete force-pushed the codex/fix-reconnect-message-duplication branch from 157c47e to fa25773 Compare September 12, 2026 23:16
@steipete
steipete merged commit bf95f2b into main Sep 12, 2026
132 of 133 checks passed
@steipete
steipete deleted the codex/fix-reconnect-message-duplication branch September 12, 2026 23:48
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 13, 2026
* fix(ui): show reconnecting messages only once

Keep attempted reconnect sends in the transcript with delivery status and local discard. Preserve unattempted offline sends in the composer queue, and filter retained custody by submission identity without collapsing intentional identical sends.

* fix(ui): preserve queue order around hidden reconnecting sends

Use stable message IDs for reorder targets, retain hidden rows as delivery barriers, and keep attempted messages fixed in the outbox. Cover keyboard and drag controls against persisted order, with the reconnecting head preserved and no resend.

* refactor(ui): reuse the movable queue segment during reorder

Check only the crossed rows for edit conflicts and split the already identified movable segment. Preserve reorder behavior while keeping the startup bundle within its existing budget.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui docs Improvements or additions to documentation maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant