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

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

Đang mở
#484 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
agent-runtime enhancement infra-cdk
Ngôn ngữ chính
TypeScript
Star
143
Fork
46
Merge trung bình
3 ngày 10 giờ
Pull request đã merge (30 ngày)
24

Mô tả

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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Bắt đầu với ROADMAP.md và ngữ cảnh thiết kế trong docs/design/COMPUTE.md và docs/design/OBSERVABILITY.md. Sau đó, xác định các entry point tải lên đã được cung cấp cho /mnt/workspace session storage và traces/...jsonl.gz. Được xem là hoàn tất khi một triển khai đã thống nhất bao quát việc mirror SessionStore portable, ánh xạ session giữa các worker, flush khi shutdown, cảnh báo lỗi, retry và compact.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
aws, python
Lĩnh vực
backend, cloud, distributed-systems, observability
Loại issue
Tính năng
Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức độ hoạt động
Ít trao đổi
Độ rõ ràng
Cần làm rõ
Mức phù hợp với người mới
25/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.