Repository navigation
fix(gateway): record visible activity on chat setup failures - #186448
moonbow0407 wants to merge 3 commits into
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs real behavior proof before merge. What this changesThis PR advances session activity when visible chat setup or dispatch fails while preserving quiet hidden work. Example: A session has lastActivityAt 1000 and lastReadAt 1500 when a visible chat fails at 2000.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 1 item remains Keep open: this PR repairs a current visibility omission through the existing lifecycle owner, with no actionable code defects found. Priority: P2 Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherChat setup and detached dispatch feed terminal events into the shared session lifecycle writer, whose persisted activity timestamps drive session unread indicators. flowchart TD
A[Chat send admission] --> B[Setup or dispatch failure]
B --> C[Run and source visibility]
C --> D[Session lifecycle writer]
D --> E[Persisted session activity]
E --> F[Session unread indicator]
Technical reviewBest possible solution: Carry the existing visibility facts into both terminal events while retaining the shared lifecycle writer and unread predicate. Do we have a high-confidence way to reproduce the issue? Current main demonstrably omits the visibility fact required to advance activity on both failure paths; the contributor reports matching base failures, but this review ran no target code. Is this the best way to solve the issue? This is the smallest complete repair for the stated scope: it supplies missing metadata at the producers and preserves lifecycle ownership, hidden-work behavior, and unread derivation. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 1ae91fa20263. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +9, Tests +61, Other +2. Total +72 across 3 files. Added test files: 0. View PR surface stats
LabelsLabel changes: No label changes. Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale6/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. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReviewed October 29, 2026, 9:28 PM ET / October 30, 2026, 01:28 UTC (Revision 3). |
|
Restored the original conditional retry await from #164682 in @clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Thanks for picking this up, @moonbow0407 — and for the credit on my withdrawn #159285. The visibility-through-admission fix with the current terminal owner is the right shape; happy to see it landed on the existing custody rather than adding a new state owner. Since this Closes #160003, I will leave that issue open for the merge to resolve it. If you want a second pair of eyes on the retry-await correction or the CI attribution while it waits on maintainer review, happy to help. |
Preserve session activity when visible chat setup or dispatch fails before the run starts. Keep hidden work quiet. The test line allocation covers persistence regressions for both paths.
|
@clawsweeper re-review The previous restart-safe recovery path was removed by #185730. The updated PR targets the remaining setup and dispatch failure paths; the description now records the changed scope and current evidence. |
|
🦞👀 Re-review progress:
|
Related: #160003
What Problem This Solves
When an accepted chat fails during setup or dispatch before its run starts, the terminal failure can be recorded without advancing session activity. A user who has already marked the session read can therefore miss that failure.
The restart-safe recovery path originally addressed by this PR was removed by #185730. This revision targets the remaining setup and dispatch failure paths in the current architecture. It does not claim that the removed mechanism still exists or that every symptom in #160003 is resolved.
Change
Carry the existing run and RPC-source visibility into terminal lifecycle persistence. Visible failures advance activity; hidden work remains quiet. Lifecycle ownership and the unread predicate are unchanged.
Thanks @wangmiao0668000666 for the original investigation in #159285.
Evidence
4e472c7eda03fe91631ee666ca79e08b40206ae7, the new isolated SQLite regressions fail for visible setup and unstarted dispatch failures becauselastActivityAtdoes not advance. The hidden setup control passes.node scripts/run-vitest.mjs src/gateway/server-methods/chat-send-dispatch-errors.test.ts --maxWorkers=1passed 25/25 on Windows with Node 24.22.1 using isolated SQLite state. Targeted lint, formatting,git diff --check, and the test-line ratchet against that upstream snapshot passed. The separate allocation covers 61 net regression-test lines for both terminal paths and hidden controls.278ccf6b9159efcdcb8d8c08e187cd82538857a8has a successfulopenclaw/ci-gatestatus. Consult its checks for details.The prior PR evidence and old-head CI concerned the removed recovery path and are not validation of this revision.