Repository navigation
feat(ci): dispatched coding agent that ends in a pull request (Phase 1) - #440
Merged
Merged
Conversation
`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
force-pushed
the
claude/agent-task-workflow
branch
from
November 3, 2026 04:40
54ea416 to
c0a56e3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
agent-task.ymlruns anthropics/claude-code-action in agent mode onworkflow_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:
agentholds only the workflow token (contents: write) and checkpointsto
agent-wip/<task>, a branch with no PR, so checkpoints cost no CI.That token cannot push
.github/workflows/**changes, so an agentcannot widen its own powers. No
id-token: write:er-ci-tf-plantrusts any ref of this repo and can read Terraform state.
publishruns 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, soCI runs on it like a human's PR. Draft unless the agent reported
completeand its step succeeded.Resume continues a task from
agent-wip/<task>; concurrency is keyed onthe task id so resumes queue instead of racing.
scripts/agent.shholds the laptop helpers.docs/agent-fleet.mdrecords 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 inmain-restricted environments rather than at repository scope; theci-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) andagent-publish(AGENT_APP_KEY, varAGENT_APP_CLIENT_ID), both restricted tomain. Seedocs/agent-fleet.md§2.Verified: workflow parses, every
run:block passesbash -n, everyuses:SHA-pinned with a# vTAGcomment;make skills-checkpasses.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