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

(orchestration): Hydrate task context from Slack thread URLs

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

説明

## Component

API or orchestration

## Describe the feature

Allow task creation (API, CLI, and Slack-origin flows) to accept a **Slack thread permalink** and hydrate the prompt from the full thread: messages, linked files, and bot replies in chronological order, within the existing hydration token budget.

## Use case

Teams often spec work in Slack: discussion, clarifications, and links accumulate in a thread before anyone files a ticket. Submitting only a one-line description drops that context. Background agents work best when the **collaboration artifact** (the thread) is the spec.

## Proposed solution

1. Extend create-task schema with optional `slack_thread_url` (or channel-specific metadata when origin is already Slack).
2. Add hydration fetcher using the installed Slack app token (same credentials as notification dispatcher).
3. Normalize thread to markdown sections; trim oldest non-essential messages first (mirror PR comment trimming).
4. Screen fetched text through existing Guardrails / sanitization paths.
5. CLI: `bgagent submit --slack-thread ...`.

## Other information

- Requires linked Slack workspace (existing setup guide).
- Complements shipped Slack @mention submission; this targets **richer context** for the same channel.
- Consider rate limits and `channel:history` scopes in setup docs.

## Acknowledgements

- [ ] I may be able to implement this feature
- [ ] This might be a breaking change

## Acceptance criteria

- [ ] API and CLI accept optional Slack thread reference; types mirrored in `cli/src/types.ts`.
- [ ] Hydration includes thread body in prompt when provided; title/issue body still preserved.
- [ ] Token budget enforcement matches existing hydration rules.
- [ ] SSRF-safe: only `slack.com` / workspace URLs from configured workspace; reject arbitrary URLs.
- [ ] Tests use mocked Slack API responses in `cdk/test/handlers/shared/context-hydration.test.ts`.

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

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

調査の方向性

まず、既存の hydration ルールと Slack 通知ディスパッチャーの credential path を読みます。次に、モックされた Slack レスポンスを含めて、cli/src/types.ts と cdk/test/handlers/shared/context-hydration.test.ts を確認します。API と CLI が thread reference を受け付け、タイトルと issue body を保持し、token budget 内で安全に hydrate し、認証されていない URL を拒否できれば完了です。

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

評価

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

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

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