invoke: CUSTOM_JWT runtime errors discard the response body and error type (e.g. "Token has expired")
Los mantenedores suelen responder en 1 día
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 82/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- node.js, typescript
- Área
- cli
Línea de trabajo
Empieza en src/core/invokeRuntime.ts, en la rama !response.ok de invokeRuntimeWithCustomJwt (alrededor de las líneas 170-178), donde se cancela el body y solo sobreviven status/headers. Lee el body con una lectura acotada antes de cancelar, parsea error.message para bodies JSON-RPC y message para JSON simple, y recurre a la línea de estado existente cuando esté vacío o no se pueda parsear; además, revisa la ruta de salida --json para que ambos campos se incluyan. Terminado cuando una invocación rechazada contra un runtime real imprime el tipo de error y el mensaje en stderr y los mismos campos aparecen en --json.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- TypeScript
- Estrellas
- 339
- Forks
- 129
- Merge medio
- 19 h 21 min
- PR fusionados (30 d)
- 125
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de aws/agentcore-cli
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
aws/agentcore-cli#2940 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
aws/agentcore-cli#2939 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
aws/agentcore-cli#2938 ·
Los mantenedores suelen responder en 1 día
-
--debug has no effect; service error name, HTTP status and request ID never reach the terminalPosiblemente ocupada @abhiramshaji-cyber la tomó hace 3 días. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
aws/agentcore-cli#2874 ·
Los mantenedores suelen responder en 1 día
-
`agentcore dev` container fails with LoginTokenLoadError when using `aws login` credentialsPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 80/100
aws/agentcore-cli#2606 · 4 comentarios ·
Los mantenedores suelen responder en 1 día
Todos los issues de aws/agentcore-cli
Issues similares
-
bot:ai-assisted component:faucet status:untriaged
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
midnightntwrk/midnight-faucet-api#222 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
bluesky-social/social-app#12545 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
knaw-huc/textannoviz#742 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
cloudflare/realtimekit-ui#219 ·
Los mantenedores suelen responder en 1 día
-
Lambda Web Function AvailabilityAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
cdklabs/cdk-nextjs#365 ·
Los mantenedores suelen responder en 1 día