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

feat(github): post final status comments with cost, turns, and duration

Ouverte
#583 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
adapters cost-finops enhancement
Langage dominant
TypeScript
Étoiles
143
Forks
46
Merge moyen
3 j 10 h
PR mergées (30 j)
24

Description

## Component

CDK fanout, GitHub adapter

## Describe the feature

GitHub issue-origin tasks should receive a deterministic final status comment with outcome, cost, turns, duration, task id, and PR link when relevant, matching Linear and the Jira parity issue.

The existing GitHub fanout machinery edits GitHub issue comments for task progress in other contexts, but the GitHub Issues channel needs the terminal status to land on the originating GitHub issue.

## Use case

A user who triggers ABCA from a GitHub issue should be able to see whether the task completed, failed, timed out, or shipped a PR but stopped early without switching to the CLI or logs.

## Proposed solution

Extend fanout for `channel_source: "github"` tasks created from GitHub Issues:

- Read GitHub issue metadata from task `channel_metadata`.
- Render the same outcome framing used for Linear/Jira final status comments.
- Include cost, turns/max-turns, duration, task id, and PR URL when needed.
- Post or edit a GitHub issue comment using the existing GitHub comment helper and token path.
- Persist an idempotency marker/comment id so stream retries do not create duplicate terminal comments.
- Keep progress comments and terminal fanout responsibilities clearly separated.

## Acceptance criteria

- GitHub issue-origin terminal tasks receive one final status comment with cost, turns, duration, and task id.
- A task that opens a PR but fails/stops later includes both the PR link and the stop reason.
- Agent crashes before agent-side completion still produce the platform-side final status comment.
- Retryable GitHub API failures trigger fanout retry; terminal auth/config failures are logged.
- Non-GitHub tasks are unaffected.

## Tests

- Fanout tests cover GitHub success, failure, PR-but-stopped, missing metadata, non-GitHub skip, idempotent retry, and retryable post failure.
- GitHub comment helper tests cover final status rendering if needed.
- Docs mention cost/turn/duration final comments in the GitHub Issues setup guide.

## Out of scope

- GitHub Projects status automation.
- Live streaming progress.
- PR review comments.
- Cost rollups across parent/sub-issues.

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Commencez par localiser le mécanisme de fanout existant de CDK, l’helper de commentaires GitHub et l’implémentation du statut final de Linear/Jira ; exécutez ensuite les tests de fanout. Le travail est considéré comme terminé lorsque les tâches provenant d’issues GitHub reçoivent un unique commentaire terminal idempotent couvrant le résultat, le coût, les tours, la durée, le task id et la PR pertinente ou la raison de l’arrêt, tandis que les retries et les tâches non-GitHub suivent le comportement indiqué.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
aws, github, typescript
Domaine
backend, devops
Type d'issue
Fonctionnalité
Difficulté
4/5
Temps estimé
3-5 jours
Activité
Calme
Clarté
Plutôt claire
Accessibilité débutants
52/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.