Skip to content

fix(ui): keep acknowledged sends pending on current connection - #131266

Merged
jalehman merged 1 commit into
mainfrom
fix/home-chat-delivery-uncertainty-v2
Aug 27, 2026
Merged

jalehman merged 1 commit into
mainfrom
fix/home-chat-delivery-uncertainty-v2

Conversation

@jalehman

Copy link
Copy Markdown
Contributor

Related: #125425
Related: #125426
Related: #131171

AI-assisted: yes.

What Problem This Solves

Fixes an issue where users sending a message from the Control UI Home chat could see a delivery-uncertain warning after five seconds when transcript history stayed stale, even though chat.send was acknowledged and the Gateway connection never changed.

#125426 reduced the race by adding a confirmation grace period. #131171 added stronger run-ID delivery proof and a calmer inline presentation for genuine reconnect uncertainty. The remaining gap was the timer itself: elapsed time could still turn a current-connection send into reconnect uncertainty without any reconnect evidence.

Why This Change Was Made

While the exact current connection still owns a matching live sending projection, reconciliation now keeps the send pending until authoritative transcript/run proof retires it or a real connection transition removes the live fact. The obsolete five-second confirmation deadline, retry timer, and owner bookkeeping are removed.

Actual reconnect ambiguity keeps the existing conservative unconfirmed path and the inline presentation added by #131171. This adds no config, storage, protocol, or API surface.

User Impact

Acknowledged Home-chat sends no longer become “Delivery unconfirmed” merely because history takes longer than five seconds to catch up. Users still receive the existing review-and-retry outcome when a real reconnect leaves delivery ambiguous.

Evidence

  • Pre-fix regression: the focused test failed after advancing the clock by 5,001 ms because the row changed from sending to unconfirmed.
  • node scripts/run-vitest.mjs ui/src/pages/chat/chat-send.test.ts — 283 passed on the current-main rebase.
  • pnpm tsgo:ui — passed.
  • Targeted oxlint and stylelint for all three changed files — passed.
  • git diff --check origin/main...HEAD — passed.
  • Fresh Codex autoreview against origin/main — no actionable findings; patch correct, confidence 0.98.
  • Production LOC: +4/−63. Tests: +3/−59.

Changed-gate limitation: node scripts/check-changed.mjs passed conflict-marker, ratchet, dependency, formatting, dead-export, temp-directory, and UI i18n checks, then stopped in core-test typechecking on pre-existing implicit-any errors in ui/src/test-helpers/control-ui-e2e*.test.ts and mock-gateway-page.test.ts, introduced on current main by #131052. The touched UI typecheck/lint/style lanes pass independently.

Visual proof is not attached yet. The deterministic owner-boundary regression covers the five-second state transition; before landing, the PR should also capture the real Control UI surface or state why isolated visual proof is infeasible.

Prevent elapsed time alone from turning an acknowledged send on the current Gateway connection into delivery uncertainty. Genuine reconnect ambiguity remains unchanged.
@clawsweeper

clawsweeper Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@openclaw-barnacle openclaw-barnacle Bot added the app: web-ui App: web-ui label Aug 27, 2026
@jalehman
jalehman marked this pull request as ready for review August 27, 2026 23:23
@openclaw-barnacle openclaw-barnacle Bot added size: S maintainer Maintainer-authored PR labels Aug 27, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. 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. labels Aug 27, 2026
@clawsweeper

clawsweeper Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 27, 2026, 7:31 PM ET / 23:31 UTC.

ClawSweeper review

What this changes

The PR removes the five-second confirmation deadline so an acknowledged Control UI chat send stays pending while its Gateway connection remains current.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

Keep this maintainer PR open for normal exact-head CI and live-proof review. The introduced change correctly removes the timer-only transition while retaining the existing reconnect path; current main still contains the five-second deadline, so the work remains necessary.

Priority: P2
Reviewed head: 275ea9f48df09e3796d1d5dc01bb1ca96f02b8b4

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, net-negative repair with source-backed regression coverage and no actionable correctness finding.
Proof confidence 🌊 off-meta tidepool Not applicable: Repository state identifies this as a member-authored PR, so the external-contributor proof gate does not apply; the PR body nevertheless has no after-fix browser artifact.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: Repository state identifies this as a member-authored PR, so the external-contributor proof gate does not apply; the PR body nevertheless has no after-fix browser artifact.
Evidence reviewed 6 items Introduced reconciliation behavior: The introduced branch returns blocked when the matching live sending row is still present, rather than allowing elapsed time to park it as unconfirmed.
Current-main necessity: Current main still creates a five-second confirmation deadline and retries until it expires, so it can still turn this otherwise matching live projection into uncertainty.
Reconnect boundary remains explicit: A connection lifecycle transition converts all sending outbox rows to waiting-reconnect, which removes the live sending condition before later reconciliation.
Findings None None.
Security None None.

