Skip to content

refactor(runtime): propagate invoke SDK errors - #1937

Merged
jariy17 merged 1 commit into
refactorfrom
fix/runtime-invoke-error-propagation
Aug 11, 2026
Merged

refactor(runtime): propagate invoke SDK errors#1937
jariy17 merged 1 commit into
refactorfrom
fix/runtime-invoke-error-propagation

Conversation

@aidandaly24

Copy link
Copy Markdown
Contributor

Summary

  • rethrow IAM InvokeAgentRuntime SDK failures without wrapping or rebuilding their diagnostics
  • let the existing root error boundary classify headless failures
  • preserve direct ServiceException metadata for structured TUI rendering
  • remove Runtime-specific logger plumbing and speculative redaction tests

Follow-up to the error-boundary review comments on #1930.

Testing

  • bun test src/core/core.test.ts src/handlers/runtime/invoke/invoke.screen.test.tsx src/handlers/runtime/invoke/invoke.test.tsx (85 pass)
  • bun run typecheck
  • bun run lint:check
  • bun run format:check
  • TUI Harness: headless invalid session surfaced the original AWS validation message
  • TUI Harness: interactive invalid session retained structured type, HTTP status, message, and request ID
  • bun test src reached 816 pass; the only two failures were unchanged src/io/exec.test.ts subprocess-output assertions that reproduce in this environment

Comment thread src/core/runtime.tsx
}`,
{ cause: error },
);
throw error;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do these errors need to be wrapped with AgentCoreCLIError.fromError(error) with the relevant settings so we know the error was a service error?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question. Headless failures are already converted through AgentCoreCLIError.fromError in the root catch, which recognizes ServiceException and assigns the appropriate error source. The TUI consumes the original exception directly for structured rendering, so I think wrapping it inside Core would duplicate that boundary.

@aidandaly24
aidandaly24 force-pushed the fix/runtime-invoke-error-propagation branch from be8f071 to 498aee6 Compare August 10, 2026 15:14
@codecov-commenter

codecov-commenter commented Aug 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.68%. Comparing base (7e29eda) to head (827d3b3).

Additional details and impacted files
@@             Coverage Diff              @@
##           refactor    #1937      +/-   ##
============================================
- Coverage     96.69%   96.68%   -0.01%     
============================================
  Files           291      291              
  Lines         16012    15980      -32     
============================================
- Hits          15483    15451      -32     
  Misses          529      529              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@aidandaly24
aidandaly24 force-pushed the fix/runtime-invoke-error-propagation branch from 498aee6 to 827d3b3 Compare August 10, 2026 15:43
@jariy17
jariy17 merged commit d90fa2b into refactor Aug 11, 2026
10 checks passed
@jariy17
jariy17 deleted the fix/runtime-invoke-error-propagation branch August 11, 2026 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants