✓ PASS

tanstack-ai 1.4.0

truncation.tool-call-args-stream · openai-chat

Back to results · Scenario

Requirements

IdLevelStatusEvidence
no-complete-partial-callMUSTSATISFIEDoutcome=returned; error signalled
cause-is-truncationMUSTSATISFIEDfinish.value="length" (primary: RUN_FINISHED.metadata.tanstack.finishReason); truth.finish="length"; error.category="other"; structured.returned_as_success=false

What the provider sent

Finish
length
Raw finish
length
Text
null
Tool calls
[
  {
    "arguments": null,
    "arguments_parsed_ok": false,
    "arguments_raw": "{\"title\":\"Weekend Pottery Workshop\",\"",
    "id": "call_DkXNh5JdHW4s54IKfPr4dP1U",
    "name": "create_event"
  }
]
Usage
{
  "alternatives": {},
  "cached_input": null,
  "input": null,
  "output": null,
  "raw": null,
  "reasoning": null,
  "total": null
}
Stream completed
true
Error
null
Wire excerpt
status: 200
content-type: text/event-stream; charset=utf-8
body (sse):
data: {"id":"chatcmpl-EXmWbuEH1m1F3czcaV6FIXqLd54H7","object":"chat.completion.chunk","created":1791720061,"model":"gpt-6-luna","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"call_DkXNh5JdHW4s54IKfPr4dP1U","type":"function","function":{"name":"create_event","arguments":""}}],"refusal":null},"finish_reason":null}],"obfuscation":"AoLyAol"}


data: {"id":"chatcmpl-EXmWbuEH1m1F3czcaV6FIXqLd54H7","object":"chat.completion.chunk","created":1791720061,"model":"gpt-6-luna","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"{\""}}]},"finish_reason":null}],"obfuscation":"q3"}


data: {"id":"chatcmpl-EXmWbuEH1m1F3czcaV6FIXqLd54H7","object":"chat.completion.chunk","created":1791720061,"model":"gpt-6-luna","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"title"}}]},"finish_reason":null}],"obfuscation":""}


data: {"id":"chatcmpl-EXmWbuEH1m1F3czcaV6FIXqLd54H7","object":"chat.completion.chunk","created":1791720061,"model":"gpt-6-luna","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\":\""}}]},"finish_reason":null}],"obfuscation":""}


data: {"id":"chatcmpl-EXmWbuEH1m1F3czcaV6FIXqLd54H7","object":"chat.completion.chunk","created":1791720061,"model":"gpt-6-luna","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"Weekend"}}]},"finish_reason":null}],"obfuscation":"MHeTX929pznvFG"}


data: {"id":"chatcmpl-EXmWbuEH1m1F3czcaV6FIXqLd54H7","object":"chat.completion.chunk","created":1791720061,"model":"gpt-6-luna","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" Pot"}}]},"finish_reason":null}],"obfuscation":"X"}


data: {"id":"chatcmpl-EXmWbuEH1m1F3czcaV6FIXqLd54H7","object":"chat.completion.chunk","created":1791720061,"model":"gpt-6-luna","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"tery"}}]},"finish_reason":null}],"obfuscation":"v"}


data: {"id":"chatcmpl-EXmWbuEH1m1F3czcaV6FIXqLd54H7","object":"chat.completion.chunk","created":1791720061,"model":"gpt-6-luna","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" Workshop"}}]},"finish_reason":null}],"obfuscation":"eBxdZFJ0AQaC"}


data: {"id":"chatcmpl-EXmWbuEH1m1F3czcaV6FIXqLd54H7","object":"chat.completion.chunk","created":1791720061,"model":"gpt-6-luna","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\",\""}}]},"finish_reason":null}],"obfuscation":""}


