{"record":{"id":"555d1e8d4ede0791","repo":"sgl-project/sglang","slug":"no-browser-tool-call-found","errorCode":null,"errorMessage":"No browser tool call found","messagePattern":"No browser tool call found","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/srt/entrypoints/tool.py","lineNumber":53,"sourceCode":"            print_info_once(\"Browser tool initialized\")\n            return\n\n        api_key = envs.EXA_API_KEY.get()\n        if not api_key:\n            self.enabled = False\n            print_warning_once(\"EXA_API_KEY is not set, browsing is disabled\")\n            return\n\n        self.exa_client = ExaClient(api_key, config=ExaSearchConfig.from_env())\n        print_info_once(\"Browser tool initialized\")\n\n    async def get_result(self, context: \"ConversationContext\") -> Any:\n        from openai_harmony import Author, Message, Role, TextContent\n\n        last_msg = context.messages[-1]\n        recipient = last_msg.recipient\n        if recipient is None or not recipient.startswith(\"browser.\"):\n            raise ValueError(\"No browser tool call found\")\n\n        try:\n            args = orjson.loads(last_msg.content[0].text)\n            result_text = await self._dispatch_browser_call(context, recipient, args)\n        except Exception as exc:\n            logger.exception(\"Browser tool call failed\")\n            result_text = f\"Browser tool call failed: {exc}\"\n\n        content = TextContent(text=result_text)\n        author = Author(role=Role.TOOL, name=recipient)\n        return [Message(author=author, content=[content], recipient=Role.ASSISTANT)]\n\n    async def _dispatch_browser_call(\n        self, context: \"ConversationContext\", recipient: str, args: dict[str, Any]\n    ) -> str:\n        if recipient == \"browser.search\":\n            query = args.get(\"query\")\n            if not query:","sourceCodeStart":35,"sourceCodeEnd":71,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/entrypoints/tool.py#L35-L71","documentation":"Thrown by SGLang's browser Tool.get_result when the last message in the conversation has no recipient (tool-call target) or its recipient does not start with 'browser.'. The tool flow expects the model to emit a browser.* tool call as the final message before harvesting a result.","triggerScenarios":"Calling get_result(context) when context.messages[-1].recipient is None, or when the model emitted a non-browser recipient such as 'python.execute' or a plain assistant reply with no tool call.","commonSituations":"Routing a non-browser tool conversation into BrowserTool.get_result, a model that failed to emit a recipient header, or invoking get_result at the wrong point in the tool loop (before the model's tool-call turn arrives).","solutions":["Check last_msg.recipient starts with 'browser.' before calling get_result","Verify the model prompt/harmony encoding includes the recipient field for tool calls","Route non-browser recipients to their matching tool implementation"],"exampleFix":"# before\nresult = await tool.get_result(context)\n# after\nlast = context.messages[-1]\nif last.recipient and last.recipient.startswith(\"browser.\"):\n    result = await tool.get_result(context)\nelse:\n    raise ValueError(\"No browser tool call found\")","handlingStrategy":"type-guard","validationCode":"last = context.messages[-1]\nrecipient = getattr(last, \"recipient\", None)\nassert recipient and recipient.startswith(\"browser.\"), \"expected a browser.* tool call\"","typeGuard":"def is_browser_call(msg) -> bool:\n    r = getattr(msg, \"recipient\", None)\n    return r is not None and r.startswith(\"browser.\")","tryCatchPattern":"try:\n    result = await tool.get_result(context)\nexcept ValueError as e:\n    if \"No browser tool call\" in str(e):\n        # route to the correct tool or re-prompt\n        ...","preventionTips":["Only call get_result after confirming the last message targets browser.*","Route by recipient prefix before dispatching to a tool implementation"],"tags":["tool-calling","browser","validation","sglang"],"backgroundTag":"tool-call-recipient-missing","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}