Bug Description
The agents.defaults.compaction.model configuration is completely ignored when a session is bound to a cliBackends backend (e.g., claude-cli). The CLI backend performs compaction using the session's primary model instead of the configured compaction model.
Expected Behavior
When compaction.model is set (e.g., to a smaller, cheaper model), ALL compaction operations should use that model — including compactions triggered for sessions bound to CLI backends.
Actual Behavior
compaction.model is only read by compactEmbeddedPiSessionDirect (internal compaction path)
- Sessions bound to
cliBackends (e.g., claude-cli) delegate compaction to the CLI backend, which does NOT read compaction.model
- The CLI backend always uses the session's primary model for compaction
Reproduction
- Configure two local LLM servers: a large model (e.g., 122B) and a small model (e.g., 9B)
- Set
agents.defaults.compaction.model to the small model
- Configure
agents.defaults.cliBackends.claude-cli
- Use Discord or other channel that creates sessions bound to
claude-cli
- Fill the session until auto-compaction triggers
- Observe: the large model handles compaction, the small model receives no requests
Impact
- Users cannot offload compaction to a cheaper/lighter model when using CLI backends
- On GPU-constrained setups (e.g., running large local models), this causes unnecessary GPU memory pressure from the main model performing compaction, potentially leading to system instability
Environment
- OpenClaw version: 2026.3.28
- OS: macOS (Apple Silicon)
- CLI backend: Claude Code
Relevant Code Paths
compactEmbeddedPiSessionDirect in auth-profiles-*.js: Reads compaction.model ✓
delegateCompactionToRuntime in delegate-*.js: Routes to compactEmbeddedPiSessionDirect ✓
- CLI backend compaction: Does NOT call
compactEmbeddedPiSessionDirect, uses own model ✗
Suggested Fix
Either:
- Pass
compaction.model config to the CLI backend process so it can use the specified model for compaction
- Or intercept CLI-backend compaction and route it through
compactEmbeddedPiSessionDirect which already handles the model override
Bug Description
The
agents.defaults.compaction.modelconfiguration is completely ignored when a session is bound to acliBackendsbackend (e.g.,claude-cli). The CLI backend performs compaction using the session's primary model instead of the configured compaction model.Expected Behavior
When
compaction.modelis set (e.g., to a smaller, cheaper model), ALL compaction operations should use that model — including compactions triggered for sessions bound to CLI backends.Actual Behavior
compaction.modelis only read bycompactEmbeddedPiSessionDirect(internal compaction path)cliBackends(e.g.,claude-cli) delegate compaction to the CLI backend, which does NOT readcompaction.modelReproduction
agents.defaults.compaction.modelto the small modelagents.defaults.cliBackends.claude-cliclaude-cliImpact
Environment
Relevant Code Paths
compactEmbeddedPiSessionDirectinauth-profiles-*.js: Readscompaction.model✓delegateCompactionToRuntimeindelegate-*.js: Routes tocompactEmbeddedPiSessionDirect✓compactEmbeddedPiSessionDirect, uses own model ✗Suggested Fix
Either:
compaction.modelconfig to the CLI backend process so it can use the specified model for compactioncompactEmbeddedPiSessionDirectwhich already handles the model override