Expand description
An agent’s route and model, and the environment that points its harness at the gateway.
The choice is kept on the agent’s definition as a content blob, so it follows the agent’s id and needs no column. The environment is built at every spawn and never persisted: the token in it lives for this srv launch.
Structs§
Constants§
- BLOCK_
META_ KEY - The block meta key the pane, its footer and its header read for the model the agent really runs: the route’s and the model’s names, or absent on the harness’s own sign-in. Without it they show the harness’s nominal model (the alias the pane was configured with), which on a route is not what answers.
- CONTENT_
TYPE - The definition content type that holds the
Choice. - LEAVING_
TYPE - The definition content type that marks a route the agent has left but whose harness may still be running a turn on it:
the gateway keeps answering that route’s token until the harness is relaunched (
super::switch::finish_leaving).
Functions§
- carry_
for_ block - Adds the gateway environment to the spawn of the agent on
block_idwhen its definition has a route, and records the real model on the pane. Over whatever a persistedcmd:envcarried: these are reserved names, set by srv at every spawn. - choice_
of - The route and model of the agent definition
def_id, if it has chosen one. - env_for
- The variables that point Claude Code at the gateway on
route. The key is not among them: the token is the harness’s whole credential, andANTHROPIC_API_KEYis emptied so no other key is used. - env_
for_ key_ route - The variables that point Claude Code at the gateway’s key route: its address and the agent’s token. No model is
named (the harness asks for the models it always does and the key’s account answers), and
ANTHROPIC_API_KEYis emptied so no other key is used. The key is not among them: it stays in the keychain. - leaving
- The route and model the agent has left but may still be running a turn on, if any.
- model_
on_ route - The model the gateway sends the agent’s requests for
routeto: its chosen one, or, on a route it has just left, the one it was on, so a turn in flight finishes (seesuper::switch::finish_leaving). None: the agent is not set to it. - pane_
meta - What the pane shows for a route and model.
- set_
choice - Saves the agent’s route and model after the shared validation, with the model made explicit.