Skip to content

Bound compaction reasoning on Gemini and AI/ML API thinking models - #1156

Draft
sosidudku1 wants to merge 2 commits into
mainfrom
fix/ato-1359-cloud-thinking-compaction
Draft

sosidudku1 wants to merge 2 commits into
mainfrom
fix/ato-1359-cloud-thinking-compaction

Conversation

@sosidudku1

@sosidudku1 sosidudku1 commented Nov 10, 2026 •

Copy link
Copy Markdown
Collaborator

ATO-1359 (leftover of #826). The compaction summary call asks for low reasoning effort, but the field was only sent to OpenRouter and OpenAI-compatible providers. Gemini and AI/ML API got nothing, so a thinking model there (Gemini 2.5 thinks dynamically by default) could reason past the 4096-token headroom and the summary fell back to the crude extractive one.

reasoning_effort is now sent on Gemini for its thinking models (2.5 and 3.x, not image, speech, live or embedding variants) and on AI/ML API for OpenAI reasoning models (o1, o3, o4, gpt-5). A call that asks for no thinking (the compaction summary) sends none on 2.5 Flash and Flash-Lite instead, since Flash-Lite does not think by default and low would turn thinking on. gpt-5-chat ids on AI/ML API are not reasoners and get no field. Other models on those providers keep the body as before. This also applies to any other call that sets a reasoning effort on those models (run-mode effort, fusion worker). Tests added.

Not checked against the live APIs: whether Gemini 3 accepts every effort level, and whether AI/ML API accepts the field for every gpt-5 variant. Non-OpenAI reasoners on AI/ML API (for example deepseek-r1) still rely on the headroom.

Not yet checked on the second Mac.

The compaction summary call asks for low reasoning effort, but the
field was only sent to OpenRouter and OpenAI-compatible providers.
Gemini and AI/ML API got nothing, so a thinking model there could
reason past the 4096-token headroom and the summary fell back to the
crude extractive one.

reasoning_effort is now sent on Gemini for its thinking models (2.5
and 3.x, not image, speech, live or embedding variants) and on AI/ML
API for OpenAI reasoning models (o1, o3, o4, gpt-5). Other models on
those providers keep the body as before, since the field is not
documented for them.

ATO-1359
…5-chat on AI/ML API

A call that asks for no thinking (the compaction summary) sent
reasoning_effort low to Gemini 2.5 Flash-Lite, which does not think by
default, so it turned thinking on. On 2.5 Flash and Flash-Lite such a
call now sends reasoning_effort none. gpt-5-chat ids on AI/ML API are
not reasoners and no longer get the field.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant