Repository navigation
fix(gateway): session lists stall during unrelated session writes - #156286
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 maintainer review before merge. Reviewed September 23, 2026, 3:06 AM ET / 07:06 UTC. ClawSweeper reviewWhat this changesThe Gateway versions each session row’s database facts so unrelated writes no longer discard completed reads, with regression coverage for writes inside and outside the captured batch. Merge readiness✅ Ready for maintainer review This remains a useful, focused fix: current main still discards entire batches after unrelated writes. No actionable correctness or security findings were identified. Priority: P2 Review scores
Verification
How this fits togetherThe Gateway builds session lists from stored session facts and current runtime information. Its resident row projection coordinates worker reads, invalidation, and readiness before authorized results reach clients. flowchart TD
A[Session list request] --> B[Resident row projection]
C[Committed session writes] --> D[Invalidate affected rows]
D --> B
B --> E[Read-only database workers]
E --> F[Check row revision and lifecycle]
F --> B
B --> G[Current access checks and list response]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +19, Tests +29. Total +48 across 5 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep database-fact freshness with each resident row while preserving global invalidation, lifecycle checks, and current authorization at response time. Do we have a high-confidence way to reproduce the issue? Yes: hold a completed session-row worker reply, commit a different session’s update, and observe main reject the unchanged row’s batch. Source establishes this path; this read-only review did not execute it. Is this the best way to solve the issue? Yes. Per-row revisions repair the existing owner’s overly broad invalidation without introducing another cache or weakening full-list readiness. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 5e5f9c275597. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash auto-merge.
|
* commit '3ab93b4ea59804b34d02a696382db16dc95189bb': (80 commits) fix(gateway): keep session refreshes moving during unrelated writes (openclaw#156286) chore(deps): update fs-safe to 0.18.2 (openclaw#156262) refactor(plugins): extract ClawHub plugin archives once (openclaw#156246) improve(llm-core): avoid unnecessary tool validation sets (openclaw#152066) fix(backup): verification accepts archives missing captured databases (openclaw#156211) fix: cancel Guest work when its original access is revoked (openclaw#156106) fix(test): classify drained legacy migration refusals fix(anthropic): finish Opus 5.5 defaults and thinking display (openclaw#156093) refactor(agents): share native harness tool execution (openclaw#154217) fix(ui): carry typed ownership through short-route resolution test(worktrees): accept additive gc result fields (openclaw#156127) test(tasks): close sqlite borrowers before registry reload (openclaw#156131) chore(autoreview): sync Astra high defaults (openclaw#156175) refactor(node-host): await prepared workspace storage (openclaw#149519) improve: speed up cold Node test planning (openclaw#156234) fix(doctor): avoid slow legacy ownership repair in source checkouts (openclaw#156238) improve: speed up native build artifact validation (openclaw#156219) fix(ui): preserve short-route resolution ownership fix(doctor): name retained session metadata conflicts (openclaw#156162) perf(tasks): bound creation selection to matching runs (openclaw#156183) ...
What Problem This Solves
Session lists can repeatedly discard completed database reads when another session changes during refresh, preventing unchanged rows from making progress.
Related: #155767, #155957.
User Impact
Busy Gateways can refresh unchanged sessions while other sessions are being updated. No configuration, schema, migration, or Doctor changes are needed.
Why This Change Was Made
A keyed publication previously invalidated the entire in-flight row batch. The resident row owner now versions its own database facts, so a changed row is reread without discarding its unchanged siblings. Broad invalidation, session replacement, registry freshness, database custody, permission checks, and complete readiness still use their existing owners.
Evidence
sessions.listhandler and real read-only workers fail on the original code and pass with the fix: a write outside the captured batch, and a write to one sibling inside it. The changed sibling's current label remains visible.node scripts/run-vitest.mjs src/gateway/session-row-projection.worker-read.test.ts --maxWorkers=1passed all 15 cases in 32.78 seconds wall time, including compiler preparation. The two added cases took 865 ms and 869 ms; they extend the existing real-worker fixture without sleeps or polling. The initial three-file run took 86.61 seconds wall time.813a10e7debfixed it upstream and is included through a patch-identical rebase.