refactor(auto-reply): add lifecycle storage seams#93685
Conversation
cd8e212 to
4d2f18f
Compare
|
Codex review: needs maintainer review before merge. Reviewed June 18, 2026, 6:55 PM ET / 22:55 UTC. Summary PR surface: Source +127, Tests +116, Other +2. Total +245 across 8 files. Reproducibility: not applicable. this is a refactor PR rather than a reported failing bug. The PR body includes after-fix live Gateway output for the /new lifecycle, and the diff adds focused reset/rollover lifecycle tests. Review metrics: 1 noteworthy metric.
Stored data model Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land the narrow file-backed lifecycle seam after assigned maintainer parity review and required checks pass, keeping SQLite storage flip and migration work in the Path 3 tracker. Do we have a high-confidence way to reproduce the issue? Not applicable; this is a refactor PR rather than a reported failing bug. The PR body includes after-fix live Gateway output for the /new lifecycle, and the diff adds focused reset/rollover lifecycle tests. Is this the best way to solve the issue? Yes; this appears to be the right owner boundary because storage lifecycle work moves into session-accessor operations while non-storage runtime cleanup and hook dispatch remain in the existing callers. The merged gateway reset/delete seam is adjacent, not a replacement for this auto-reply reset/rollover slice. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 6af1b97b1de7. Label changesLabel justifications:
Evidence reviewedPR surface: Source +127, Tests +116, Other +2. Total +245 across 8 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
4d2f18f to
8604daa
Compare
8604daa to
50f4d68
Compare
* 'main' of https://github.com/openclaw/openclaw: (82 commits) fix(e2e): validate chat tools body limit fix(e2e): honor chat tools body limit fix(e2e): validate chat tools timeout fix(e2e): give cleanup smoke build heap headroom fix(e2e): validate plugin lifecycle limits refactor(auto-reply): add lifecycle storage seams (#93685) fix: preserve pending subagent completion announces (#94349) fix(e2e): validate plugin log limits before setup fix(e2e): validate codex media timeout fix(e2e): validate fixture log limits fix(e2e): validate cleanup log limits fix(e2e): validate docker log limits fix(live): validate docker pids limits fix(e2e): validate docker pids limits test: fold channel message flows into qa e2e (#93174) fix(e2e): validate docker build limits Prevent Codex thread rotation from losing next-step context (#94093) fix(e2e): validate fixture cleanup interval fix(agents): correct claw-score validation workflow fix(e2e): validate log tail limits ...
* refactor(auto-reply): add lifecycle storage seams * fix(auto-reply): remove unused transcript replay shim
* refactor(auto-reply): add lifecycle storage seams * fix(auto-reply): remove unused transcript replay shim
* 'main' of https://github.com/openclaw/openclaw: (82 commits) fix(e2e): validate chat tools body limit fix(e2e): honor chat tools body limit fix(e2e): validate chat tools timeout fix(e2e): give cleanup smoke build heap headroom fix(e2e): validate plugin lifecycle limits refactor(auto-reply): add lifecycle storage seams (openclaw#93685) fix: preserve pending subagent completion announces (openclaw#94349) fix(e2e): validate plugin log limits before setup fix(e2e): validate codex media timeout fix(e2e): validate fixture log limits fix(e2e): validate cleanup log limits fix(e2e): validate docker log limits fix(live): validate docker pids limits fix(e2e): validate docker pids limits test: fold channel message flows into qa e2e (openclaw#93174) fix(e2e): validate docker build limits Prevent Codex thread rotation from losing next-step context (openclaw#94093) fix(e2e): validate fixture cleanup interval fix(agents): correct claw-score validation workflow fix(e2e): validate log tail limits ...
* refactor(auto-reply): add lifecycle storage seams * fix(auto-reply): remove unused transcript replay shim
Summary
persistSessionResetLifecycle.persistSessionRolloverLifecycle.Linked context
Related #88838
Related #89124
Related #93659
Tracks OpenClaw Path 3 transaction-boundary follow-up
.32.Requested by maintainer/coordinator delegation for OpenClaw Path 3 transaction-boundary prep.
Real behavior proof
Behavior addressed: Auto-reply reset and rollover callers now route lifecycle storage work through the session accessor seam while preserving transcript replay/archive behavior and keeping non-storage cleanup in the callers.
Real environment tested: Local live gateway from /Users/phaedrus/Projects/clawdbot on rebased head 50f4d68, OpenClaw 2026.6.8 (50f4d68), LaunchAgent on loopback port 18789, macOS, built dist/index.js service path.
Exact steps or command run after this patch:
Evidence after fix: Gateway restart succeeded on
50f4d68;/healthzreturned{"ok":true,"status":"live"}. The realpnpm openclaw agent --session-key ... --message /new --json --timeout 60path returnedstatus: "ok", payload text✅ New session started., andagentMeta.sessionId: "2d9f521e-2f0e-4146-bf1a-c0eb05484529". Persisted state changed from pre-resetsessionId: "cd40c7ee-f66b-4a2a-a8b8-505646b2c0e5"tosessionId: "2d9f521e-2f0e-4146-bf1a-c0eb05484529";sessions.getreturnedmessages: []for the fresh current transcript. The old transcript was archived ascd40c7ee-f66b-4a2a-a8b8-505646b2c0e5.jsonl.reset.2026-06-18T22-23-21.089Zcontaining the injected assistant row, and the new transcript2d9f521e-2f0e-4146-bf1a-c0eb05484529.jsonlcontained a fresh session header. Cleanup removed the throwaway proof session entry and both proof transcript artifacts. Final/readyzafter cleanup returnedready:true,failing:[], and non-degraded event loop metrics.Observed result after fix: The rebased auto-reply
/newlifecycle produced a fresh session row and archived the previous transcript through the live Gateway, with no model turn needed and no leftover proof state after cleanup.What was not tested: Future SQLite implementation, doctor migration/import behavior, plugin SDK compatibility, full CI, and broad remote Crabbox/Testbox gates.
Tests and validation
node scripts/run-vitest.mjs src/config/sessions/session-accessor.test.ts src/auto-reply/reply/agent-runner-session-reset.test.ts src/auto-reply/reply/session.test.ts src/auto-reply/reply/session-transcript-replay.test.ts test/scripts/check-session-accessor-boundary.test.tsnode scripts/run-oxlint.mjs scripts/check-session-accessor-boundary.mjs src/auto-reply/reply/agent-runner-session-reset.ts src/auto-reply/reply/session-transcript-replay.ts src/auto-reply/reply/session.ts src/config/sessions/session-accessor.test.ts src/config/sessions/session-accessor.ts src/config/sessions/transcript-replay.ts test/scripts/check-session-accessor-boundary.test.tspnpm run lint:tmp:session-accessor-boundarygit diff --check HEAD~1 HEADpnpm exec oxfmt --check scripts/check-session-accessor-boundary.mjs src/auto-reply/reply/agent-runner-session-reset.ts src/auto-reply/reply/session-transcript-replay.ts src/auto-reply/reply/session.ts src/config/sessions/session-accessor.test.ts src/config/sessions/session-accessor.ts src/config/sessions/transcript-replay.ts test/scripts/check-session-accessor-boundary.test.tspnpm build/Users/phaedrus/Projects/clawdbot/.agents/skills/autoreview/scripts/autoreview --mode branch --base upstream/mainRegression coverage added in
src/config/sessions/session-accessor.test.tsfor reset lifecycle replay/cleanup and rollover archive/stable transcript results. The boundary guard now ratchetsagent-runner-session-reset.tsandsession.tsagainst legacy session-store writer calls. Autoreview was clean on final head50f4d68703a93a28be104be27d1b4a30b0f1868bwithoverall: patch is correct (0.84).Risk checklist
Did user-visible behavior change? (
Yes/No): NoDid config, environment, or migration behavior change? (
Yes/No): NoDid security, auth, secrets, network, or tool execution behavior change? (
Yes/No): NoWhat is the highest-risk area?
Preserving exact reset and rollover hook payload behavior while moving transcript archive/replay work behind the accessor.
How is that risk mitigated?
Existing auto-reply reset/session tests still pass, new accessor lifecycle tests cover the moved storage work, and non-storage side effects remain in the original callers.
Current review state
What is the next action?
Draft review and CI.
What is still waiting on author, maintainer, CI, or external proof?
Maintainer review and CI; no known author-side blockers.
Which bot or reviewer comments were addressed?
Fresh autoreview found no accepted/actionable findings.