Skip to content

Allow passing env to the localharness subprocess #107

Description

@bai-uipath

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

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions