Expand description
A Claude Code agent pointed at a server of its own: ANTHROPIC_BASE_URL in its environment names
something other than Anthropic (a local model, a LAN server, a proxy; set by an agent through
Agents env_set or by the person in My Agents).
The rule, applied to every spawn after the account’s credentials were put in the environment: the person’s Claude sign-in goes only to Anthropic. Whatever the account injected (its config directory with the OAuth login, an OAuth token variable, an API key) is taken out, the CLI is given a private config directory with no sign-in in it, and its credentials are only what the agent’s own environment gave it: a Vault entry the person opened to that agent, a placeholder for a server that ignores the key, or nothing (then a placeholder, so the CLI does not fall back to asking for a sign-in). Otherwise the sign-in would go to the other server, over plain HTTP for a LAN one.
An agent on a model route (model_gateway) is not touched here: the route’s own variables are put
in after this step and name srv’s gateway, which holds the key.
Structs§
- Endpoint
- What the agent’s own environment (
cmd:env, before the account’s variables) asks for.
Constants§
- NO_
KEY_ PLACEHOLDER - The key the CLI is given when the agent’s environment gave none: a value, so it never asks for a sign-in, and one that is no credential.
Functions§
- apply
- Takes the account’s login out of
envand gives the CLI the endpoint and the keys the agent’s own environment asked for.resolve_vaultturns an entry id into its value, orNonewhen the agent may not have it (the key is then left out: never a fallback to another key). - own_
claude_ endpoint - Whether a spawn brings its own Claude endpoint: the pane runs Claude Code and
own(its own environment,cmd:env) names a model server other than Anthropic’s. The spawn and the quiet recheck of a held message’s gate (server/jekt_held.rs) both ask this, so a held message is released exactly when the spawn would pass. - own_
claude_ endpoint_ of own_claude_endpointfor a block’s owncmd:env, as a spawn reads it.- private_
config_ dir - Where the CLI’s private config directory is for this agent on the server at
base_url: beside the shared one, never in it, so no sign-in is ever visible there. The address is part of the name, so a conversation belongs to the server it was held with: pointing the agent at another server (or back) gives the CLI a directory that does not hold it, and the next launch cannot resume it there (--resumeis a lookup in this directory), where one folder per agent would send A’s history to B. - requested
- The custom endpoint
own(the agent’s own environment) asks for, orNonewhere it names none or names Anthropic’s own API.