Repository navigation
fix: chat turns fail when session receipts exceed transport limits - #169843
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. What this changesTransfers oversized session outcomes through existing bounded frames and confirms their commit with a compact native receipt. Example: Continue a conversation containing 36,864 stored policy names of 512 characters each.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR fixes a concrete chat-continuation failure still present on current main; the reviewed patch has no actionable findings. Priority: P1 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherGateway chat preparation invokes the session actor, whose SQLite worker commits session mutations and returns complete outcomes to the executor and replica. flowchart LR
A[Gateway chat request] --> B[Session actor executor]
B --> C[SQLite actor worker]
C --> D[Bounded outcome frames]
D --> B
C --> E[Final authority admission]
E --> F[SQLite commit]
F --> G[Compact native receipt]
G --> B
Technical reviewBest possible solution: Land the existing bounded-transfer repair while preserving complete session state, final authority admission, and native settlement semantics. Do we have a high-confidence way to reproduce the issue? Current-main source establishes the complete-outcome-to-32-MiB-guard failure, and supplied built-Gateway baseline/fixed output exercises it; this read-only review ran no reproduction. Is this the best way to solve the issue? Reusing the existing framed transport fixes the owning boundary without raising global limits, truncating state, or restoring retired duplicate bookkeeping. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against a7b8ae7417e2. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +71, Tests +174. Total +245 across 4 files. Added test files: 0. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. LabelsLabel changes: No label changes. Label justifications:
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 HistoryReview history (12 earlier review cycles; latest 8 shown)
Reviewed October 12, 2026, 4:15 PM ET / 20:15 UTC (Revision 13). |
|
The requested built Gateway/chat proof is now complete and included in the PR body at unchanged head On macOS arm64 / Node 24.19.0, the production Gateway completed a real
51 focused tests passed on each of Windows and native macOS, including refusal, interrupted transfer and known-commit recovery controls. Independent Codex autoreview found no actionable P0-P2 findings. Canonical CI, including the gate, passed at this exact head. This proves the oversized-state synthetic Gateway repair. Adoption into the original personal installation and re-testing its private conversation remain separate; no private data or credentials were used or published. @clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
The affected conversation now replies on my original Mac mini installation after installing this PR's exact head, The screenshot below shows the earlier SQLite receipt failure at the top and the successful post-update turn below, in the affected conversation. The later turn displays an assistant response and “Done in 28 seconds”. The earlier error remains in the conversation history; it is not a new failure after the update. An earlier provider timeout is also visible and is separate from the receipt-limit bug this PR fixes. Independent installation checks confirmed Gateway This adds original-installation and user-visible confirmation to the synthetic production-path proof already in the PR. The reported merge conflict remains a separate integration task. @clawsweeper re-review |
|
🦞👀 Re-review progress:
|
Carry complete actor outcomes through the existing bounded transfer owner, and retain compact native commit evidence without changing transaction semantics or the global transport limit. Integrate current main's simplified executor and remove the redundant transfer flag and receiver bookkeeping. Fixes openclaw#169780 Co-authored-by: TheAngryPit <[email protected]>
|
Peter's integration resolves the conflict and simplifies the receipt repair onto Core's existing transfer collector. Follow-up At Peter's Canonical CI is now successful on exact head The PR description retains the earlier production Gateway trace and original-installation screenshot as revision-pinned runtime evidence. The integrated-head checks are recorded separately; no personal installation was changed to test this merge. Skipped native jobs are not counted as additional runtime proof. @clawsweeper re-review |
|
🦞👀 Re-review progress:
|
Merge current main, preserving its read-invalidation error and complete composer fixture alongside the oversized native receipt transfer repair. Co-authored-by: TheAngryPit <[email protected]>
…penclaw#169843) Co-authored-by: TheAngryPit <[email protected]> Co-authored-by: Peter Steinberger <[email protected]>
…D1) Intermediate outcome frames add no state to authorize. The host now accepts them without re-running the caller's authority or cloning a snapshot; the liveness checks and grant still run per frame, and the final commit admission still authorizes the complete postimage before the witness can commit. Frames carry only their target instead of the full oversized hot state, removing several full-snapshot clones per command on long sessions. This deviates from upstream openclaw#169843, which re-authorizes every frame with an authority projection; the stale-preimage refusal applies there too. Refs #1475 Co-Authored-By: Claude Opus 5.5 <[email protected]>
A durable session actor whose hot state serializes past the 32 MiB inline receipt budget must still commit an ordinary patch, and the next command on the same actor must commit too. On 855242b the patch rolls back with "SQLite worker commit receipt exceeds the transport limit", the exact error long room sessions hit on cael after the cut. Also ports upstream's host-side transfer cases from openclaw#169843 (lost ordinary reply recovers from the transfer witness; an incomplete transfer never publishes). Refs #1475 Co-Authored-By: Claude Opus 5.5 <[email protected]> (cherry picked from commit 7cdd8f2)
…turn (#1475 D1) Carry openclaw#169843 (ca0a172, "fix: chat turns fail when session receipts exceed transport limits") onto the composite's actor shape, plus the transfer collector it depends on from openclaw#169744 (31a4b92, sqlite-worker-transfer.ts only). When the committed outcome serializes past SQLITE_WORKER_MAX_MESSAGE_BYTES, the worker frames it through live transaction admissions and commits only a small transfer witness. The host accepts the frames, and certifies the outcome only when the witness names the completed transfer. The receipt cap is unchanged. Adaptation to 855242b: admissions carry the full projected hot snapshot (this base has no projectSessionActorAuthority), and the commit admission has no inner kernel publication, so authorities receive undefined there as before. Accepted cost: on oversized sessions every frame repeats the hot snapshot; upstream later bounded the hot state itself (openclaw#172702, openclaw#174274), which stays a separate carry. Refs #1475 Co-Authored-By: Claude Opus 5.5 <[email protected]> (cherry picked from commit 454e86e)
…omes (#1475 D1) Carry adaptation for 454e86e on the 19fe879 absorb. The framed commit admission now carries `publication: turn ?? commitPublication` inside its outcome envelope, as the inline admission does since upstream openclaw#168607 and as upstream's own openclaw#169843 (ca0a172) shapes it. The host already hands `outcome.publication` to the caller's authority, so an oversized session's turn keeps its commit-stage custody recheck. No D2 code is involved; upstream openclaw#169064 is untouched. Refs #1475 Co-Authored-By: Claude Opus 5.5 <[email protected]>
…D1) Intermediate outcome frames add no state to authorize. The host now accepts them without re-running the caller's authority or cloning a snapshot; the liveness checks and grant still run per frame, and the final commit admission still authorizes the complete postimage before the witness can commit. Frames carry only their target instead of the full oversized hot state, removing several full-snapshot clones per command on long sessions. This deviates from upstream openclaw#169843, which re-authorizes every frame with an authority projection; the stale-preimage refusal applies there too. Refs #1475 Co-Authored-By: Claude Opus 5.5 <[email protected]> (cherry picked from commit 6839f6f)
…d commit (#1475 D1) Carry adaptation for 6d79105 on the 19fe879 absorb. That commit restored upstream openclaw#169843's commit-stage revocation case but expected "SQLite transaction admission was refused", the generic error 855242b surfaced. Upstream openclaw#168607 (929bfc0, in the absorb) now settles a refused admission as rolled-back with the admission's recorded failure, which is the authority's own error. Restore upstream's exact expectation, "synthetic live authority revocation" (ca0a172's session-actor.test.ts). The invariant is unchanged and still asserted: the refused commit grant rolls the transfer back and leaves the entry untouched, framed or inline. At 06386fa the inline variant already reports this message; at 7bd11d9 both variants failed only on the stale message text. Refs #1475 Co-Authored-By: Claude Opus 5.5 <[email protected]>

Fixes #169780
What Problem This Solves
Fixes chat turns failing before the agent starts when an existing conversation's accumulated session state exceeds the SQLite native commit receipt limit.
User Impact
Valid session mutations can commit without resetting the conversation or dropping retained transcript identities. There is no schema migration, authentication change, retention change, or increase to the global transport limit.
Why This Change Was Made
Even a tiny activity update builds a full actor postimage. Passing that entire result into the native commit receipt makes accumulated transcript state subject to a 32 MiB message limit.
The durable actor now uses Core's existing bounded transfer frames for oversized outcomes before final commit admission. A compact native commit witness confirms the complete candidate; the executor then reconstructs the original domain result. Existing reply framing stays in place. Small receipts and incognito acquisition retain their existing paths.
Final authority checks still decide whether the transaction may commit. An incomplete transfer or rejected final admission rolls back; a confirmed commit remains known if ordinary reply or final settlement delivery is lost. Losing native commit evidence still fences the actor until reconciliation.
Evidence
Maintainer validation of the integrated implementation
Original fix by @TheAngryPit; maintainer cleanup by @steipete. Head:
edfd9059a27cb21fe63b6fff771007deca9f1426, integrated main:019e5c4ab54b0ccbe08a8c2f1234cbdf8170e889. The integration preserves main's read-invalidation behavior and resolves the composer fixture to main, leaving four session-owner files in the PR.Real Gateway proof passed at this head. A fresh secretless Untrusted AWS lease (
cbx_c04722b472f4,r7a.xlarge, 30.6 GiB RAM; runrun_7fdbf1bc8d8a0c2f3459bfaa5b564c25) ran the built Gateway with isolated state, an ephemeral port, and the mock OpenAI provider. The trusted bootstrap verified the full SHA and absence of an IAM role; hydration was disabled and onlyCIwas forwarded.The fixture creates a session through
sessions.create, completes an initialchat.send, then usessessions.patchManyto store 36,864 distinct 512-character policy names (18,874,368 string bytes; 18,985,150 RPC input bytes). Separately cloned entry/result and actor postimage copies exceed the unchanged native receipt limit. Existingsessions.describeandsessions.getRPCs verify the session, all policy values, and persisted message identities. State construction uses real RPCs, with no database injection, raised limit, or split commit.errorokSQLite worker commit receipt exceeds the transport limitRedacted continuation events, omitting nonessential synthetic IDs:
{"mode":"baseline","status":"error","providerRequests":0,"transportFailure":true,"assistantMarkerCount":0,"sameSession":true,"policyNamesRetained":true,"retainedMessageIdentities":2,"retainedMessageIdsExact":true,"errors":["SQLite worker commit receipt exceeds the transport limit"]} {"mode":"fixed","status":"ok","providerRequests":1,"transportFailure":false,"assistantMarkerCount":1,"sameSession":true,"policyNamesRetained":true,"retainedMessageIdentities":2,"retainedMessageIdsExact":true,"errors":[]}The baseline replaces only
session-actor-sqlite.tsandsession-actor.worker.tswith integrated main; a source guard verifies all production undersrcmatches main. The fixed run restores the verified head and checks for a clean source tree. Commands:The production-only negative control retained the new tests and failed with the exact native receipt error: 1 expected failure / 16 skipped, wall 46.28 s. Prior focused proof on the same receipt implementation passed all 46 actor, worker, and replica tests in 71.54 s with
--maxWorkers=1, oncbx_df5941ade787/run_9603a13f4ef80f4b243650919de47d11. Those worker regressions also cover oversized retained transcript identities, final-admission refusal, interrupted transfer, and lost reply/settlement delivery. The live fixture above uses oversized policy state; it is Gateway RPC proof, not a browser rendering run.Independent Codex autoreview of the integrated tree is scoped-clean through P2, with no actionable findings. ClawSweeper revision 12, reviewing this exact head, reports proof sufficient, complete issue scope, no findings, and no before-merge requirements. The integrated Gateway baseline/fixed evidence and retained negative control resolve its earlier proof requests. Human comments contain no unresolved code finding.
Formatting and
git diff --checkpassed. Final-headpnpm tsgo:corepassed in 83.27 s;pnpm tsgo:core:test --ci-graphs-json '["core-test-agents-sessions"]'passed in 79.24 s; targeted four-file oxlint passed with zero warnings/errors in 9.81 s. Exact-head CI passed, includingopenclaw/ci-gate. The three changed-test jobs took 237 s, 272 s, and 322 s; the changed-boundary job took 140 s (the additional compact changed-check job took 71 s).The final complete session-directory run finished in 3,178.75 s:
OPENCLAW_NODE_TEST_PLAN_CONTINUE_ON_FAILURE=1 pnpm test src/config/sessions --maxWorkers=2It covered all 358 tracked test files: 340 passed / 17 failed / 1 existing benchmark skipped; 3,168 tests passed / 65 failed / 1 skipped. All 17 actor regression cases passed, as did all 17 infrastructure files. There were no unhandled-error sections. The broad command retains its failing exit status; this is not a claim that the entire suite is green.
All 65 failing cases match main, case by case, in unchanged files. The failures comprise 63 fixtures reading unprepared runtime config after main #169714, one default-store fixture mismatch, and one existing SQLite relocation lock failure. Direct main-production replays reproduced the default-store case (
session-accessor.test.ts, 1 failed / 63 skipped, 40.88 s oncbx_c6d14b746c37/run_6086efb3caa02f31361b4723ff8db945), plus the pending-input and reconciliation-lifecycle files (13 failed / 28 passed, 76.90 s oncbx_83a8109fe1bd/run_082e1d0240e93759d643096b2e3da19a). Production-source guards passed on both leases.The other 51 cases match complete logs from scheduled main CI run 38292584060, at
c66da3d764b0ba7996aa77c98a885298bb0dc2c4; the relevant session and runtime-config source is byte-identical to integrated main019e5c4. The matching logs are job 114956274875, job 114956274760, and job 114956274893. No assertions, retries, timeouts, or skips were changed to hide these failures. All proof leases have been released.Production is +82/−11, net +71, reduced from the submitted net +221. This uses the LOC escape: the remaining growth connects the existing transfer, final-admission, and native settlement owners; unrelated deletions would not improve this repair. Tests/support are +236/−62, net +174. Docs are +0/−0.
src/config/sessions/session-actor-sqlite.tssrc/config/sessions/session-actor.worker.tssrc/config/sessions/session-actor.test.tssrc/config/sessions/session-actor-worker.test-support.tsEarlier live fixture attempts exposed a loader mismatch and a
chat.historyresponse that repeated the large policy twice, exceeding its separate client frame limit. Neither is counted as receipt proof; the successful flow uses existing bounded readback RPCs and preserves all values.Earlier integration at cd6ee9e
Peter Steinberger integrated and simplified the repair at
44422ac1365e41face74e6de334fa6d7a08c0fe3. It now uses Core's transfer collector and simplified executor, without restoring retired generation or snapshot bookkeeping.The canonical actor suite passed 17/17 tests at that head, including the oversized durable outcome, final-admission refusal, interrupted-transfer rollback, reply/settlement loss and reconciliation controls (job log). The changed-boundary suite passed 133/133. Production types and all five Core lint jobs also passed. That run failed only on a Chat UI fixture type error introduced in its newer main integration, outside the receipt repair.
Follow-up
cd6ee9ef0ab764186c5ba18ec5e93fe79f407ec2preserves the maintainer's actor/worker/collector source and integrates mainb8d31e961294ff7eaf4e1e4b399a3c2ff3eea3f1. Its sole additional fix explicitly retains the existingUnarchiveaction label in the refreshed test banner. The exact UI-chat type lane reproduced TS2322 before the line and passed afterward; all 3/3 banner tests, targeted type-aware lint, formatting and independent Codex/OpenAI source review passed. No production UI behavior, assertions, timeout or guard changed. Canonical CI for this exact follow-up completed successfully, including the formerly failing test-type lane and final CI gate. The branch is conflict-free; skipped native jobs are not counted as new native runtime proof.The runtime and original-installation evidence below is retained at
fb26a485c555334f29a2f5ee3ea3a1f13e054aba. No personal installation was changed to qualify the integration.The synthetic fixture accumulates 34,000 retained transcript identities with bounded 512-character key payloads. Its serialized state exceeds the native receipt limit without one artificially oversized message.
Built Gateway runtime proof at fb26a48
The built production Gateway was exercised on macOS arm64 with Node 24.19.0 in an isolated OCM environment, outside Vitest.
sessions.createcreated the conversation through the real RPC. With that Gateway stopped, Core's transcript writer prepared the accumulated synthetic history; the Gateway was then restarted and received onechat.send. Only inference was synthetic, using the repository's loopback mock OpenAI server. The Gateway, chat RPC, durable SQLite worker, commit admission and persistence paths were real and uninstrumented.Observed complete actor hot-state measurements, serialized with
node:v8through Core's state reader:Both state measurements exceed the unchanged 33,554,432-byte native limit. The retained identity set has the same SHA-256 before and after:
6d3900564eb2adb292240c44671ade5c4b726809e2c5ee569ac7ac0199265dc0.Redacted live CLI output:
{"method":"chat.send","status":"started","messageSeq":34001} {"method":"agent.wait","status":"ok","terminalDisposition":"visible","rerouted":false,"successfulToolNames":[],"terminalReply":"OPENCLAW_SQLITE_RECEIPT_PROOF_OK"} {"method":"chat.history","assistantMarkerPresent":true}The first bounded
agent.waitreturnedtimeoutwhile transcript hydration was still running. Waiting again on the same run returned the terminal receipt above; no secondchat.send, timeout increase or guard change was used. The local provider recorded 43 inference requests, including normal pre-turn compaction. The original 34,000 identities survived that processing. The task Gateway then drained and shut down cleanly; both synthetic listeners were verified stopped, and the separate personal Gateway remained healthy.Earlier automated checks and review at fb26a48
path.relativesupplies backslashes, while the mirror exemption requiresCHANGELOG/); no source or guard was changed to hide it. The canonical guard job passed.EBUSYon Windows. No source changes or guard relaxation were used to obtain those results.Original installation confirmation
On October 12, the original Mac mini installation adopted this exact candidate through the Core updater: Gateway
2026.10.2atfb26a485c555334f29a2f5ee3ea3a1f13e054aba, retaining Node24.19.0. Independent checks confirmed the matching service/listener PID, HTTP 200 health and readiness, channels ready, and no plugin errors.The user then retried the affected conversation and confirmed that it replied. The authorized screenshot shows the earlier SQLite receipt error at the top and the successful post-update reply below, displaying “Done in 28 seconds”. The earlier failure remains in conversation history; it is not a new failure after adoption. The separate historical provider timeout visible between them is outside this PR's scope. No conversation reset or transport-limit increase was used.
Original-installation confirmation and screenshot. This supplements the reproducible synthetic production-path proof above with user-confirmed recovery of the reported conversation.
Original proof base:
490deff4b336d647350f444f45b1b1767761a759; runtime-proof candidate:fb26a485c555334f29a2f5ee3ea3a1f13e054aba. The integration retains Core's immutable snapshot publication and resident entry-patch updates.Reproduce the original revision's focused checks: