hive-subagent-mcp: check subagent models against the swarm's subagent_models
A `start` or `continue` naming a `model` now reads this agent's key in the `agent-inference` bucket and, when `subagent_models` is set, checks the model against that list instead of HIVE_AVAILABLE_MODELS (agent.nix `availableModels`). An unset field, an absent key or an absent bucket keeps today's check. A read that fails or takes over 2 s falls back to HIVE_AVAILABLE_MODELS with a warning, so a subagent start never waits on the queue. A call without a `model` is not checked and does not read. The read uses the agent's own queue credential through swarm_term's connect, and the one direct-get subject the agent is granted in that bucket. The refusal names the list and that it came from the swarm. Refs #5034 (S5)
This commit is contained in:
parent
971426a1c0
commit
90e6b984eb
9 changed files with 394 additions and 46 deletions
|
|
@ -216,7 +216,7 @@ impl SubagentMcp {
|
|||
you do not have refuses the whole call rather than spawning without it. See the \
|
||||
`base:claude-subagents` skill for when to reach for this."
|
||||
)]
|
||||
fn start(&self, Parameters(args): Parameters<StartArgs>) -> String {
|
||||
async fn start(&self, Parameters(args): Parameters<StartArgs>) -> String {
|
||||
match session::start(
|
||||
&self.state,
|
||||
session::StartRequest {
|
||||
|
|
@ -231,7 +231,9 @@ impl SubagentMcp {
|
|||
max_turns: args.max_turns,
|
||||
report_file: args.report_file,
|
||||
},
|
||||
) {
|
||||
)
|
||||
.await
|
||||
{
|
||||
Ok(msg) => msg,
|
||||
Err(e) => format!("start error: {e:#}"),
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue