Skip to content

sync-preview: merge main into preview#1057

Merged
aidandaly24 merged 9 commits intopreviewfrom
sync-preview/merge-main-20260430-v2
Apr 30, 2026
Merged

sync-preview: merge main into preview#1057
aidandaly24 merged 9 commits intopreviewfrom
sync-preview/merge-main-20260430-v2

Conversation

@aidandaly24
Copy link
Copy Markdown
Contributor

Description

Merge main into preview — includes harness Dockerfile and review script refactor.

⚠️ You MUST merge this PR using "Create a merge commit". NOT squash. NOT rebase.

Type of Change

  • Other (please describe): sync main → preview

jesseturner21 and others added 6 commits April 30, 2026 11:00
* refactor: move harness resources to .github/harness/

Move PR reviewer harness files into a dedicated .github/harness/ directory,
separate from the general .github/scripts/ used by Strands workflows.

- Move harness_review.py, prompts/ to .github/harness/
- Add Dockerfile for the harness container (dual-token: CLONE_TOKEN for
  git clones, GITHUB_TOKEN for gh CLI/PR comments)
- Add README documenting the harness directory
- Update pr-ai-review workflow to reference new path
- Update .prettierignore for new prompts location

* fix(harness): update Dockerfile comment to accurately describe token handling

Tokens are baked into image layers at build time — the previous comment
incorrectly implied they were not stored. Updated to make the security
posture explicit: the image itself must be treated as a secret.

* refactor(harness): use boto3 invoke_harness instead of raw SigV4 HTTP

Replace manual SigV4 signing + urllib3 + EventStreamBuffer parsing with
the native boto3 bedrock-agentcore client's invoke_harness method.
This simplifies the code significantly and leverages the typed event
stream response from the SDK.

Rejected: keep raw HTTP approach | boto3 now supports invoke_harness natively
Confidence: high
Scope-risk: narrow

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
…voke_harness

- Move harness_review.py, prompts/ to .github/harness/
- Add Dockerfile for the harness container (dual-token setup)
- Add README documenting the harness directory
- Update pr-ai-review workflow to reference new path
- Replace manual SigV4 signing + urllib3 with native boto3 invoke_harness
- Update .prettierignore for new prompts location
chore: reland harness refactor without co-author metadata
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.
@aidandaly24 aidandaly24 requested a review from a team April 30, 2026 15:58
@github-actions github-actions Bot added the agentcore-harness-reviewing AgentCore Harness review in progress label Apr 30, 2026
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 30, 2026

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 43.43% 8717 / 20067
🔵 Statements 42.78% 9228 / 21569
🔵 Functions 41.01% 1475 / 3596
🔵 Branches 40.66% 5683 / 13976
Generated in workflow #2198 for commit 7590650 by the Vitest Coverage Report Action

@agentcore-cli-automation
Copy link
Copy Markdown

parse_events in .github/harness/harness_review.py doesn't handle the validationException event type. The boto3 event stream for invoke_harness can emit messageStart, contentBlockStart, contentBlockDelta, contentBlockStop, messageStop, metadata, internalServerException, validationException, and runtimeClientError, but the current if/elif chain only yields five of those — validationException is silently dropped.

The previous SigV4-based parser treated any event with :message-type: exception as fatal and exited non-zero. With the boto3 rewrite we lost that fallthrough, so an in-stream validation error will now cause the workflow to exit 0 with no review posted and no error surfaced, which is a regression worth fixing before merge.

A couple of ways to fix:

  1. Add an explicit elif "validationException" in event: branch in parse_events, and a matching handler in print_stream that closes the group, prints the error to stderr, and sys.exit(1) — mirroring the internalServerException / runtimeClientError handlers.

  2. Generically handle any modeled exception event by yielding it as an error and exiting — e.g. check shape.metadata.get('exception') or just treat any top-level key that ends in Exception/Error as fatal. This would be more future-proof if the service adds new exception event types.

(Minor side note while you're in there: the new .github/harness/README.md describes harness_review.py as "Invokes the harness to review PRs (SigV4 + event stream)" — that parenthetical is stale now that the script uses the boto3 client.)

@github-actions github-actions Bot removed the agentcore-harness-reviewing AgentCore Harness review in progress label Apr 30, 2026
avi-alpert and others added 2 commits April 30, 2026 12:12
# Conflicts:
#	CHANGELOG.md
#	package-lock.json
#	package.json
@aidandaly24 aidandaly24 merged commit 18fa2c9 into preview Apr 30, 2026
15 checks passed
@aidandaly24 aidandaly24 deleted the sync-preview/merge-main-20260430-v2 branch April 30, 2026 16:23
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.

4 participants