Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Python ModelLimits drops max_output_tokens from model metadata

未关闭 适合新手
#2,798 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

@HDMowri 已经在做这个了。

开始于 2026年9月30日。

  • #2799 来自 @HDMowri —— 未关闭

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
78/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
python
领域
api

调研方向

从公开的 Python ModelLimits 类型及其 from_dict() 和 to_dict() 方法开始,然后跟踪 CopilotClient.list_models() 如何反序列化模型限制。复现提供的示例,并验证 max_output_tokens 在反序列化后仍被保留,且包含在序列化的模型元数据中。

由索引模型根据 Issue 内容生成。

描述

bug

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.

主要语言
TypeScript
星标
10.5k
派生
1.5k
平均合并
1 天 7 小时
30 天内合并 PR
64

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

github/copilot-sdk 的其他 Issue

查看 github/copilot-sdk 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。