Skip to content

fix(gateway,ui): reconcile pending chat sends after reconnect - #182334

Merged
steipete merged 5 commits into
mainfrom
steipete/chat-send-reconcile
Oct 24, 2026
Merged

steipete merged 5 commits into
mainfrom
steipete/chat-send-reconcile

Conversation

@steipete

@steipete steipete commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

When a chat message's socket died after the frame was written, the Control UI parked it as "Delivery unconfirmed" with Retry / Discard (and "Check delivery" for a new session's first message). The user had to decide whether it had been sent. Peter: "we can't really have an unconfirmed state. Either it's pending (needs sending or not confirmed) or sent - we can reconcile when we are connected to the network."

Why It Happened

The client sends each message with a stable idempotency key, but the Gateway only deduplicated a resend in two cases: within a 5-minute in-memory window on the same process, or durably for "restart-safe" requests. Outside those cases a resend could dispatch a second turn, so the client couldn't safely resend on its own and asked the user instead.

Solution

  • Server guarantee (src/gateway/server-methods/chat-send-pre-admission.ts): before dispatching a request it would otherwise treat as new, chat.send checks for that session's recorded user row ${runId}:user (or its durable input receipt) through the existing session-scoped indexed reader (readSessionSubmittedInput). If it finds one, the request is a duplicate: no new turn is dispatched and nothing is appended. It returns the existing cached ACK or in_flight/ok shape. The same key with different content still returns chat-request-conflict. This covers attachments, commands and overrides. Accepted edge: a crash before either durable record exists leaves the key available, so the retry simply sends it.
  • Client state machine: pending, then sent (on an ACK or a duplicate response) or failed (on a real rejection, which keeps Retry/Discard). Transport loss keeps a message pending ("Waiting for reconnect"). On the first accepted hello with the same identity and recovery scope, attempted sends are replayed FIFO with their original keys and physical session identity, and the server decides. The new-session first message follows the same path; it is never paused as unconfirmed. Saved attempts that lack a physical-session identity (from older stored outboxes) are held for explicit review rather than guessed.
  • Deleted: chat-outbox-receipts.ts, chat-outbox-history.ts, the passive history-receipt reconciliation, paused-unconfirmed handling, and the "Check delivery" / "Delivery unconfirmed" UI and copy.
  • The Control UI is always served by its own paired Gateway build (build-identity pairing), so this needs no compatibility shim.
  • Docs: docs/web/control-ui/chat.md, docs/web/control-ui/offline-and-reconnect.md, docs/web/control-ui/sessions-and-sidebar.md and the chat.send protocol docs describe the delivery states, automatic reconciliation and the server idempotency guarantee.

Merge repair

Merged current main 07a637979d4c1df3da8cf65103cd7ccad00dee3a without rewriting branch history. The capacity, payload, and recovery E2E conflicts preserve main's retained coverage and the intentional consolidations from #182358. Pending sends reconcile through their original keys and duplicate ACKs; rejection alone exposes Retry. Recovery retains unrelated-event isolation, nonmatching history, exact durable user-row identity, and no duplicate bubble while readback is held.

The reported type error and seven unit failures were branch-caused:

  • The retry-cancellation test now supplies the recovery-access argument required by pause.
  • The recovered-session expectation includes the exact 500 ms retry delay.
  • Goal admission no longer bypasses a run started by an older FIFO message.
  • Outbox readiness revalidates current holds after both fulfilled and rejected history reads, preserving the visible queue while account recovery is unready.
  • All four retired-event variants now prove interrupted same-key replay followed by duplicate ACK, retaining the original stale-session, transcript, and foreground-pane isolation assertions.

The failed CI run also exposed a pending telemetry-row regression. ACK handling now publishes accepted run activity before retiring queued progress across an await. Mobile motion is branch-caused: all four motion cases pass on the pinned main checkout; the branch footer shrinks during ACK and causes an instant virtualizer retarget. The existing scroll-command owner now preserves smooth movement when the endpoint shrinks during that journey; growth and cancellation behavior remain unchanged. The original browser assertions remain unchanged. No assertion, timeout, skip, or baseline was relaxed.

Codex review also identified two additional boundary bugs. Legacy uncertain local commands now require explicit Retry after reload, and attempted sends with missing/unavailable attachment bytes stay held with their original key and FIFO position until retry or discard. Both have regressions proven red before the repair. The proposed memory-only rejection finding was rejected: the recoverable branch explicitly excludes nonretryable Gateway errors, which already fall through to the failed state and visible error.

