fix(cli-runner): add opt-in raw transcript reseed for invalidated CLI sessions#79764
Conversation
|
Codex review: needs changes before merge. Summary Reproducibility: yes. from source. Current main clearly returns no no-compaction reseed, and the PR’s new raw-reseed path can be traced through the existing prepare ordering where missing-transcript is classified before auth reuse checks. Real behavior proof Next step before merge Security Review findings
Review detailsBest possible solution: Land the opt-in reseed only after missing-transcript recovery preserves auth-boundary no-raw semantics, with prepare-level regression coverage and docs/schema kept aligned. Do we have a high-confidence way to reproduce the issue? Yes from source. Current main clearly returns no no-compaction reseed, and the PR’s new raw-reseed path can be traced through the existing prepare ordering where missing-transcript is classified before auth reuse checks. Is this the best way to solve the issue? No as currently patched. The opt-in design is the right narrow direction, but the implementation needs auth-profile and auth-epoch invalidation to win before any raw missing-transcript reseed is prepared. Full review comments:
Overall correctness: patch is incorrect Security concerns:
Acceptance criteria:
What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 9b629758fe26. |
|
Thanks for digging into this. I agree the reported behavior is real: when the external CLI session is invalidated before we have a compaction summary, the fresh run currently starts with I don't think we should fix it by enabling raw pre-compaction transcript reseeding by default, though. The smallest landable shape I would suggest is:
If we want automatic continuity by default later, I think the safer product fix is to summarize-on-invalidation and reseed from that summary, rather than injecting raw transcript history into a fresh external CLI session by default. That is a larger session/compaction-flow change and probably should be separate from this small fix. |
b78aa40 to
07e44ec
Compare
07e44ec to
47e97d9
Compare
…penclaw#79713) loadCliSessionReseedMessages returned [] for any session that had never been compacted, making the historyPrompt fallback silently inert. On short sessions (the common case for Discord/Telegram DMs), this meant every CLI invalidation (idle timeout, system-prompt change) restarted the agent with no prior context. Return limitAgentHookHistoryMessages(rawTail) instead, mirroring the same cap already applied to the post-compaction tail messages. The rival opt-in config approach (openclaw#77583) stalled on a missing CliBackend schema key; always-on is simpler and matches the issue author's suggested fix. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
47e97d9 to
b63f3af
Compare
Summary
reseedFromRawTranscriptWhenUncompactedas an explicit CLI backend opt-in in config types, strict schema, generated baseline, and docsmissing-transcript,system-prompt,mcp,session-expired) while auth profile/credential-epoch resets remain no-rawFixes #79713.
Verification
pnpm exec oxfmt --check --threads=1 CHANGELOG.md docs/gateway/cli-backends.md docs/gateway/config-agents.md src/agents/cli-runner.reliability.test.ts src/agents/cli-runner/prepare.test.ts src/agents/cli-runner/prepare.ts src/agents/cli-runner/session-history.test.ts src/agents/cli-runner/session-history.ts src/config/types.agent-defaults.ts src/config/zod-schema.core.tspnpm run lint:extensions:bundledpnpm deadcode:dependenciespnpm test src/agents/cli-runner/session-history.test.ts src/agents/cli-runner/prepare.test.ts src/agents/cli-runner.reliability.test.ts src/config/schema.test.ts src/config/zod-schema.agent-defaults.test.tspnpm changed:lanes --jsongit diff --checkpnpm config:docs:genupdateddocs/.generated/config-baseline.sha256and the local ignored generated JSON containsagents.defaults.cliBackends.*.reseedFromRawTranscriptWhenUncompacted.pnpm config:docs:checkdid not complete locally after the updated hash; it stayed inscripts/generate-config-doc-baseline.ts --checkwith no output and was stopped after several minutes.