Skip to content

fix(ui): avoid false delivery warnings after stale history - #125426

Merged
jalehman merged 1 commit into
mainfrom
fix/webchat-delivery-uncertainty
Aug 18, 2026
Merged

jalehman merged 1 commit into
mainfrom
fix/webchat-delivery-uncertainty

Conversation

@jalehman

Copy link
Copy Markdown
Contributor

Closes #125425

What Problem This Solves

Fixes an issue where WebChat users could see a Delivery uncertain warning after a message was acknowledged and delivered when terminal reconciliation read temporarily stale history on a stable Gateway connection.

Why This Change Was Made

Reconciliation now checks every pane sharing the outbox for the same delivery attempt's live sending projection before classifying the durable waiting-reconnect copy as uncertain. It keeps that attempt pending and uses the existing bounded history retry; restored or disconnected attempts still follow the existing manual-review path.

User Impact

Acknowledged messages no longer show a false reconnect warning while transcript history catches up. WebChat retains the durable row until exact idempotency history proves delivery, so crash recovery and duplicate-send protection remain intact.

Evidence

  • Before: the observed Gateway returned status: "started" in 60 ms, the WebChat connection identity remained unchanged, and later chat.history contained the exact idempotency key, while the UI still showed the warning.
  • Regression proof: the new test failed on origin/main because the live row changed from sending to unconfirmed after two stale idle history reads.
  • pnpm --dir ui exec vitest run --config vitest.config.ts src/pages/chat/chat-send.test.ts (299 passed)
  • pnpm check:changed (passed)
  • .agents/skills/autoreview/scripts/autoreview --mode uncommitted --base origin/main --stream-engine-output (TruffleHog clean; no accepted/actionable findings; correctness 0.98)

Before screenshot:

WebChat false Delivery uncertain warning

An after screenshot is not deterministic in an isolated Gateway because the defect requires the transient transcript-persistence timing window from the affected live session. The regression test drives that ordering directly and verifies that the warning remains absent through later exact history proof.

AI-assisted: yes. The author reviewed the code path and validation results. Session transcripts are omitted because they contain private environment and conversation metadata.

@clawsweeper

clawsweeper Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@jalehman
jalehman marked this pull request as ready for review August 17, 2026 22:06
@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: S maintainer Maintainer-authored PR labels Aug 17, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 17, 2026
@clawsweeper

clawsweeper Bot commented Aug 17, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 17, 2026, 8:11 PM ET / August 18, 2026, 00:11 UTC.

ClawSweeper review

What this changes

The PR keeps an acknowledged WebChat send pending during briefly stale Gateway history, avoiding a false delivery-uncertain warning while preserving the existing eventual warning.

Regression provenance

Possible regression — probable (reproduction; reviewed change). No predecessor PR is attributed.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

No blocking findings on the current head. The prior grace-state cleanup concern is addressed; this maintainer-owned PR remains open for the bounded delivery-warning tradeoff and exact-head CI/merge decision.

Priority: P1
Reviewed head: 7f75fe5a01768f744dbbb906a345596687ff4145
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) Focused owner-boundary repair with direct UI evidence, source-backed regression coverage, and the prior cleanup finding resolved.
Proof confidence 🌊 off-meta tidepool Not applicable: The contributor is a repository member, so the external-contributor proof gate does not apply; nevertheless, the supplied isolated WebChat screenshot directly shows the after-fix chat with no warning.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The contributor is a repository member, so the external-contributor proof gate does not apply; nevertheless, the supplied isolated WebChat screenshot directly shows the after-fix chat with no warning.
Evidence reviewed 6 items Current-main defect path: Current main verifies idle history twice and then marks an attempted row unconfirmed without consulting a still-live sending projection.
Owner-boundary repair: The PR checks all panes sharing the outbox for the same live delivery version and schedules a maximum five-second retry before the existing unconfirmed path.
Prior finding resolved: Removing a row deletes its live projection, including its grace state; the new regression reuses the identical delivery version after removal and proves it receives a fresh grace window.
Findings None None.
Security None None.

