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:
parent
abd547f600
commit
f189724a4c
13 changed files with 559 additions and 44 deletions
|
|
@ -635,6 +635,16 @@ async fn serve_main<S: Surface>(socket: &Path, poll_ms: u64) -> Result<()> {
|
|||
.await
|
||||
}
|
||||
|
||||
/// Hand the bus the session's handles the web UI reads from outside a turn.
|
||||
fn share_session_handles(bus: &Bus, session: &turn::AgentSession) {
|
||||
if let Some(canceller) = hive_runtime::Runtime::canceller(session) {
|
||||
bus.set_turn_canceller(canceller);
|
||||
}
|
||||
if let Some(choices) = hive_runtime::Runtime::choices(session) {
|
||||
bus.set_session_choices(choices);
|
||||
}
|
||||
}
|
||||
|
||||
/// The long-running message loop. Long-polls the broker via
|
||||
/// `S::recv_next`, drives a turn per message, parks on auth-failed,
|
||||
/// otherwise retries.
|
||||
|
|
@ -662,9 +672,7 @@ async fn serve_loop<S: Surface>(
|
|||
// The durable agent session, built once and reused for every turn +
|
||||
// idle compaction below (it's effectively stateless).
|
||||
let session = turn::make_session(&bus)?;
|
||||
if let Some(canceller) = hive_runtime::Runtime::canceller(&session) {
|
||||
bus.set_turn_canceller(canceller);
|
||||
}
|
||||
share_session_handles(&bus, &session);
|
||||
// Tracks the last observed pause state so the transitions get logged
|
||||
// once each instead of twelve lines a minute while parked.
|
||||
let mut was_paused = false;
|
||||
|
|
|
|||
Loading…
Reference in a new issue