Skip to content

Commit 0730340

Browse files
authored
fix: Improve print in handoff to user (#206)
1 parent c33f301 commit 0730340

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/strands_tools/handoff_to_user.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ def handoff_to_user(tool: ToolUse, **kwargs: Any) -> ToolResult:
179179
else:
180180
# Wait for user input and continue
181181
try:
182-
user_response = get_user_input("<bold>Your response:</bold> ").strip()
182+
user_response = get_user_input(f"<bold>Agent requested user input:</bold> {message}\n<bold>Your response:</bold> ").strip()
183183

184184
console.print()
185185

tests/test_handoff_to_user.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def test_handoff_with_breakout_false_direct(mock_get_user_input, mock_request_st
6363
result = handoff_to_user.handoff_to_user(tool=tool_use, request_state=mock_request_state)
6464

6565
# Verify get_user_input was called
66-
mock_get_user_input.assert_called_once_with("<bold>Your response:</bold> ")
66+
mock_get_user_input.assert_called_once_with("<bold>Agent requested user input:</bold> Please confirm the action.\n<bold>Your response:</bold> ")
6767

6868
# Verify the result has the expected structure
6969
assert result["toolUseId"] == "test-tool-use-id"

0 commit comments

Comments
 (0)