subagent: split session.rs into state, config, run, goal and status modules, and its tests by topic
This commit is contained in:
parent
cd8feedf73
commit
ca16980a06
1 changed files with 5334 additions and 5241 deletions
|
|
@ -16,14 +16,18 @@ its own deployable/restartable unit.
|
|||
One bin (`hive-subagent-daemon`, `src/main.rs`) built from the crate's
|
||||
own lib (`src/lib.rs`):
|
||||
|
||||
- **`session.rs`** — the actual claude-facing logic: `Claude::spawn` +
|
||||
`RunningClaude::wait`/`cancel_handle` (not `InfiniteSession::run`,
|
||||
which has no cancel handle to reach in — see the module doc for the
|
||||
v1 scope this trades away), the turn-continuation loop a `goal`
|
||||
switches on, and the in-memory maps that are the _only_ state this
|
||||
daemon keeps (no task files — a restart stops whatever's running;
|
||||
the actual claude session is the durable store, found again by name
|
||||
via `hive_claude::SessionStore`).
|
||||
- **`session.rs` and `session/`** — the actual claude-facing logic. The
|
||||
entry file has the module doc (the v1 scope: `Claude::spawn` +
|
||||
`RunningClaude::wait`/`cancel_handle` rather than `InfiniteSession::run`,
|
||||
which has no cancel handle to reach in), the shared types and a table of
|
||||
the parts: `session/run.rs` holds `start`, `continue_` and the loop over
|
||||
a run's turns, `session/goal.rs` the goal prompts and the `goal`
|
||||
switch, and `session/state.rs` the in-memory maps that are the _only_
|
||||
state this daemon keeps (no task files — a restart stops whatever's
|
||||
running; the actual claude session is the durable store, found again by
|
||||
name via `hive_claude::SessionStore`). `session/config.rs` and
|
||||
`session/status.rs` hold the run's configuration and what `status` and
|
||||
`interrupt` say.
|
||||
- **`mcp.rs`** — the `rmcp` tool routers (the parent's
|
||||
`start`/`continue`/`status`/`interrupt` on `/mcp`, the subagent's
|
||||
`goal_reached`/`need_help` on `/signal/mcp/<token>`) + `serve_http`.
|
||||
|
|
|
|||
Loading…
Reference in a new issue