Skip to content

fix: apply custom provider context limits consistently - #10806

Closed
d3f4w2 wants to merge 1 commit into
aaif-goose:mainfrom
d3f4w2:d3f4w2/providers/context-limit-10805
Closed

fix: apply custom provider context limits consistently#10806
d3f4w2 wants to merge 1 commit into
aaif-goose:mainfrom
d3f4w2:d3f4w2/providers/context-limit-10805

Conversation

@d3f4w2

@d3f4w2 d3f4w2 commented Jul 29, 2026

Copy link
Copy Markdown

Summary

  • resolve model configs against the active provider registry before doctor requests
  • apply the same provider metadata fallback when a session has no persisted model config
  • preserve existing behavior for providers that are not present in the registry

Custom/declarative providers already expose per-model context_limit values through ProviderEntry::normalize_model_config, but the doctor and session fallback paths constructed a bare ModelConfig and skipped that normalization. As a result, large-context custom models could silently fall back to 128k.

Testing

  • cargo test -p goose providers::init::tests --lib -- --nocapture (8 passed)
  • cargo clippy -p goose --all-targets -- -D warnings
  • cargo fmt --all -- --check
  • git diff --check

All Rust checks ran in the repository toolchain version (Rust 1.96.1).

Related Issues

Fixes #10805

Screenshots/Demos (for UX changes)

Not applicable.

@alexhancock alexhancock self-assigned this Jul 30, 2026
@alexhancock
alexhancock self-requested a review August 10, 2026 15:51
@alexhancock

Copy link
Copy Markdown
Collaborator

Thanks for the submission! It's a valid problem and we have a few other aspects to resolve as well

We're tracking things here for a unified fix #10966

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.

context_limit from custom provider config not applied to ModelConfig

2 participants