Repository navigation
fix: group turns fail silently when session history cannot load - #135253
Conversation
…anscripts A /new or daily reset against a session entry whose SQLite transcript had no rows appended the reset boundary at seq 0 with no session header. Every later load then classified the transcript as legacy v1 and failed the session lane on each turn, while the group silent-reply policy swallowed the generic failure text - the bot showed typing, then nothing, forever. - buildSessionResetBoundaryEvent builds no boundary when the transcript has nothing to reset; both lifecycle call sites share one owner helper. - Loads distinguish headerless transcripts from legacy versions and point at "openclaw doctor --fix", which actually repairs that state (#115080). - Transcript-repair load failures are classified as actionable rather than generic, so the repair notice stays visible in group chats instead of being silenced to NO_REPLY. Co-Authored-By: Claude Fable 5 <[email protected]>
|
🦞👀 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. |
…ures The durable-reset assertions seeded a session entry with zero transcript rows and asserted the reset boundary landed there - exactly the headerless seq-0 corruption the parent fix removes. Seed one message first so an allowed reset still proves a durable boundary on a real conversation. Co-Authored-By: Claude Fable 5 <[email protected]>
|
Codex review: needs maintainer review before merge. Reviewed October 8, 2026, 7:05 AM ET / 11:05 UTC (Revision 6). ClawSweeper reviewWhat this changesThe branch classifies unreadable conversation history as an actionable failure and shows qualified Doctor recovery guidance on optional group turns. Example: A user sends an unmentioned group message whose saved history has no session header.
Review scores
ProductKind: Bug fix · Worth it: Yes Merge readiness✅ Ready for maintainer review This PR remains useful and is ready from this review: current main still misses the history-loader failure, and the updated exact-head Gateway trace resolves the previous proof blocker. No actionable findings remain. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe Gateway loads saved conversation history before running an agent. Shared failure classification and reply rendering determine whether a failed turn produces recovery guidance or optional silence. flowchart TD
A[Group message] --> B[Gateway loads conversation history]
B --> C{History readable?}
C -->|Yes| D[Agent processes turn]
C -->|No| E[Shared failure classification]
E --> F[Recovery notice delivered to group]
F --> G[Operator tries existing Doctor repair]
Technical reviewBest possible solution: Keep recovery in the shared classifier and renderer while preserving strict history admission and the existing Doctor repair owner. Do we have a high-confidence way to reproduce the issue? Yes: the loader emits a diagnostic current main does not classify, and the supplied pinned-baseline Gateway trace records acknowledged group dispatch with no outbound reply. This review did not execute a reproduction. Is this the best way to solve the issue? Yes: extending the existing failure owner fixes visibility without duplicating reset logic, relaxing storage validation, or adding configuration. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 9c763cb168e9. Provenance checked
TestingProof path: shipped entry point. Added test files: 2. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource 0, Tests +16, Docs +8. Total +24 across 5 files. View PR surface stats
Stored data modelPersistent data-model change detected: LabelsLabel 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 (5 earlier review cycles)
|
|
This pull request has been automatically marked as stale due to inactivity. |
|
This pull request has been automatically marked as stale due to inactivity. |
Classify missing or legacy transcript headers through the existing transcript validation owner so optional group turns receive actionable failure copy. Qualify Doctor as a repair attempt and preserve an escalation path for histories it cannot repair. Extend the existing terminal-failure regression and document recovery without changing storage or reply policy. Current main already initializes headers before reset boundaries; retain that implementation and drop the obsolete empty-reset changes while resolving the contributor branch against main. Related: #115080. Original fix by @izshaw; maintainer cleanup consolidates the remaining diagnostic fix into the current shared error classifier and renderer. Co-authored-by: izshaw <[email protected]>
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Merged via squash.
|
…claw#135253) * fix(sessions): stop resets from wedging never-materialized session transcripts A /new or daily reset against a session entry whose SQLite transcript had no rows appended the reset boundary at seq 0 with no session header. Every later load then classified the transcript as legacy v1 and failed the session lane on each turn, while the group silent-reply policy swallowed the generic failure text - the bot showed typing, then nothing, forever. - buildSessionResetBoundaryEvent builds no boundary when the transcript has nothing to reset; both lifecycle call sites share one owner helper. - Loads distinguish headerless transcripts from legacy versions and point at "openclaw doctor --fix", which actually repairs that state (openclaw#115080). - Transcript-repair load failures are classified as actionable rather than generic, so the repair notice stays visible in group chats instead of being silenced to NO_REPLY. * test(auto-reply): materialize transcripts in reset-authorization fixtures The durable-reset assertions seeded a session entry with zero transcript rows and asserted the reset boundary landed there - exactly the headerless seq-0 corruption the parent fix removes. Seed one message first so an allowed reset still proves a durable boundary on a real conversation. Co-authored-by: izshaw <[email protected]>
Related: #115080
What Problem This Solves
Fixes unmentioned group turns that show typing and then fail silently when stored conversation history has no session header or still uses an unsupported legacy header.
User Impact
The group receives a visible recovery notice even when optional replies may be silent. It asks the Gateway operator to try
openclaw doctor --fix, and tells users to preserve the history and contact support if repair does not resolve the error. Doctor is not presented as a guaranteed repair for unsupported or malformed histories.The fresh-session reset producer was already fixed by #125336. This PR preserves main's header-first
/newand daily reset behavior, and changes only the remaining failure classification and recovery guidance. No schema, configuration, SDK, migration, or reply-policy change is introduced.Why This Change Was Made
The existing transcript-validation classifier recognized invalid entries but missed the history loader's missing/legacy-header error. That error fell through as generic runner failure, which optional group turns suppress. Both execution failures and outer runner failures now use the existing shared classifier and renderer to preserve actionable guidance.
All obsolete producer and SessionManager edits from the original branch were removed while merging current main without rebasing or force-pushing. The bounded recovery copy replaces misleading
/newor/compactadvice for history that cannot load. A single-use private copy constant was inlined at its renderer, leaving production LOC unchanged.Original fix by @izshaw; maintainer cleanup narrows the change to the still-reproducible diagnostic defect, preserves current reset ownership, and adds qualified recovery guidance and proof.
Evidence
Head:
d44fae1f13575bedc7eb8da95a9a810d550cbc4c. Baseline:76d6104f77234bdba2c953cf0208b19b49f9a36f.The baseline real Gateway proof used an isolated state directory and ephemeral port on secretless AWS, the QA mock OpenAI provider, and actual
qa-channelgroup ingress. It confirmed:/newon a zero-row transcript persisted a session header before its reset boundary; the next turn deliveredREL6_NEW_OK.REL6_DAILY_OKandREL6_DAILY_NEXT_OK.outbound: [], while Gateway logs recordedPersisted legacy session transcripts require doctor/import migration before runtime use.Prepended missing headers to 1 session transcript; the same group then deliveredREL6_REPAIRED_OK.Baseline lease:
cbx_f175e861347c(r7i.xlarge, 32,309,964 KiB RAM). Baseline run:run_d9b7433a9f9693b5d3e2e3f62fccb173, exit 0. The lease was stopped. Existing reset-header and failure-reply suites passed 40 tests in 56.47 seconds wall time, including cold worker compilation.Exact-head CI passed, including production types, core test-type stripes, lint, guards, docs, and the changed-test lanes. Its logs show the new missing-header regression passing in 6 ms.
Fresh exact-head AWS proof passed on lease
cbx_8fe476835cef(r7i.xlarge, 32,309,960 KiB RAM), runrun_5c03bc2f6ae61b04e85b12d5c45b77e2, exit 0. The trusted bootstrap checked the full SHA and no-role boundary; the run used--fresh-pr,--no-hydrate, an isolated HOME, and a real Gateway child with isolated state and an ephemeral loopback port. The final source check was clean at the same SHA.pnpm tsgo:coreagents-othershardprompt-failure.test.tsassistant-request-failure-copy.test.tsPositive unit coverage totals 996 tests across 16 files, including every test file in
src/agents/failoverplus the prompt-failure, reply-failure, Doctor-header, and reset-header boundaries.For the negative control, only
message-patterns.tsandassistant-request-failure-copy.tswere replaced with their baseline versions. The new missing-header case failed because the trace lacked the expectedreason: "format". Restoring the production files from HEAD returnedgit diffto clean before the live run.The after-fix fixture enabled the existing optional group reply policy, sent an unmentioned group message through
qa-channel, and waited for dispatch acknowledgment. The captured delivery was:{ "step": "headerless-group-failure", "acknowledged": true, "outbound": [ { "text": "OpenClaw couldn't read this conversation's history. Ask the Gateway operator to try `openclaw doctor --fix`. If it still fails, preserve the history and contact support with the Gateway logs.", "isError": true } ] }The exact-head Gateway also repeated both zero-row
/newand daily-reset cases successfully, deliveringREL6_NEW_OK,REL6_DAILY_OK, andREL6_DAILY_NEXT_OK. Offline Doctor reportedPrepended missing headers to 1 session transcript; the same formerly broken group then deliveredREL6_REPAIRED_OK. The Gateway fixture shut down cleanly. Both proof leases were stopped; the earlier undersizedt3.smallallocation was also stopped before contributor execution.The successful candidate run took 692.910 s for bootstrap/install/check execution and 783.213 s including checkout and connection phases.
Formatting, targeted type-aware Oxlint, and
git diff --checkpassed. Fresh isolated Codex autoreview found no actionable P0-P2 findings in the exact candidate tree; the final commit preserves that reviewed tree.ClawSweeper findings addressed: the obsolete reset implementation is removed; conflicts are resolved against main; Doctor guidance is explicitly conditional and includes an escalation path. The after-fix group delivery and recovery trace above supplies the requested channel-boundary proof. The live transport is synthetic
qa-channelthrough a real Gateway process; native Telegram transport was not exercised.ClawSweeper revision 4 on this head reports no actionable code findings and confirms the prior recovery-guidance finding is resolved. Its stale-body item is addressed by this rewritten description. The automated data-model item is a false positive:
isSessionTranscriptValidationErrorMessageonly matches error text, andrenderFormatErrorCopyonly returns display text. The diff changes no persisted field, storage writer, schema, migration, or admission code; the reset and Doctor owners are byte-identical to the baseline exercised above. No migration is introduced or needed for this change. Existing unreadable histories still use the existing repair owner. After-fix channel delivery is now proved above.CI reported test time:
prompt-failure.test.ts— 26 tests, 0.327 s;assistant-request-failure-copy.test.ts— 47 tests, 0.015 s. Standalonepnpm test <file> --maxWorkers=1wall times were 43.51 s and 19.42 s. The first file included 25.057 s of cold compiled-worker preparation from its existing SessionManager fixture; the added missing-header case took 6 ms. This extends the existing failure/credential-health boundary without a new Gateway fixture, process boot, sleep, or test-only production seam. The complete CI workflow took 612 s, including other selected lanes and setup.Exact validation commands and live fixture boundary
All execution below ran on the secretless AWS lease through the clean-main
scripts/crabbox-untrusted-bootstrap.sh, bound to the full head SHA above.The temporary live fixture used the maintained
createQaLiveLaneGateway, QA bus, andcreateQaChannelTransportowners with provider modemock-openai. It seeded only synthetic session rows, sent/newand ordinary messages through real channel ingress, forced daily rollover using a 48-hour-old session row, and measured completed dispatch through the acknowledged bus cursor. Doctor ran while that fixture's Gateway was stopped, followed by a restart and a successful message to the same group. The baseline used the same fixture withOPENCLAW_REL6_EXPECT_SILENCE=1on the pinned main checkout.Local static command:
node scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.core.jsonwith a zsh array of the four changed TypeScript files. No contributor code or tests executed on the maintainer host; no local dependency install was performed.