aws-samples / aws-samples/sample-autonomous-cloud-coding-agents

feat(orchestration): autonomous feedback loop (PR watcher → merge)

Aperta
#444 1 commento 0 reazioni 0 assegnatari Vedi su GitHub
agent-runtime enhancement orchestration
Lingua principale
TypeScript
Stelle
143
Fork
46
Merge medio
3g 10h
PR unite (30g)
24

Descrizione

**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

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia da ROADMAP.md e docs/design/ORCHESTRATOR.md, oltre a docs/design/EVALUATION.md, poi esamina l’orchestrator esistente e il flusso pr_iteration. Confronta le fasi proposte del watcher, gli eventi GitHub, i guardrails e gli stati terminali con #22, #425 e la bozza della funzione decisionale pura; pipeline.py è esplicitamente un ciclo pre-PR separato. Il lavoro è completo quando è implementato l’intero ciclo di vita del PR con la policy indicata e i confini dell’intervento umano stabiliti.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
github, typescript
Ambito
backend-api-design
Tipo di issue
Funzionalità
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Tranquilla
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.