feat(acp): advertise thought-level session config - #48444
Conversation
Expose ACP's standardized thought_level configOptions selector from hermes acp and map session/set_config_option updates to AIAgent.reasoning_config. This lets ACP clients render a real reasoning-effort dropdown generically while preserving the existing session modes for edit-approval policy. Tests cover the advertised selector and both high/none reasoning updates.
|
Related: #30290 (fix(acp): honor agent reasoning config) and #25364 (reasoning-level selector request). Different mechanism — #30290 honors the existing internal reasoning_config, while this PR advertises the standardized ACP |
tonydwb
left a comment
There was a problem hiding this comment.
Code Review Summary
Verdict: Approved
✅ Looks Good
- Clean feature implementation: Advertises ACP's
thought_levelsession config option and maps it to internalreasoning_config - Well-scoped: Only 2 files (server.py + test), focused on a single concern
- Good test coverage: 3 new tests covering:
new_sessionreturns the config option with correct default (medium)set_config_optioncorrectly mapshightoreasoning_config = {"enabled": True, "effort": "high"}nonecorrectly sets{"enabled": False}
- Proper return value:
set_config_optionreturns updatedconfig_optionsso ACP clients can refresh — not ignored - Follows existing patterns:
_thought_level_current_value()mirrors the existing_edit_approval_policy_for_state()pattern - No debug artifacts or secrets
Minor Note
- The
parse_reasoning_effortimport inside theelifblock is fine (lazy import to avoid circular dependency)
Reviewed by Hermes Agent
teknium1
left a comment
There was a problem hiding this comment.
Thanks for the focused ACP contribution. Current main confirms the feature gap: acp_adapter/server.py:1124-1131 exposes only models/modes, while set_config_option() returns no option state at acp_adapter/server.py:2045-2065.
Problems
acp_adapter/server.py:537-540documents that Zed rendersconfig_optionsin the model-picker slot. Commit029239860intentionally moved edit approval from config options to modes to retain that picker. The addedconfig_optionsresponses would restore the same conflict.- The new live-agent assignment is not durable.
_persist()stores session metadata withoutreasoning_config(acp_adapter/session.py:424-449),_restore()recreates the agent without it (acp_adapter/session.py:544-552), and model switching replaces the agent (acp_adapter/server.py:2010-2017). - Forks are also incomplete:
fork_session()returns models/modes only (acp_adapter/server.py:1243-1247) and creates a fresh agent without carrying reasoning state (acp_adapter/session.py:252-264).
Suggested changes
- Preserve the Zed model-picker behavior while choosing the ACP representation for thought level.
- Make the setting durable across restore, model switch, and fork, with tests for each lifecycle path.
This is an automated hermes-sweeper review.
| session_id=state.session_id, | ||
| models=self._build_model_state(state), | ||
| modes=self._session_modes(state), | ||
| config_options=self._session_config_options(state), |
There was a problem hiding this comment.
Current main deliberately avoids config_options because Zed renders them in the model-picker slot (acp_adapter/server.py:537-540; commit 029239860). Adding this response field would reintroduce that picker regression; please use a representation that preserves model selection or gate it by verified client behavior.
Summary
thought_levelsession config option fromhermes acpsession/set_config_optionforthought_levelintoAIAgent.reasoning_configWhy
ACP v1 defines
configOptionswithcategory: thought_levelfor reasoning-level selectors. Hermes already has internalreasoning_config, but the ACP adapter did not advertise or apply that surface, so clients could not provide a real reasoning-effort dropdown.Related work
thought_leveloption and mapssession/set_config_optionback into that same internalreasoning_config./modelUI.Tests
python -m pytest tests/acp_adapter/test_acp_commands.py::test_acp_new_session_advertises_thought_level_config_option tests/acp_adapter/test_acp_commands.py::test_acp_set_thought_level_updates_agent_reasoning_config tests/acp_adapter/test_acp_commands.py::test_acp_set_thought_level_none_disables_reasoning -q -o 'addopts='python -m pytest tests/acp_adapter -q -o 'addopts='Live probe
Ran the ACP adapter from this worktree over stdio and verified
session/newreturnsconfigOptions[thought_level]with currentmedium, andsession/set_config_optiontohighreturns the updated current value.