Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions .github/workflows/integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@ name: Secure Integration test
on:
pull_request_target:
branches: main

jobs:
authorization-check:
permissions: read-all
runs-on: ubuntu-latest
outputs:
outputs:
approval-env: ${{ steps.collab-check.outputs.result }}
steps:
- name: Collaborator Check
uses: actions/github-script@v7
id: collab-check
with:
result-encoding: string
script: |
script: |
try {
const permissionResponse = await github.rest.repos.getCollaboratorPermissionLevel({
owner: context.repo.owner,
Expand All @@ -31,7 +31,7 @@ jobs:
} else {
console.log(`Verifed ${context.payload.pull_request.user.login} has write access. Auto Approving PR Checks.`)
return "auto-approve"
}
}
} catch (error) {
console.log(`${context.payload.pull_request.user.login} does not have write access. Requiring Manual Approval to run PR Checks.`)
return "manual-approval"
Expand All @@ -45,9 +45,9 @@ jobs:
pull-requests: read
contents: read
steps:
- name: Configure Credentials
- name: Configure Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
with:
role-to-assume: ${{ secrets.STRANDS_INTEG_TEST_ROLE }}
aws-region: us-east-1
mask-aws-account-id: true
Expand All @@ -70,5 +70,3 @@ jobs:
id: tests
run: |
hatch test tests-integ


7 changes: 6 additions & 1 deletion src/strands/agent/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@ def _execute_event_loop_cycle(self, callback_handler: Callable[..., Any], kwargs

try:
# Execute the main event loop cycle
stop_reason, message, metrics, state = event_loop_cycle(
events = event_loop_cycle(
model=model,
system_prompt=system_prompt,
messages=messages, # will be modified by event_loop_cycle
Expand All @@ -559,6 +559,11 @@ def _execute_event_loop_cycle(self, callback_handler: Callable[..., Any], kwargs
event_loop_parent_span=self.trace_span,
**kwargs,
)
for event in events:
if "callback" in event:
callback_handler(**event["callback"])

stop_reason, message, metrics, state = event["stop"]

return AgentResult(stop_reason, message, metrics, state)

Expand Down
4 changes: 2 additions & 2 deletions src/strands/event_loop/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
iterative manner.
"""

from . import error_handler, event_loop, message_processor
from . import event_loop, message_processor

__all__ = ["error_handler", "event_loop", "message_processor"]
__all__ = ["event_loop", "message_processor"]
56 changes: 0 additions & 56 deletions src/strands/event_loop/error_handler.py

This file was deleted.

Loading