Description
The generated RPC schema includes max_output_tokens in ModelCapabilitiesLimits, but the public Python ModelLimits type does not. CopilotClient.list_models() deserializes model limits through ModelLimits.from_dict(), so the value is discarded.
This follows the same schema/public-type parity principle addressed for TypeScript in #2569, although this issue affects the Python model-list response path rather than the session override path.
Reproduction
from copilot import ModelLimits
limits = ModelLimits.from_dict(
{
"max_prompt_tokens": 128000,
"max_output_tokens": 16384,
"max_context_window_tokens": 144384,
}
)
assert limits.max_output_tokens == 16384
assert limits.to_dict()["max_output_tokens"] == 16384
Currently, ModelLimits has no max_output_tokens attribute and to_dict() omits the field.
Expected behavior
ModelLimits should preserve max_output_tokens when deserializing and serializing model metadata.
Description
The generated RPC schema includes
max_output_tokensinModelCapabilitiesLimits, but the public PythonModelLimitstype does not.CopilotClient.list_models()deserializes model limits throughModelLimits.from_dict(), so the value is discarded.This follows the same schema/public-type parity principle addressed for TypeScript in #2569, although this issue affects the Python model-list response path rather than the session override path.
Reproduction
Currently,
ModelLimitshas nomax_output_tokensattribute andto_dict()omits the field.Expected behavior
ModelLimitsshould preservemax_output_tokenswhen deserializing and serializing model metadata.