Skip to main content

build

Function build 

Source
pub async fn build(
    resolved: &ResolvedModel,
    args: &Args,
    cwd: &Path,
) -> Result<AgentHarness, BuildError>
Expand description

Build the AgentHarness from the resolved model + parsed args + cwd.

This is the v1 equivalent of TS createAgentSession. It:

  1. Builds the OsExecutionEnv rooted at cwd.
  2. Constructs the built-in tools (optionally filtered by --tools/ --exclude-tools/--no-tools/--no-builtin-tools).
  3. Resolves the session storage (ephemeral vs fresh JSONL vs restore-error).
  4. Assembles AgentHarnessOptions and calls AgentHarness::create.