Interface: ModeControl
Defined in: core/session.ts:233
The supervision mode of a running session. "guided", "interactive" and "plan" switch into
one another: they share the same tools (the approval tool), and the step gate and the plan
gate are registered in all three, deciding only in their own mode. "autonomous" has no
approval tool at all, and a tool can't appear or vanish mid-session, so a session that
starts autonomous stays autonomous, and one that doesn't can't become autonomous. The
system prompt keeps the mode it was built with, so entering or leaving plan mode is told
to the model with the next message instead (takeNotice()).
Properties
| Property | Modifier | Type | Description | Defined in |
|---|---|---|---|---|
mode | readonly | Mode | - | core/session.ts:234 |
switchable | readonly | readonly Mode[] | The modes this session can be in, in Shift+Tab's order; fewer than two means it can't switch. | core/session.ts:236 |
Methods
set()
set(next): boolean;
Defined in: core/session.ts:238
Switches to next if this session allows it; returns whether it did.
Parameters
| Parameter | Type |
|---|---|
next | Mode |
Returns
boolean
takeNotice()?
optional takeNotice(): string | undefined;
Defined in: core/session.ts:244
The note telling the model it entered or left plan mode, once per change it hasn't been
told about yet; undefined otherwise. createInputQueue({ modeControl }) puts it before
the next message; a caller with its own queue prepends it itself.
Returns
string | undefined