data: {"id":"chatcmpl-EXmWbuEH1m1F3czcaV6FIXqLd54H7","object":"chat.completion.chunk","created":1791720061,"model":"gpt-6-luna","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{},"finish_reason":"length"}],"obfuscation":"ppOIfIY"}


data: [DONE]

What the library reported

Outcome
returned
Finish
{
  "raw": null,
  "source": "RUN_FINISHED.metadata.tanstack.finishReason",
  "surface": "primary",
  "value": "length"
}
Text
Value
null
Surface
absent
Tool calls
[
  {
    "arguments": null,
    "arguments_parsed_ok": false,
    "arguments_raw": "{\"title\":\"Weekend Pottery Workshop\",\"",
    "id": "call_DkXNh5JdHW4s54IKfPr4dP1U",
    "name": "create_event"
  }
]
Usage
{
  "cached_input": null,
  "input": null,
  "output": null,
  "reasoning": null,
  "surface": {
    "cached_input": "absent",
    "input": "absent",
    "output": "absent",
    "reasoning": "absent",
    "total": "absent"
  },
  "total": null
}
Stream
{
  "chunks_seen": 13,
  "completed": true,
  "used": true
}
Error
Type
TOOL_CALL_RESULT
Message
The answer stopped at the output limit, so no tool call in it ran. Send the tool calls again. Do not repeat text you already wrote. If one call has a large input, split the work into smaller calls.
Category
other
Retry after
null
Stack top
null
Unsupported reason
null
Full observation JSON
{
  "elapsed_ms": 176.29159000000004,
  "error": {
    "category": "other",
    "message": "The answer stopped at the output limit, so no tool call in it ran. Send the tool calls again. Do not repeat text you already wrote. If one call has a large input, split the work into smaller calls.",
    "retry_after": null,
    "stack_top": null,
    "type": "TOOL_CALL_RESULT"
  },
  "finish": {
    "raw": null,
    "source": "RUN_FINISHED.metadata.tanstack.finishReason",
    "surface": "primary",
    "value": "length"
  },
  "format": "wiretruth.observation/v1",
  "library": {
    "api": "chat",
    "language": "javascript",
    "name": "tanstack-ai",
    "version": "1.4.0"
  },
  "notes": [],
  "outcome": "returned",
  "stream": {
    "chunks_seen": 13,
    "completed": true,
    "used": true
  },
  "structured": {
    "attempted": false,
    "returned_as_success": false,
    "value": null
  },
  "text": {
    "surface": "absent",
    "value": null
  },
  "tool_calls": [
    {
      "arguments": null,
      "arguments_parsed_ok": false,
      "arguments_raw": "{\"title\":\"Weekend Pottery Workshop\",\"",
      "id": "call_DkXNh5JdHW4s54IKfPr4dP1U",
      "name": "create_event"
    }
  ],
  "unsupported_reason": null,
  "usage": {
    "cached_input": null,
    "input": null,
    "output": null,
    "reasoning": null,
    "surface": {
      "cached_input": "absent",
      "input": "absent",
      "output": "absent",
      "reasoning": "absent",
      "total": "absent"
    },
    "total": null
  }
}

Fixture

recorded openai-chat/truncation.tool-call-args-stream

ProvenanceValue
Recorded at2026-10-11T12:01:01Z
Requested modelgpt-6-luna
Returned modelgpt-6-luna
CI runhttps://github.com/kartsan03/wiretruth/actions/runs/38137650119

Reproduce

wiretruth serve openai-chat/truncation.tool-call-args-stream

Plain-library snippet from the shim manifest.

createOpenaiChatCompletions(model, apiKey, { baseURL: WIRETRUTH_BASE_URL_OPENAI_CHAT }); POST /v1/chat/completions. https://tanstack.com/ai/latest/docs/adapters/openai#chat-completions-api

Upstream

released Issue · PR

Fixed in: @tanstack/openai-base 1.0.0 (@tanstack/ai-openai 1.0.0)

@tanstack/openai-base Chat Completions picks tool_calls over a pending finish_reason "length" once TOOL_CALL_END was emitted for the unfinished arguments. The core then treats the arguments as a parse failure and the agent loop sends the conversation back to the model: 5 requests in the fixture replay. Fixed by #1874: a pending 'length' now wins over the tool-call flag, so 1.0.0 reports length and sends one request.

History

VersionGrade
1.4.0✓ PASS
1.0.0✓ PASS
0.71.0✗ WRONG