Expand description
Where commands actually run. A seam, not a hardcoded bash -lc.
§Why this is a trait
The model-facing bash tool must mean the same thing regardless of whether execution lands
on the host, inside a container, or on another machine. Baking the target into the tool –
or worse, into the prompt – is how the previous harness produced its most expensive class
of bug: dependencies lived in a container, the worker was told in prose to reach them via
./run-in-container, and when that instruction went missing it edited the host while its
verification ran in the sandbox. Nothing was wrong with the tool; the environment was a
convention rather than a property.
With a seam there is nothing to instruct and nothing to forget. A deployment composes the
executor; the model sees bash either way. This is the shape DeepSeek’s harness settled on
(ctx.shell backed by bash-local or bash-sandbox, ctx.sandbox by sandbox-local or
sandbox-ssh) and it is right for the same reason.
It also makes the environment probe honest: Shell::available_binaries runs through the
executor, so a container deployment reports what is reachable inside the container rather
than what happens to be installed on the host.
Structs§
- Cancel
Handle - Cooperative cancellation handle that terminates an active command’s process group.
- Cancellable
Container Shell - A
ContainerShellwhose running command can be stopped via aCancelHandle. - Cancellable
Local Shell - A [
LocalShell] whose running command can be stopped via aCancelHandle. - Container
Shell - Commands run inside an already-running container via
docker exec. - Local
Shell - Commands run on this machine, in the workspace directory.
- Output
- Persistent
Shell - Commands through persistent sessions instead of a process each: one session for the
harness’s own commands (each in a fresh subshell in the directory asked for, never affected
by the model’s) and one for the model’s
bash(itscdandexportcarry over). Falls back to a process per command, exactly as [LocalShell] /ContainerShell, when a session cannot start. - Session
- One long-lived
bash -l. A command arrives through a heredoc read by thereadbuiltin; its stdout and stderr go to their own files and come back with oneprintfbehind a header of byte lengths. Only the command itself runs as a process: the previous protocol spawned about six helpers per command (base64,tr,rm), about 25 ms on macOS.
Enums§
- Launcher
- How to start a session’s shell: a login shell, as
bash -lcgives today. - RunResult
- How a session command ended.
Constants§
- HARNESS_
ENV - Variables the harness itself uses, never passed to the commands it runs: provider credentials
(the model could otherwise read them with
env) and blyte’s own configuration (aBLYTE_MODELin the environment broke the repository’s provider tests). Every variable namedBLYTE_*is removed as well, exceptBLYTE_SESSION: an interactive session’s id, which the dispatches it starts must inherit so the usage log can attribute them. Container commands never inherit the host environment. - Local
Shell - MODEL_
SHELL_ ENV - POLL_
START - SHELL_
RESTART_ NOTICE
Traits§
Functions§
- credential_
like - True when the upper-cased name is one of
CREDENTIAL_NAMES, or, split on_, has a credential segment, or the value contains a URL with inline credentials. - inherited_
path_ prefix - macOS
path_helperin the login profile reorders PATH. - is_
pass_ env - Returns true when
nameis in the process-wide pass-through list set byset_pass_env. - model_
shell_ refusal_ message - poll_
backoff - How long to sleep before checking a child again, and the interval to use next time: 1 ms doubling to 50 ms, never longer than the time left before the deadline.
- scrub_
harness - Remove blyte’s own variables (the model API keys and
BLYTE_*, exceptBLYTE_SESSION) from a command about to run on this machine. - set_
pass_ env - Process-wide allow-list of environment variable names to keep even if they look like credentials.
- withheld_
env - The sorted names of current process environment variables withheld by the credential filter.