Live Verification

Entry: /

Result: FAIL (partial) — step 3 expect_text OpenClaw: locator.waitFor: Timeout 15000ms exceeded.

Steps:

  • PASS goto /
  • PASS wait_for body
  • FAIL expect_text OpenClaw — locator.waitFor: Timeout 15000ms exceeded.

How this fits together

The Control UI keeps attempted messages in a durable outbox and reconciles them with Gateway history, session-run metadata, and connection state. It retires proven sends, keeps current sends pending, and shows an inline retry state only after genuine reconnect ambiguity.

flowchart LR
  Composer[Control UI composer] --> Outbox[Durable chat outbox]
  Outbox --> Reconcile[Delivery reconciliation]
  Gateway[Gateway history and run state] --> Reconcile
  Connection[Connection lifecycle] --> Reconcile
  Reconcile --> Delivered[Retire proven send]
  Reconcile --> Pending[Keep current send pending]
  Reconcile --> Uncertain[Show reconnect uncertainty]
Loading

Before merge

  • Resolve merge risk (P1) - No after-fix Control UI artifact is attached. Repository policy prefers a real UI verification or a concrete infeasibility statement before landing this user-visible change.
  • Complete next step (P2) - No repair job is warranted: no introduced actionable defect was found, and the remaining work is ordinary exact-head CI and proof review on a maintainer PR.
Agent review details

Security

None.

PR surface

Source -59, Tests -56. Total -115 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 2 4 63 -59
Tests 1 3 59 -56
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 7 122 -115

Review metrics

Metric Value Why it matters
Production versus test LOC production −59, tests −56 The bug fix removes the obsolete timer and owner bookkeeping rather than adding another delivery path.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Land the timer removal after exact-head CI and a redacted mocked-Gateway Control UI proof, or document why that isolated visual proof cannot exercise the timing path.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Land the timer removal after exact-head CI and a redacted mocked-Gateway Control UI proof, or document why that isolated visual proof cannot exercise the timing path.

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

Yes, from source: current main's reconciliation starts a five-second deadline for a matching live send, and the focused test drives the stale-history/clock sequence past that deadline.

Is this the best way to solve the issue?

Yes. The patch removes only the elapsed-time classifier; current lifecycle code still changes sending rows on a real connection transition, and Gateway event paths continue to reload and flush delivery state.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 0fdae639d1fd.

Labels

Label changes:

  • add P2: This is a bounded Control UI delivery-state regression with misleading retry guidance but no demonstrated message loss.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: Repository state identifies this as a member-authored PR, so the external-contributor proof gate does not apply; the PR body nevertheless has no after-fix browser artifact.

Label justifications:

  • P2: This is a bounded Control UI delivery-state regression with misleading retry guidance but no demonstrated message loss.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: Repository state identifies this as a member-authored PR, so the external-contributor proof gate does not apply; the PR body nevertheless has no after-fix browser artifact.

Evidence

What I checked:

Likely related people:

  • jalehman: Authored the merged stale-history repair and this targeted follow-up. (role: original stale-history repair author and current area contributor; confidence: high; commits: 02ec1b6166f1, 275ea9f48df0; files: ui/src/pages/chat/chat-outbox-drain.ts, ui/src/pages/chat/chat-send.test.ts)
  • steipete: Authored the merged reconnect delivery-proof and inline uncertainty refinement. (role: recent adjacent delivery-state contributor; confidence: high; commits: 6e827231257c; files: ui/src/pages/chat/chat-outbox-drain.ts, ui/src/pages/chat/chat-queue.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Attach a redacted mocked-Gateway Control UI proof, or state the concrete reason the timing path cannot be shown in isolation.

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.

@jalehman
jalehman merged commit e946d22 into main Aug 27, 2026
208 checks passed
@jalehman
jalehman deleted the fix/home-chat-delivery-uncertainty-v2 branch August 27, 2026 23:57
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 28, 2026
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 maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S 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