Watch
0
0
Fork
You've already forked hyperhive
0
hyperhive/hive-subagent-mcp/src/lib.rs
atlas 90e6b984eb 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)
2026-10-10 13:58:47 +02:00

25 lines
1.2 KiB
Rust

//! Library for `hive-subagent-daemon`: spawns nested claude sessions on
//! request and serves the `start`/`continue`/`status`/`interrupt` MCP tool
//! surface directly over streamable-http — no stdio bridge, no round-trip
//! socket. Independent of `hive-bash-mcp` — a subagent is a much heavier
//! capability than a bash command (a full nested `claude` process), worth
//! its own deployable/restartable unit rather than sharing one.
//!
//! A second route on the same listener serves `goal_reached`/`need_help` to
//! the *subagents*, which is how a run says it's done or stuck; see
//! [`mcp`]'s module doc for why that is a separate surface rather than two
//! more tools on the parent's, and why it is served per session under a
//! minted token rather than at one shared path — neither tool takes a
//! session name, so a subagent has no way to say it is somebody else.
//!
//! See [`session`]'s module doc for the actual design: no task files, no
//! restart recovery, no mid-turn compaction — the daemon's only state is a
//! handful of in-memory maps, live only as long as the process is.
pub mod mcp;
pub mod mcp_config;
pub mod paths;
pub mod role;
pub mod session;
pub mod swarm_models;
pub mod swarm_term;