openclaw - ✅(Solved) Fix agents.defaults.compaction.model appears unused / dead config in runtime [1 pull requests, 1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#59863Fetched 2026-04-08 02:39:40
View on GitHub
Comments
1
Participants
2
Timeline
2
Reactions
0
Participants
Timeline (top)
commented ×1cross-referenced ×1

OpenClaw exposes agents.defaults.compaction.model in the runtime schema/config surface, but in the installed runtime build I tested, I could not find any active code path that consumes it for session compaction.

Error Message

  • Config includes:
    • agents.defaults.compaction.model
  • Runtime schema/help includes:
    • agents.defaults.compaction.model
  • But runtime search only found references in:
    • runtime-schema-B34T_6nr.js
  • I could not find any execution path that reads the configured value and uses it to select a compaction model.

Root Cause

This is misleading for operators. A config like:

"compaction": {
  "mode": "safeguard",
  "model": "openai-codex/gpt-5.3-codex-spark"
}

strongly implies compaction will use that model, but runtime behavior suggests it does not.

Fix Action

Fixed

PR fix notes

PR #59929: fix(compaction): prioritize runtime override model in safeguard

Description (problem / solution / changelog)

Summary

  • prefer untime.model over ctx.model inside compaction safeguard model resolution
  • this preserves the session model fallback but ensures gents.defaults.compaction.model override wins when both are present
  • add a regression test that proves runtime override precedence when both models exist

Test plan

  • pnpm test -- src/agents/pi-hooks/compaction-safeguard.test.ts
  • pnpm test -- src/agents/pi-embedded-runner/run/attempt.test.ts -t "resolves compaction.model override in runtime context so all context engines use the correct model"

Fixes #59863

Changed files

  • src/agents/pi-hooks/compaction-safeguard.test.ts (modified, +32/-1)
  • src/agents/pi-hooks/compaction-safeguard.ts (modified, +4/-3)

Code Example

"compaction": {
  "mode": "safeguard",
  "model": "openai-codex/gpt-5.3-codex-spark"
}
RAW_BUFFERClick to expand / collapse

Summary

OpenClaw exposes agents.defaults.compaction.model in the runtime schema/config surface, but in the installed runtime build I tested, I could not find any active code path that consumes it for session compaction.

Observed behavior

  • Config includes:
    • agents.defaults.compaction.model
  • Runtime schema/help includes:
    • agents.defaults.compaction.model
  • But runtime search only found references in:
    • runtime-schema-B34T_6nr.js
  • I could not find any execution path that reads the configured value and uses it to select a compaction model.

Evidence

  1. Searching the installed runtime under:
    • /usr/local/lib/node_modules/openclaw/dist/**/*.js
  2. Only hit for compaction.model was schema metadata:
    • runtime-schema-B34T_6nr.js
  3. Budget-triggered compaction path appears to pass the session's active model instead:
    • compactEmbeddedPiSession({ ... model: params.followupRun.run.model, trigger: "budget", ... })
  4. Memory-flush path is separate and also does not appear to read agents.defaults.compaction.model

Expected behavior

One of these should be true:

  1. agents.defaults.compaction.model is actually honored for compaction runs, or
  2. the config key is removed from schema/docs if it is no longer supported

Why this matters

This is misleading for operators. A config like:

"compaction": {
  "mode": "safeguard",
  "model": "openai-codex/gpt-5.3-codex-spark"
}

strongly implies compaction will use that model, but runtime behavior suggests it does not.

Impact

  • makes compaction behavior hard to reason about
  • can lead to false assumptions during context-budget tuning
  • especially confusing when debugging large-session compaction/model limits

Suggested fix

  • wire agents.defaults.compaction.model into the actual compaction executor, or
  • remove/deprecate the config key and update schema/docs accordingly

extent analysis

TL;DR

The most likely fix is to either wire the agents.defaults.compaction.model configuration into the compaction executor or remove/deprecate the config key and update the schema and documentation accordingly.

Guidance

  • Review the code paths for session compaction to ensure that the configured agents.defaults.compaction.model value is being used to select the compaction model.
  • Verify that the compactEmbeddedPiSession function is using the correct model for compaction, and consider updating it to use the configured agents.defaults.compaction.model value.
  • If the config key is no longer supported, remove or deprecate it and update the schema and documentation to reflect the change.
  • Test the compaction behavior with different configurations to ensure that it is working as expected and that the configured model is being used.

Example

// Example configuration that implies compaction will use the specified model
"compaction": {
  "mode": "safeguard",
  "model": "openai-codex/gpt-5.3-codex-spark"
}

Notes

The issue lacks information about the specific code changes required to fix the problem, so a detailed solution cannot be provided. However, the suggested fix provides a general direction for resolving the issue.

Recommendation

Apply a workaround by removing or deprecating the agents.defaults.compaction.model config key and updating the schema and documentation accordingly, until a proper fix can be implemented to wire the config key into the compaction executor. This will prevent misleading operators and reduce confusion during debugging.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

One of these should be true:

  1. agents.defaults.compaction.model is actually honored for compaction runs, or
  2. the config key is removed from schema/docs if it is no longer supported

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING