Problem
OpenAI-compatible providers can expose the same model name with different context windows. Registering provider-specific values in the process-wide model-name registry makes one provider silently affect another.
Proposal
Add an OpenAI model option that accepts a provider-scoped context-window resolver. A positive explicit WithContextWindow value remains authoritative; otherwise the resolver may supply provider metadata, and unresolved names continue to use the existing model-name registry fallback.
This keeps existing callers unchanged while letting provider adapters avoid global model-name collisions.
Problem
OpenAI-compatible providers can expose the same model name with different context windows. Registering provider-specific values in the process-wide model-name registry makes one provider silently affect another.
Proposal
Add an OpenAI model option that accepts a provider-scoped context-window resolver. A positive explicit
WithContextWindowvalue remains authoritative; otherwise the resolver may supply provider metadata, and unresolved names continue to use the existing model-name registry fallback.This keeps existing callers unchanged while letting provider adapters avoid global model-name collisions.