aws-samples / aws-samples/sample-autonomous-cloud-coding-agents
feat(orchestration): autonomous feedback loop (PR watcher → merge)
- Dominant language
- TypeScript
- Stars
- 143
- Forks
- 46
- Avg merge
- 3d 9h
- Merged PRs (30d)
- 20
Description
**Context:** ROADMAP.md → Agent quality → Autonomous feedback loop
**Related:** #22 (merge conflicts slice), pure decision function orchestrator draft, #425
---
## Component
API or orchestration
## Describe the feature
Extend orchestrator beyond **`PR_OPENED`** with a **PR watcher phase**. Auto-resume when:
- **CI fails** — inject failure logs
- **Merge conflicts** — rebase instructions (#22 related)
- **Reviewers request changes** — inline comments
Continue until **PR merged** or human **cancels**. Optionally **auto-merge** when CI passes and review approved.
**Outcome:** transforms ABCA from "open PR" to "merge PR".
## Use case
Today tasks often end at PR creation; humans must manually re-submit `pr_iteration` tasks for CI failures, review feedback, and merge conflicts. Teams want the agent to own the full PR lifecycle with guardrails.
## Proposed solution
1. New orchestrator phase(s): `AWAITING_PR_FEEDBACK` / `PR_WATCHING` with GitHub webhook + polling triggers.
2. Classify events: `check_suite.failure`, `pull_request_review.comment`, `merge_conflict`, `review_requested_changes`.
3. Resume agent with structured context injection; respect `max_turns`, `max_budget_usd`, Cedar HITL.
4. Optional policy-gated auto-merge (repo Blueprint flag).
5. Terminal states: `COMPLETED` (merged), `FAILED`, `CANCELLED`, or `AWAITING_HUMAN` when stuck.
6. **Prerequisite:** pure decision-function orchestrator refactor (separate draft) recommended for testability.
## Other information
- Distinct from **in-pipeline build/lint fix-up loop** (pre-PR, `pipeline.py` only).
- #22 covers merge-conflict handling in `pr_iteration` but not the full watcher loop.
- Design context: `docs/design/ORCHESTRATOR.md`, `docs/design/EVALUATION.md`.
- [x] This might be a breaking change
Contributor guide
Research direction
Start with ROADMAP.md and docs/design/ORCHESTRATOR.md plus docs/design/EVALUATION.md, then inspect the existing orchestrator and pr_iteration flow. Compare the proposed watcher phases, GitHub events, guardrails, and terminal states with #22, #425, and the pure decision-function draft; pipeline.py is explicitly a separate pre-PR loop. Done means the full PR lifecycle is implemented with the stated policy and human-intervention boundaries.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- github, typescript
- Domain
- backend-api-design
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100