Responses replay puts assistant text between function_call and function_call_output
维护者通常 1 天内回复
@tombeckenham 已经在做这个了。
开始于 2026年10月15日。
评估
这个 Issue 还没有评估数据。
描述
TanStack AI version
@tanstack/ai0.68.0@tanstack/ai-openai0.29.1@tanstack/openai-base0.13.1
Provider / API
DeepSeek Responses API, called through TanStack's OpenAICompatibleResponsesAdapter at /responses.
Describe the bug and steps to reproduce it
When an assistant ModelMessage contains both non-empty text content and a function tool call, and the next ModelMessage contains the matching tool result, the shared Responses conversion currently serializes the assistant items in this order:
function_call
message (assistant text)
function_call_output
DeepSeek rejects this request with HTTP 400 and No tool output found for function call.
In a live A/B test using the same tool call and matching call_id, moving the assistant message before the function_call produced this order:
message (assistant text)
function_call
function_call_output
That request succeeded. The call_id and tool output were unchanged. This reproduces with reasoning enabled as well; changing the reasoning item's text representation did not change the result.
Expected behavior
The Responses adapter should avoid placing the assistant message between a function_call and its matching function_call_output, or expose a provider-specific way to choose this serialization order if the current order is intentional for other providers.
Additional context
This seems distinct from the reasoning/function-call replay ordering issue in #1345: here the intervening item is an assistant message, and DeepSeek reports that the corresponding tool output is missing.
The current workaround is a DeepSeek-specific subclass that calls super.convertMessagesToInput(messages), reorders the assistant message before function calls, and leaves the shared tool-output conversion intact.
- 主要语言
- TypeScript
- 星标
- 3.2k
- 派生
- 361
- 平均合并
- 1 天 8 小时
- 30 天内合并 PR
- 252
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
TanStack/ai 的其他 Issue
-
难度 4/5 3-5 天 新手友好度 32/100
维护者通常 1 天内回复
-
move to modelschemas可能已有人在做 @jherr 今天认领。 未关闭has-pr waiting-on: maintainer
维护者通常 1 天内回复
-
Text adapters fail chat()'s adapter constraint under exactOptionalPropertyTypes (midConversationChannels)可能已有人在做 @tombeckenham 于 1 天前认领。 未关闭waiting-on: maintainer
维护者通常 1 天内回复
-
chat(): sign the state of a suspended run so a resume without persistence cannot change it可能已有人在做 @AlemTuzlak 于 2 天前认领。 未关闭waiting-on: maintainer
TanStack/ai#1740 · 2 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
-
@tanstack/ai-anthropic: a stream that fails after message_start loses the call's input usage可能已有人在做 @AlemTuzlak 于 2 天前认领。 未关闭waiting-on: maintainer
TanStack/ai#1735 · 2 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
相似的 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 85/100
juice-shop/juice-shop#3686 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 78/100
dsh-market/dsh-market#877 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
-
enhancement
难度 2/5 1-3 小时 新手友好度 74/100
ScottKirvan/GOMAC#61 ·
-
难度 2/5 1-3 小时 新手友好度 72/100
stellar/stellar-dev-skill#151 ·
维护者通常 1 天内回复