Repository navigation
Conversation
…cations Signed-off-by: Ym <173550318+MaxonT@users.noreply.github.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When a CUSTOM_JWT runtime rejects a call, invoke now shows the response body and error type, such as "Token has expired", instead of dropping them; I only had the issue title, so other error shapes may need checking.
When a CUSTOM_JWT Runtime invocation returns a non-2xx response,
invokeRuntimeWithCustomJwtcurrently cancels the body and only reports the status, so a rejected token giveserror=HTTP 401 request-id=...with no reason. Thank you to the reporter for the clear curl comparison and acceptance list; I followed it.This change reads a bounded amount of the rejected response (at most 4 KiB, with a 2 s read timeout) together with the
x-amzn-errortypeheader, and addserrorTypeandmessageto the rejected response'serror. The message is taken from a JSON-RPC body (error.message) or a plain JSON body (message/Message), whitespace-collapsed and capped at 500 characters. The stderr summary now reads, for example,error=HTTP 401 UnrecognizedClientException: Token has expired request-id=.... An empty, non-JSON or unexpected body falls back to the existing status line. Both--jsonand plain output use this same summary line, so they carry the same fields.Tests: added cases in
src/core/core.test.ts(JSON-RPC body plus header, plain JSON body, empty/unparseable/non-string bodies, oversized body) and insrc/handlers/runtime/invoke/response.test.ts(summary text).bun test src/core/core.test.ts src/handlers/runtime/invokepasses (56 tests in the two touched files),tsc --noEmitis clean, and the three new behavior tests fail with the source change reverted.Not verified: no real CUSTOM_JWT Runtime or expired token was available, so the behavior was checked against mocked
fetchresponses only. The interactive TUI screen (runtime/invoke/screen.tsx) was not changed and still shows status and request ID only. The fullbun testsuite was not run, only the touched areas plussrc/handlers/project/invoke.Refs #2875