fix(slack): preserve parent agent's system prompt in message processing#372
Open
strands-agent wants to merge 1 commit intostrands-agents:mainfrom
Open
fix(slack): preserve parent agent's system prompt in message processing#372strands-agent wants to merge 1 commit intostrands-agents:mainfrom
strands-agent wants to merge 1 commit intostrands-agents:mainfrom
Conversation
The Slack tool was overwriting the agent's system_prompt with only the SLACK_SYSTEM_PROMPT constant, ignoring any custom system prompts provided by the parent agent. This fix ensures the parent agent's system_prompt is preserved and prepended to the Slack-specific context in: - _process_message: Both agent creation and system_prompt refresh - _process_interactive: Both agent creation and system_prompt refresh The fix follows the pattern already established in agent creation at line 359, now consistently applied across all locations. Fixes strands-agents#302
3 tasks
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
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
The Slack tool was overwriting the agent's
system_promptwith only theSLACK_SYSTEM_PROMPTconstant, ignoring any custom system prompts provided by the parent agent.This fix ensures the parent agent's
system_promptis preserved and prepended to the Slack-specific context in:_process_message: Both agent creation and system_prompt refresh_process_interactive: Both agent creation and system_prompt refreshThe Problem
When a user creates an agent with a custom system prompt:
The custom system prompt was lost because the code overwrote it with:
The Fix
Now preserves the parent agent's system prompt:
This follows the pattern already established in agent creation at line 359, now consistently applied across all locations.
Related Issues
Fixes #302
Type of Change
Bug fix
Testing
test_slack_socket.pyChecklist
🤖 This is an experimental AI agent response from the Strands team, powered by Strands Agents. We're exploring how AI agents can help with community support and development. Your feedback helps us improve! If you'd prefer human assistance, please let us know.