refactor: route auto-reply sessions through session seam#89124
Conversation
|
Codex review: found issues before merge. Reviewed June 15, 2026, 4:54 PM ET / 20:54 UTC. Summary PR surface: Source +228, Tests +405, Other +57. Total +690 across 35 files. Reproducibility: not applicable. This is a refactor PR, and the review is based on source inspection plus the provided live Gateway proof rather than a standalone bug reproduction. Review metrics: 2 noteworthy metrics.
Stored data model 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 findings
Review detailsBest possible solution: Rebase on current main, add saveSessionStore to the writer guard and focused test, refresh affected checks, then merge only after maintainer acceptance of the staged session-state migration risk. Do we have a high-confidence way to reproduce the issue? Not applicable. This is a refactor PR, and the review is based on source inspection plus the provided live Gateway proof rather than a standalone bug reproduction. Is this the best way to solve the issue? Yes on direction, not yet on merge readiness. The accessor seam is the right owner boundary for this migration slice, but the write guard and current-main conflicts need to be fixed first. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against efa9a6110b4e. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +228, Tests +405, Other +57. Total +690 across 35 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
|
f18f99c to
b39023f
Compare
582bdb0 to
522bc6a
Compare
a13e0eb to
890d5e3
Compare
890d5e3 to
b496b4b
Compare
522bc6a to
52753f5
Compare
|
Follow-up before land: this slice still carries a whole-store read on the attempt hot path — |
|
Posted live Gateway behavior proof in the PR body. Summary of the new proof:
This proof used the real local Gateway service, not the earlier isolated in-process harness. |
|
Additional live channel proof from the same managed Gateway build (
Both were real live channel adapter deliveries on the LaunchAgent-managed local Gateway, not mocks. |
63f9801 to
0ac3386
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
What
Path 3 / PR 3.1b auto-reply/agent: routes auto-reply and agent runtime session writes through the 3.1a session accessor seam while preserving current file-backed behavior. Refs #88838.
Why
This moves the auto-reply/agent slice off direct session-store mutations before the SQLite storage flip, keeping caller adoption separate from storage implementation changes. The PR depends on the 3.1a seam base branch
clawdbot-9c3/session-accessor-seamatbe13ad13f8and its seam commits includingbb48e18ded,f6ae83451a,0faccc0cfa,5c38bb4be4,2d9c5b65a3, andbe13ad13f8.Changes
src/agents/command/*src/agents/embedded-agent-runner/*src/auto-reply/reply/*Testing
clawdbot-6f0/31b-auto-reply-agent-seamat582bdb04e7(7bd273b08c+582bdb04e7on the 3.1a base).node scripts/run-vitest.mjsover agent command/session and auto-reply runner/session tests passed 428 tests.integration/sqlite-flip-auto-reply-agentatb1600517d6.src/config/sessions/session-accessor.conformance.test.tsandsrc/auto-reply/reply/sqlite-session-accessor.validation.test.ts.3b9353414e(3.1a read-scope fix),59a590e825(3.2 SQLite foundation), andc221e48beb(3.2 read-scope fix) with no storage fallback or dual-read wiring.pnpm exec oxfmt --check src/config/sessions/session-accessor.ts src/auto-reply/reply/sqlite-session-accessor.validation.test.tsnode scripts/run-oxlint.mjs src/config/sessions/session-accessor.ts src/auto-reply/reply/sqlite-session-accessor.validation.test.tspnpm tsgo:corepnpm tsgo:core:testgit diff --checkReal behavior proof
Behavior addressed: PR #89124 routes auto-reply sessions through the session-accessor seam after the #90463 rebase, preserving the narrow auto-reply slice.
Real environment tested: Managed live OpenClaw Gateway on this machine, running PR head f0a985f after pnpm build and LaunchAgent Gateway restart. The CLI reported OpenClaw 2026.6.2 (f0a985f), the Gateway was listening on loopback port 18789, and the agent used the live openai/gpt-5.5 provider.
Exact steps or command run after this patch: Ran pnpm openclaw agent against the managed Gateway with session key agent:main:pr89124-live-gateway-proof-20260615T2017Z and prompt "Reply exactly with PR89124_LIVE_OK and nothing else." Then ran delivered channel proofs with pnpm openclaw agent --deliver for the configured Discord channel and configured Telegram group topic.
Evidence after fix: Gateway run 54cde5c1-d306-4a71-80eb-3d8a8b18d1b6 completed in session 5676b0d9-3548-4b64-aa4a-2df6dcb571bd with output PR89124_LIVE_OK; the persisted session row reported status done, modelProvider openai, model gpt-5.5, totalTokensFresh true, and a transcript file exists. Discord delivery run 465d5103-b947-4500-ad0c-584a90f8526e completed in session 6e8d619d-10c7-4bef-b866-4f172ed68ee2 with payload PR89124_DISCORD_OK., deliveryStatus sent, succeeded true. Telegram delivery run d575b759-5865-47a4-a5f6-3776ecd99dce completed in session 6a240460-5e6b-48c0-a52d-207f5fcc1f6d with payload PR89124_TELEGRAM_OK, deliveryStatus sent, succeeded true.
Observed result after fix: The real managed Gateway accepted the PR build, completed the Gateway agent turn, and sent real outbound replies through both the Discord and Telegram channel adapters.
What was not tested: I did not prove inbound human-authored Discord or Telegram trigger messages in this pass; the channel proof used Gateway-delivered outbound replies to already configured live channel targets.