Repository navigation
fix: preserve pending user turns through asynchronous transcript writes - #163753
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. |
|
@clawsweeper review |
|
🦞👀 Re-review progress:
|
|
Codex review: needs maintainer review before merge. Reviewed October 3, 2026, 1:21 AM ET / 05:21 UTC (Revision 3). ClawSweeper reviewWhat this changesThe PR preserves accepted user messages during asynchronous transcript writes by comparing captured database locators consistently and refreshing prepared-turn state when a session manager is reused. Merge readiness✅ Ready for maintainer review The integrated patch remains useful: pinned main still lacks both repairs, and no actionable introduced defect was found. The previous review had no findings; the updated source and evidence support that conclusion. Priority: P1 Review scores
Verification
How this fits togetherOpenClaw stages accepted user messages before adding them to the session transcript. The transcript guard carries approved message bytes and live custody into the database writer, which records the message and consumes its pending input. flowchart TD
A[Accepted user message] --> B[Pending input admission]
B --> C[Prepared turn and live owner]
C --> D[Reused transcript guard]
D --> E[Database custody checks]
E --> F[Committed session transcript]
E --> G[Pending input consumption]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +23, Tests +21. Total +44 across 6 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep one transcript-persistence owner that records approved input exactly once across aliased paths and manager reuse while preserving live custody checks. Do we have a high-confidence way to reproduce the issue? Yes, from source: aliased admission and asynchronous persistence compare inconsistent locators, and re-guarding retains earlier prepared-turn state on pinned main. The PR reports independent failing controls; this review did not execute them. Is this the best way to solve the issue? Yes. The patch repairs existing owners, reuses identity captured at database open, and refreshes turn state without changing storage formats or relaxing live authorization. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 9d2ebf60d97a. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
7d6b4c1 to
9dc0726
Compare
|
@clawsweeper re-review Please review exact head Review only. Do not merge, queue, or enable automerge. |
|
🦞👀 Re-review progress:
|
What Problem This Solves
Fixes accepted user turns failing before model execution when asynchronous transcript writes use a physical database path but admission retained an alias, such as
/tmpversus/private/tmpon macOS. Reusing a guarded session manager could also retain the previous turn's prepared message, recorder, and persistence suppression.User Impact
Accepted input persists once with its approved bytes and current turn's custody, including through aliased paths and reused managers. Async writes and live-owner checks remain in place. No schema, configuration, retention, or migration changes are required.
Why This Change Was Made
Preserves main's dual-locator custody contract from
fa56f5e2e9e:databasePathremains the native/process-cache locator, whileworkerDatabasePathcarries the physical identity captured at database open and is serialized to workers. Admission aggregation, append, consumption, recovery, and history compare the captured canonical identity without changing native cache ownership or resolving aliases during append. Incognito custody retains its native locator.Re-guarding replaces the prepared user-turn message, recorder, and replay key and resets one-shot persistence suppression. Existing live-owner, lifecycle, session, row, transaction, and commit checks remain authoritative.
Evidence
Rebased once onto
350e91cf765632fd23169c0603aa94272ceade36after GitHub and merge-tree confirmed three conflicts introduced by the dual-locator main change. Integrated head:9dc0726e145d26ab56063e73c60b1aa629f15400.interruptedinstead ofqueued). Both pass with the integrated comparisons. The prior same-locator history assertion could not detect this incorrect resolution.Pending input cannot be appended outside its admitted turn, confirming the refresh repair remains necessary.pnpm test src/agents/session-tool-result-guard.transcript-events.test.ts --maxWorkers=1passed 15 tests in 27.72 s wall, including compiler preparation; Vitest reported 9.18 s. Pending history (4 tests) and worker custody (2 tests) passed together in a 9.18 s Vitest shard. The conflict-resolution regression extends an existing case; it adds no process boot, timer, worker pin, or production seam.pnpm changed:lanes --jsonselected core/coreTests only.pnpm check:changed --base 350e91cf765632fd23169c0603aa94272ceade36passed, including production core types, all 27 core test typecheck graphs, semantic lint, dead-export scans, database ownership guards, and zero runtime import cycles.issue-109025-completion-policy-live: 1 passed, 0 failed, exit 0, 32.993 s QA wall time. The isolated OpenClaw runtime completed qa-channel ingress, native child spawn, parent yield before child completion, dormant parent resume with exact-sender restricted exec authority, and visible final delivery. Parent successful tools were exactlysessions_spawn: 1,sessions_yield: 1,exec: 1; child successful tools wereread: 4. The scenario requires the live provider contract; only this single row ran, with retry count 0.9dc0726e145d26ab56063e73c60b1aa629f15400: 48 successful jobs, 22 intentionally skipped, 0 failed. The combined CI/security gate, dependency review, and security-sensitive review are successful. No CI rerun or further push was needed. GitHub reports OPEN, ready for review, MERGEABLE, CLEAN, with automerge disabled.This PR remains ready for review; no merge, queue, or automerge is requested.