Skip to content

feat(llm): forward configured reasoning_effort to native LLM calls - #26

Merged
LZH-YS1998 merged 2 commits into
HKUDS:mainfrom
cgycorey:feat/llm-reasoning-effort
Aug 6, 2026
Merged

feat(llm): forward configured reasoning_effort to native LLM calls#26
LZH-YS1998 merged 2 commits into
HKUDS:mainfrom
cgycorey:feat/llm-reasoning-effort

Conversation

@cgycorey

@cgycorey cgycorey commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

What

Adds an optional reasoning_effort field to LLMConfig (e.g. low/medium/high/max) and forwards it to litellm.acompletion in both chat() and chat_stream() when set.

Why

Native (OpenOPC Native agent) LLM calls had no way to control model reasoning effort. The field is opt-in: unset by default, so non-OpenAI providers and existing configs are unaffected. Callers can still override per-call via kwargs (the injection skips when reasoning_effort is already present).

Scope

  • Native LLMProvider calls only (both streaming and non-streaming paths — these are the only two litellm.acompletion call sites in the codebase).
  • Subagents inherit the field automatically via config.model_copy(deep=True).
  • External agents (codex/claude/cursor/opencode) are out of scope: they do not use LLMProvider.

Tests

tests/test_llm_provider_reasoning_effort.py — 4 tests covering config retention, chat forwarding, chat_stream forwarding, and the unset default (no param added). All pass locally.

Add an optional reasoning_effort field to LLMConfig (e.g. low/medium/high/max)
and forward it to litellm.acompletion in both chat() and chat_stream() when
set. Unset by default so non-OpenAI providers are unaffected. Callers can
still override per-call via kwargs.
@cgycorey
cgycorey force-pushed the feat/llm-reasoning-effort branch from e57c7e4 to 02290b3 Compare August 1, 2026 10:57
@LZH-YS1998
LZH-YS1998 merged commit cf963be into HKUDS:main Aug 6, 2026
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.

2 participants