fix(api): GET /v1/pending lists approval requests whose window has passed
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 78/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- aws, typescript
Hướng nghiên cứu
Start with the query and row mapping in cdk/src/handlers/get-pending.ts, then check PR #904 for the agreed expiration rule and PR #1013 for how timeout_s of 0 is handled. Filter expired requests while preserving rows with no automatic deadline. Done means GET /v1/pending omits expired requests and retains requests whose timeout is 0.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Component
CDK / infrastructure (API handlers)
Describe the bug
GET /v1/pending (bgagent pending) lists approval requests whose window has already passed.
The handler returns every row of the caller whose status is PENDING. It computes expires_at (created_at + timeout_s) for each row, and never compares it with the clock (cdk/src/handlers/get-pending.ts, the query and the mapping that follows it).
Normally the agent ends the wait itself and writes TIMED_OUT, which takes the row out of the list. A stale row is left when the agent can no longer do that: its container is gone, or the task was failed or cancelled while it waited. The row then stays PENDING until DynamoDB's TTL deletes it. The TTL is created_at + timeout_s + 120 s, and DynamoDB deletes expired items lazily, so the row can stay listed long after its window.
Expected behavior
A request whose window has passed is not listed as pending.
Current behavior
The request is listed, with an expires_at in the past. Approving or denying it is refused once the task has left AWAITING_APPROVAL; before that it records a decision that no agent is waiting for.
Reproduction steps
- Leave an approval row in status
PENDINGwhosecreated_at + timeout_sis in the past. On a deployed stack: let a task reach an approval gate, stop its agent (for example by cancelling the task), and wait for the window to pass. On a table without TTL deletion (the emulator tier's tables): write such a row directly. - Call
GET /v1/pendingas the row's user. - The response contains the request.
Possible solution
Filter out rows whose computed expires_at is in the past in get-pending.ts. The index the handler reads already projects created_at and timeout_s, so this needs no index change.
Two things to check when doing it:
- Open PR #904 adds a
deadline_epochto the row and makes approve and deny refuse after it. That settles what "expired" means, and the filter should use the same rule. - Open PR #1013's writer accepts
timeout_s0 as "no automatic deadline". A filter must keep such rows.
Additional context
Found by the investigation recorded in docs/research/aws-emulator-local-tests.md (pull request for #1041), re-checked on main at 8697c821. It is not fixed by that pull request. No open pull request changes get-pending.ts.
AWS quotas
- I have reviewed the relevant service quotas (or N/A)
- Ngôn ngữ chính
- TypeScript
- Star
- 173
- Fork
- 53
- Merge trung bình
- 2 ngày 9 giờ
- Pull request đã merge (30 ngày)
- 14
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của aws-samples/sample-autonomous-cloud-coding-agents
-
bug infra-cdk
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
aws-samples/sample-autonomous-cloud-coding-agents#1044 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
cdk: support Docker-compatible engines such as Finch (clean:disk hard-codes docker)Có thể đã có người làm @alvarohare đã nhận 19 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
aws-samples/sample-autonomous-cloud-coding-agents#969 · 1 bình luận · 1 reaction · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
aws-samples/sample-autonomous-cloud-coding-agents#968 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
documentation P2 security
Độ khó 2/5 1-2 ngày Mức phù hợp với người mới 74/100
aws-samples/sample-autonomous-cloud-coding-agents#793 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Docs: How to clear previously set attributes for a blueprintCó thể làm lại được @rkumarus-aws đã nhận 77 ngày trước và không có pull request nào đang mở. Đang mởdocumentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
aws-samples/sample-autonomous-cloud-coding-agents#767 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của aws-samples/sample-autonomous-cloud-coding-agents
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
ilan-pinto/roaring-lions#1552 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug: [React Native/Android] KeepAliveService never starts when CAMERA is not granted (Android 14+)Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
cloudflare/realtimekit-ui#208 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
usebruno/bruno-vscode#235 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày