Skip to main content

Module workspace

Module workspace 

Source
Expand description

Per-agent filesystem workspace isolation.

task_context isolates an agent’s state (the key/value store). This module isolates its filesystem: when parallel agents mutate files, giving each its own working directory prevents them from clobbering one another — the file-level analogue of the blog’s isolation: 'worktree'.

§What the runtime can and can’t do

CAR doesn’t own process execution — the caller’s AgentRunner runs the tools. So the runtime provisions an isolated directory (or git worktree) and advertises its path to the agent via AgentSpec.metadata["workspace"]; the runner is responsible for actually running its file tools relative to that path. The runtime guarantees provisioning and cleanup (RAII); honoring the path is a cooperative contract with the runner. This is the honest boundary for a runtime that validates and orchestrates but does not itself exec.

Structs§

AgentWorkspace
An RAII handle to a provisioned per-agent workspace. The directory (or git worktree) is removed when this is dropped.
WorkspaceConfig
Configuration for per-agent workspace provisioning.

Enums§

WorkspaceMode
How to provision a per-agent workspace.

Constants§

WORKSPACE_METADATA_KEY
Metadata key under which a provisioned workspace path is advertised to the agent runner.