How this fits together

WebChat stores outgoing messages in a durable outbox while showing a live sending projection in each pane. The outbox drain reconciles those views with Gateway history to either retire the message or surface an uncertainty warning.

flowchart LR
  A[WebChat send] --> B[Durable outbox row]
  A --> C[Live pane projection]
  B --> D[Outbox reconciliation]
  C --> D
  E[Gateway history] --> D
  D --> F[Retire confirmed message]
  D --> G[Bounded uncertain warning]
Loading

Decision needed

Question Recommendation
Should maintainers accept up to five seconds of pending status before the existing uncertain-delivery warning to prevent false warnings from briefly stale history? Accept the bounded grace: Merge with the five-second maximum hold, which avoids false warnings while retaining the existing uncertain state for permanently missing history.

Why: This is a user-visible delivery-state tradeoff on a protected maintainer PR; source and tests establish the mechanics, but the warning-timing policy belongs to maintainers.

Before merge

  • Resolve merge risk (P1) - Merging deliberately defers a genuine uncertain-delivery warning for up to five seconds when history remains missing; the added regression covers the eventual warning. The bug fix adds production state for the shared-pane deadline (+71 production lines); that state is justified because no existing owner holds a cross-pane, per-delivery deadline.
Agent review details

Security

None.

PR surface

Source +71, Tests +117. Total +188 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 2 74 3 +71
Tests 1 117 0 +117
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 191 3 +188

Review metrics

Metric Value Why it matters
Production versus test delta production +71, tests +117 The production growth is a bounded shared-owner deadline and cleanup path; the test growth covers recovery, expiry, and removed-scope reuse.
Grace-state coverage 3 added scenarios The tests cover brief stale history, permanently missing history, and clearing state before an identical delivery version is reused.

Merge-risk options

Maintainer options:

  1. Accept the bounded warning delay (recommended)
    Merge with the intentional maximum five-second hold because it prevents the false warning and the regression test proves permanently absent history still becomes uncertain.
  2. Ask for current-head live confirmation
    Pause for a fresh isolated WebChat trace if maintainers require live evidence after the cleanup-only head update.

Technical review

Best possible solution:

Keep the bounded grace state in the shared outbox owner, clear it whenever the live row retires, and merge after exact-head CI if maintainers accept the five-second warning delay.

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

Yes—current main's attempted-send path reaches unconfirmed after two idle history reads without checking the same-version live sending projection; the supplied regression exercises that ordering.

Is this the best way to solve the issue?

Yes—the shared outbox owner is the narrowest correct place for a cross-pane deadline, rather than adding a pane-local exception or weakening the durable recovery state.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 3cc55589e379.

Labels

Label changes:

  • add rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🌊 off-meta tidepool and patch quality is 🦞 diamond lobster.
  • remove rating: 🐚 platinum hermit: Current PR rating is rating: 🦞 diamond lobster, so this older rating label is no longer current.

Label justifications:

  • P1: The fix affects a WebChat delivery warning that can prompt users to retry an already accepted message.
  • merge-risk: 🚨 message-delivery: The changed reconciliation decides when an acknowledged message is retained, retired, or shown as uncertain.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🌊 off-meta tidepool and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The contributor is a repository member, so the external-contributor proof gate does not apply; nevertheless, the supplied isolated WebChat screenshot directly shows the after-fix chat with no warning.

Evidence

