Skip to main content

Module dispatch

Module dispatch 

Source
Expand description

Subprocess-side tool dispatcher.

Maps each browser_* tool name to a BrowserPlugin::execute flow without requiring an AgentContext (which the subprocess cannot construct). Tool argument schemas live in tool_defs.rs — keep the two in sync when adding or changing a tool.

Functions§

dispatch_browser_tool
Match tool_name against the browser_* tools and dispatch to the matching BrowserPlugin::execute flow. Returns a JSON Value ready to land in the tool.invoke reply’s result field, or ToolInvocationError for the host’s RemoteToolHandler decoder.
resolve_plugin_or_legacy
Resolve the BrowserPlugin that should service this tool.invoke call. Four cases:
resolve_plugin_or_legacy_gated
Variant of resolve_plugin_or_legacy that lets the caller opt out of the legacy per-agent_id fallback (dispatch case 3). Wired from main.rs::on_tool via [ProfileLimits::legacy_per_agent_enabled]. The 0.4.0 plan is to flip the env default so this off-path becomes the norm.