Skip to main content

Module launch

Module launch 

Source
Expand description

Handing the terminal over to the agent.

Re-exports§

pub use crate::agents::via_gateway::shell_quote;

Structs§

Prepared
A gateway session ready to start.

Functions§

exec_agent
Replace this process with the agent, so the terminal, signals and exit code are the agent’s. Returns only by exiting: 127 when the executable cannot be started.
gateway_setting_env
The environment variable that gives the gateway setting key of the user config, for when the file cannot be written.
gateway_settings_hint
Where the gateway’s settings are made, for somebody whose gateway is not ready or who wants another one.
gateway_summary
What visdom init set up for the gateway, and where each setting comes from.
key_helper_command
The command a launched agent runs to get its gateway key: this visdom, asked for the key of one console and project, of the kind billing.
key_http_client
The HTTP client for getting a key: the agent does not start without it, so it may take longer than a check.
launch_error_message
What to tell the user when the agent’s executable cannot be started.
no_model
Why there is no model alias for agent to ask the gateway for, and what to set: without one the agent asks for its own default, which a project’s allow-list of aliases does not have.
prepare_gateway
Everything the agent needs to run through the gateway: the developer’s key (the kept one, or a new one), a model alias and the ids that attribute the session. The second value holds what the developer should know (no model alias to ask for).
private_dir
Where a launch keeps what must not be on the agent’s command line: the user’s state directory ($XDG_STATE_HOME, ~/.local/state), else visdom’s config directory.
remove_stale_private_files
Remove the Claude Code settings files in dir whose visdom process is gone: they hold a key, and nothing else would remove them.
run_agent_then_remove
Run the agent as a child and exit with its status, removing private_file (the settings that hold a key) once it has exited. Used instead of exec_agent when there is such a file: a replaced process could not remove it.
session_billing
Who pays for a gateway session: the setting where it applies, else the project.
usable_model
Whether model is one the agent can ask the gateway for: an alias the key may call. Err says what is wrong and what to set — no alias at all (no_model), or one (set at source) that the project does not have.