Evidence

Final repair head: c949ed13090c84c2a5350d7c999751c928f9db0d.

  • Final focused unit sweep: 387/387 tests across 18 files (60.30 s wrapper wall time), including all failing unit files, outbox/reconnect, attachment retirement, memory-only custody, legacy recovery, and the scroll owner/browser tests.
  • Review follow-up proof: 8 detached-approval and 37 required-profile/gating cases pass on unchanged final source.
  • Browser E2E: 27/27 tests across the capacity, payload, recovery, streaming, and motion files (175.13 s), using the repository UI E2E runner with one worker.
  • pnpm tsgo:ui, pnpm tsgo:core, and the UI-app, UI-chat, and UI-chat-E2E test type configurations pass.
  • Targeted oxlint, oxfmt --check, and staged/working-tree git diff --check pass.
  • Codex autoreview: two complete full-candidate reviews. Two accepted findings were fixed with red/green regressions; three findings were rejected after source and existing-test verification. No actionable finding remains unresolved.
  • The earlier live integration proof covered lost send and lost ACK with exactly-once delivery. It remains integration-build evidence, not final-head live proof. This repair did not access a live Gateway or operator state.

Review rejection details: nonretryable memory-only errors are excluded from recoverable handling (chat-send-queue-state.ts:281) and already become failed with a visible error. Required profile placement explicitly bypasses sessions.dispatch (session-placement-startup.ts:420); existing initial/retry/resend tests assert the permitted RPC lists. The detached route is restricted to /approve (chat-send-submit.ts:351), retains main's existing explicit composer restoration, never auto-replays on reconnect, and resolves through the same canonical approval ID. Approval settlement rejects an already-resolved ID instead of applying a second decision. Restoring an automatic detached-command queue or adding an admin-dispatch gate would change those owning contracts.

Hosted CI on the new head remains the broad landing gate; this repair does not merge the PR.

Deduplicate recorded chat.send submissions in pre-admission using the existing
session-scoped indexed user-input lookup, including non-restart-safe attachments,
commands, and overrides after the in-memory cache expires. Preserve cached ACKs,
active-run responses, current authority, and conflicting-payload rejection.

Keep unacknowledged chat sends pending and automatically replay them FIFO with
the original submission and physical-session identities after authenticated
reconnect. Apply the same admission contract to new-session first messages.
Remove delivery-unconfirmed UI, manual delivery checks, and passive outbox
history-receipt scanning; keep explicit failures and pending Discard behavior.
Explicit Retry after rejection renews the admission and physical-session binding
together; intentional recovery into another conversation remains inert until Retry.
Preserve saved first prompts when their original physical identity is unavailable,
hold stored attempted sends without a physical target until explicit review,
and resume attachment sends after private Blob adoption without bypassing retry delays.

Release-note context: reconnect now settles pending sends automatically without
starting a duplicate recorded turn. The Control UI is served by its paired
Gateway build, so no old-Gateway compatibility shim is needed. Existing RAM
reservations cover concurrent admissions; a crash before either durable input
record exists leaves the original key available for retry.

Validation: focused Gateway and UI owner suites, selected Chromium reconnect,
rejection, attachment, and first-message scenarios, core/UI typechecks,
targeted lint/format, English i18n baseline, and five edited MDX pages.
Pending/rejected startup controls also remain reachable when canonical history
hides the local initial bubble; Discard cannot be undone by a late ACK.

Proof gap: seven individual-module browser scenarios exceeded the native
initial-roster deadline before reaching their recovery assertions. The retained
build became ready after 26.399 seconds; assertion deadlines were not widened.
@clawsweeper

clawsweeper Bot commented Oct 24, 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.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-24T10:12:11.344219Z c949ed1 New commits
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui gateway Gateway runtime size: XL labels Oct 24, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 21b647607b

ℹ️ 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".

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 24, 2026
@clawsweeper

clawsweeper Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge.

What this changes

This PR automatically retries pending chat submissions after reconnect and deduplicates recorded inputs at Gateway admission.

Example: The Gateway receives submission message-stable, but its acknowledgment is lost.

  • Before: The Control UI shows Delivery unconfirmed and asks the user to decide whether to retry.
  • After: The message remains pending and reconnect resends message-stable; the Gateway acknowledges the recorded input without dispatching another turn.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) Useful direction with ordinary reconnect integration evidence, but an unfixed upgrade regression, broken test consumers, and incomplete authority and upgrade validation prevent readiness.
