Skip to content

fix: add contextWindow defaults and compaction safeguard for custom providers#1146

Merged
su8su merged 1 commit into
mainfrom
fix_clawx_compact
Jul 7, 2026
Merged

fix: add contextWindow defaults and compaction safeguard for custom providers#1146
su8su merged 1 commit into
mainfrom
fix_clawx_compact

Conversation

@su8su

@su8su su8su commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 49bd2948a1

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

input: inferCustomModelInputModalities(id),
// Without an explicit contextWindow OpenClaw cannot budget compaction
// for custom providers and long sessions die with context overflow.
contextWindow: inferCustomModelContextWindow(id),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Limit inferred context windows to custom providers

When an Ollama account is saved or updated, syncRuntimeProviderConfig also reaches syncProviderConfigToOpenClaw because isUnregisteredProviderType includes ollama, so this line writes the custom-provider default contextWindow onto new ollama-* model rows. That contradicts the new backfill’s explicit scoping away from small local models and can make the runner believe an 8k/32k Ollama model has the 131k fallback window, so safeguard compaction still happens too late and the local provider overflows.

Useful? React with 👍 / 👎.

@su8su
su8su merged commit e09dd28 into main Jul 7, 2026
6 checks passed
@su8su
su8su deleted the fix_clawx_compact branch July 7, 2026 07:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant