Repository navigation
fix(sessions): preserve accepted input during announcements - #160962
chuanleiguo wants to merge 35 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 maintainer review before merge. Reviewed October 1, 2026, 1:48 AM ET / 05:48 UTC (Revision 21). ClawSweeper reviewWhat this changesThe branch preserves accepted messages during same-session announcements, retains Bedrock input identities, and repairs requester settlement and archive cleanup ownership. Merge readiness✅ Ready for maintainer review This PR remains necessary: current main does not protect another live input from announcement repair. The updated commit-boundary observations address the previous authority-proof blocker, and no actionable introduced defect was found. Priority: P1 Review scores
Verification
How this fits togetherOpenClaw stores accepted conversation input in SQLite before agent execution. Announcements and resumed turns share that transcript, so session custody and lifecycle checks determine which input may enter provider requests or be settled. flowchart TD
A[Accepted user message] --> B[SQLite transcript and live custody]
C[Child completion announcement] --> D[Session preparation]
B --> D
D --> E{Input belongs to another live turn}
E -->|Yes| F[Announcement context excludes input]
E -->|Original owner resumes| G[Provider executes original input]
G --> H[Authorized settlement and lifecycle publication]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +198, Tests +744. Total +942 across 32 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Technical reviewBest possible solution: Keep accepted input under its existing live owner, exclude it from foreign announcement context, and retain current-authority checks through settlement. Do we have a high-confidence way to reproduce the issue? Yes: promote accepted input, hold its dispatch, and complete a child announcement in the same session. Current-main orphan repair lacks the live-custody exclusion; this reviewer inspected the path without executing it. Is this the best way to solve the issue? Yes: the patch repairs the existing custody, provider-boundary, and lifecycle owners without introducing a competing dispatcher or configuration mode. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against c88630d58679. 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
HistoryReview history (20 earlier review cycles; latest 8 shown)
|
|
Current candidate: The PR remains necessary: upstream still lacks the foreign live-input announcement exclusion, pre-adoption chat reservation guard, and distinct Bedrock runtime input identity. Official #160128 covers compacted current input, not the foreign live input handled here. The four failures in run 36597840024 adopt their official upstream repairs. Equivalent local fixture/observer/cleanup changes were removed. A reproduced local planner failure identified four duplicate database-consumer routes after integration; removing only redundant registrations fixes the original failures while keeping the official isolation routes and all assertions. Local validation: 730/730 cases across 14 files, production/test types, format/lint and all relevant ratchets passed. The two real SQLite operator cases reached final commit: live authority persists the pending requester-yield batch (0.847 s); revocation immediately before commit rejects as Independent autoreview completed. Its final P2 archive-batch concern is rejected because the actual SQL filters New-head remote CI and hosted review are pending. This is current-candidate local proof, not a claim that remote CI is green. No merge or auto-merge is requested. |
|
🦞👀 Re-review progress:
|
|
Superseded by #162473, which carries only the core fix (foreign live-input custody at the attempt boundary) rebased on current main: 1 commit, 8 files. The pre-adoption lifecycle reservation and the Bedrock distinct-user-turn replay will follow as separate PRs. The archive/settlement changes here were conflict-integration churn and are dropped. |
What Problem This Solves
Fixes accepted user turns failing with
Pending input is no longer active in its admitted transcriptwhen a same-session announcement treats their promoted input as an orphan.User Impact
Announcements preserve another live turn's accepted input without executing it or including it in the announcement's model context. The original turn can continue exactly once; cancellation still prevents execution. Bedrock runtime replay retains the original input identity. No configuration, schema, stored-format, permission, retention-policy or migration change is required.
Why This Change Was Made
Promotion removes the pending database row before its live owner finishes. Orphan repair must consult that current owner, including collected inputs, and exclude foreign input when rebuilding announcement context. Lifecycle persistence also preserves the original pre-adoption chat reservation. Bedrock runtime keeps distinct user turns until the existing provider stream boundary performs its merge.
Integration repairs preserve canonical archive recovery and admitted requester handoff after the launching tool ends. They keep physical database identity, live authority, FIFO commits and deletion ordering intact.
Candidate:
1d139df8f22efadd549f1e165cd5ed13aaa7d424, integrated with official main3cb68020b6a5a7a82b881d1ccde4cc30c7da769cfor actual conflicts. All three original protections remain absent from that upstream source: foreign live-input custody, pre-adoption chat reservation, and distinct Bedrock runtime user turns. Official #160128 fixes compacted current input; it does not protect a different live input from announcements.Evidence
Current candidate
readPublishedSessionArchiveBatchInDatabasealready applies.where("published_at", "is not", null)before ordering and.limit(limit). Unpublished rows cannot consume its batch. No accepted actionable P0–P2 findings remain.Executed operator commit-boundary proof
The complete requester-wake E2E file passed 27/27, Vitest duration 52.02 s. Its two real SQLite cases reached the final worker commit authorization stage:
outcome: not-committed; continuation remains unsettledBoth cases use real registry registration,
sessions_yield,settleRequesterRunand SQLite persistence. The observer changes only operator liveness before forwarding the real commit request to its real admission/grant path; source authority remains valid. No fake database, rollback or worker grant is substituted. This execution supplies the public observed result requested by hosted review revision 20.The accepted-input file takes 33.99 s (seven cases): it exercises the real attempt boundary, SQLite ownership and provider-context conversion rather than a helper predicate. Archive retention shares existing suite-owned state; no live-provider fixture was added to per-PR CI. New-head CI timing is pending.
Previous CI failures and upstream repairs
Run 36597840024 tested the previous head
5a960e8076c82f45f113622ae1091e53b150373a. Its four failed jobs are addressed by adopted official changes:531f0a229c36ande603e31e7cdf(#161509), frame sampling plus ResizeObserver completion450dba2dc67a, fixed workload/capacity inputs while retaining real runtime timings82ad20b96722, synchronize the actual durable entry and restore it; retain original assertions5eeecd39f956, use existing cold-spawn budget; production inspection budget/identity checks unchangedEquivalent branch-local metadata, worker observer, snapshot cleanup, SDK drainage, CLI fixture and placement fixture repairs were removed in favor of current upstream owners. A local planner failure after integration exposed four duplicate database-consumer registrations; only those redundant registrations were removed, keeping their existing upstream isolation routes and the new live-input test route. No planner guard or assertion was weakened.
Windows and browser CI outcomes must still be verified on the new remote head; this macOS run does not establish Windows execution or browser geometry proof. No workflow was dispatched or rerun for green.
Real Gateway/provider verification retained for unchanged original behavior
Passed on the exact source candidate committed as
d75cd3e3cd7c5f3e204148cb8100c69b4eccd068, using an isolated real Gateway, SQLite, browser-authenticated WebSocket RPCs, native agent runtime and a real OpenAI-compatible Responses service. Prompts were synthetic; provider responses, tool decisions and announcement delivery were not stubbed.Public
sessions.createmade an explicit non-main session. A real model turn calledsessions_spawn; browserchat.sendnaturally persisted U before its started ACK. The fixture held dispatch scheduling only, not promotion or ownership receipts. Completing the child produced a real announcement whose provider request contained zero copies of U, while U's original canonical record and pre-adoption claim stayed unchanged. Releasing U's dispatch produced one provider request containing one copy of U and one final reply. Cancelling a second promoted input throughchat.abortthen releasing dispatch produced zero new provider requests and no remaining live input owner.Trace date: 2026-09-29; synthetic run nonce
d7a39832-e5af-43c5-acbb-cc87c290c4ad. Both proof record and runner exit 0 passed. The isolated Gateway/state were cleaned up. This is real Responses-provider proof; Bedrock is covered by committed runtime/SDK boundary tests with a synthetic stream, not live AWS proof. No conversation, private endpoint, model identity or credential is published.Remote CI and hosted review must be assessed for the candidate above before calling the PR merge-ready. This PR remains open; no merge or auto-merge is requested.