Agentic AI Atlasby a5c.ai
OverviewWikiGraphFor AgentsEdgesSearchWorkspace
/
GitHubDocsDiscord
i.4Wiki
Agentic AI Atlas · Mock Harness
docs/agent-mux/tutorials/mock-harnessa5c.ai
Search the atlas/
Wiki · linked records

Article and nearby pages

I.Current articlepp. 1 - 1
Cost trackingDocker Invocation ModeGetting StartedHooksKubernetes Invocation ModeMulti-Agent Dispatch
I.
Wiki article

docs/agent-mux/tutorials/mock-harness

Reading · 2 min

Mock Harness reference

The mock harness replaces the real CLI spawn with a scripted event stream. Use it for tests, CI, and demos where real credentials or network access are undesirable.

Page nodewiki/docs/agent-mux/tutorials/mock-harness.mdNearby pages · 9Documents · 0

Continue reading

Nearby pages in the same section.

Cost trackingDocker Invocation ModeGetting StartedHooksKubernetes Invocation ModeMulti-Agent DispatchPlugins (MCP)Remote bootstrapSessions

Mock Harness

The mock harness replaces the real CLI spawn with a scripted event stream. Use it for tests, CI, and demos where real credentials or network access are undesirable.

Enabling

Two equivalent switches:

bash
amux run claude --use-mock-harness --prompt "test"

or globally:

bash
export USE_MOCK_HARNESS=1
amux run claude --prompt "test"

Programmatically:

ts
await client.run({
  agent: 'claude',
  prompt: 'test',
  useMockHarness: true,
});

Scenarios

The mock emits a deterministic sequence of AgentEvents chosen by scenario name:

ScenarioWhat it emits
textA few text_delta events and a final done.
tool-calltext_delta → tool_call_start → tool_call_result → done.
thinkingthinking_delta events before the final message.
errorEmits an error event with recoverable: false.
session-resumeReplays a prior session snapshot.

Pick one with --scenario:

bash
amux run claude --use-mock-harness --scenario tool-call --prompt "x"

If you invoke the package binary directly, the same agent scoping is available there too:

bash
mock-harness --agent claude --list
mock-harness --agent claude --scenario tool-call

Interactive approval scenarios under packages/agent-mux/harness-mock now model real gating semantics rather than timer-only replay:

  • interactive:yolo auto-approves and then emits the post-approval output.
  • interactive:prompt waits for stdin before it emits the post-approval output and exits.
  • interactive:deny auto-denies, emits the denial path, and exits non-zero.
  • interactive:timeout waits for approval until the configured timeout, emits a timeout error, and exits non-zero.

Why use it

  • **CI**: No API keys, no flakiness.
  • **Adapter tests**: Validate parseEvent without invoking the real CLI.
  • **Integration tests**: Exercise hooks, session-save paths, and the event stream in isolation.

See Harness & Mock for the full event script format.

Trail

Wiki
Babysitter Docs
agent-mux docs
Agent Mux Tutorials

Mock Harness

Continue reading

Cost tracking
Docker Invocation Mode
Getting Started
Hooks
Kubernetes Invocation Mode
Multi-Agent Dispatch
Plugins (MCP)
Remote bootstrap

Page record

Open node ledger

wiki/docs/agent-mux/tutorials/mock-harness.md

Documents

No documented graph nodes on this page.