[Bugfix][Responses] Fix browser.find action type (#55305)
Signed-off-by: nicole-lihui <nicole.li@daocloud.io> Co-authored-by: Chauncey <chaunceyjiang@gmail.com>
This commit is contained in:
co-authored by
Chauncey
parent
b4da4d17ae
commit
7ef4d9bfed
@@ -273,6 +273,23 @@ class TestHarmonyToResponseOutput:
|
||||
assert output_items[0].action.type == "search"
|
||||
assert output_items[0].action.query == "cursor:weather in San Francisco"
|
||||
|
||||
def test_browser_find_recipient_uses_responses_action_type(self):
|
||||
"""browser.find must use the Responses API find_in_page action type."""
|
||||
message = (
|
||||
Message.from_role_and_content(
|
||||
Role.ASSISTANT, '{"pattern": "vLLM", "cursor": 42}'
|
||||
)
|
||||
.with_channel("analysis")
|
||||
.with_recipient("browser.find")
|
||||
)
|
||||
|
||||
output_items = harmony_to_response_output(message, frozenset())
|
||||
|
||||
assert len(output_items) == 1
|
||||
assert isinstance(output_items[0], ResponseFunctionWebSearch)
|
||||
assert output_items[0].action.type == "find_in_page"
|
||||
assert output_items[0].action.pattern == "vLLM"
|
||||
|
||||
def test_commentary_with_empty_content_and_no_recipient(self):
|
||||
"""Test edge case: empty commentary with recipient=None."""
|
||||
message = Message.from_role_and_content(Role.ASSISTANT, "")
|
||||
|
||||
Reference in New Issue
Block a user