Repository navigation
Conversation
dbcdc44 to
b173659
Compare
Preflight compaction only skipped CLI backends when the provider string or a persisted session runtime pin looked like CLI. Anthropic sessions routed to claude-cli via model policy still hit transcript_bytes compaction and could truncate an empty OpenClaw message view. Defer preflight (and memory flush) when the effective turn runtime's CLI backend declares ownsNativeCompaction, and cover Anthropic→claude-cli routing without a session runtime pin. Fixes openclaw#108984
resolveFollowupAgentRuntimeId only needs sessionId and runtime pin fields, so share FollowupCliRuntimeParams instead of requiring a full SessionEntry. Unblocks tsgo after the ownsNativeCompaction preflight gate.
b173659 to
a654666
Compare
|
Wanted to make sure the CI passes |
|
Codex review: needs real behavior proof before merge. Reviewed July 16, 2026, 11:57 AM ET / 15:57 UTC. Summary PR surface: Source +41, Tests +68. Total +109 across 2 files. Reproducibility: yes. at source level: current main has a concrete Anthropic-to-claude-cli model-policy path without a persisted runtime pin that bypasses the existing CLI guard. A live current-main reproduction was not performed in this read-only review. 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:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Keep the generic effective-runtime plus backend-capability gate, cover both preflight and memory-flush callers, and land only after a redacted live claude-cli run shows the byte threshold no longer invokes OpenClaw compaction or resets the native session. Do we have a high-confidence way to reproduce the issue? Yes, at source level: current main has a concrete Anthropic-to-claude-cli model-policy path without a persisted runtime pin that bypasses the existing CLI guard. A live current-main reproduction was not performed in this read-only review. Is this the best way to solve the issue? Yes. Reusing the existing effective-runtime resolver and the backend's AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against c46cc1e2d458. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +41, Tests +68. Total +109 across 2 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
|
|
Closing as landed via #115284 ( Your diagnosis and approach were correct and are what shipped: Thanks for the report, the fix, and confirming the diagnosis on #108984 — much appreciated. |
Closes #108984
What Problem This Solves
Fixes an issue where users running long claude-cli sessions (including Anthropic models routed to claude-cli via model policy) would lose conversation continuity when OpenClaw's transcript-byte preflight compaction fired. The OpenClaw message view for those sessions is near-empty, so the summarizer produced an empty summary and
truncateAfterCompactionrotated the session mid-thread.Why This Change Was Made
Preflight only deferred for CLI when the provider string or a persisted session runtime pin looked like CLI. Routes that keep provider=
anthropicwhile the effective turn runtime isclaude-clistill reached thetranscript_bytespath. The CLI backend contract already saysownsNativeCompaction: truebackends own context management; preflight now resolves that effective backend the same way execution does and defers when ownership is set. Memory flush uses the same gate so it stays consistent.User Impact
claude-cli / native-compaction-owning backends no longer get empty OpenClaw safeguard summaries that wipe active context. Embedded non-CLI compaction behavior is unchanged.
Evidence
agentRuntime: claude-cli, no session runtime pin, oversized transcript +truncateAfterCompaction— preflight must not callcompactEmbeddedAgentSession.node scripts/run-vitest.mjs src/auto-reply/reply/agent-runner-memory.test.ts src/auto-reply/reply/agent-runner-memory.preflight-stale-tokens.test.ts— 55 passed.