Skip to content

fix(agent): propagate reasoning_effort to Ollama + curator fork#25866

Closed
luyao618 wants to merge 1 commit into
NousResearch:mainfrom
luyao618:fix/reasoning-effort-ollama-curator-propagation
Closed

fix(agent): propagate reasoning_effort to Ollama + curator fork#25866
luyao618 wants to merge 1 commit into
NousResearch:mainfrom
luyao618:fix/reasoning-effort-ollama-curator-propagation

Conversation

@luyao618

Copy link
Copy Markdown
Contributor

Summary

Fixes #25758agent.reasoning_effort: none was 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=False

plugins/model-providers/custom/__init__.py set extra_body["think"] = False when reasoning was disabled, but Ollama's /v1/chat/completions endpoint silently ignores this field (ollama/ollama#14820). Ollama respects the top-level reasoning_effort parameter instead.

Defect 2 — Curator fork drops reasoning_config

agent/curator.py _run_llm_review() creates a forked AIAgent without passing reasoning_config. The fork defaults to medium effort, so even when defect 1 is fixed, background review tasks still think at full intensity. Structurally similar to #15543 (fork missing api_key/base_url/api_mode).

Changes

File Change
plugins/model-providers/custom/__init__.py Emit reasoning_effort="none" as a top-level API kwarg (in addition to extra_body.think=False) when reasoning is disabled
agent/curator.py Resolve reasoning_config from config.yaml via parse_reasoning_effort() and pass it to the forked AIAgent

Testing

  • All 889 existing tests pass (pytest -k "custom or curator or reasoning")
  • Manual verification: with agent.reasoning_effort: none and an Ollama endpoint, the API call now includes reasoning_effort="none" at the top level

@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/agent Core agent loop, run_agent.py, prompt builder comp/plugins Plugin system and bundled plugins provider/ollama Ollama / local models labels May 14, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

This PR supersedes #18973 and #20674 (both fix only the curator fork's missing reasoning_config). This PR fixes both that defect and the Ollama extra_body.think=False being silently ignored. Related: #11520, #12914 (scope think=False to Ollama only — partially overlapping with defect 1 here).

@luyao618

Copy link
Copy Markdown
Contributor Author

Note for triage: this PR is a superset of #18973 and #20674, which only patch the curator fork's missing reasoning_config. This PR fixes both that defect AND the Ollama extra_body.think=False being silently ignored — so closing those in favor of this one would resolve all reported instances of #25859-class issues at once.

…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
@luyao618

Copy link
Copy Markdown
Contributor Author

Closing — open too long, no longer relevant.

@luyao618 luyao618 closed this May 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/agent Core agent loop, run_agent.py, prompt builder comp/plugins Plugin system and bundled plugins P2 Medium — degraded but workaround exists provider/ollama Ollama / local models type/bug Something isn't working

Projects

None yet

2 participants