Skip to content

fix(acp): support per-session reasoning effort for thinking control (#78229) - #78295

Open
kyssta-exe wants to merge 1 commit into
NousResearch:mainfrom
kyssta-exe:auto-fix/issue-78229
Open

fix(acp): support per-session reasoning effort for thinking control (#78229)#78295
kyssta-exe wants to merge 1 commit into
NousResearch:mainfrom
kyssta-exe:auto-fix/issue-78229

Conversation

@kyssta-exe

Copy link
Copy Markdown
Contributor

Closes #78229

Problem

When using Hermes via the ACP protocol, there is no way to enable/disable thinking or set the reasoning effort level for a model. The thinking configuration is entirely determined by the static config.yaml default and cannot be changed per-session or per-model-switch through ACP. The TUI Gateway already supports reasoning_effort in session.create via parse_reasoning_effort(), and agent/agent_init.py accepts reasoning_config — the gap is purely in the ACP adapter wiring.

Fix

  • acp_adapter/server.py: set_session_model now accepts an optional reasoning_effort kwarg (both reasoning_effort and reasoningEffort spellings, passable via ACP _meta or direct param) and rebuilds the agent with the parsed reasoning_config. new_session accepts the same kwarg for session creation.
  • acp_adapter/session.py: SessionState carries reasoning_config so model switches without an explicit effort preserve the session override; _make_agent threads it into the AIAgent; it is persisted in session model_config and restored on session restore/fork.

ACP clients can now send e.g. {"method": "session/set_session_model", "params": {"modelId": "...", "sessionId": "...", "reasoningEffort": "high"}} to control thinking per session, matching TUI Gateway capability.

Tests

  • tests/acp/test_session.py: create passes reasoning_config to agent, absent config omits the kwarg, fork preserves it, persist round-trip keeps it.
  • tests/acp/test_server.py: set_session_model accepts snake/camel effort, keeps existing config when omitted, new_session accepts effort, parser handles empty/invalid values.
  • Full tests/acp/ suite: 135 passed.

…ousResearch#78229)

The ACP adapter had no way to enable/disable thinking or set the
reasoning effort level for a model — thinking behavior was pinned to the
static config.yaml default. The TUI Gateway already supports
reasoning_effort in session.create via parse_reasoning_effort() and the
core agent init accepts reasoning_config; only the ACP adapter wiring was
missing.

- set_session_model now accepts an optional reasoning_effort kwarg (both
  reasoning_effort and reasoningEffort spellings, e.g. via ACP _meta) and
  rebuilds the agent with the parsed reasoning_config
- new_session accepts the same kwarg for session creation
- SessionState carries reasoning_config so model switches without an
  explicit effort keep the session override
- reasoning_config is persisted in session model_config and restored on
  session restore/fork
- regression tests for create, fork, persist round-trip, and the ACP
  handler-level parsing
@alt-glitch alt-glitch added type/feature New feature or request P4 Best-effort: we will get to it when we get to it (no commitment) comp/acp Agent Communication Protocol adapter labels Aug 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/acp Agent Communication Protocol adapter P4 Best-effort: we will get to it when we get to it (no commitment) type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: ACP path cannot control model thinking (reasoning effort) — missing feature parity with TUI Gateway

2 participants