Skip to content

fix(linux): recover completed Quick Chat replies without resending - #146048

Merged
vincentkoc merged 2 commits into
mainfrom
fix/linux-audit-stack-04-quickchat-recovery-20260912
Sep 13, 2026
Merged

vincentkoc merged 2 commits into
mainfrom
fix/linux-audit-stack-04-quickchat-recovery-20260912

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Sep 12, 2026 •

Copy link
Copy Markdown
Member

Related: #145355

Stack 4/8, replayed onto main after the preceding layer landed.
Previous: #146047 | Next: #146049

This same-repository branch is writable by maintainers with push access.

What Problem This Solves

Fixes Quick Chat remaining busy after a completed turn loses its acknowledgement, or sending a queued draft to a replacement Gateway.

User Impact

Retrying an unchanged draft can recover the completed reply without generating a second provider turn. Incomplete or unrelated history remains an error.

Why This Change Was Made

Carry the selected Gateway generation through socket dispatch, preserve the original retry key, and recover only its bounded, matching terminal history. The replay preserves current desktop request and sleep ownership checks, including a selected configuration at the actual socket enqueue.

The existing Canvas refresh and widget command interfaces remain unchanged until the next stack layer.

Evidence

  • Current replay: 22 renderer tests passed, with targeted TypeScript lint/format and JavaScript syntax checks. The desktop cleared-route wire control checks configuration absence independently of matching generation IDs.
  • Reused aggregate native proof: an isolated real Gateway and deterministic provider recovered a lost-ACK turn with the same key and no second provider turn. This is historical behavior proof, not a native run of this replay.
  • Scoped composition review completed; its cross-platform test-constructor correction is included. The other reported platform issue was excluded by the existing Linux-only match-arm guard.
  • Current replay native proof: Rust 1.98.1 formatting/build passed; gateway dispatch tests passed 38 with one X11-only test intentionally ignored, desktop owner tests passed 2, and sleep tests passed 17 including six private-logind cases. Native run. The ignored test is not counted as a pass; this is Linux proof, not cross-compilation.
  • LinuxApp at the tested replay passed formatting, Rust tests/build, the inline-browser flow and mac companion checks. Packaging and first-run steps were skipped.
  • Current signed head 4389b0d3218f7a4c9a957bf4b08f0c03b6d7cfbe syncs main to inherit the unrelated Workboard lint repair in fix: resume tasks after tools finish and the model times out #147203. Its complete four-path delta is byte-identical to tested replay c59470f2c184271db69898faec68ac7329c0098b; no Linux behavior was changed for that CI failure. Fresh-head LinuxApp passed Linux formatting, Rust tests/build, inline-browser and mac companion checks; packaging and first-run remained skipped. Fresh-head core CI and its required gate passed.

Native behavior evidence used the recorded X11/Xvfb functional graphics profile. Default graphics, Wayland, packaged installation and performance are not qualified by this PR.

@vincentkoc vincentkoc self-assigned this Sep 12, 2026
@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.

@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 Sep 12, 2026
@clawsweeper

clawsweeper Bot commented Sep 12, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 13, 2026, 2:06 PM ET / 18:06 UTC (Revision 4).

ClawSweeper review

What this changes

Linux Quick Chat recovers completed replies using the original retry identity and prevents queued sends or recovered replies from crossing a Gateway replacement.

Merge readiness

✅ Ready for maintainer review

This repair remains necessary on current main. No blocking correctness or security finding was identified, and the latest sync preserves the previously reviewed Linux changes.

Priority: P2
Reviewed head: 4389b0d3218f7a4c9a957bf4b08f0c03b6d7cfbe

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A useful owner-focused repair with substantial boundary coverage, preserved replay validation, and no blocking findings.
Proof confidence 🌊 off-meta tidepool Not applicable: The MEMBER-authored PR is exempt from the ordinary external-contributor proof gate, and no unresolved authority violation was identified. Its body reports historical native lost-ACK recovery through a real Gateway; verified LinuxApp validation covers the identical replay, while socket tests supplement replacement and stale-generation rejection.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The MEMBER-authored PR is exempt from the ordinary external-contributor proof gate, and no unresolved authority violation was identified. Its body reports historical native lost-ACK recovery through a real Gateway; verified LinuxApp validation covers the identical replay, while socket tests supplement replacement and stale-generation rejection.
Evidence reviewed 8 items Current main still needs recovery: Current main clears retry state after an accepted send, while its acknowledgement classifier accepts completed, started, and in-flight responses without returning a recovered reply.
Terminal retry ownership: The native send owner retains confirmed completion across recovery failures, makes subsequent unchanged retries history-only, and validates session identity, transcript ordering, pagination, and completion within bounded history.
Authority checked at socket enqueue: After transport readiness, dispatch holds the configuration lock through enqueue and rejects absent configuration, stale caller or connection generations, and expired recovery deadlines. Existing local sleep-route restrictions remain.
Findings None None.
Security None None.

How this fits together

Quick Chat sends desktop messages through the native Gateway WebSocket client and displays streamed replies. Recovery reads Gateway conversation history when an acknowledgement says the original turn already completed.

flowchart TD
  A[Quick Chat draft] --> B[Native retry identity]
  B --> C[Current Gateway ownership check]
  C --> D[Gateway send acknowledgement]
  D --> E[Stream active reply]
  D --> F[Read bounded completed history]
  F --> G[Validate turn and session identity]
  G --> H[Display recovered reply]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests +154, Other +2299. Total +2453 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 178 24 +154
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 3 2533 234 +2299
Total 4 2711 258 +2453

Review metrics

Metric Value Why it matters
Production versus test growth Net production +730 lines; tests and test support +1723 lines Production growth implements bounded recovery and Gateway ownership checks; most added lines exercise retry, history, and transport rejection behavior.

Root-cause cluster

Relationship: canonical
Canonical: #146048
Summary: This is the focused Quick Chat recovery layer of the explicitly split Linux repair stack.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Technical review

Best possible solution:

Keep retry identity and bounded history recovery in the native Quick Chat owner, with current Gateway authority checked before transport effects and recovered output entering the existing renderer.

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

Yes, from source: lose a completed turn's acknowledgement, then retry the unchanged draft; current main accepts the completed acknowledgement but still waits for streaming events. This review did not execute that scenario.

Is this the best way to solve the issue?

Yes. The patch reuses Gateway idempotency and history contracts, preserves ordinary streaming, and keeps failed terminal recovery from starting another provider turn.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P2: This fixes a bounded Linux Quick Chat recovery and routing problem without evidence of a broader urgent outage.
  • 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: The MEMBER-authored PR is exempt from the ordinary external-contributor proof gate, and no unresolved authority violation was identified. Its body reports historical native lost-ACK recovery through a real Gateway; verified LinuxApp validation covers the identical replay, while socket tests supplement replacement and stale-generation rejection.

Evidence

What I checked:

  • Current main still needs recovery: Current main clears retry state after an accepted send, while its acknowledgement classifier accepts completed, started, and in-flight responses without returning a recovered reply. (apps/linux/src-tauri/src/quickchat.rs:627, 201f11afefdb)
  • Terminal retry ownership: The native send owner retains confirmed completion across recovery failures, makes subsequent unchanged retries history-only, and validates session identity, transcript ordering, pagination, and completion within bounded history. (apps/linux/src-tauri/src/quickchat.rs:176, 4389b0d3218f)
  • Authority checked at socket enqueue: After transport readiness, dispatch holds the configuration lock through enqueue and rejects absent configuration, stale caller or connection generations, and expired recovery deadlines. Existing local sleep-route restrictions remain. (apps/linux/src-tauri/src/gateway_ws.rs:1713, 4389b0d3218f)
  • Observable regression coverage: Socket fixtures inspect transmitted frames for stale callers, replaced connections, and expired queued history reads. Recovery tests cover lost acknowledgements, history-only retries, conflicting identities, truncation, and superseded attempts; renderer tests cover unlocking and buffered-final precedence. (apps/linux/src-tauri/src/gateway_ws.rs:2460, 4389b0d3218f)
  • Re-review continuity: Comparison with the preceding reviewed replay produced no differences in any of the four introduced paths; the previous completed review retained no findings. (4389b0d3218f)
  • Validation and proof scope: GitHub verifies https://github.com/openclaw/openclaw/actions/runs/34772334949 succeeded at the identical replay, including Linux and macOS companion jobs. The captured PR body separately reports historical real-Gateway lost-ACK recovery without a second provider turn. Run 34771579815 has a cancelled overall conclusion; its reported completed subchecks could not be independently inspected because log retrieval redirects to a blocked artifact host. No tests or native application were executed during this review. (c59470f2c184)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • vincentkoc: 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-12T14:52:34.113Z sha 0cfbbad :: needs maintainer review before merge. :: none
  • reviewed 2026-09-13T17:19:55.446Z sha 0cfbbad :: blocked before merge. :: none
  • reviewed 2026-09-13T17:52:12.813Z sha c59470f :: needs maintainer review before merge. :: none

@vincentkoc
vincentkoc force-pushed the fix/linux-audit-stack-03-remote-recovery-20260912 branch from d7102a9 to a92cbc1 Compare September 13, 2026 13:35
Base automatically changed from fix/linux-audit-stack-03-remote-recovery-20260912 to main September 13, 2026 17:13
@vincentkoc
vincentkoc force-pushed the fix/linux-audit-stack-04-quickchat-recovery-20260912 branch from 0cfbbad to c59470f Compare September 13, 2026 17:41
@vincentkoc
vincentkoc marked this pull request as ready for review September 13, 2026 17:44
@vincentkoc
vincentkoc merged commit 09777da into main Sep 13, 2026
132 of 133 checks passed
@vincentkoc
vincentkoc deleted the fix/linux-audit-stack-04-quickchat-recovery-20260912 branch September 13, 2026 18:16
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Sep 13, 2026
* commit '2d87daf04b78992382299d552f15ac84a86a23ed': (1815 commits)
  fix(ui): distinguish tool activity with semantic icons (#147207)
  fix(linux): recover completed Quick Chat replies without resending (#146048)
  feat(desktop): unify Tauri title bar and window controls (#147097)
  refactor(test): share plugin fixture server shims (#147225)
  perf(gateway): defer worker workspace execution imports (#143496)
  fix(gateway): post-ack webhook work fails with "Async work scope is closed" (#144801)
  refactor(scripts): centralize upgrade survivor version floors (#146975)
  fix(ci): check publication registries before FRV fanout (#147184)
  fix(qa): align system-agent delegation with channel contracts (#145905)
  improve: reduce repeated chat message identity work (#147210)
  fix(channels): remove stale pre-tool previews from Slack and Telegram (#147106)
  fix: keep catalog discovery scoped and execution lazy (#147159)
  fix: serialize reclamation worker shutdown with foreground writes (#147178)
  test(sessions): cover abrupt committed transcript recovery (#143984)
  fix: stop transcript storms during context overflow recovery (#147202)
  fix: reduce CPU overhead for small history and usage reads (#147205)
  fix: resume tasks after tools finish and the model times out (#147203)
  refactor(scripts): share SQLite reliability message waits (#146900)
  feat(exec): configure approval reviewer thinking and fastMode (#147192)
  test: remove redundant Bonjour module headers (#146981)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: linux P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XL 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