docs(web-ui/agent): add POST /api/effort and effort_changed to endpoint + event list

This commit is contained in:
iris 2026-07-02 21:34:36 +02:00 committed by mara
commit 2717c2f305

View file

@ -282,6 +282,12 @@ shaped).
`TurnStateChanged`.
- `POST /api/model` (`model=<name>`) — switch the model for
future turns. `Bus::set_model` emits `ModelChanged`.
- `POST /api/effort` (`effort=<level>`) — switch the claude
effort level for future sessions. Validated server-side against
`EFFORT_LEVELS` (`medium`/`high`/`xhigh`) — 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).
- `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
@ -314,7 +320,7 @@ shaped).
- `GET /api/state` — cold-load snapshot (`StateSnapshot`) consumed by
`app.js` on page load and while `status === 'needs_login_in_progress'`.
Includes `turn_state`, `context_window_tokens`, `qualified_label`,
`available_models`, `links`, and other fields described inline
`available_models`, `available_efforts`, `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
fetched once per running agent by the dashboard's container row to
@ -375,6 +381,9 @@ Bus events (new vocabulary on `/events/stream`):
alive-badge. `rate_limited` is set when the harness detects a
429 response and cleared when the retry sleep expires.
- `model_changed { model }` — drives the model chip.
- `effort_changed { effort }` — drives the effort picker chip.
Emitted from `Bus::set_effort` on `POST /api/effort`; applies on
the next session start.
- `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