What I checked:

  • Current-main defect path: Current main verifies idle history twice and then marks an attempted row unconfirmed without consulting a still-live sending projection. (ui/src/pages/chat/chat-outbox-drain.ts:294, 3cc55589e379)
  • Owner-boundary repair: The PR checks all panes sharing the outbox for the same live delivery version and schedules a maximum five-second retry before the existing unconfirmed path. (ui/src/pages/chat/chat-outbox-drain.ts:315, 7f75fe5a0176)
  • Prior finding resolved: Removing a row deletes its live projection, including its grace state; the new regression reuses the identical delivery version after removal and proves it receives a fresh grace window. (ui/src/pages/chat/chat-send.test.ts:5686, 7f75fe5a0176)
  • Live behavior evidence: The supplied isolated OCM screenshot visibly shows the sent WebChat prompt and OK response with no Delivery uncertain banner; the accompanying author report records the stale durable/live projection scenario.
  • Current-main and release check: Current main does not contain the confirmation-grace symbols, and no release tag contains the PR head; this remains an unmerged fix rather than an implemented-on-main candidate. (ui/src/pages/chat/chat-outbox-drain.ts:315, 7f75fe5a0176)
  • History provenance: The shared outbox projection architecture was introduced by the current-main refactor; current-head blame attributes the new grace logic to this PR head. (ui/src/pages/chat/chat-outbox-owner.ts:240, 66ff7b6e9428)

Likely related people:

  • steipete: Introduced the centralized outbox-projection refactor that owns the shared live and durable state used by this repair. (role: shared outbox architecture owner; confidence: high; commits: 66ff7b6e9428, 6c9cb8e04d4d; files: ui/src/pages/chat/chat-outbox-owner.ts, ui/src/pages/chat/chat-outbox-drain.ts)
  • Vyctor H. Brzezowski: Recent queued-message editing and reordering work modified the same shared outbox owner and its cross-pane lifecycle. (role: recent adjacent contributor; confidence: medium; commits: 9327c10d2bdc, 1d989027cf6c; files: ui/src/pages/chat/chat-outbox-owner.ts)

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 (2 earlier review cycles)
  • reviewed 2026-08-17T22:53:19.697Z sha 013f60f :: found issues before merge. :: [P1] Bound the live sending hold before retrying
  • reviewed 2026-08-17T23:57:10.387Z sha 45d1541 :: found issues before merge. :: [P3] Clear grace state when its queued scope disappears

@jalehman

jalehman commented Aug 17, 2026 •

Copy link
Copy Markdown
Contributor Author

Live OCM verification

Verified PR head 45d1541aeb0ef59cf35b9055e0d1a4819beeb646 with a release-shaped runtime in an isolated OCM environment.

  • Built the PR runtime with source extensions and confirmed the served runtime reported OpenClaw 2026.8.1 (45d1541).
  • Sent a real message through WebChat.
  • The live row entered sending while its durable copy entered waiting-reconnect, exercising the reconciliation path that produced the false warning.
  • The row retired after authoritative history contained the matching send.
  • Delivery uncertain did not appear.
  • The user turn rendered and the agent replied OK.
  • Captured after the one-time first-reply confetti canvas had been removed.
  • Removed the disposable browser, OCM environment, and test runtime after verification.

Live WebChat verification showing the sent message and OK response without a Delivery uncertain banner

Final head 7f75fe5a01768f744dbbb906a345596687ff4145 bounds the hold to five seconds after two idle/missing-history reads and stores the deadline on the live projection, so removing that delivery clears its grace state by construction. Regressions cover transient history lag, permanently missing history, and removal/reuse of the same delivery version. Final validation: 301 chat-send tests passed, pnpm check:changed passed, autoreview clean (0.98), and exact-head CI green.

@jalehman
jalehman force-pushed the fix/webchat-delivery-uncertainty branch from 013f60f to 45d1541 Compare August 17, 2026 23:51
@jalehman

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 17, 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: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 17, 2026
@jalehman
jalehman force-pushed the fix/webchat-delivery-uncertainty branch from 45d1541 to 7f75fe5 Compare August 18, 2026 00:05
@jalehman

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 18, 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.

@clawsweeper clawsweeper Bot added rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Aug 18, 2026
@jalehman
jalehman merged commit 02ec1b6 into main Aug 18, 2026
147 checks passed
@jalehman
jalehman deleted the fix/webchat-delivery-uncertainty branch August 18, 2026 00:33
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 18, 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 merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦞 diamond lobster Very strong PR readiness with only minor 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.

[Bug]: WebChat marks acknowledged sends as delivery uncertain

1 participant