Repository navigation
Description
Bug type
Behavior bug (incorrect output/state without crash)
Beta release blocker
No
Summary
Auto-compaction in OpenClaw 2026.6.1 does not resolve a configured compaction model alias before dispatch, causing the alias gpt54mini to be sent as openai/gpt54mini and rejected as an unknown model.
Steps to reproduce
-
Start OpenClaw 2026.6.1 with a model alias and compaction override shaped like this sanitized config:
{ "models": { "providers": { "openai": { "api": "openai-chatgpt-responses", "agentRuntime": { "id": "pi" } } } }, "agents": { "defaults": { "model": { "primary": "gpt55", "fallbacks": ["gpt54"] }, "models": { "openai/gpt-5.5": { "alias": "gpt55", "agentRuntime": { "id": "pi" } }, "openai/gpt-5.4": { "alias": "gpt54", "agentRuntime": { "id": "pi" } }, "openai/gpt-5.4-mini": { "alias": "gpt54mini", "params": { "thinking": "high" }, "agentRuntime": { "id": "pi" } }, "openai/*": { "agentRuntime": { "id": "pi" } } }, "compaction": { "reserveTokens": 30000, "keepRecentTokens": 20000, "maxHistoryShare": 0.1, "model": "gpt54mini", "notifyUser": true } } } } -
Run a long
openai/gpt-5.5session until embedded auto-compaction is triggered. -
Observe the gateway/agent log line shown below.
Expected behavior
The auto-compaction path should resolve agents.defaults.compaction.model = "gpt54mini" through the same model alias resolver used by normal agent model selection, then dispatch compaction to canonical openai/gpt-5.4-mini.
Actual behavior
Auto-compaction dispatches or reports the alias as openai/gpt54mini, which is not a configured model id and is rejected as unknown.
OpenClaw version
2026.6.1
Operating system
macOS 15.x / Darwin 24.x
Install method
npm global, Node.js 24
Model
Primary session model: openai/gpt-5.5
Compaction override: alias gpt54mini for canonical openai/gpt-5.4-mini
Provider / routing chain
OpenClaw -> OpenAI plugin -> ChatGPT Responses runtime (agentRuntime.id = "pi")
Additional provider/model setup details
The alias is defined under agents.defaults.models as:
"openai/gpt-5.4-mini": {
"alias": "gpt54mini",
"params": { "thinking": "high" },
"agentRuntime": { "id": "pi" }
}Changing only agents.defaults.compaction.model from gpt54mini to canonical openai/gpt-5.4-mini avoids the failure.
Logs, screenshots, and evidence
15:17:24+02:00 warn agent/embedded {"subsystem":"agent/embedded"} auto-compaction failed for openai/gpt-5.5: Unknown model: openai/gpt54miniSanitized verification after workaround:
agents.defaults.compaction.model = "openai/gpt-5.4-mini"
config valid: true
issues: []
warnings: []Impact and severity
- Affected users/systems/channels: OpenClaw sessions using
agents.defaults.compaction.modelset to a configured alias instead of a fully-qualified provider/model id. - Severity: Medium. Normal chat continues, but auto-compaction fails, so long sessions can lose the intended context-management behavior.
- Frequency: Observed when auto-compaction runs with the alias override shown above.
- Consequence: Context compaction does not complete until the config is changed to a canonical model id.
Additional information
This appears to be either:
- the embedded auto-compaction path not calling the normal model alias resolver, or
- the call site passing the configured alias into provider/model normalization before alias resolution.
The workaround is to avoid aliases in agents.defaults.compaction.model and use openai/gpt-5.4-mini directly.
No credentials, user paths, account names, chat IDs, or local file paths are included in this report.
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Activity
clawsweeper commentedon Jun 4, 2026
Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve. Reviewed June 19, 2026, 6:32 AM ET / 10:32 UTC.
Summary
Keep open: current main and v2026.6.8 still treat a bare compaction model override as a literal model id, while open fix PRs already target the remaining alias-resolution bug.
Reproducibility: yes. at source level: a bare
compaction.modelalias reaches the return branch asmodel: overridewithout calling the shared alias resolver. I did not run a live long-session auto-compaction in this read-only review.Root-cause cluster
Relationship:
canonicalCanonical: #90340
Summary: This issue is the canonical report for the embedded auto-compaction alias-resolution bug; open PRs are candidate fixes, while safeguard-mode compaction issues are related but distinct.
Members:
fixed_by_candidate: fix(agents): resolve compaction model alias before dispatch #90357 - Open PR uses closing syntax and targets the same alias-before-dispatch bug.fixed_by_candidate: fix(agent): resolve compaction model alias to canonical model ref #90885 - Open PR targets the same bug and includes stronger same-provider, cross-provider, literal fallback, and collision-precedence proof.superseded: fix(agents): resolve model aliases in compaction model override (fixes #90340) #91153 - Closed unmerged PR attempted the same fix and is not a viable canonical landing path.partial_overlap: Safeguard compaction ignores compaction.model config — uses session model instead #57901 - This open issue concerns safeguard compaction ignoringcompaction.model, not embedded bare alias resolution.partial_overlap: fix(safeguard): resolve compaction provider/model before registering runtime #73704 - This open PR targets the safeguard-mode issue and is adjacent rather than a direct fix for this embedded alias report.Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.
Next step
Open fix PRs already target this issue, so ClawSweeper should not queue another repair branch.
Review details
Best possible solution:
Land one canonical narrow fix, likely #90885 if maintainers accept that direction, then close this issue after the merged code is on main.
Do we have a high-confidence way to reproduce the issue?
Yes at source level: a bare
compaction.modelalias reaches the return branch asmodel: overridewithout calling the shared alias resolver. I did not run a live long-session auto-compaction in this read-only review.Is this the best way to solve the issue?
Yes: the best fix is to reuse the existing shared model alias resolver in
resolveEmbeddedCompactionTargetwhile preserving current literal model-id and auth-profile behavior. The linked open PRs are implementation candidates, so the issue should remain open until one merges or maintainers close both.AGENTS.md: found and applied where relevant.
Remaining risk / open question:
Codex review notes: model internal, reasoning high; reviewed against d4833e27c775.
Label changes
Label justifications:
P2: This is a normal-priority compaction/model-routing bug with a clear canonical-model workaround and limited blast radius.impact:session-state: Failed auto-compaction prevents the intended long-session context-management behavior from completing.impact:auth-provider: The failure is in provider/model choice for a configured compaction override alias.Evidence reviewed
What I checked:
AGENTS.md:11, d4833e27c775)src/agents/embedded-agent-runner/run/AGENTS.md:6, d4833e27c775)resolveEmbeddedCompactionTargetreadsagents.defaults.compaction.model, only splits values containing/, and returns bare values asmodel: overrideunder the active provider without alias lookup. (src/agents/embedded-agent-runner/compaction-runtime-context.ts:72, d4833e27c775)resolveEmbeddedCompactionTarget, then passes the resulting provider/model into model resolution, so a bare alias can reach dispatch as a literal model id. (src/agents/embedded-agent-runner/compact.ts:591, d4833e27c775)buildModelAliasIndexandresolveModelRefFromStringimplement configured alias resolution fromagents.defaults.models, but the current compaction target helper does not call them. (src/agents/model-selection-shared.ts:590, d4833e27c775)src/agents/embedded-agent-runner/compaction-runtime-context.ts:124, 844f405ac1be)Likely related people:
src/agents/embedded-agent-runner/compaction-runtime-context.ts,src/agents/model-selection-shared.ts)src/agents/embedded-agent-runner/compaction-runtime-context.ts,src/agents/model-selection-shared.ts)src/agents/model-selection-shared.ts)How this review workflow works
@clawsweeper re-reviewcomments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.@clawsweeper re-reviewor@clawsweeper re-runon an open PR or issue to request a fresh review only.@clawsweeper reviewto request a fresh review only.@clawsweeper autofix,@clawsweeper automerge,@clawsweeper fix ci, or@clawsweeper address review.@clawsweeper explainto ask for more context, or@clawsweeper stopto stop active automation.fix(agents): preserve bare model-id precedence in compaction alias re…
steipete commentedon Jun 19, 2026
Fixed by #90885 in b677ea6.
Bare compaction model aliases now resolve to the canonical provider/model at the shared runtime-context boundary before direct, queued, or context-engine dispatch. The fix also preserves active-provider literal precedence and same-provider auth. Focused tests, docs checks, exact-head autoreview, and exact-head hosted CI passed.
Thanks for the report and clear workaround, @toruvieI.