Preserve wire aliases when converting Responses output items to input
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 62/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- python
调研方向
issue 中指出的修改位置是转换辅助函数 _output_item_to_input_item 和 _tool_search_item_to_input_item。从这里开始,检查它们在哪里对 ResponseFunctionToolCall 等 Pydantic 响应项调用了 model_dump。将转储改为 by_alias=True,同时保留 exclude_unset 以及对 created_by 等仅输出字段的剥离。完成标准是:有一个回归测试回放带有 async 等别名字段的函数调用,并确认序列化后的输入使用线上名称。
由索引模型根据 Issue 内容生成。
描述
Summary
Response items converted back into Responses API input are serialized without Pydantic aliases. For OpenAI's ResponseFunctionToolCall, the Python attribute is async_ but the wire field is async. Replaying that item can therefore send async_ to the API and fail with an unknown parameter error.
This also affects users of the Restate Python SDK's OpenAI Agents integration, which persists model responses and returns them to the Agents SDK. The problematic conversion is in the Agents SDK's output-to-input path.
Expected behavior
When a Pydantic response item is converted to request input, serialize its API aliases (for example, async_ as async) while continuing to strip output-only metadata such as created_by.
Proposed fix
Use model_dump(exclude_unset=True, by_alias=True) in _output_item_to_input_item and _tool_search_item_to_input_item, with regression coverage for an aliased field on a response function call.
- 主要语言
- Python
- 星标
- 30.4k
- 派生
- 4.9k
- 平均合并
- 16 小时 32 分钟
- 30 天内合并 PR
- 85
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
openai/openai-agents-python 的其他 Issue
-
Voice: default sentence splitter never splits Chinese/Japanese, so TTS waits for the whole reply未关闭
难度 2/5 1-3 小时 新手友好度 78/100
openai/openai-agents-python#5475 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 70/100
openai/openai-agents-python#5472 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
openai/openai-agents-python#5471 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
openai/openai-agents-python#5468 · 1 条评论 ·
维护者通常 1 天内回复
-
Docs: `tool_choice="required"` can select a state-changing tool when the needed one is not shown未关闭
难度 1/5 1 小时以内 新手友好度 90/100
openai/openai-agents-python#5461 · 1 条评论 ·
维护者通常 1 天内回复
查看 openai/openai-agents-python 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
enhancement good first issue
难度 2/5 1-3 小时 新手友好度 78/100
elviskahoro/sdk-python-attio#144 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 84/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
RenyiELBO raises TypeError when model has no sample sites可能已有人在做 @alibb007 今天认领。 未关闭
难度 1/5 1 小时以内 新手友好度 85/100
维护者通常 1 天内回复