Expand description
Per-agent runner trait, error types, and agent registry.
Each agent (Claude, Codex, OpenCode, Grok) has a different CLI invocation, output format, and error pattern. This module defines a common trait so the runner can delegate parsing and error classification to the correct implementation.
Modules§
- claude
- Claude-compatible agent runner.
- codex
- Codex agent runner.
- grok
- Grok agent runner.
- kimi
- Kimi agent runner — extends the Claude-compatible runner.
- minimax
- MiniMax agent runner — extends the Claude-compatible runner.
- opencode
- OpenCode agent runner.
Structs§
- Agent
Result - Structured result from per-agent NDJSON extraction.
- Parsed
Response - Parsed response from an agent, including metadata extracted from the agent-specific output envelope.
- Permission
Rules - Unified permission rules that each agent translates into its native flags.
Enums§
- Agent
Error - Agent-specific error with enough detail for autonomous recovery.
- Router
Transcript - Router stdout shape. Each runner reports its own
- Sandbox
Level - Sandbox level — how much filesystem access the agent gets.
- Stream
Event - One step of an agent’s work, as
orch streamshows it
Traits§
- Agent
Runner - Per-agent runner trait.
Functions§
- collect_
assistant_ messages_ text - Concatenate text from all assistant-turn messages in the agent’s NDJSON
output stream. Used as an intermediate fallback when the
type:resultenvelope text is not valid AgentResponse JSON but an earlier assistant message in the conversation might contain it. - error_
class_ name - Return the variant name of an
AgentErroras a static string, for structured logging andresult.jsonoutput. - find_
agent_ result - Dispatch to the appropriate per-agent result extractor.
- get_
runner - Get the appropriate AgentRunner implementation for an agent name.
- supports_
session - Agents whose CLI takes
--session-idfor a new session and--resumeto continue it - synthesize_
response_ from_ text - Build a synthetic agent response from plain text when structured parsing fails.
- truncate_
at_ char_ boundary - Find the largest byte index <=
max_bytesthat lies on a UTF-8 char boundary. Used for safe string truncation in error messages.