forked from strands-agents/sdk-python
-
Notifications
You must be signed in to change notification settings - Fork 0
testing label #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
dbschmigelski
wants to merge
100
commits into
integ-testing
Choose a base branch
from
main
base: integ-testing
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Partial fix to strands-agents#1069 - previously the agent would prematurely exit if the agent generated a tool with an invalid name; this avoids that by ensuring the agent loop continues with zero tool-uses. --------- Co-authored-by: Mackenzie Zastrow <zastrowm@users.noreply.github.com>
…ands-agents#1068) * feat: skip model invocation when latest message contains ToolUse - Add _has_tool_use_in_latest_message() helper function to detect ToolUse in latest message - Modify event_loop_cycle() to skip model execution when ToolUse is detected - Set stop_reason='tool_use' and use latest message directly for tool execution - Add comprehensive test coverage with 10 test scenarios - Maintain backward compatibility and existing functionality - No performance impact, minimal overhead for detection Resolves the requirement to skip model calls when the agent should directly execute tools based on existing ToolUse messages in the conversation. 🤖 Assisted by the code-assist agent script * fix: Check messages array size
* fix(litellm): enhance structured output handling * fix(litellm): update logic
…trands-agents#1091) Per bug strands-agents#1069, session-managers never persist tool-name changes after we initially persist the message, which means once an agent generates an invalid-tool name, that message history is poisoned on re-hydration. To avoid that going forward, do the translation of invalid-tool names on sending to the provider and not on the initial tool_use detection. The initial tool_use detection is needed to add a tool_response with a proper error message for the LLM, but this will avoid the poisoning issue --------- Co-authored-by: Mackenzie Zastrow <zastrowm@users.noreply.github.com>
* fix: (bug): Drop reasoningContent from request * fix: (bug): Drop reasoningContent from request * fix: (bug): Drop reasoningContent from request
) * feat: add multiagent hooks, add serialize & deserialize function to multiagent base & agent result * feat: add multiagent session manager, register hooks, fix import issue, rename deserialize function # Conflicts: # src/strands/experimental/agent_config.py * Delete __init__.py * fix: address comments * fix: renaming function to keep consistent with existing code * feat: add multiagent session/repository management pattern * fix: fix unit tests * fix: address comments * fix: update parameter to use MultiAgentBase * fix: fix unit tests
…full" (strands-agents#1072) * fix: detect guardrails with trace="enabled_full" Fix and simplify _find_detected_and_blocked_policy so that it correctly works even in case the guardrails assessments contains both detected and non-detected filters (as with guardrail_trace="enabled_full") * test: add bedrock int tests with different guardrail_trace levels * test: add xfail with guardrail_trace=disabled
* fix: Fix broken converstaion with orphaned toolUse * fix: Address pr cmments
…ents#1110) * feat: enable multiagent session persistent # Conflicts: # src/strands/multiagent/graph.py # src/strands/multiagent/swarm.py # tests/strands/multiagent/test_graph.py # tests/strands/multiagent/test_swarm.py # tests_integ/test_multiagent_graph.py # tests_integ/test_multiagent_swarm.py * fix: fix docstring * fix: rebase from main and address comments * fix: fix nit
…ching (strands-agents#1112) * feat(model): support prompt caching via SystemContentBlock * fix: concat text blocks for system_prompt * remove litellm and openai changes for now * integ tests * linting * linting * fix test * add test cases
PR#1078 mentioned that context overflows were not handled, but I wasn't able to reproduce using the code changes in it. However, in testing (using @DEA's suggested test) I was able to reproduce and consistently got a "prompt is too long:" error Co-authored-by: Mackenzie Zastrow <zastrowm@users.noreply.github.com>
…trands-agents#1142) Per strands-agents#1067 including the args in the description is redundant as it's already included in the parameter docs which can increase the token counts. Strip args from the description strings for inputSpecs --------- Co-authored-by: Mackenzie Zastrow <zastrowm@users.noreply.github.com>
…ands-agents#1089) --------- Co-authored-by: Dean Schmigelski <dbschmigelski+github@gmail.com>
Bumps [actions/checkout](https://github.com/actions/checkout) from 5 to 6. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](actions/checkout@v5...v6) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Updates the requirements on [pytest-asyncio](https://github.com/pytest-dev/pytest-asyncio) to permit the latest version. - [Release notes](https://github.com/pytest-dev/pytest-asyncio/releases) - [Commits](pytest-dev/pytest-asyncio@v1.0.0...v1.3.0) --- updated-dependencies: - dependency-name: pytest-asyncio dependency-version: 1.3.0 dependency-type: direct:development ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4 to 6. - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](actions/upload-artifact@v4...v6) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 5 to 7. - [Release notes](https://github.com/actions/download-artifact/releases) - [Commits](actions/download-artifact@v5...v7) --- updated-dependencies: - dependency-name: actions/download-artifact dependency-version: '7' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
….0 (strands-agents#1242) Updates the requirements on [pre-commit](https://github.com/pre-commit/pre-commit) to permit the latest version. - [Release notes](https://github.com/pre-commit/pre-commit/releases) - [Changelog](https://github.com/pre-commit/pre-commit/blob/main/CHANGELOG.md) - [Commits](pre-commit/pre-commit@v3.2.0...v4.5.0) --- updated-dependencies: - dependency-name: pre-commit dependency-version: 4.5.0 dependency-type: direct:development ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* feat: add api check to github workflow * Update pr-and-push.yml fix package name. * fix: Compare against the actual base of the PR or the previous commit on push, rather than the latest tag * fix: add more explicit error message * feat: add name to each step
…gents#1352) Bumps [aws-actions/configure-aws-credentials](https://github.com/aws-actions/configure-aws-credentials) from 4 to 5. - [Release notes](https://github.com/aws-actions/configure-aws-credentials/releases) - [Changelog](https://github.com/aws-actions/configure-aws-credentials/blob/main/CHANGELOG.md) - [Commits](aws-actions/configure-aws-credentials@v4...v5) --- updated-dependencies: - dependency-name: aws-actions/configure-aws-credentials dependency-version: '5' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…strands-agents#1004) Updates the requirements on [ruff](https://github.com/astral-sh/ruff) to permit the latest version. - [Release notes](https://github.com/astral-sh/ruff/releases) - [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md) - [Commits](astral-sh/ruff@0.13.0...0.14.0) --- updated-dependencies: - dependency-name: ruff dependency-version: 0.14.0 dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…ands-agents#1374) Allow conversation managers to act as hook providers and add an option to built-in conversation managers to proactively apply message management during the agent loop execution. Use that functionality to add an option to SlidingWindowConversationManager to allow per_turn management application Fixes strands-agents#509 --------- Co-authored-by: Mackenzie Zastrow <zastrowm@users.noreply.github.com>
Bumps [actions/checkout](https://github.com/actions/checkout) from 5 to 6. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](actions/checkout@v5...v6) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Mackenzie Zastrow <zastrowm@users.noreply.github.com>
…gents#1405) Users need the ability to retry model calls on arbitrary exceptions beyond just ModelThrottledException, and also retry based on response validation. This feature adds a low-level mechanism that enables that and more by letting hooks implement custom retry logic for both exceptions and successful responses. --------- Co-authored-by: Strands Agent <217235299+strands-agent@users.noreply.github.com> Co-authored-by: Mackenzie Zastrow <zastrowm@users.noreply.github.com>
…ed (strands-agents#1380) Previously, the deprecation warning was emitted at module import time, which triggered whenever `strands` was imported because other modules import from `experimental.hooks`. Changed to use `__getattr__` to lazily emit the warning only when the deprecated aliases (BeforeToolInvocationEvent, AfterToolInvocationEvent, BeforeModelInvocationEvent, AfterModelInvocationEvent) are actually accessed. Fixes strands-agents#1236 --------- Co-authored-by: Mackenzie Zastrow <zastrowm@users.noreply.github.com>
dbschmigelski
pushed a commit
that referenced
this pull request
Jan 16, 2026
…1474) * feat(hooks): expose input messages to BeforeInvocationEvent Add messages attribute to BeforeInvocationEvent to enable input-side guardrails for PII detection, content moderation, and prompt attack prevention. Hooks can now inspect and modify messages before they are added to the agent's conversation history. - Add writable messages attribute to BeforeInvocationEvent (None default) - Pass messages parameter from _run_loop() to BeforeInvocationEvent - Add unit tests for new messages attribute and writability - Add integration tests for message modification use case - Update docs/HOOKS.md with input guardrails documentation Resolves #8 * refactor: address review feedback - Remove detailed Input Guardrails section from docs/HOOKS.md - Simplify BeforeInvocationEvent docstring per review - Remove backward compatibility note from messages attribute - Remove no-op test for messages initialization * refactor: simplify test assertions per review Use concise equality comparison for BeforeInvocationEvent assertions instead of verbose instance checks and property assertions. * Use overwritten messages array for the agent * Fix mypy issue --------- Co-authored-by: Strands Agent <217235299+strands-agent@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Related Issues
Documentation PR
Type of Change
Bug fix
New feature
Breaking change
Documentation update
Other (please describe):
Testing
How have you tested the change? Verify that the changes do not break functionality or introduce warnings in consuming repositories: agents-docs, agents-tools, agents-cli
hatch run prepareChecklist
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.