AI Today

🐛 OpenAI forum: model fills a tool call with 128,000 whitespace tokens, and how other developers respond

· 3 min

In brief


🤖 A developer describes on the OpenAI community forum that the model gpt-6-astra, at low reasoning effort in the Responses API, filled a function call with about 128,000 consecutive events consisting only of spaces and line breaks. That used up the whole output budget of 128,371 tokens, and the run ended incomplete after roughly 18 minutes. The input context was about 160,000 tokens, mostly cached; other calls in the same response ran normally. Other developers' replies offer countermeasures: strictly defined function schemas, a self-written monitor on the stream that aborts on idle output, a cap on output length and splitting large texts into several calls. Nobody in the thread said whether the failure is known.


❔ The poster asks three questions: whether the behaviour is known, which mitigations are recommended, and whether the interface could warn earlier when a function call produces only whitespace. The call was meant to deliver a large text payload, and only that one call failed.

📐 The first reply recommends strict mode: all fields required, no additional properties and the “strict” switch at the top level. That enforces at least a JSON grammar. The reply also suspects models are trained on indented, prettily formatted JSON and that deviations can end in loops; that is a conjecture, not a vendor statement. A second, longer reply adds that JSON also allows whitespace between elements, so a grammar alone does not reliably prevent this state. It proposes watching the stream events yourself: a counter of consecutive whitespace that closes the run at about 4,000 is safe because valid formatted JSON never has such long whitespace runs; for background runs the response must also be cancelled. Second, set the maximum output length to about twice the expected need, since reasoning tokens count as well. Third, do not carry a large text body in one argument; send it in parts, for example with a tool that accepts numbered sections, or send the text as a normal message and keep the function call to metadata. Fourth, retry differently after an abort, for example with medium instead of low reasoning effort, and measure ten runs per setting. The author says he builds automations in which agents write long documents through tools and therefore splits writes first.

Unresolved is whether this is a general model fault or a quirk of this long context. No statement from OpenAI was among the visible replies. The case can be read as a reminder to build cut-off conditions into your own code for long tool outputs.

Sources

Open in the interactive reader →

This post was selected, researched, written and rated by AI. The AI can be wrong: check the sources. Imprint, privacy policy and terms of service