You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
CUSTOM_JWT runtime invocation fails silently for rejected bearer tokens #2745
When agentcore invoke calls a CUSTOM_JWT Runtime with a rejected bearer token, the command exits unsuccessfully without printing an error. The Runtime response contains an HTTP status and useful JSON error message, but the CLI discards the body and suppresses the resulting error.
Steps to Reproduce
Configure and deploy a Runtime with authorizerType set to CUSTOM_JWT.
Invoke it with an invalid or expired token:
agentcore invoke --runtime <runtime-name> --bearer-token <invalid-or-expired-token> --payload '{"prompt":"hello"}'\n echo $?\n ```\n\n3. Observe stdout, stderr, and the exit status.\n\n## Expected Behavior\n\nThe command exits nonzero and prints an actionable error containing at least the HTTP status. When safe and available, it should also include the service error type or message, for example that the token has expired.\n\n## Actual Behavior\n\nThe command exits with status 1 and prints nothing to stdout or stderr. Debug logging records only the HTTP status.\n\nIn the v1 implementation, `invokeRuntimeWithCustomJwt` cancels the non-success response body and throws `RuntimeInvokeResponseError("HTTP <status>")`. `RuntimeInvokeResponseError` extends `SilentCLIError`, so the top-level runner does not print it.\n\n## CLI Version\n\nObserved with 1.0.1 and confirmed in the current `v1.x` implementation.\n\n## Operating System\n\nLinux\n\n## Additional Context\n\nRelevant public code paths:\n\n- `src/core/invokeRuntime.ts`\n- `src/errors/errors.tsx`\n- `src/runnable/index.tsx`\n\nThe fix should preserve a bounded response size and avoid exposing bearer tokens or request headers in output or logs.
Activity