Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/prerequisites.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ The [`autopilot`](../skills/autopilot) skill requires these tools:
- Git
- At least one supported harness CLI: Claude Code, Codex, Pi, or OpenCode
- Optional: an installed and active `pi-subagents` 0.53.0 or newer for the process-local Pi backend; the packaged Autopilot Pi extension probes it before launch, and direct Pi remains a distinct fallback
- Optional: an explicitly supplied `@anthropic-ai/claude-agent-sdk` 0.3.246 or newer and matching Claude Code executable for `claude-agent-sdk`; set their absolute paths through `AUTOPILOT_CLAUDE_AGENT_SDK_ROOT` and `AUTOPILOT_CLAUDE_AGENT_SDK_CLI`
- `gh` for GitHub delivery or `glab` for GitLab delivery

Autopilot checks these tools automatically before starting a run and reports anything missing. It never installs tools, downloads runtimes, or changes authentication.
4 changes: 3 additions & 1 deletion skills/autopilot/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Autopilot is not a prompt loop. It seals your request into an immutable charter,

## Use it

You need Node.js 24+, Git, and at least one supported harness CLI. Remote delivery also needs authenticated `gh` or `glab`. Pi can use the packaged Autopilot extension with an installed and active `pi-subagents` 0.53.0+ owner for process-local execution; otherwise it reports the distinct direct CLI fallback. Autopilot checks the environment before launch; it never installs tools, enables extensions, or signs you in.
You need Node.js 24+, Git, and at least one supported harness CLI. Remote delivery also needs authenticated `gh` or `glab`. Pi can use the packaged Autopilot extension with an installed and active `pi-subagents` 0.53.0+ owner for process-local execution; otherwise it reports the distinct direct CLI fallback. Claude can use an explicitly supplied Agent SDK 0.3.246+ and matching executable for same-query implementation execution. Autopilot checks the environment before launch; it never installs tools, finds private caches, enables extensions, or signs you in.

From the project repository, invoke the skill through your host:

Expand All @@ -21,6 +21,8 @@ changes and rollback notes. Open a PR, but do not merge or deploy it.

When using Pi's process-local backend, load `runtime/dist/src/pi-extension-entry.js` through Pi's documented extension or package mechanism, then start the sealed charter with `/autopilot-start <charter-file>`. The owning Pi process must remain uninterrupted; losing it makes the exact attempt unknown and never triggers a replacement.

Claude offers two explicit charter modes. `claude-agent-sdk` binds implementation to one in-memory query, captured child, exact session, and caller-selected user message; query or process loss becomes unknown. Set `AUTOPILOT_CLAUDE_AGENT_SDK_ROOT` and `AUTOPILOT_CLAUDE_AGENT_SDK_CLI` to operator-provided matching artifacts. `claude-code` remains the direct CLI mode, and Agent SDK independent review still uses that direct path.

Codex offers two explicit charter modes. `codex-app-server` binds an implementation to one per-attempt app-server instance and exact ephemeral thread/turn; connection or server loss becomes unknown. `codex` retains the direct CLI fallback and POSIX process-supervised restart reattachment. App-server independent review still uses the direct read-only CLI path.

OpenCode also offers two explicit modes. `opencode-server` owns one authenticated loopback server, dedicated session, caller-selected message, and uninterrupted event stream per implementation attempt; any identity or stream gap becomes unknown. `opencode` remains the direct CLI mode. Server-mode independent review still uses the direct CLI path.
Expand Down
3 changes: 2 additions & 1 deletion skills/autopilot/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ disable-model-invocation: true

# Autopilot