Proof confidence 🦐 gold shrimp (3/6) Real behavior proof is necessary before merge. See Before merge.
Patch quality 🦪 silver shellfish (2/6) Security review found an item that needs attention.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: After a lost acknowledgment, users must decide whether their chat message arrived and whether retrying could duplicate it.
Reason: The maintainer-authored direction removes an avoidable delivery decision and reuses the existing submission identities and owners.

Merge readiness

⛔ Blocked before merge - 8 items remain

Keep this maintainer-directed repair open: automatic reconciliation addresses a real delivery problem, but the legacy review-barrier migration and two test consumers still need correction.

Priority: P1
Reviewed head: 544ff5ede31646a774049d10d3aeb40a5e4618e3

Before merge

  • Add real behavior proof - Authority-chain proof required: the posted Chromium/TCP-proxy report proves ordinary lost-send and lost-ACK recovery through an isolated Gateway, but does not show revoked device or session authority stopping provider/tool I/O or a replacement recovery scope preventing replay; the final authority attempt is explicitly inconclusive. The inspected images show sibling archive/delete behavior, so matching pending-send before/after captures are still needed, with credentials, IPs, phone numbers, and non-public endpoints redacted. After adding proof, update the PR body, then request a new review with @clawsweeper re-review. The PR author or someone with repository write access can request it.
  • Migrate legacy unconfirmed review barriers to held state (P1) - The prior finding remains unfixed. v2026.10.6 persists an unattempted successor as unconfirmed when a preceding /clear has an uncertain outcome. Removing this accepted state leaves that saved row with no sendState; the new missing-session guard does not hold it because it has no attempted send. The drain then passes its held/failed checks and can send it automatically after reload, bypassing the required conversation review. Preserve legacy review-only barriers as held while allowing eligible attempted submissions to reconcile.
  • Pass recovery access to the startup pause test (P2) - The new pause cancellation case invokes startup.pause(key, "Stopped"), but ApplicationPlacementStartup.pause requires a third PlacementStartupRecoveryAccess argument. This is a definite TS2554 error in the affected test graph; pass the existing recovery operations used by other pause consumers. This was equally visible at the previously reviewed head and is a late discovery in this review.
  • Include the retry delay in the pending-result expectation (P2) - For the injected Error("connection unavailable"), startup classifies the send as ambiguous and returns retryAfterMs: 500; advanceSessionPlacementDraft forwards that field in its pending result. This changed exact toEqual expectation omits the field and therefore fails. Assert the returned delay while preserving the recovery checks. The expectation is unchanged from the previously reviewed head, making this a late discovery.
  • Resolve security review attention item - Automatic replay changes when saved input can execute, and final-effect revocation safety remains unverified.
  • Resolve merge risk - Before merge, the PR author must establish that automatic replay cannot carry revoked device authority, removed session membership, or a replaced recovery scope into provider or tool I/O.
  • Add data-model compatibility proof - The review found that existing stored data may not work after upgrade. Show that existing data still loads and works with this change.
  • Explain or restore the original intent of Legacy unconfirmed review barriers - dedf85a: History carries the uncertain-/clear successor barrier through the drain split; both the latest stable producer and retained new held producer require explicit review, but the codec supplies no equivalent legacy migration.

Findings

  • [P1] Migrate legacy unconfirmed review barriers to held state — ui/src/lib/chat/outbox-store-codec.ts:242-246
  • [P2] Pass recovery access to the startup pause test — ui/src/app/session-placement-startup.delivery.test.ts:101
  • [P2] Include the retry delay in the pending-result expectation — ui/src/pages/new-session/session-placement-submit.test.ts:108-110

Provenance

  • Legacy unconfirmed review barriers changes intended behavior without addressing why it exists (dedf85a: History carries the uncertain-/clear successor barrier through the drain split; both the latest stable producer and retained new held producer require explicit review, but the codec supplies no equivalent legacy migration.)

Tests

  • Missing end-to-end proof: Provide replay revocation traces, matching pending-send visual captures, and a latest-stable outbox upgrade run; red-before/green-after proof for the legacy review-barrier regression is not supplied.
Agent review details

How this fits together

The browser outbox retains submissions across transport loss; authenticated chat.send admission compares their original identities with session-owned input receipts and transcript records before dispatch.

flowchart LR
  Composer --> Outbox
  Outbox --> Reconnect
  Reconnect --> Admission
  Admission --> RecordedInput
  RecordedInput --> Acknowledgment
  Admission --> AgentTurn
  Acknowledgment --> Outbox
Loading

Technical review

Best possible solution:

Keep deduplication in Gateway admission and replay in the existing outbox owners, migrate legacy review barriers to held, and complete the affected consumer contracts.

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

The stable producer, changed codec, and current drain establish the legacy-barrier failure from source; the supplied integration report independently demonstrates the ordinary reconnect scenario, without a local reproduction run.

Is this the best way to solve the issue?

The existing admission and outbox owners are the right boundaries, and removing passive receipt scanning is coherent once replay is safe; the persisted-state cutover remains incomplete.

Full review comments:

  • [P1] Migrate legacy unconfirmed review barriers to held state — ui/src/lib/chat/outbox-store-codec.ts:242-246
    The prior finding remains unfixed. v2026.10.6 persists an unattempted successor as unconfirmed when a preceding /clear has an uncertain outcome. Removing this accepted state leaves that saved row with no sendState; the new missing-session guard does not hold it because it has no attempted send. The drain then passes its held/failed checks and can send it automatically after reload, bypassing the required conversation review. Preserve legacy review-only barriers as held while allowing eligible attempted submissions to reconcile.
    Confidence: 0.99
  • [P2] Pass recovery access to the startup pause test — ui/src/app/session-placement-startup.delivery.test.ts:101
    The new pause cancellation case invokes startup.pause(key, "Stopped"), but ApplicationPlacementStartup.pause requires a third PlacementStartupRecoveryAccess argument. This is a definite TS2554 error in the affected test graph; pass the existing recovery operations used by other pause consumers. This was equally visible at the previously reviewed head and is a late discovery in this review.
    Confidence: 1
    Late finding: first raised on code an earlier review cycle already covered.
  • [P2] Include the retry delay in the pending-result expectation — ui/src/pages/new-session/session-placement-submit.test.ts:108-110
    For the injected Error("connection unavailable"), startup classifies the send as ambiguous and returns retryAfterMs: 500; advanceSessionPlacementDraft forwards that field in its pending result. This changed exact toEqual expectation omits the field and therefore fails. Assert the returned delay while preserving the recovery checks. The expectation is unchanged from the previously reviewed head, making this a late discovery.
    Confidence: 0.99
    Late finding: first raised on code an earlier review cycle already covered.

Overall correctness: patch is incorrect
Overall confidence: 0.96

AGENTS.md: found and applied where relevant.

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

Merge-risk options

Maintainer options:

  1. Verify replay at the final authority boundary (recommended)
    The PR author should demonstrate allowed replay and rejection after device revocation, session-membership removal, and recovery-scope replacement before provider or tool effects.

Provenance checked

Testing

Proof path: shipped entry point.

Security

Needs attention: Automatic replay changes when saved input can execute, and final-effect revocation safety remains unverified.

Evidence

What I checked:

  • Pinned introduction and policy: Inspected the introduced production diff from d95a32c to 544ff5e, root policy, and all applicable ancestor guides: docs, Gateway, and Control UI. The maintainer-notes directory is absent; the installed Solid cheatsheet is unavailable. (AGENTS.md:1, 544ff5ede316)
  • Released review barrier: v2026.10.6 writes an unconfirmed successor after an uncertain /clear and documents it in code as a durable review barrier; current main retains that producer. (ui/src/pages/chat/chat-outbox-drain.ts:431, fe06181dc5ec)
  • Unfixed prior finding: The codec drops legacy unconfirmed state, while the drain blocks held rows; an unattempted review barrier does not meet the new missing-physical-identity hold condition. (ui/src/lib/chat/outbox-store-codec.ts:242, 544ff5ede316)
  • Concrete test consumer defects: The added cancellation test calls the three-argument pause API with two arguments, and the changed draft-advancement test expects an exact pending result without the newly returned retryAfterMs: 500. (ui/src/app/session-placement-startup.delivery.test.ts:101, 544ff5ede316)
  • Current-head CI and merge metadata: GitHub reports failed typecheck and UI E2E checks for this head. E2E annotations identify mobile send motion and pending telemetry stability failures, but do not establish their cause. Runner-log download was blocked at the Azure artifact host. Captured merge metadata was dirty; the subsequent REST read returned unknown, so current mergeability remains unsettled. (544ff5ede316)
  • Supplied behavior evidence: The author's integration report demonstrates ordinary lost-send and lost-ACK reconciliation through Chromium, a TCP fault proxy, and an isolated Gateway: fix(gateway,ui): reconcile pending chat sends after reconnect #182334 (comment). Both downloaded images were inspected and show the archive/delete scenarios from feat(ui): archive and delete sessions while the Gateway reconnects #182292, rather than pending-send before/after states.

