I am running into another codex/api style bug where setting reasoning from medium, high, xhigh with reasoning summary detailed;
models 5.5, 5.6-sol will thinking or reason until it hits an internal limit and stall before making a decision burning a lot of tokens to learn these lessons and it doesn’t seem like there’s any way to stop it from happening other than trying to break the task into something smaller, but even a small query sometimes does a lot of thinking.
On the API, there is a parameter that can be mis-used: max_output_tokens (or max_completion_tokens on Chat Completions).
The parameter sets a token output budget for an API call. That budget will include not merely seen output, but the internal reasoning is also billed and counted as output tokens.
You further might hit your own limit unexpectedly if using OpenAI’s hosted tools that the model can use with multiple internal calls, meaning multiple output generations are possible in reasoning and calling tools.
You don’t need to set the parameter to a value at all - but the maximum can be quite high with 128000 tokens output per turn, giving potential for hundreds of thousands of tokens in one internal tool use being done over-and-over (such as code interpreter with containers and your coding task).
So: ensure that the maximum tokens parameter is not set too low, and observe the cutoff of the API’s return of “usage” and output tokens within it when you do see this symptom in order to refactor your API call. Otherwise, you might get termination while the AI is still reasoning and before it generates an output.
You request the amount of “burning of tokens” yourself when you set the reasoning.effort parameter to one of the higher settings, especially in conjunction with a more difficult task. OpenAI recommends one step lower reasoning effort on 5.6 as a starting point, since it can do more with less thinking yet often reasons more at the same setting.
Yes, please, if there is anyone that could explain ~/.codex/config.toml or how to get a log of the RESTful transmission over the wire, as it seems my work here is done.