Skip to main content

Module agent_model

Module agent_model 

Source
Expand description

The composer’s model panel, srv’s half (docs/specs/SPEC_AGENT_MODEL_ROUTES_ANY_MODEL_SPAWN_AND_SWITCH_2026_11_06.md section 7a). agent.model.panel says what the panel may offer for a pane’s agent and what cannot be picked, with the reason; agent.model.switch is a person’s pick: it moves the agent to a model on a route, or back to the harness’s own sign-in, and restarts its panes so the next turn runs there. Both are the operator’s window only: the click is the approval of the spend, which an agent cannot give for itself.

Structs§

AgentModelPanel
AgentModelPanelModel
AgentModelPanelReq
AgentModelPanelRoute
AgentModelPlace
A route and model the agent is on or was on. An empty route is the harness’s own sign-in.
AgentModelSwitchReq
AgentModelSwitchResult
AgentPeerLabels
What agent.peer-labels answers.

Enums§

Fit 🔒
Whether a conversation of tokens fits the model’s context: as it is, only once compacted (Some with the sizes, to say so), or not even then.

Constants§

COMPACTED_TOKENS 🔒
What a conversation is taken to need after /compact: the summary, the system prompt and the tool definitions. A model whose context is smaller than the conversation can still take it compacted when its context is above this.
REREAD_WARNING_TOKENS 🔒
A conversation over this many tokens makes a switch worth a warning: the new model reads all of it again at full input price, because a prompt cache belongs to one model.
SLOW_REQUEST_MS 🔒
A request slower than this is worth a line in the log: the panel is waiting for it with its harness models showing.

Functions§

agent_of_block 🔒
check_fresh 🔒
What a fresh session on a model change needs, checked before anything is changed: a handoff within the limit, and every pane of the agent able to start a fresh session (the test Agents fresh applies to its own pane).
fit 🔒
fresh_refused 🔒
What a refused fresh session says: why, and what to do instead.
images_in_conversation 🔒
The images in the agent’s conversation, as its transcript lists them: the pane’s own count only sees the feed it has loaded, and a text-only model chosen for a conversation that still holds an image fails on it. 0 when it is not known.
images_known 🔒
The images in the conversation as far as they are known without reading the transcript, and the count started in the background for the next time. The first count of a big agent’s transcript takes longer than the panel’s request has, and a panel that times out shows the harness’s own models alone. 0 when it is not known.
kilo 🔒
logged 🔒
What became of a request from the window. Nothing else records it: a refused or failed one reaches only the pane, and the pane had nothing to say about a panel it could not read.
panel 🔒
panel_model 🔒
peer_label 🔒
The model and route an agent with choice runs on harness, or None when it has no choice or the saved one no longer validates (the launch falls back to the harness’s own sign-in then, so the label must too).
peer_labels 🔒
place 🔒
place_label 🔒
Where the agent is moved to, as its first message says it: the model’s name and its route, or the harness’s own sign-in.
refuse_unreadable 🔒
A model that cannot read the images in the conversation is refused, with the reason the panel gives for it. A route or model that does not validate is left to the switch, which says so.
register
Both commands are the window’s: an agent may change its own model through Agents update, which stays on its route and is counted against its hourly limit.
restart_panes 🔒
Restarts the agent’s panes on its new place, and ends the access of a route it left when no relaunch is coming to do it: the pane restarts at the end of its turn, and its relaunch is what takes the old route’s token away.
start_fresh_panes 🔒
Starts the fresh sessions of a model change. A running pane ends its session when its turn ends and starts the new one with message, on the model the agent is set to now; a pane with no controller (a stopped agent) forgets the session it would resume, so its next start begins a new one. Returns how many panes will start fresh, and what could not.
switch_model 🔒
unavailable 🔒
Why the model cannot be picked now, if it cannot.
yes 🔒