Summary
On a fresh macOS DMG install (unmodified), using GPT-5.4-mini or GPT-5.6-Luna as the main model causes every chat turn to fail immediately. The request reaches OpenAI successfully but is rejected with HTTP 400 because tinyagents sends max_tokens — a parameter these GPT-5.x models do not accept. The correct parameter is max_completion_tokens.
Problem
Exact error from OpenHuman logs:
tinyagents harness run failed: model error: model error: openai returned HTTP 400
(unsupported_parameter): Unsupported parameter: 'max_tokens' is not supported with
this model. Use 'max_completion_tokens' instead.
OpenAI's GPT-5.x model family (gpt-5.4-mini, gpt-5.6-luna, and likely the full family) dropped support for the max_tokens request field and require max_completion_tokens in its place. tinyagents is sending max_tokens unconditionally, so every turn with one of these models hard-fails before the model produces any output.
This is a parameter name mismatch in the tinyagents request builder — auth and connectivity are fine, the request reaches OpenAI, and OpenAI rejects it at the protocol level.
Reproduction
- Fresh macOS DMG install (no source modifications).
- Set main model to
gpt-5.4-mini or gpt-5.6-luna with a valid OpenAI key.
- Send any chat message.
- Result: immediate failure, no response, HTTP 400 in logs.
Confirmed on:
gpt-5.4-mini
gpt-5.6-luna
Root cause
tinyagents constructs the OpenAI chat completion request with max_tokens. For GPT-5.x models this field must be max_completion_tokens. The fix needs to be applied at the request-building layer — either by detecting the model family and switching the field name, or by migrating to max_completion_tokens across the board (OpenAI accepts it for older models too).
Solution
- Replace
max_tokens with max_completion_tokens in the tinyagents OpenAI request builder.
- Audit other OpenAI-compatible parameters that may have similar deprecation gaps in the GPT-5.x family.
- Regression-test with at least
gpt-5.4-mini and gpt-5.6-luna to confirm chat turns complete successfully.
Acceptance criteria
Related
Summary
On a fresh macOS DMG install (unmodified), using GPT-5.4-mini or GPT-5.6-Luna as the main model causes every chat turn to fail immediately. The request reaches OpenAI successfully but is rejected with HTTP 400 because tinyagents sends
max_tokens— a parameter these GPT-5.x models do not accept. The correct parameter ismax_completion_tokens.Problem
Exact error from OpenHuman logs:
OpenAI's GPT-5.x model family (
gpt-5.4-mini,gpt-5.6-luna, and likely the full family) dropped support for themax_tokensrequest field and requiremax_completion_tokensin its place. tinyagents is sendingmax_tokensunconditionally, so every turn with one of these models hard-fails before the model produces any output.This is a parameter name mismatch in the tinyagents request builder — auth and connectivity are fine, the request reaches OpenAI, and OpenAI rejects it at the protocol level.
Reproduction
gpt-5.4-miniorgpt-5.6-lunawith a valid OpenAI key.Confirmed on:
gpt-5.4-minigpt-5.6-lunaRoot cause
tinyagents constructs the OpenAI chat completion request with
max_tokens. For GPT-5.x models this field must bemax_completion_tokens. The fix needs to be applied at the request-building layer — either by detecting the model family and switching the field name, or by migrating tomax_completion_tokensacross the board (OpenAI accepts it for older models too).Solution
max_tokenswithmax_completion_tokensin the tinyagents OpenAI request builder.gpt-5.4-miniandgpt-5.6-lunato confirm chat turns complete successfully.Acceptance criteria
gpt-5.4-miniorgpt-5.6-lunareturns a response — no HTTP 400unsupported_parametererrors in logs.gpt-4o,gpt-4-turbo, etc.) that currently work.Related
stream=truemissing forgpt-5.6-terraon Linux (different param, same class of bug)