From 2717c2f305ecddf5bc30300eb16f7394e9565160 Mon Sep 17 00:00:00 2001 From: iris Date: Thu, 2 Jul 2026 21:34:36 +0200 Subject: [PATCH] docs(web-ui/agent): add POST /api/effort and effort_changed to endpoint + event list --- docs/web-ui/agent.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/docs/web-ui/agent.md b/docs/web-ui/agent.md index 0723c8c1..1206ba35 100644 --- a/docs/web-ui/agent.md +++ b/docs/web-ui/agent.md @@ -282,6 +282,12 @@ shaped). `TurnStateChanged`. - `POST /api/model` (`model=`) — switch the model for future turns. `Bus::set_model` emits `ModelChanged`. +- `POST /api/effort` (`effort=`) — 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