Skip to content

feat: goal-driven autopilot driver (default), keep /loop fallback (v1.7.0)#10

Open
memorysaver wants to merge 1 commit into
mainfrom
feat/goal-driven-autopilot
Open

feat: goal-driven autopilot driver (default), keep /loop fallback (v1.7.0)#10
memorysaver wants to merge 1 commit into
mainfrom
feat/goal-driven-autopilot

Conversation

@memorysaver

Copy link
Copy Markdown
Owner

Summary

Autopilot's real objective is goal-shaped ("complete the current layer"), not time-shaped — the 5-minute /loop interval was only a polling throttle, and termination was ad-hoc. This makes the goal driver the default: it uses the host-native /goal primitive, which re-fires a tick when there's work and self-terminates at the layer boundary. The fixed-interval /loop driver is retained as the fallback (--loop).

Only the driver changes. The 7-step CHECK→ACT tick, the delegated cheap CHECK, the signals protocol, the executor abstraction, and the orchestrator boundary are all unchanged.

Why this works on both runtimes

Both hosts ship a near-symmetric /goal (verified live):

  • Claude Code /goal (v2.1.139+) — session-scoped condition; a Haiku evaluator judges it against the transcript after each turn; turn-driven.
  • Codex goals (experimental flag, CLI 0.130) — persisted thread goal with a first-class token_budget (soft-stops to budget_limited); idle-driven.

Design decisions (per the ADR)

  • Scope: one layer per goal — stops (complete or paused) at the layer gate, mapping 1:1 onto existing pause-at-gate boundaries, then the human runs the gate / /aep-reflect and re-invokes for the next layer.
  • Anti-hot-loop (the crux): /goal re-fires the instant a turn ends, so each tick ends by (1) surfacing a signals-only AUTOPILOT status line for the evaluator (boundary-safe — never workspace code) and (2) waiting a bounded floor (default 5m, --floor). Reliability-first: CC uses Monitor with a hard timeout (a raw foreground sleep is blocked in a turn), Codex uses shell sleep. Cadence is behaviorally identical to the /loop 5m users already trust — the only change is self-termination.
  • Runaway bound: --max-turns (default 200) + Codex token_budget.
  • /loop retained because /goal is in-session-only and the cron/launchd unattended path needs /loop / codex exec.

Changes

  • skills/patterns/autopilot/SKILL.md — goal driver as default; restructured start protocol into 6a (goal) / 6b (loop); step ⑦ surface+wait tail; stop/guardrails/resume updated.
  • skills/patterns/autopilot/references/tick-protocol.md — invocation + step ⑦ goal-driver tail with the status-line format.
  • skills/patterns/executor/references/backends.md — driver × backend matrix names both in-session variants; goal driver is in-session-only.
  • docs/workflow/autonomous-loop.md — human-facing description.
  • docs/decisions/goal-driven-autopilot.mdnew ADR.
  • CHANGELOG.md [1.7.0] + marketplace.json 1.6.0 → 1.7.0.

Test plan

Docs/skill-content change (no code). Validated: marketplace.json parses; pre-commit (oxlint/oxfmt) green; no stale "recurring loop / 5-minute" phrasing left in the autopilot skill; command surface unchanged (--loop restores prior behavior exactly).

🤖 Generated with Claude Code

….7.0)

Autopilot's real objective is goal-shaped ("complete the current layer"),
not time-shaped. Replace the fixed-interval poll loop as the *default*
driver with a goal-driven one built on the host-native `/goal` primitive
(Claude Code v2.1.139+ and Codex's experimental `goals` feature), which
re-fires a tick when there is work and self-terminates at the layer
boundary. The `/loop` driver is retained as the fallback (`--loop`),
including for unattended cron/launchd runs (`/goal` is in-session only).

Only the driver changes. The 7-step CHECK→ACT tick, the delegated cheap
CHECK, the signals protocol, the executor abstraction, and the
orchestrator boundary are all unchanged.

Key mechanics:
- Scope: one layer per goal; stops (complete or paused) at the layer gate.
- Anti-hot-loop: each tick surfaces a signals-only AUTOPILOT status line
  (boundary-safe) then waits a bounded floor (default 5m, --floor) before
  ending the turn — CC Monitor-with-timeout (raw sleep is blocked in a
  turn), Codex shell sleep.
- Runaway bound: --max-turns (default 200) + Codex token_budget.

Decision record: docs/decisions/goal-driven-autopilot.md.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant