fix(acp): expose session model selector via configOptions - #75358
Open
quanrees wants to merge 1 commit into
Open
fix(acp): expose session model selector via configOptions#75358quanrees wants to merge 1 commit into
quanrees wants to merge 1 commit into
Conversation
Newer ACP clients (Zed and others) render their per-session model picker from the ACP-standard configOptions mechanism (a select option with category: "model"), driven by session/set_config_option. Hermes only sent the legacy SessionModelState (models) field, which those clients no longer render, so the model selector disappeared from the editor. Advertise a configOptions model selector on session/new, session/load and session/resume, built from the existing cross-provider inventory (_build_model_state) so it stays in sync with the legacy field, which is retained for older clients. Handle session/set_config_option for configId="model" as a session-scoped switch that mirrors set_session_model and the /model command: it only mutates session state and persists the session row, never writing config.yaml. The response returns the complete configOptions set per the ACP spec. _build_model_state is now built once per session response and reused for both surfaces to avoid rebuilding the (potentially network-bound) inventory twice.
Contributor
|
Thanks for tracing this to the ACP config-options surface. The premise is verified on current main: Problems
Suggested changes
Automated hermes-sweeper review. |
7 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.
What does this PR do?
Restores the per-session model selector in ACP editor clients (Zed and others) by advertising the model list through the ACP-standard
configOptionsmechanism.Problem: Newer ACP clients render their per-session model picker from
configOptions(aselectoption withcategory: "model"), driven bysession/set_config_option. Hermes only sent the legacySessionModelState(models) field, which these clients no longer render — so the model selector disappeared from the editor UI. Users on Zed are left unable to switch models per-session from the panel and must fall back to typing exact/model <version>strings. (Same class of regression reported upstream for other ACP agents: zed-industries/zed #59197, #59096, #59169, #59202.)Fix:
configOptionsmodel selector (category: "model") onsession/new,session/load, andsession/resume, built from the existing cross-provider inventory (_build_model_state) so it stays in sync with the legacy field.modelsfield for older clients (non-breaking).session/set_config_optionforconfigId="model"as a session-scoped switch that mirrorsset_session_modeland the/modelcommand: it only mutates session state and persists the session row, and never writesconfig.yaml.configOptionsset fromset_config_option, per the ACP spec._build_model_stateonce per session response and reuse it for both surfaces to avoid rebuilding the potentially network-bound inventory twice.Type of Change
How to Test
python -m pytest tests/acp/ tests/acp_adapter/ -q→ 141 passed.configOptions-aware ACP client such as Zed, open a Hermes ACP thread; the model selector should listProvider · modelentries.~/.hermes/config.yamldefault should remain unchanged.Platform tested: macOS.
Checklist
category: "model"configOption. feat(acp): advertise thought-level session config #48444 coversthought_levelonly.pytest tests/acp/ tests/acp_adapter/ -qpasses (141)