Repository navigation
Bound compaction reasoning on Gemini and AI/ML API thinking models - #1156
Draft
sosidudku1 wants to merge 2 commits into
Draft
sosidudku1 wants to merge 2 commits into
sosidudku1 wants to merge 2 commits into
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_effortis 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) sendsnoneon 2.5 Flash and Flash-Lite instead, since Flash-Lite does not think by default andlowwould turn thinking on.gpt-5-chatids 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.