Skip to main content

Module switch

Module switch 

Source
Expand description

Moving an agent to another route or model in place (spec section 7a): what is recorded, and the guard on how often an agent may do it. The harness never changes. Restarting the panes at a turn boundary is the caller’s: the choice is read at every spawn, so recording it is what makes the next launch use it.

Structs§

Moved
What a change did.
Previous
What the agent ran on before its last change, for the panel’s “Back” row. An empty route is the harness’s own sign-in, whose model is the agent’s runtime setting and not kept here.

Enums§

Target
Where a change takes an agent.

Constants§

AGENT_SWITCHES_PER_HOUR
How many times an agent may change its own model in an hour: each change costs the prompt cache (decision D12).
PREVIOUS_TYPE
The definition content type that holds the Previous.

Functions§

agent_switch_allowed
Whether an agent may change its own model now: it has made fewer than AGENT_SWITCHES_PER_HOUR changes in the last hour. Counts nothing; count_agent_switch is called once the change has been made, so a refused one costs none. A person’s change in the panel is not counted at all.
count_agent_switch
Counts one change the agent made to its own model.
finish_leaving
Ends the access of a route the agent has left: the harness has been relaunched without it, or nothing is left to relaunch. Until then the gateway keeps answering its token, so a turn in flight is not cut off.
finish_leaving_after_relaunch
finish_leaving for a relaunch of the pane this_block, unless another pane of the same agent is still in a turn: its harness holds the old route’s token until its own (deferred) relaunch, which is then the one that ends the access.
move_to
Records the agent’s move to target, after the shared validation and with its old place kept as previous. key_present says whether a route’s key is in the Vault: a route without one is not moved to. Leaving a route keeps its gateway token until the harness is relaunched (finish_leaving), so a turn in flight finishes.
pane_in_a_turn
Whether the pane is in a turn: its harness holds the old route’s token until the turn ends.
previous_of
The previous route and model of the agent definition def_id.