Autopilot delegates bounded coding work to a fresh Claude Code, Codex, Pi, or OpenCode execution. Pi implementations prefer the packaged process-local extension backend. Codex charters select either the exact same-instance `codex-app-server` backend or the distinct direct `codex` CLI path. OpenCode charters similarly select the same-instance `opencode-server` backend or distinct direct `opencode` CLI path. Other modes and fallbacks use their declared boundaries. The runtime owns lifecycle state, Git commits, verification, remote delivery, and completion decisions.
Autopilot delegates bounded coding work to a fresh Claude Code, Codex, Pi, or OpenCode execution. Pi implementations prefer the packaged process-local extension backend. Claude charters select either the exact same-instance `claude-agent-sdk` backend or the distinct direct `claude-code` CLI path. Codex charters select either the exact same-instance `codex-app-server` backend or the distinct direct `codex` CLI path. OpenCode charters similarly select the same-instance `opencode-server` backend or distinct direct `opencode` CLI path. Other modes and fallbacks use their declared boundaries. The runtime owns lifecycle state, Git commits, verification, remote delivery, and completion decisions.

## New-run preconditions

Expand All @@ -20,6 +20,7 @@ For a new implementation run:
5. Do not install tools, download runtimes, authenticate providers, or modify global configuration.
6. For Codex, select `codex-app-server` only when the operator accepts same-instance cooperative terminality; select `codex` for the distinct direct CLI mode. Never switch between them after admission or infer one mode's guarantees from the other.
7. For OpenCode, select `opencode-server` only when the operator accepts one owned loopback server, an uninterrupted non-replayable event stream, and same-instance cooperative terminality; select `opencode` for the distinct direct CLI mode. Never reuse a shared server or switch modes after admission.
8. For Claude, select `claude-agent-sdk` only when the operator explicitly supplies SDK 0.3.246 or newer and its matching Claude Code executable and accepts same-query-instance cooperative terminality; select `claude-code` for the distinct direct CLI mode. Never discover private caches, resume a lost query, replace an unknown execution, or switch modes after admission.

Treat “I am going to sleep,” “work overnight,” and “have this ready in the morning” as explicit unattended-run intent. Preserve that intent in `sourceText`, but do not turn it into a deadline, merge grant, deployment grant, or guarantee of completion time.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ The implementation began from this boundary:
3. Reports listed receipt IDs but did not provide one evidence result for every acceptance predicate.
4. The baseline package suite contained 111 passing Node tests.

Phases 0–6A replaced that boundary with versioned attempt context, structured predicate receipts and reports, continuity status, an exact-tree review gate, journal-safe pause, verified-item continuation, effect reconciliation, and exact-subject provider heartbeat waiting. The exact-tree review gate passed with Pi 0.84.4, Codex 0.151.0, and OpenCode 1.18.25. Claude Code 2.1.251 now reaches its identity-linked API key but requires an `ANTHROPIC_WORKSPACE_ID` absent from the validation environment, and production notification wake remains unverified.
Phases 0–6A replaced that boundary with versioned attempt context, structured predicate receipts and reports, continuity status, an exact-tree review gate, journal-safe pause, verified-item continuation, effect reconciliation, and exact-subject provider heartbeat waiting. The exact-tree review gate passed with Pi 0.84.4, Claude Code 2.1.251, Codex 0.151.0, and OpenCode 1.18.25. The direct Claude Code adapter also passed an exact disposable edit without changing HEAD, Git configuration, or global Claude configuration; production notification wake remains unverified.

## Phase 0: Align documentation with executable support

Expand Down Expand Up @@ -487,7 +487,7 @@ skills/autopilot/runtime/test/fault-injection.test.ts

## Phase 7: Finish documentation and packaging

**Result:** Implemented for Phases 0–6A. Phase 6B is not promoted under the recorded no-receiver decision and is not a current release blocker. The current validation baseline is 234 Node tests locally after adding Codex app-server and OpenCode server contract coverage. The earlier 187-test native-free, 200-test Pi process-local, 162-test, and 137-test baselines passed at their recorded revisions on Ubuntu and Windows.
**Result:** Implemented for Phases 0–6A. Phase 6B is not promoted under the recorded no-receiver decision and is not a current release blocker. The current validation baseline is 253 Node tests locally after adding Claude Agent SDK, Codex app-server, and OpenCode server contract coverage. The earlier 187-test native-free, 200-test Pi process-local, 162-test, and 137-test baselines passed at their recorded revisions on Ubuntu and Windows.