Likely related people:

  • Peter Steinberger: Raw commit 5e1ffe9 adds src/gateway/server-methods/chat-send-retry-comparison.ts:41 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 5e1ffe933799; files: src/gateway/server-methods/chat-send-retry-comparison.ts)
  • Liu Zixiang: Raw commit 7a894c6 adds src/gateway/server-methods/chat-send-retry-comparison.ts:40 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 7a894c69dac8; files: src/gateway/server-methods/chat-send-retry-comparison.ts)
  • Vyctor H. Brzezowski: Raw commit 55cec08 adds ui/src/lib/chat/outbox-store-codec.ts:199 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: low; commits: 55cec088a8ad; files: ui/src/lib/chat/outbox-store-codec.ts)

PR surface

PR surface statistics unavailable: the file list is incomplete.

Labels

Label changes:

No label changes.

Label justifications:

  • P1: This affects reliable chat delivery, and the remaining migration defect can automatically release saved input that required explicit review.
  • merge-risk: 🚨 compatibility: The latest stable release persists unconfirmed review barriers that the changed codec no longer preserves.
  • merge-risk: 🚨 message-delivery: Dropping a legacy review barrier can send its queued successor without the user's required retry decision.
  • merge-risk: 🚨 security-boundary: Automatic replay consumes saved submissions across reconnects, requiring evidence that current device and session authority still gates final effects.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦐 gold shrimp and patch quality is 🦪 silver shellfish.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (3 earlier review cycles)
  • reviewed 2026-10-24T07:18:59.699Z sha 21b6476 :: needs real behavior proof before merge. :: [P1] Preserve authorized restart recovery before acknowledging stored input | [P2] Schedule first-message retries on a healthy connection | [P2] Wake memory-only sends after an acknowledgment timeout | [P2] Migrate the remaining first-message RPC test consumers | [P2] Complete the consumer-test cutover for acceptance retirement
  • reviewed 2026-10-24T09:07:11.960Z sha 1c55ec2 :: needs real behavior proof before merge. :: [P1] Migrate legacy unconfirmed review barriers to held state
  • reviewed 2026-10-24T09:43:40.191Z sha 544ff5e :: needs real behavior proof before merge. :: [P1] Migrate legacy unconfirmed review barriers to held state

Reviewed October 24, 2026, 5:52 AM ET / 09:52 UTC (Revision 4).

@steipete

Copy link
Copy Markdown
Contributor Author

Live integration proof

Current main (5e0b786) merged locally with #182334 (send reconciliation), #182292 (offline archive/delete) and #182336 (deferred-chunk precache), plus #182336's sidecar-race fix. One full build on Node 26.12.1, served by an isolated Gateway behind a TCP fault proxy, and driven by real headless Chromium with fresh browser contexts and nothing pre-warmed.

Scenario Result
Lost send (full black hole, then link down) "Waiting for reconnect", then sent automatically after reconnect; exactly 1 row after reload
Lost ACK (Gateway received it, reply lost, then link down) "Waiting for reconnect", then sent after reconnect; exactly 1 row after reload (no duplicate turn)
Dead link with a pending send detected after 35s; delivered automatically when the link returned (no Retry)
Idle dead link detected after 30s
Offline delete and archive from the session menu (cold, no warmed chunks) rows applied immediately ("1 queued", then "2 queued"); drained on reconnect; persisted after reload
Deferred precache 752 cache entries after background precache; 5 never-visited routes opened offline with 0 chunk failures
Offline rename / reaction applied with "1 queued"; persisted after reload
Blip, offline send queue, flaky link (600ms latency, 900ms jitter, 4% resets), offline reload via SW pass (flaky: 5/5 delivered)

No "Delivery unconfirmed" state appeared in any scenario.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4a81673452

ℹ️ 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".

Comment thread ui/src/pages/chat/chat-send-delivery.ts Resolved
@steipete

Copy link
Copy Markdown
Contributor Author

The landing repair in 1c55ec2 addresses the verified findings: interrupted-input recovery retains its private current-authority path; first-message and memory-only sends retry on healthy connections; reservation-only duplicate responses preserve browser custody until Gateway acceptance. Attachment/display handoff now uses the existing shared outbox owner, and consumed receipts carry their existing committed transcript position.

