fix(agent): propagate reasoning_effort to Ollama + curator fork#25866
Closed
luyao618 wants to merge 1 commit into
Closed
fix(agent): propagate reasoning_effort to Ollama + curator fork#25866luyao618 wants to merge 1 commit into
luyao618 wants to merge 1 commit into
Conversation
Collaborator
Contributor
Author
|
Note for triage: this PR is a superset of #18973 and #20674, which only patch the curator fork's missing |
11 tasks
…Research#25758) Two defects caused agent.reasoning_effort: none to be silently ignored on Ollama-backed custom providers: 1. Custom provider profile only emitted extra_body.think=False, which Ollama's /v1/chat/completions endpoint silently ignores (ollama/ollama#14820). Now also emits top-level reasoning_effort="none" which Ollama respects. 2. Curator's forked AIAgent (_run_llm_review) was created without propagating reasoning_config from the user's config. The fork ran with default medium effort, causing thinking-capable models to spiral (up to 65k output tokens / 28 min GPU blocking). Fixes NousResearch#25758
1109fc6 to
907629f
Compare
19 tasks
14 tasks
Contributor
Author
|
Closing — open too long, no longer relevant. |
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.
Summary
Fixes #25758 —
agent.reasoning_effort: nonewas silently ignored on Ollama-backed custom providers, causing thinking-capable models to spiral (up to 65k output tokens / 28 min GPU blocking).Root Cause
Two distinct defects:
Defect 1 — Custom provider only emits
extra_body.think=Falseplugins/model-providers/custom/__init__.pysetextra_body["think"] = Falsewhen reasoning was disabled, but Ollama's/v1/chat/completionsendpoint silently ignores this field (ollama/ollama#14820). Ollama respects the top-levelreasoning_effortparameter instead.Defect 2 — Curator fork drops
reasoning_configagent/curator.py_run_llm_review()creates a forkedAIAgentwithout passingreasoning_config. The fork defaults tomediumeffort, so even when defect 1 is fixed, background review tasks still think at full intensity. Structurally similar to #15543 (fork missingapi_key/base_url/api_mode).Changes
plugins/model-providers/custom/__init__.pyreasoning_effort="none"as a top-level API kwarg (in addition toextra_body.think=False) when reasoning is disabledagent/curator.pyreasoning_configfromconfig.yamlviaparse_reasoning_effort()and pass it to the forkedAIAgentTesting
pytest -k "custom or curator or reasoning")agent.reasoning_effort: noneand an Ollama endpoint, the API call now includesreasoning_effort="none"at the top level