agents: remove the hive-level /effort control too
mara on #5034: "effort shares /models fate". The per-agent web UI no longer sets effort: the `/effort` slash command, the effort picker, `POST /api/effort`, `Bus::set_effort`, the `hyperhive-effort` writer, `EFFORT_LEVELS`/`is_valid_effort` and the ACP effort-list payload are gone, and `lib/modelEffort.ts` with them. The effort chip is display-only and shows its source (`effort_source` in `/api/state`); on ACP it stays hidden while the session offers no effort level. The read side is unchanged: with no swarm value an agent runs an existing `hyperhive-effort` file, else its agent.nix effort, else medium. Existing files are not touched. Refs #5034
This commit is contained in:
parent
594693f4c7
commit
ed271e655f
25 changed files with 170 additions and 464 deletions
|
|
@ -47,21 +47,20 @@ at a given viewport width. Two columns:
|
|||
`◌ needs login` / `◌ logging in` / `○ offline` / `… connecting`.
|
||||
- **State badge**: `💤 idle` / `🧠 thinking` / `📦 compacting` /
|
||||
`○ offline` / `… booting` + age suffix.
|
||||
- **Model badge** (`model · <name>`): display only. Its tooltip says where
|
||||
the model comes from (`state.model_source`: set on the swarm, agent.nix,
|
||||
an existing `hyperhive-model` file, or the built-in default) and what the
|
||||
last turn resolved it to. The model is set on the swarm: the swarm UI's
|
||||
agents page, or `swarmctl agent inference set`
|
||||
- **Model and effort badges** (`model · <name>`, `effort · <level>`):
|
||||
display only. Each tooltip says where the value comes from
|
||||
(`state.model_source` / `state.effort_source`: set on the swarm,
|
||||
agent.nix, an existing `hyperhive-model` / `hyperhive-effort` file, or
|
||||
the built-in default); the model's also says what the last turn
|
||||
resolved it to. Both are set on the swarm: the swarm UI's agents page,
|
||||
or `swarmctl agent inference set`
|
||||
([`inference.md`](../swarm/inference.md)).
|
||||
- **Effort badge** (`effort · <level> ▾`): a real picker — selecting it
|
||||
opens a `Dropdown` of `state.available_efforts` and POSTs `/api/effort`
|
||||
immediately. Shown when `state.available_efforts` is non-empty.
|
||||
- On an ACP agent the model badge shows the session's own model when it
|
||||
doesn't offer the requested one, and the effort picker lists the levels
|
||||
its session offers (its `thought_level` config option), empty until the
|
||||
first turn has attached a session. The effort picker is hidden when the
|
||||
model offers no effort levels, and while a newly picked model waits for
|
||||
the next turn, since the levels come with the model.
|
||||
- On an ACP agent each badge shows the session's own value when it
|
||||
doesn't offer the requested one. The effort badge is hidden
|
||||
(`state.effort` is `null`) until the first turn has attached a
|
||||
session, when the model offers no effort levels, and while a newly
|
||||
set model waits for the next turn, since the levels come with the
|
||||
model.
|
||||
- **Ctx / cost badges**: `ctx · 142k` (last inference's prompt size,
|
||||
tooltip shows % of context window) / `cost · 1.3M` (cumulative
|
||||
tokens billed across every inference in the last turn).
|
||||
|
|
@ -85,8 +84,8 @@ at a given viewport width. Two columns:
|
|||
(`GET /api/state`'s `links` field) also feeds
|
||||
`DashboardState.links` for the dashboard card's icon strip —
|
||||
`agent_links()` in hive-agent is the single source of truth for
|
||||
both. The dashboard link lives in this 🔗 popover; the effort picker
|
||||
is a real badge above; and `/new-session` / `/logout` are
|
||||
both. The dashboard link lives in this 🔗 popover, and
|
||||
`/new-session` / `/logout` are
|
||||
typed slash commands with their own type-twice confirm (see
|
||||
below).
|
||||
- `/cancel` (slash command, below) is the only cancel-turn path; the
|
||||
|
|
@ -237,10 +236,6 @@ Slash commands today:
|
|||
runs the `/compact` at the next turn boundary (end of the in-flight
|
||||
turn, or `turn::run_pending_compact` when idle); output streams into
|
||||
the live panel. Works mid-turn, not only when idle.
|
||||
- `/effort <level>` — `POST /api/effort` setting the claude effort
|
||||
level (`low` / `medium` / `high` / `xhigh` / `max`). Takes effect on the next
|
||||
turn. `StatusChips`' effort badge calls the same endpoint; both stay
|
||||
in sync via `StateSnapshot.effort`.
|
||||
- `/new-session` — `POST /api/new-session` (confirms first).
|
||||
Arms a one-shot on the Bus; next turn runs without
|
||||
`--continue`, dropping the resume session entirely.
|
||||
|
|
@ -275,15 +270,6 @@ shaped).
|
|||
turn — only the stdin payload differs). Flips state to
|
||||
`Compacting` via `Bus::set_state`, which emits
|
||||
`TurnStateChanged`.
|
||||
- `POST /api/effort` (`effort=<level>`) — switch the claude
|
||||
effort level for future sessions. Validated server-side against
|
||||
`EFFORT_LEVELS` (`low`/`medium`/`high`/`xhigh`/`max`) — unknown values are
|
||||
rejected rather than forwarded to `claude --effort`. Persists via
|
||||
`Bus::set_effort`, which emits `EffortChanged`. Applies on the next
|
||||
session start (no mid-session swap).
|
||||
- On an ACP agent, `/api/effort` accepts only values the session offers,
|
||||
and the runtime sets the level with `session/set_config_option` before
|
||||
the next prompt.
|
||||
- `POST /api/new-session` — arm a one-shot for the next turn to
|
||||
drop `--continue`. Emits a `LiveEvent::Note`.
|
||||
- `POST /api/logout` — three-step teardown that re-uses the
|
||||
|
|
@ -317,7 +303,7 @@ shaped).
|
|||
the frontend (`useAgentState.ts`) on page load and, on a poll, while
|
||||
`status === 'needs_login_in_progress'`. Includes `turn_state`,
|
||||
`context_window_tokens`, `qualified_label`,
|
||||
`model`, `model_source`, `effort`, `available_efforts`, `links`, and
|
||||
`model`, `model_source`, `effort`, `effort_source`, `links`, and
|
||||
other fields described inline throughout this document. All
|
||||
subsequent state updates arrive via SSE.
|
||||
- `GET /api/dashboard-state` — lean snapshot of agent-owned fields
|
||||
|
|
@ -391,9 +377,8 @@ Bus events (new vocabulary on `/events/stream`):
|
|||
429 response and clears it when the retry sleep expires.
|
||||
- `model_changed { model }` — drives the model chip. The harness emits it
|
||||
when it applies or clears a swarm value.
|
||||
- `effort_changed { effort }` — drives the effort picker chip.
|
||||
Emitted from `Bus::set_effort` on `POST /api/effort`; applies on
|
||||
the next session start.
|
||||
- `effort_changed { effort }` — drives the effort chip. The harness
|
||||
emits it when it applies or clears a swarm value.
|
||||
- `token_usage_changed { ctx: TokenUsage, cost: TokenUsage }`
|
||||
— drives the ctx + cost badges. Emitted from
|
||||
`Bus::record_turn_usage` at turn-end; `ctx` is the last
|
||||
|
|
|
|||
Loading…
Reference in a new issue