fix(runtime): polish invoke TUI errors and sessions - #1930
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## refactor #1930 +/- ##
=========================================
Coverage 96.28% 96.29%
=========================================
Files 245 245
Lines 12105 12130 +25
=========================================
+ Hits 11655 11680 +25
Misses 450 450 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
AlexanderRichey
left a comment
There was a problem hiding this comment.
Approved with a couple comments we might want to address in a follow up.
| @@ -194,7 +199,10 @@ | |||
| }) | |||
| .debug("Runtime invocation SDK request failed"); | |||
| throw new Error( | |||
There was a problem hiding this comment.
Should this be an AgentCoreError?
| if (typeof sdkError?.name === "string" && sdkError.name !== "Error") { | ||
| diagnostics.push(sdkError.name); | ||
| } | ||
| if (typeof sdkError?.$metadata?.httpStatusCode === "number") { |
There was a problem hiding this comment.
Is all of this complexity necessary? Why not simply throw the error? All of these details should already be handled in the error message, no? If they're not handled, then extracting this complexity into a reusable helper would help to simplify the main flow at this level.
Summary
--session-idJSON payloadheading and trailing response whitespace before settled metadataTesting
bun test src/core/core.test.ts src/handlers/runtime/invoke/invoke.screen.test.tsx(60pass)bun run typecheckbun run lint:checkbun run format:check--session-id; generated ID persisted in request and responseValidationExceptiontype, HTTP status, complete message, and request ID on separate linesbun test src: the only failures were two unchangedsrc/io/exec.test.tssubprocess-output assertions that reproduce when run alone in this environment