You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-**`cli/`** — `@backgroundagent/cli` — CLI tool for interacting with the deployed REST API (see below).
27
-
-**`agent/`** — Python code that runs inside the agent compute environment (entrypoint, server, system prompt, Dockerfile, requirements).
27
+
-**`agent/`** — Python code that runs inside the agent compute environment (entrypoint, server, system prompt, Dockerfile, requirements). The system prompt is refactored into `agent/prompts/` with a shared base template and per-task-type workflow variants (`new_task`, `pr_iteration`, `pr_review`).
28
28
-**`docs/`** — Authoritative Markdown in `guides/` (developer, user, roadmap, prompt) and `design/`; assets in `diagrams/`, `imgs/`. The Starlight docs site lives here (`astro.config.mjs`, `package.json`); `src/content/docs/` is refreshed via `docs/scripts/sync-starlight.mjs`.
29
29
-**`CONTRIBUTING.md`** — Contribution guidelines at the repository root.
30
30
-**`package.json`** (root), **`yarn.lock`** — Yarn workspace root (minimal manifest); dependencies live in **`cdk/`**, **`cli/`**, and **`docs/`** package manifests.
@@ -40,7 +40,7 @@ The `@backgroundagent/cli` package provides the `bgagent` executable for submitt
40
40
-`src/api-client.ts` — HTTP client wrapping `fetch` with auth header injection
-`src/types.ts` — API request/response types (mirrored from `cdk/src/handlers/shared/types.ts`)
43
+
-`src/types.ts` — API request/response types (mirrored from `cdk/src/handlers/shared/types.ts`), including `TaskType` (`new_task` | `pr_iteration` | `pr_review`)
Copy file name to clipboardExpand all lines: agent/README.md
+22-9Lines changed: 22 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Agent Runtime
2
2
3
-
The agent runtime container for ABCA. Each agent instance clones a GitHub repo, works on a task using Claude, and opens a pull request. Runs as a Docker container with two modes:
3
+
The agent runtime container for ABCA. Each agent instance clones a GitHub repo, works on a task using Claude, and delivers a result — a new pull request (`new_task`), updates to an existing PR (`pr_iteration`), or structured review comments on a PR (`pr_review`). Runs as a Docker container with two modes:
4
4
5
5
-**Local mode** — batch execution via `run.sh` with AgentCore-matching constraints (2 vCPU, 8 GB RAM)
6
6
-**AgentCore mode** — FastAPI server on port 8080 with `/invocations` and `/ping` endpoints, deployable to AWS Bedrock AgentCore Runtime
2.**Context hydration** — fetches the GitHub issue (title, body, comments) if an issue number is provided
259
-
3.**Prompt assembly** — combines the system prompt (behavioral contract) with the issue context and task description
260
-
4.**Deterministic pre-hooks** — clones repo, creates branch, configures git auth, runs `mise trust`, `mise install`, `mise run build`, and `mise run lint`
264
+
2.**Context hydration** — fetches the GitHub issue (title, body, comments) if an issue number is provided; for `pr_iteration` and `pr_review`, fetches PR context (diff, description, review comments)
265
+
3.**Prompt assembly** — combines the system prompt (behavioral contract, selected by task type from `prompts/`) with the issue/PR context and task description
266
+
4.**Deterministic pre-hooks** — clones repo, creates or checks out branch, configures git auth, runs `mise trust`, `mise install`, `mise run build`, and `mise run lint`
261
267
5.**Agent execution** — invokes the Claude Agent SDK via the `ClaudeSDKClient` class (connect/query/receive_response pattern) in unattended mode. The agent:
262
268
- Understands the codebase
263
-
- Makes changes, runs tests and linters
264
-
-Commits and pushes after each unit of work
265
-
-Creates a pull request with summary, testing notes, and decisions
266
-
6.**Deterministic post-hooks** — verifies `mise run build` and `mise run lint`, ensures a PR exists (creates one if the agent did not)
269
+
-**`new_task`**: Makes changes, runs tests and linters, commits and pushes after each unit of work, creates a pull request
270
+
-**`pr_iteration`**: Reads review feedback, addresses it with focused changes, commits and pushes, posts a summary comment on the PR
271
+
-**`pr_review`**: Analyzes changes read-only (no `Write` or `Edit` tools available), composes structured review findings, posts a batch review via the GitHub Reviews API
272
+
6.**Deterministic post-hooks** — verifies `mise run build` and `mise run lint`, ensures a PR exists (creates one if the agent did not). For `pr_review`, build status is informational only and the commit/push steps are skipped.
267
273
7.**Metrics** — returns duration, disk usage, turn count, cost, and PR URL
268
274
269
275
## Metrics
@@ -322,9 +328,16 @@ agent/
322
328
├── task_state.py Best-effort DynamoDB task status (no-op if TASK_TABLE_NAME unset)
0 commit comments