### Files

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Cooperative harness execution implementation plan

- **Status:** Implemented through the explicit OpenCode server backend; the Claude Agent SDK boundary has a conditional GO and remains unimplemented
- **Status:** Implemented through the explicit Claude Agent SDK, Codex app-server, and OpenCode server backends
- **Date:** 2026-08-31
- **Audience:** Autopilot implementers and reviewers
- **Related:** [Architecture](architecture.md), [continuity implementation plan](2026-08-30-continuity-evidence-implementation-plan.md), [OpenCode server evaluation](2026-08-31-opencode-server-evaluation.md), [Claude Agent SDK evaluation](2026-09-04-claude-agent-sdk-evaluation.md), [durable event engine ADR](adr/0001-durable-event-engine.md)
Expand Down Expand Up @@ -379,7 +379,7 @@ The default stdio transport cannot reconnect after coordinator loss. WebSocket t
Investigate and implement each remaining provider as a separate boundary.

- OpenCode: the [server evaluation](2026-08-31-opencode-server-evaluation.md) established the same-instance contract. The explicit `opencode-server` adapter owns one server process, dedicated session, caller-selected message ID, uninterrupted live events, and fresh REST reconciliation. Controlled fault coverage passes, and live completion and cancellation passed with OpenCode 1.18.28.
- Claude Code: the [Agent SDK evaluation](2026-09-04-claude-agent-sdk-evaluation.md) established a conditional same-instance contract for a distinct `claude-agent-sdk` implementation backend. Promotion requires an explicitly supplied SDK at 0.3.246 or later, controlled fault coverage, and exact-version live completion and cancellation. The direct `claude-code` mode remains session-scoped.
- Claude Code: the [Agent SDK evaluation](2026-09-04-claude-agent-sdk-evaluation.md) established the same-instance contract for a distinct `claude-agent-sdk` implementation backend. An explicitly supplied SDK 0.3.260 and matching Claude Code 2.1.260 passed controlled fault coverage and exact-version live completion and cancellation. The direct `claude-code` mode remains separate and session-scoped for review.

Do not add a provider-neutral durable-subject framework based only on hypothetical future consumers.

Expand Down Expand Up @@ -468,6 +468,6 @@ Pause and revisit the design if implementation shows any of the following:
- No provider currently proves Windows process-tree quiescence through its public subagent contract.
- Codex app-server 0.151.0 exact completion and interruption were exercised over one uninterrupted stdio connection. Cross-connection live rejoin is intentionally unimplemented because the default transport is not reconnectable; continuity loss remains unknown.
- OpenCode 1.18.25 protocol probes and the production adapter's 1.18.28 live completion and cancellation passed. An earlier isolated probe process was later found still running after its parent harness had ended, invalidating that probe's cleanup claim and reinforcing the documented absence of whole-harness process containment. The production live run awaited cleanup and a post-run process scan found no remaining server. Disconnect remains intentionally unrecoverable because SSE has no replay cursor.
- Agent SDK 0.3.220 with bundled Claude Code 2.1.220 produced an exact natural completion and an interrupt receipt followed by `aborted_tools`, with normal-path cleanup and unchanged Claude configuration digests. Its cancellation result lacked the required user-message UUID. The current 0.3.260 API shape closes that identity gap, but controlled and live validation on 0.3.246 or later remains required before implementation promotion.
- Agent SDK 0.3.220 with bundled Claude Code 2.1.220 produced an exact natural completion and an interrupt receipt followed by `aborted_tools`, but its cancellation result lacked the required user-message UUID. The promoted adapter used an explicitly supplied SDK 0.3.260 and Claude Code 2.1.260; controlled faults plus exact live completion and cancellation passed with the required identities, isolated configuration, and awaited direct-child cleanup.
- Cooperative terminality does not prevent external effects performed by worker tools before terminal response.
- The Pi entry point follows the documented package manifest at `runtime/dist/src/pi-extension-entry.js` and registers `/autopilot-start`, `/autopilot-resume`, and `/autopilot-recover`; callers must load it through Pi's normal package or extension mechanism.
11 changes: 6 additions & 5 deletions skills/autopilot/docs/2026-09-04-claude-agent-sdk-evaluation.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# Claude Agent SDK execution evaluation

