Sidekicks and plans API
10 endpoints, split between sidekicks (5) and plans (5).
Sidekicks#
| Method | Path | Purpose |
|---|---|---|
POST |
/v1/rooms/{room_id}/sidekicks |
Spawn. |
GET |
/v1/rooms/{room_id}/sidekicks |
List sidekicks in a room. |
GET |
/v1/rooms/{room_id}/sidekicks/{task_id} |
One sidekick's detail. |
POST |
/v1/rooms/{room_id}/sidekicks/{task_id}/cancel |
Cancel. |
GET |
/v1/sidekicks |
All your active sidekicks across rooms. |
POST /v1/rooms/{room_id}/sidekicks#
json
1 2 3 4 5 6 7 | |
context_mode:
task_only(default) — sidekick sees only its task description.full— gets the parent room's recent history.
Returns:
json
1 2 3 4 5 6 7 8 9 | |
Cancel#
POST .../cancel returns 200 with the updated task. Interrupting
an in-flight ScaiGrid stream is best-effort; the task is marked
terminated regardless.
Plans#
| Method | Path | Purpose |
|---|---|---|
GET |
/v1/rooms/{room_id}/plan |
Active plan for this room (or null). |
GET |
/v1/rooms/{room_id}/plans?limit=20 |
Recent plans (audit). |
POST |
/v1/rooms/{room_id}/plan/pause |
Supervisor pause. |
POST |
/v1/rooms/{room_id}/plan/resume |
Supervisor resume; resets auto-step throttle. |
POST |
/v1/rooms/{room_id}/plan/cancel |
Supervisor cancel; propagates to sidekick venue. |
GET /v1/rooms/{room_id}/plan#
Returns:
json
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | |
Pause / Resume / Cancel#
jsonc
// POST .../pause
{ "reason": "lunch break" }
// POST .../cancel
{ "reason": "scope changed" }
/resume takes no body. It resets consecutive_auto_steps to 0
so the AI has fresh budget after a supervisor nudge.
/cancel is idempotent — cancelling a terminal plan returns it
unchanged.
Permissions#
Any room member can pause / resume / cancel. The user is always a supervisor by project rule; no role gating.
Errors#
SW_PLAN_NOT_FOUND— no active plan in this room.SW_PLAN_NOT_RUNNING— operation requiresstate=running.SW_PLAN_NOT_PAUSABLE— onlyrunningcan be paused.SW_PLAN_NOT_RUNNABLE— onlydraftorpausedcan be run.SW_PLAN_TOO_MANY_STEPS— write tried to submit > 20 steps.SW_PLAN_EMPTY_STEPS/SW_PLAN_EMPTY_GOAL.SW_PLAN_UNKNOWN_STEP— step_id not in the plan.SW_PLAN_STEP_TERMINAL— step already done / failed / skipped.
Sidekick venue cancel propagation#
When plan.venue=sidekick and plan.sidekick_room_id is set, the
cancel handler:
- Looks up the
AgentTaskfor the sidekick room. - Calls
AIBridge.cancel_generation(...)to interrupt any active ScaiGrid stream. - Marks the task
TERMINATEDwith a "plan supervisor: <reason>" summary. - Then sets the plan state to
cancelled.
Order matters — the sidekick's record gets the supervisor reason
in its result_summary, not a generic "plan cancelled".