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

feat(agent): S3-backed Claude SDK session store

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

説明

**Context:** ROADMAP.md → S3-backed SDK session store (portable transcripts)

---

## Component

Agent (Python runtime)

## Describe the feature

Plumb the Claude Agent SDK **`SessionStore`** to S3 (dedicated bucket or prefix) with:

- Eager flush, IAM-scoped access, conditional part creates, checksums, adaptive retries, structured logging
- Metrics/alarms on transcript mirror failures
- Graceful shutdown (`disconnect` on SIGTERM/cancel) so in-flight frames flush
- Persist **`task_id` ↔ Claude session UUID** (from first `ResultMessage`) for resume on another worker
- Keep agent **`cwd` stable** so SDK-derived `project_key` paths stay predictable
- Plan **compaction** when part count threatens resume latency
- Optional **S3 Express One Zone** when fleet is single-AZ

Complements shipped **Persistent session storage** (`/mnt/workspace` FUSE caches) and end-of-task **trace** upload to `traces/...jsonl.gz`.

## Use case

In-VM caches do not survive worker migration or long pauses. Portable transcripts enable resume, debugging, and compliance without relying solely on end-of-task trace upload.

## Proposed solution

1. S3 prefix per `task_id` + SDK `project_key`; SessionRole scoped writes.
2. Flush on frame boundary; `disconnect` on shutdown.
3. Alarms on mirror failures; structured logging.
4. Compaction when part count threatens resume latency.
5. Optional S3 Express One Zone when fleet is single-AZ.
6. Map first `ResultMessage` session UUID to `task_id` in DynamoDB for cross-worker resume.

## Other information

- Shipped: persistent session storage on `/mnt/workspace`; execution tracing to `traces/...jsonl.gz`.
- Design context: `docs/design/COMPUTE.md`, `docs/design/OBSERVABILITY.md`.

- [ ] This might be a breaking change

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

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

調査の方向性

ROADMAP.md と docs/design/COMPUTE.md および docs/design/OBSERVABILITY.md の設計コンテキストから始めてください。次に、出荷済みの /mnt/workspace session storage と traces/...jsonl.gz のアップロードエントリポイントを見つけてください。完了とは、portable SessionStore ミラーリング、worker 間の session マッピング、シャットダウン時のフラッシュ、障害アラーム、リトライ、コンパクションをカバーする合意済みの実装があることです。

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

評価

技術スタック
aws, python
領域
backend, cloud, distributed-systems, observability
issue の種類
機能追加
難易度
5/5
見積もり時間
1週間以上
活発さ
静か
明瞭さ
説明が足りない
初心者へのやさしさ
25/100

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

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