Documentation
¶
Overview ¶
Package acp runs an `acp-agent` job: it starts the agent's ACP server over stdio, drives exactly one prompt turn (initialize → session/new → session/prompt) and maps the protocol's events onto the job's outputs.
Where each thing goes (bd h-aii-rnxk / h-aii-7kja):
- stdout.log — the agent's own text, one block per message (a tool call ends a block, and the block after it starts on a fresh line).
- stderr.log — the execution DETAILS as compact `{"type":…}` event lines in the ndjson capture's shape, so the web's NdjsonTimeline and `job logs stderr` read them: tool_call (per status or content/location change), thought (coalesced), permission, plan, stop.
- acp.jsonl — the full structured stream for debugging (raw payloads truncated), thoughts coalesced the same way.
- job events — lifecycle only: the approval gate's permission_* rows and ONE job.acp_summary at the end of the turn.
See docs/design/2026-09-17-acp-agent-and-approval-gate-design.md §一 (S0). The protocol client itself lives in internal/acp; this package is the mapping layer.
Index ¶
Constants ¶
const ACPFileName = "acp.jsonl"
ACPFileName is the structured event stream this runner writes, relative to the job result dir. It sits under artifacts/ so it is part of the job's artifact manifest (listable + downloadable like any other artifact).
const Name = "acp"
Name is the runner identifier ("acp"). It is NOT a configurable runner key: the job service selects it for acp-agent jobs the way it selects the pty runner for interactive ones.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Runner ¶
type Runner struct{}
Runner executes acp-agent jobs.
func (*Runner) Run ¶
Run drives one prompt turn against the agent in req.Command/req.Args.
Outcome mapping (design §一.3): end_turn → exit 0; max_tokens/max_turn_requests → exit 0 with a warning and the stop_reason recorded; refusal → non-zero with an error; cancelled → the job's context error (the job service classifies it as cancelled or timeout); a protocol/transport failure → non-zero with that error. The session id and stopReason ride the result so the job row records both.