[Feature] ACP mode has no model picker: no config options and no session/set_config_option #1420
Replies: 2 comments
|
I've implemented this and can offer it per the contribution process (discussion first, PR on maintainer invitation). Branch: https://github.com/seyfal/prime-agent/tree/acp-config-options — one commit touching What it does: Value encoding: Verified live against an authenticated install (built from this branch on Linux, driven over stdio JSONL): Context for appetite: I maintain a T3 Code integration that drives prime-agent over ACP, where this gap currently forces model discovery via Happy to open the PR if a maintainer wants it, and to adjust scope — e.g. dropping the |
|
+1 from me. I use prime agent in emdash, but acp mode is not really usable without being able to set model/thinking. happy to open a pr! |
Uh oh!
There was an error while loading. Please reload this page.
Affected area
Coding agent and CLI (ACP mode)
What is the problem?
ACP mode exposes no way to see or change the session's model.
session/newreturns only asessionId, there is nosession/set_config_optionhandler, and nothing insrc/modes/acp/reads the model catalog. A client is stuck with whatever model the agent started on for the life of the connection.The TUI has a full picker on
/model; over ACP the same session offers nothing./modelis also not usable as a workaround, since it opens a selector UI and has no headless behavior, so submitting it as prompt text just talks to the model about the word "model".This is the "expose model selection" bullet from #1040, which is still open.
Proposed direction
Use ACP's session config options, which are the protocol's model picker (
session/set_modeldoes not exist;configOptionswithcategory: "model"replaced it).session/newreturns:{ "id": "model", "name": "Model", "category": "model", "type": "select", "currentValue": "anthropic/claude-sonnet-4-5", "options": [{ "value": "anthropic/claude-sonnet-4-5", "name": "claude-sonnet-4-5", "description": "anthropic" }] }and
session/set_config_optionswitches the model, answering with the complete configuration state as the spec requires.Details that decide behavior:
provider/idreference — the keyfindExactModelReferenceMatchand the TUI picker already use. The same model id is served by more than one provider, so an id alone does not identify a model. A submitted value is resolved by matching the advertised ids rather than splitting the string, because a model id can itself contain a slash (prime-inference/z-ai/glm-5.2).getAvailableModels()). The TUI lists the rest and starts a sign-in when one is picked; ACP has no sign-in flow, so an unauthenticated model would be a choice that only fails at the next prompt.currentValueis not among its options is worse than no selector.get_available_modelsandset_modelare already daemon commands.Reasoning level (
category: "thought_level") is the obvious next config option, but it is a separate change.Alternatives considered
Advertising every model in the catalog and letting a pick fail on the next prompt: rejected, an ACP client cannot run the sign-in that would fix it.
Grouping options by provider (
SessionConfigSelectGroup): the shipped schema supports it, but the protocol docs only describe the flat form, so a client built from the docs would not render groups. A flat list with the provider as each option's description carries the same information.Putting the picker in the Prime Agent
_metaenvelope: rejected, only a Prime-Agent-aware client would read it, and ACP has the standard field.Additional context
I have a patch locally: ~75 lines in
src/modes/acp/acp-mode.ts, plusdocs/acp.md, the changelog, and two tests intest/suite/acp-mode.test.tsthat drive a real ACP client over an in-memory duplex — one asserts the advertised option and its values, one switches the model and checks that the connection state followed and that an unadvertised value is rejected.npm run checkis clean andtest/suite/acp-mode.test.ts+test/suite/acp-features.test.tsare green (27 tests).One test-infrastructure note that a reviewer would hit: the suite harness registers the faux provider's models on the
ModelRegistrybut not its stream, andModelRegistry.refresh()callsresetApiProviders(), so the first code path that refreshes the model list unregisters the faux api and every later prompt in that harness fails withNo API provider registered for api: faux:.... Carrying the faux stream as the provider'sstreamSimplemakes the refresh restore it (one line intest/suite/harness.ts).Opening this as a Discussion rather than an Issue per the new contribution process; happy to send the patch if a maintainer wants it.
All reactions