Request
Add an optional way to pass a custom environment to the localharness process (e.g. an env field on the agent config that flows into the harness spawn), inherited by its tool execution.
Rationale
The harness is currently spawned with no env argument, so it can only inherit the parent process's environment. Callers that need to give a single agent instance a custom environment — for example, prepending mock CLI directories to PATH so a fake binary shadows the real one — have no way to do it per instance. The only workaround is to mutate the global process environment around the spawn, which is unsafe when multiple agents start concurrently: one task's environment can leak onto another's harness. A per-agent env parameter makes the environment isolated and removes the need to touch global state. The SDK already supports this pattern for MCP stdio servers, so it would be a natural extension.
Possibly related to: #61
Request
Add an optional way to pass a custom environment to the localharness process (e.g. an
envfield on the agent config that flows into the harness spawn), inherited by its tool execution.Rationale
The harness is currently spawned with no
envargument, so it can only inherit the parent process's environment. Callers that need to give a single agent instance a custom environment — for example, prepending mock CLI directories toPATHso a fake binary shadows the real one — have no way to do it per instance. The only workaround is to mutate the global process environment around the spawn, which is unsafe when multiple agents start concurrently: one task's environment can leak onto another's harness. A per-agentenvparameter makes the environment isolated and removes the need to touch global state. The SDK already supports this pattern for MCP stdio servers, so it would be a natural extension.Possibly related to: #61