feat(agents): agent jobs in CI, live run activity, and short answers
- A CI job with `agent: <handle>` runs that hosted agent on the run's pull request, with an optional prompt, and succeeds when the agent answers. - Each model turn of a run is recorded with the tools it called and its thinking. The Agents tab lists recent runs and shows a working run step by step. - Agents answer in at most 5 points and 150 words.
1 decision
A CI agent job runs in every run, also in untrusted runs such as a pull request that an agent opened.
Why
- The main use is a review of the pull requests that agents open, and those runs are untrusted
- An agent job gets no CI secrets; it runs on the server with the agent's sealed key, which the job never sees
- The agent only reads the code and posts one comment, so an untrusted run can only spend model usage
If this changes later
A change adds a trust check, and agent pull requests then need a person to approve each run before the review starts.
Paths considered
- Chosen
- Run agent jobs only in trusted or approved runs, like jobs that get secrets
- ApprovalThe reviewer would never run on its own on pull requests that agents open.
Assumes
- Model usage stays small enough that refs does not need a quota yet
Touches
agent-runs.tsrun-pipeline.ts
19 files changed · +373 −35
apps/backend/agent-runs.ts+103 −7
apps/backend/agents.ts+3 −3
apps/backend/contract/events.ts+2 −0
apps/backend/contract/handles.ts+3 −0
apps/backend/contract/views.ts+16 −0
apps/backend/handles/repo.ts+6 −0
apps/backend/index.ts+1 −1
apps/backend/models.ts+7 −4
apps/backend/test/agent-runs.test.ts+21 −1
apps/ci/config/parse-pipeline.ts+23 −2
apps/ci/config/pipeline.ts+9 −0
apps/ci/runtime/index.ts+1 −0
apps/ci/runtime/job-spec.ts+9 −1
apps/ci/runtime/run-hub.ts+1 −1
apps/ci/runtime/run-pipeline.ts+46 −1
apps/ci/test/pipeline-config.test.ts+16 −0
apps/frontend/components/hosted-agents.tsx+74 −3
apps/frontend/routes/repo-agents.tsx+18 −9
workers/main.ts+14 −2