fix(acp): support per-session reasoning effort for thinking control (#78229) - #78295
Open
kyssta-exe wants to merge 1 commit into
Open
fix(acp): support per-session reasoning effort for thinking control (#78229)#78295kyssta-exe wants to merge 1 commit into
kyssta-exe wants to merge 1 commit into
Conversation
…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
19 tasks
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.
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.yamldefault and cannot be changed per-session or per-model-switch through ACP. The TUI Gateway already supportsreasoning_effortinsession.createviaparse_reasoning_effort(), andagent/agent_init.pyacceptsreasoning_config— the gap is purely in the ACP adapter wiring.Fix
acp_adapter/server.py:set_session_modelnow accepts an optionalreasoning_effortkwarg (bothreasoning_effortandreasoningEffortspellings, passable via ACP_metaor direct param) and rebuilds the agent with the parsedreasoning_config.new_sessionaccepts the same kwarg for session creation.acp_adapter/session.py:SessionStatecarriesreasoning_configso model switches without an explicit effort preserve the session override;_make_agentthreads it into the AIAgent; it is persisted in sessionmodel_configand 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_modelaccepts snake/camel effort, keeps existing config when omitted,new_sessionaccepts effort, parser handles empty/invalid values.tests/acp/suite: 135 passed.