Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Responses replay puts assistant text between function_call and function_call_output

Aperta
#1,792 0 commenti 0 reazioni 1 assegnatario Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@tombeckenham ci sta già lavorando.

Dal 15/10/2026.

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

waiting-on: maintainer
TanStack AI version
  • @tanstack/ai 0.68.0
  • @tanstack/ai-openai 0.29.1
  • @tanstack/openai-base 0.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.

Lingua principale
TypeScript
Stelle
3.2k
Fork
361
Merge medio
1g 8h
PR unite (30g)
252

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di TanStack/ai

Tutte le issue di TanStack/ai

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.