Skip to content

The agent that grows with you

docs(tools): say what toolchain_environ drops for a remote client's session

unsupportedpastels306efddd90c4
diff --git a/agent/session_client_env.py b/agent/session_client_env.py
index d4273a4261d..63b6573af52 100644
--- a/agent/session_client_env.py
+++ b/agent/session_client_env.py
@@ -146,13 +146,14 @@ def tool_env() -> dict[str, str]:
def toolchain_environ(base=None) -> dict[str, str]:
"""The environment this session's tool subprocesses start from (``base``: the gateway's). Unbound
- (messaging, cron, Desktop) or a client not attached locally: unchanged. A local shell client's
+ (messaging, cron, Desktop): unchanged. Every client's session drops the gateway's own behaviour
+ values it reads from its client (:func:`session_env`), so tools never see the daemon's ephemeral
+ prompt or provider request in place of the session's. A client not attached locally keeps the
+ host values (``HOST_BEHAVIOUR``) and the rest of the gateway's environment. A local shell client's
session: its toolchain replaces the gateway's, and every toolchain name it did not export (built-in,
or configured for its profile when the session was created) is unset, as in main's process: one
client's venv or GEM_HOME never reaches another's session through the daemon it started. PATH is
- the exception: a client that sent none runs with the gateway's. A shell client's session also drops
- the gateway's own behaviour values it reads from its client (:func:`session_env`): tools never see
- the daemon's ephemeral prompt or provider request in place of the session's."""
+ the exception: a client that sent none runs with the gateway's."""
env = dict(os.environ if base is None else base)
bound = _BOUND.get()
if bound is None: