invoke: CUSTOM_JWT runtime errors discard the response body and error type (e.g. "Token has expired")
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 82/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ệ
- node.js, typescript
- Lĩnh vực
- cli
Hướng nghiên cứu
Bắt đầu trong src/core/invokeRuntime.ts, trong nhánh !response.ok của invokeRuntimeWithCustomJwt (khoảng dòng 170-178), nơi body bị hủy và chỉ còn lại status/headers. Đọc body bằng một lần đọc có giới hạn trước khi hủy, parse error.message cho các body JSON-RPC và message cho JSON thuần, và fallback về dòng status hiện có khi rỗng hoặc không parse được; đồng thời kiểm tra đường xuất --json để cả hai trường được bao gồm. Hoàn tất khi một invocation bị từ chối với runtime thật in ra loại lỗi và thông điệp ra stderr và các trường tương tự xuất hiện trong --json.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Description
When a CUSTOM_JWT Runtime invocation returns a non-2xx response, the CLI discards the response body and the x-amzn-errortype header, so the reason for the failure never reaches the user.
In src/core/invokeRuntime.ts (invokeRuntimeWithCustomJwt), the !response.ok branch reads the request ID, then calls response.body?.cancel() and returns only status and header metadata.
Since #2751 (1.0.2) a status line is printed to stderr. Before that (1.0.1) nothing was printed at all.
Steps to Reproduce
- Have a Runtime with a CUSTOM_JWT authorizer.
- Invoke it with an expired token:
agentcore invoke --runtime <name> --bearer-token "$EXPIRED_TOKEN" --payload '{"prompt":"hi"}'
Expected Behavior
stderr includes the error type and the message from the response body, for example:
Error: HTTP 401 UnrecognizedClientException: Token has expired (request-id=<id>)
Actual Behavior
1.0.2+ prints only:
status=401 content-type=... complete=false bytes=0 error=HTTP 401 request-id=<id>
1.0.1 prints nothing and exits 1.
For comparison, the same request with curl returns header x-amzn-errortype: UnrecognizedClientException:<namespace> and body {"jsonrpc":"2.0","error":{"code":-32001,"message":"Token has expired"}}.
CLI Version
1.1.0 (also 1.0.1)
Operating System
Linux
Additional Context
Acceptance:
- On a rejected CUSTOM_JWT invocation, read (a bounded amount of) the body and surface the error type and message.
- Handle both JSON-RPC (
error.message) and plain JSON (message) bodies; fall back to the current status line when the body is empty or unparseable. -
--jsonoutput carries the same fields.
- Ngôn ngữ chính
- TypeScript
- Star
- 339
- Fork
- 129
- Merge trung bình
- 19 giờ 21 phút
- Pull request đã merge (30 ngày)
- 125
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/agentcore-cli
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
aws/agentcore-cli#2940 ·
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 78/100
aws/agentcore-cli#2939 ·
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 84/100
aws/agentcore-cli#2938 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
--debug has no effect; service error name, HTTP status and request ID never reach the terminalCó thể đã có người làm @abhiramshaji-cyber đã nhận 3 ngày trước. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
aws/agentcore-cli#2874 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
`agentcore dev` container fails with LoginTokenLoadError when using `aws login` credentialsCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
aws/agentcore-cli#2606 · 4 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của aws/agentcore-cli
Issue tương tự
-
bot:ai-assisted component:faucet status:untriaged
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
midnightntwrk/midnight-faucet-api#222 ·
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 78/100
bluesky-social/social-app#12545 ·
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 67/100
knaw-huc/textannoviz#742 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
cloudflare/realtimekit-ui#219 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Lambda Web Function AvailabilityĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
cdklabs/cdk-nextjs#365 ·
Maintainer thường phản hồi trong vòng 1 ngày