fix: 剥离 Codex cache_control 并完善 Responses 工具调用展示#625
Merged
fawney19 merged 3 commits intoJun 4, 2026
Merged
Conversation
The response.completed fallback rebuilt every call item with responsesCallInput(), which returns '{}' for a function_call lacking arguments. Since '{}' is truthy, ensureToolCall overwrote arguments already collected from streamed delta events. Guard the completed branch with responsesCallHasInput (matching the output_item.done branch) so empty/default inputs no longer clobber streamed args, and align its dedupe key with the streaming phase to avoid duplicate tool-call rendering when an item has no id. Drop the now-dead '工具调用' fallbacks since responsesCallName never returns empty.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
这组改动包含两类修复:
cache_control会被带入 Codex Responses 请求体;当前上游会返回未知参数错误。*_callitem 没有展示,流式工具调用参数也可能在response.completed兜底解析时被默认{}覆盖。改动
cache_control派生稳定的prompt_cache_key,但在发给上游前递归移除所有cache_control字段。*_callitem 的通用支持。response.completed只有在最终 item 确实带输入时才覆盖已收集的增量参数,并复用流式阶段的 key 避免重复渲染。验证
cargo test -p aether-ai-formatsnpm run test:run -- src/features/usage/conversation/__tests__/stream.spec.tspersonal分支 DockerHub Image 构建已通过。