- **Status:** Evaluation complete; production adapter not yet implemented
- **Decision:** CONDITIONAL GO for a distinct `claude-agent-sdk` implementation backend
- **Status:** Evaluation complete; production adapter implemented and validated separately
- **Decision:** GO for a distinct `claude-agent-sdk` implementation backend at the tested boundary
- **API baseline:** `@anthropic-ai/claude-agent-sdk` 0.3.260, tag `v0.3.260` at commit `a79d677cbd0a627bddf8ad37d8d010c727c71fc7`
- **Live probe baseline:** Agent SDK 0.3.220 with its bundled Claude Code 2.1.220
- **Evaluation probe baseline:** Agent SDK 0.3.220 with its bundled Claude Code 2.1.220
- **Promotion evidence:** [Agent SDK implementation validation](2026-09-04-claude-agent-sdk-validation.md)
- **Scope:** Implementation execution only; independent review remains on the direct `claude-code` adapter

## Decision summary
Expand All @@ -12,7 +13,7 @@ The TypeScript Agent SDK now exposes enough identity and lifecycle data for an e

Autopilot can therefore implement a backend whose subject is the original in-memory `Query`, its Claude Code subprocess, the reported session ID, and the caller-selected user-message UUID. Completion or cancellation is acceptable only while that exact query remains uninterrupted and only from a terminal result bound to both identities.

This is a conditional GO rather than production promotion. The locally available 0.3.220 SDK proved natural completion and cooperative interruption, but its cancellation result did not echo the user-message UUID. The required identity fields arrived in later releases. Autopilot must not ship the backend until an explicitly provided SDK at 0.3.246 or later passes the controlled fault matrix and live completion and cancellation probes. The runtime must not install that SDK or its platform binary.
The evaluation originally issued a conditional GO because the locally available 0.3.220 cancellation result did not echo the user-message UUID. The required identity fields arrived in later releases. An explicitly operator-supplied 0.3.260 SDK and matching Claude Code 2.1.260 executable subsequently passed the controlled fault matrix and live completion and cancellation probes, allowing the distinct backend to ship. The runtime still must not install the SDK or its platform binary.

The backend must remain separate from `claude-code`. It must advertise no restart reattachment and must not use transcript resume to infer the state of an interrupted query. SDK or subprocess loss before an exact terminal result becomes `EXECUTION_STATE_UNKNOWN` and cannot launch a replacement automatically.

Expand Down Expand Up @@ -252,4 +253,4 @@ The implementation must not claim:

## Outcome

Agent SDK 0.3.260 resolves the earlier API-shape blocker: current result and first-reply messages can bind the provider terminal to a caller-selected user-message UUID, while interrupt receipts and structured terminal reasons distinguish acknowledgment from cancellation. The remaining blocker is empirical, not architectural. Autopilot needs an explicitly supplied current SDK, a controlled fault implementation, and exact-version live completion and cancellation before promoting `claude-agent-sdk` into the charter schema.
Agent SDK 0.3.260 resolves the earlier API-shape blocker: current result and first-reply messages bind the provider terminal to a caller-selected user-message UUID, while interrupt receipts and structured terminal reasons distinguish acknowledgment from cancellation. The [promotion validation](2026-09-04-claude-agent-sdk-validation.md) supplied the required controlled and exact-version live evidence. `claude-agent-sdk` is now an explicit charter value while `claude-code` remains the distinct direct CLI and independent-review path.
Loading