Watch
0
0
Fork
You've already forked hyperhive
0

hive-runtime, hive-agent: model/effort picker for ACP agents from configOptions

An ACP agent's model and effort pickers now list what its session offers
(its `model` and `thought_level` config options) instead of the claude
model list and EFFORT_LEVELS. A pick goes through the same Bus::set_model /
Bus::set_effort -> Config.model / Config.effort path as on claude; before
each prompt the ACP runtime sets it with `session/set_config_option`, model
first, and only when the session offers that value. Options are re-read
from the set response and from `config_option_update`, so the effort picker
disappears when the chosen model offers no effort levels, and is hidden
while a newly picked model waits for the next turn.

The session's options reach the web UI through a `Choices` handle from a
new `Runtime::choices`, registered on the bus the way `canceller` is.
/api/model and /api/effort accept only offered values on ACP. The claude
path is unchanged.

Refs #4391
This commit is contained in:
atlas 2026-09-30 07:59:27 +02:00
commit f189724a4c
13 changed files with 559 additions and 44 deletions

View file

@ -1,7 +1,7 @@
# hive-runtime
The layer an agent's turns are driven through: one `Runtime` interface
(`run`, `compact`, `archive`, `canceller`) with a backend per runtime.
(`run`, `compact`, `archive`, `canceller`, `choices`) with a backend per runtime.
- **claude** — `claude --print` through the `hive-claude` crate's
`InfiniteSession`. A pass-through: same spawn, same session handling, same
@ -56,3 +56,14 @@ past the watermark, or on `compact` (the operator's `/compact`, the agent's
window if that is shorter), is cancelled and handled as the case above; the
checkpoint turn is not run a second time. So a compaction always leaves a
smaller session behind, and a failed one is not retried on the next turn.
## ACP backend: model and effort
Before each prompt, `Config::model` and then `Config::effort` are set on the
session with `session/set_config_option`, as the value of its first `model`
and `thought_level` config option. A value the session does not offer, or
already holds, is not sent, so a claude alias such as `haiku` does nothing
on an ACP agent. Model goes first because the effort levels on offer depend
on it. The `Choices` handle (`Runtime::choices`) reads what the session
offers now, including after a `config_option_update`. It is empty until a
session is attached.