Skip to content

feat(ci): dispatched coding agent that ends in a pull request (Phase 1) - #440

Merged
athvin merged 1 commit into
mainfrom
claude/agent-task-workflow
Nov 3, 2026
Merged

athvin merged 1 commit into
mainfrom
claude/agent-task-workflow

Conversation

@athvin

@athvin athvin commented Nov 3, 2026 •

Copy link
Copy Markdown
Owner

agent-task.yml runs anthropics/claude-code-action in agent mode on
workflow_dispatch, one task per run, and publishes the result as a PR.

Two jobs, so the security properties come from the structure rather than
the prompt:

  • agent holds only the workflow token (contents: write) and checkpoints
    to agent-wip/<task>, a branch with no PR, so checkpoints cost no CI.
    That token cannot push .github/workflows/** changes, so an agent
    cannot widen its own powers. No id-token: write: er-ci-tf-plan
    trusts any ref of this repo and can read Terraform state.
  • publish runs on a fresh runner, never checks out the agent's tree,
    mints the GitHub App token at publish time (no 1-hour expiry mid-task),
    fast-forwards agent/<task> and opens or updates the PR as the App, so
    CI runs on it like a human's PR. Draft unless the agent reported
    complete and its step succeeded.

Resume continues a task from agent-wip/<task>; concurrency is keyed on
the task id so resumes queue instead of racing.

scripts/agent.sh holds the laptop helpers. docs/agent-fleet.md
records the design, the one-time setup, how it departs from the
originating plan (Auto Mode instead of a Karpenter install, Pod Identity
instead of IRSA, SHA-tagged immutable images, ARC on er-dev), and the
vCPU-quota prerequisite that blocks Phase 3.

This adds two stored secrets beyond #439's ANTHROPIC_API_KEY, both in
main-restricted environments rather than at repository scope; the
ci-and-supply-chain skill gains a section for this workflow (after #439's
gh-aw section, which is kept as is) and the required-checks reference is
regenerated.

Rebased onto #439, which conflicted in the ci-and-supply-chain skill.

Before it can run (configuration, not in this diff): the publish GitHub App
(Contents + Pull requests RW, no Workflows) and environments agent
(CLAUDE_CODE_OAUTH_TOKEN) and agent-publish (AGENT_APP_KEY, var
AGENT_APP_CLIENT_ID), both restricted to main. See docs/agent-fleet.md §2.

Verified: workflow parses, every run: block passes bash -n, every
uses: SHA-pinned with a # vTAG comment; make skills-check passes.
Not run: actionlint (no usable local binary), and the workflow itself has
never executed — first dispatch should be a trivial task.

🤖 Generated with Claude Code

https://claude.ai/code/session_01MFnHDTZqHqQHUB7UwMUJY6

`agent-task.yml` runs anthropics/claude-code-action in agent mode on
workflow_dispatch, one task per run, and publishes the result as a PR.

Two jobs, so the security properties come from the structure rather than
the prompt:

- `agent` holds only the workflow token (contents: write) and checkpoints
  to `agent-wip/<task>`, a branch with no PR, so checkpoints cost no CI.
  That token cannot push `.github/workflows/**` changes, so an agent
  cannot widen its own powers. No `id-token: write`: `er-ci-tf-plan`
  trusts any ref of this repo and can read Terraform state.
- `publish` runs on a fresh runner, never checks out the agent's tree,
  mints the GitHub App token at publish time (no 1-hour expiry mid-task),
  fast-forwards `agent/<task>` and opens or updates the PR as the App, so
  CI runs on it like a human's PR. Draft unless the agent reported
  `complete` and its step succeeded.

Resume continues a task from `agent-wip/<task>`; concurrency is keyed on
the task id so resumes queue instead of racing.

`scripts/agent.sh` holds the laptop helpers. `docs/agent-fleet.md`
records the design, the one-time setup, how it departs from the
originating plan (Auto Mode instead of a Karpenter install, Pod Identity
instead of IRSA, SHA-tagged immutable images, ARC on er-dev), and the
vCPU-quota prerequisite that blocks Phase 3.

This adds two stored secrets beyond #439's `ANTHROPIC_API_KEY`, both in
`main`-restricted environments rather than at repository scope; the
ci-and-supply-chain skill gains a section for this workflow (after #439's
gh-aw section, which is kept as is) and the required-checks reference is
regenerated.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01MFnHDTZqHqQHUB7UwMUJY6
@athvin
athvin force-pushed the claude/agent-task-workflow branch from 54ea416 to c0a56e3 Compare November 3, 2026 04:40
@athvin
athvin merged commit c75f830 into main Nov 3, 2026
34 checks passed
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.

2 participants