@@ -376,20 +376,16 @@ For CLIs that emit Claude Code stream-json compatible JSONL, set
376376
377377Some CLI backends run an agent that compacts its ** own** transcript, so OpenClaw must
378378not run its safeguard summarizer against them - doing so fights the backend's own
379- compaction and can hard-fail the turn. ** Codex** (its app-server owns automatic
380- compaction) and ** Claude Code** (` claude-cli ` ) both work this way, and both ** opt out
381- of OpenClaw compaction** :
379+ compaction and can hard-fail the turn.
382380
383- - ** Codex** routes to its native-harness compaction endpoint (matched by the session's
384- ` agentHarnessId ` ).
385- - ** ` claude-cli ` ** has no harness endpoint - Claude Code compacts internally - so it
386- declares ` ownsNativeCompaction: true ` , and OpenClaw returns a no-op from the
387- compaction path.
381+ ` claude-cli ` has no harness endpoint - Claude Code compacts internally - so it declares
382+ ` ownsNativeCompaction: true ` , and OpenClaw returns a no-op from the compaction path.
383+ Native-harness sessions such as Codex keep routing to their harness compaction endpoint
384+ instead.
388385
389- Either way OpenClaw ** defers and never compacts these sessions.** Because the backend
390- owns compaction, the old stopgap of setting ` contextTokens: 1_000_000 ` purely to keep
391- OpenClaw's safeguard from firing on a claude-cli session is ** no longer needed** - the
392- opt-out replaces it.
386+ Because the backend owns compaction, the old stopgap of setting
387+ ` contextTokens: 1_000_000 ` purely to keep OpenClaw's safeguard from firing on a
388+ claude-cli session is ** no longer needed** - the opt-out replaces it.
393389
394390``` typescript
395391api .registerCliBackend ({ id: " my-cli" , ownsNativeCompaction: true /* ... */ });
@@ -398,8 +394,7 @@ api.registerCliBackend({ id: "my-cli", ownsNativeCompaction: true /* ... */ });
398394Only declare ` ownsNativeCompaction ` for a backend that genuinely owns its compaction: it
399395must reliably bound its own transcript as it nears its context window and persist a
400396resumable session (e.g. ` --resume ` / ` --session-id ` ); otherwise a deferred session can
401- stay over budget. (A session whose ` agentHarnessId ` matches the provider still routes to
402- the harness endpoint - the no-op applies only when there is no harness endpoint.)
397+ stay over budget. Matching ` agentHarnessId ` sessions still route to the harness endpoint.
403398
404399## Bundle MCP overlays
405400
0 commit comments