跳到导航

Connect an Agent Harness

Point Claude Code, Codex, OpenCode, and other coding agents at a Dynamo deployment

By the end of this guide, your coding agent is sending its requests to Dynamo, and each request carries the agent’s own session ID.

Dynamo serves v1/chat/completions, v1/responses, and v1/messages, so any agent that uses one of these APIs can talk to a Dynamo endpoint, even if it is not listed here. The harnesses below also send stable session IDs, which Dynamo normalizes for tracing and other explicitly configured consumers.

Before You Start

You need a running Dynamo endpoint. To start a local one, follow Run an agent on Dynamo. The examples use http://localhost:8000 and zai-org/GLM-4.7-Flash; replace them with your endpoint and model.

Configure Your Harness

Codex uses the Responses API. Add a local provider in ~/.codex/config.toml:

[model_providers.dynamo]
name = "dynamo"
base_url = "http://localhost:8000/v1"
wire_api = "responses"

Dynamo’s Responses adapter currently supports function tools, including functions inside namespaces, and tool_choice values of none, auto, required, or a named function. Unsupported tool or tool-choice types return HTTP 400 before inference. Unsupported tools are rejected even when tool_choice is none or auto.

Disable Codex’s hosted web search when using Dynamo. The following command overrides the top-level web_search setting for this run:

# replace -m <model> with your model
codex -m zai-org/GLM-4.7-Flash -c model_provider=dynamo \
-c 'web_search="disabled"'

Dynamo maps Codex’s thread-id header to session_id. A spawned child thread also sends x-codex-parent-thread-id, which Dynamo maps to parent_session_id.

Check That Dynamo Sees the Session

Send a request from the harness, then follow the trace check in Run an agent on Dynamo. Each request should show a session ID. If it does not, the harness is not sending a session header; see Identify agent sessions for the headers Dynamo recognizes.

Run a sandboxed coding benchmark

Run SWE-bench Verified with Harbor, Pi, and Substrate walks through sandbox preparation, one trial, a concurrent batch, and result inspection. Use Dynamo inference or a compatible external endpoint. The runnable example contains the environment adapter, prepared-image build, and telemetry configuration.

Drive a Harness from Another Agent

Use the repository’s .agents/skills/dynamo-agent-harness skill when an agent needs to keep a Claude Code, Codex, or OpenCode session open across multiple prompts while Dynamo serves the model. The skill uses Agent Client Protocol (ACP) and injects the provider configuration through the child process environment instead of adding harness configuration files to the delegated worktree.

The skill pins the Claude Code and Codex ACP adapters. If a harness release changes the model, endpoint, session header, authentication, or mode configuration, update this page and the skill in the same change after running a persistent two-turn tool smoke test.

Tool Schema Validation

On Chat Completions and Responses requests, function tools with explicit strict: true receive schema preflight before inference. Invalid schemas now return HTTP 400 where earlier versions could accept them. Responses validates every submitted function, including namespace members and functions excluded by allowed_tools or tool_choice: "none". Omitted, null, or false strictness and omitted or null parameters retain existing behavior.

Preflight runs independently of structural-tag activation. Passing preflight does not guarantee complete OpenAI compatibility or backend enforcement. See Request Validation for object rules, size budgets, and Dynamo’s bounded local-reference support.

Next

Identify agent sessions explains how Dynamo reads these headers and how subagents are linked to their parent.