Skip to content

fix(harness): add error handling for invoke_harness API call#1056

Merged
jesseturner21 merged 1 commit intomainfrom
fix/harness-error-handling
Apr 30, 2026
Merged

fix(harness): add error handling for invoke_harness API call#1056
jesseturner21 merged 1 commit intomainfrom
fix/harness-error-handling

Conversation

@jesseturner21
Copy link
Copy Markdown
Contributor

Summary

  • Wraps the invoke_harness_streaming call in a try/except block so boto3 errors (bad credentials, network issues, invalid ARN) produce a clean error message instead of a raw Python traceback in GitHub Actions logs.

Test plan

  • Verified Python syntax is valid
  • Trigger harness review workflow with an invalid ARN to confirm clean error output

Wrap the invoke_harness_streaming call in a try/except so boto3 errors
(bad credentials, network issues, invalid ARN) produce a clean error
message instead of a raw traceback in GitHub Actions logs.
@jesseturner21 jesseturner21 requested a review from a team April 30, 2026 15:25
@github-actions github-actions Bot added size/xs PR size: XS agentcore-harness-reviewing AgentCore Harness review in progress labels Apr 30, 2026
Copy link
Copy Markdown
Contributor

@tejaskash tejaskash left a comment

Choose a reason for hiding this comment

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

LGTM

@jesseturner21 jesseturner21 merged commit 9a6a5d0 into main Apr 30, 2026
23 of 24 checks passed
@jesseturner21 jesseturner21 deleted the fix/harness-error-handling branch April 30, 2026 15:27
@github-actions github-actions Bot removed the agentcore-harness-reviewing AgentCore Harness review in progress label Apr 30, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 43.02% 7794 / 18117
🔵 Statements 42.42% 8247 / 19439
🔵 Functions 40.46% 1349 / 3334
🔵 Branches 40.65% 5108 / 12564
Generated in workflow #2189 for commit 5fd5a0a by the Vitest Coverage Report Action

@agentcore-cli-automation
Copy link
Copy Markdown

Reviewed the change — it's a small, safe addition that wraps the invoke_harness_streaming call in a try/except so boto3 client errors (bad credentials, invalid ARN, etc.) produce a clean error message instead of a raw traceback. Looks good to merge.

One small observation (non-blocking): the try/except only covers the invoke_harness API call itself. Errors that occur while iterating the event stream inside print_stream (e.g. network drops mid-stream, botocore.exceptions.EventStreamError) would still surface as raw tracebacks. Server-side stream errors are already handled via the internalServerException / runtimeClientError event types, so this is only a concern for client-side/transport errors during streaming. Fine to address separately if it ever becomes a problem in practice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/xs PR size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants