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

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

オープン
#583 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
adapters cost-finops enhancement
主要言語
TypeScript
スター
143
フォーク
46
平均マージ
3日 10時間
マージ済み PR(30日)
24

説明

## 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.

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

まず、既存のCDKのfanout機構、GitHubコメントヘルパー、Linear/Jiraの最終ステータス実装を見つけ、その後fanoutテストを実行します。完了とは、GitHub issueを起点とするタスクに、結果、コスト、ターン数、所要時間、task id、関連するPRまたは停止理由を含む、冪等な単一の終端コメントが付くことです。一方、リトライとGitHub以外のタスクは、記載された動作に従います。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
aws, github, typescript
領域
backend, devops
issue の種類
機能追加
難易度
4/5
見積もり時間
3〜5日
活発さ
静か
明瞭さ
おおむね明確
初心者へのやさしさ
52/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。