fix: add contextWindow defaults and compaction safeguard for custom providers#1146
Conversation
There was a problem hiding this comment.
💡 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), |
There was a problem hiding this comment.
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 👍 / 👎.
No description provided.