The PR body links the already-posted live integration proof and records focused repair checks plus the earlier E2E failures still requiring final-head hosted CI. No assertions, skips, timeouts, budgets or baselines were weakened.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added the clawsweeper:intake:bug Preliminary submission classification; full source review pending. label Oct 24, 2026
steipete added a commit that referenced this pull request Oct 24, 2026
…182651)

Main red after #182334 (11cb698): its durable retry lookup let the fixture's immediate mock run finish before /stop selected it, so 'preserves stop-command reason when /stop lands during the accepted ack yield' failed deterministically. The fixture now controls its timer explicitly; every cancellation and stop-reason assertion stays. Live isolated Gateway /stop, partial preservation and recovery verified.
steipete added a commit that referenced this pull request Oct 25, 2026
Reduce the durable submitted-input source lookup from five SQL statements to one snapshot-consistent autocommit SELECT on SQLite and PostgreSQL. Keep restart, expired-memory, and attachment duplicate-dispatch protection, with the original bounded recovery transaction unchanged.

The normal new-input path saves four statements without adding a worker request. The accepted rare recovery tradeoff is one additional statement for pending or committed input.

Verified with both-engine count regressions, 56 focused behavior/prompt-prefix tests, three synthetic Gateway baseline/candidate pairs, and PostgreSQL owner review. Exact-head CI passes all static gates; the inherited PostgreSQL shard 2 fixture failure was independently fixed in #182990.

Follow-up to #182334; single-statement precedent #182883.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 25, 2026
…aw#182334)

* fix(gateway,ui): reconcile pending chat sends after reconnect

Deduplicate recorded chat.send submissions in pre-admission using the existing
session-scoped indexed user-input lookup, including non-restart-safe attachments,
commands, and overrides after the in-memory cache expires. Preserve cached ACKs,
active-run responses, current authority, and conflicting-payload rejection.

Keep unacknowledged chat sends pending and automatically replay them FIFO with
the original submission and physical-session identities after authenticated
reconnect. Apply the same admission contract to new-session first messages.
Remove delivery-unconfirmed UI, manual delivery checks, and passive outbox
history-receipt scanning; keep explicit failures and pending Discard behavior.
Explicit Retry after rejection renews the admission and physical-session binding
together; intentional recovery into another conversation remains inert until Retry.
Preserve saved first prompts when their original physical identity is unavailable,
hold stored attempted sends without a physical target until explicit review,
and resume attachment sends after private Blob adoption without bypassing retry delays.

Release-note context: reconnect now settles pending sends automatically without
starting a duplicate recorded turn. The Control UI is served by its paired
Gateway build, so no old-Gateway compatibility shim is needed. Existing RAM
reservations cover concurrent admissions; a crash before either durable input
record exists leaves the original key available for retry.

Validation: focused Gateway and UI owner suites, selected Chromium reconnect,
rejection, attachment, and first-message scenarios, core/UI typechecks,
targeted lint/format, English i18n baseline, and five edited MDX pages.
Pending/rejected startup controls also remain reachable when canonical history
hides the local initial bubble; Discard cannot be undone by a late ACK.

Proof gap: seven individual-module browser scenarios exceeded the native
initial-roster deadline before reaching their recovery assertions. The retained
build became ready after 26.399 seconds; assertion deadlines were not widened.

* fix(gateway,ui): preserve send custody and retry pending admissions
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 25, 2026
…penclaw#182651)

Main red after openclaw#182334 (66d9c47): its durable retry lookup let the fixture's immediate mock run finish before /stop selected it, so 'preserves stop-command reason when /stop lands during the accepted ack yield' failed deterministically. The fixture now controls its timer explicitly; every cancellation and stop-reason assertion stays. Live isolated Gateway /stop, partial preservation and recovery verified.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 25, 2026
…182971)

Reduce the durable submitted-input source lookup from five SQL statements to one snapshot-consistent autocommit SELECT on SQLite and PostgreSQL. Keep restart, expired-memory, and attachment duplicate-dispatch protection, with the original bounded recovery transaction unchanged.

The normal new-input path saves four statements without adding a worker request. The accepted rare recovery tradeoff is one additional statement for pending or committed input.

Verified with both-engine count regressions, 56 focused behavior/prompt-prefix tests, three synthetic Gateway baseline/candidate pairs, and PostgreSQL owner review. Exact-head CI passes all static gates; the inherited PostgreSQL shard 2 fixture failure was independently fixed in openclaw#182990.

Follow-up to openclaw#182334; single-statement precedent openclaw#182883.
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 gateway Gateway runtime merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: XL status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant