{"record":{"id":"4f5506baa2d4c9b1","repo":"can1357/oh-my-pi","slug":"unsupported-action-params-as-browserparams-ac","errorCode":null,"errorMessage":"Unsupported action: ${(params as BrowserParams).action}","messagePattern":"Unsupported action: (.+?)","errorType":"exception","errorClass":"ToolError","httpStatus":null,"severity":"error","filePath":"packages/coding-agent/src/tools/browser.ts","lineNumber":246,"sourceCode":"\t\t_onUpdate?: AgentToolUpdateCallback<BrowserToolDetails>,\n\t\t_ctx?: AgentToolContext,\n\t): Promise<AgentToolResult<BrowserToolDetails>> {\n\t\ttry {\n\t\t\tthrowIfAborted(signal);\n\t\t\tconst timeoutSeconds = clampTimeout(\"browser\", params.timeout, this.session.settings.get(\"tools.maxTimeout\"));\n\t\t\tconst timeoutMs = timeoutSeconds * 1000;\n\t\t\tconst name = params.name ?? DEFAULT_TAB_NAME;\n\t\t\tconst details: BrowserToolDetails = { action: params.action, name };\n\n\t\t\tswitch (params.action) {\n\t\t\t\tcase \"open\":\n\t\t\t\t\treturn await this.#open(name, params, details, timeoutMs, signal);\n\t\t\t\tcase \"close\":\n\t\t\t\t\treturn await this.#close(name, params, details, timeoutMs, signal);\n\t\t\t\tcase \"run\":\n\t\t\t\t\treturn await this.#run(name, params, details, timeoutMs, signal);\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new ToolError(`Unsupported action: ${(params as BrowserParams).action}`);\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tif (error instanceof ToolAbortError) throw error;\n\t\t\tif (error instanceof Error && error.name === \"AbortError\") {\n\t\t\t\tthrow new ToolAbortError();\n\t\t\t}\n\t\t\tthrow error;\n\t\t}\n\t}\n\n\tasync #open(\n\t\tname: string,\n\t\tparams: BrowserParams,\n\t\tdetails: BrowserToolDetails,\n\t\ttimeoutMs: number,\n\t\tsignal?: AbortSignal,\n\t): Promise<AgentToolResult<BrowserToolDetails>> {\n\t\tconst kind = resolveBrowserKind(params, this.session);","sourceCodeStart":228,"sourceCodeEnd":264,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/packages/coding-agent/src/tools/browser.ts#L228-L264","documentation":"The browser tool's execute() dispatches on params.action ('open'|'close'|'run'). Any other action value falls through the switch default and throws this ToolError naming the unsupported action. It is an input-validation error protecting the internal dispatch table.","triggerScenarios":"Passing params.action with a typo or an action this tool version does not support ('goto', 'click', 'eval', etc. instead of open/close/run); model-generated tool arguments inventing an action name; older/newer tool schema mismatch between caller and implementation.","commonSituations":"LLM hallucinating an action name in tool args; hand-written RPC/SDK code calling browser with an unlisted action; stale docs listing a removed action.","solutions":["Use one of the supported actions: 'open', 'close', or 'run'","Check the tool's parameter schema for the exact allowed action strings","If you need element interaction, use the dedicated browser/tab sub-tools rather than an action on this tool","Update the caller/code generation to match the current BrowserParams schema"],"exampleFix":"// before\nawait browser.run({ action: 'navigate', url })\n// after\nawait browser.run({ action: 'open', url })","handlingStrategy":"validation","validationCode":"const SUPPORTED = new Set(['open', 'close', 'run']);\nif (!SUPPORTED.has(params.action)) {\n\tthrow new Error(`action must be one of ${[...SUPPORTED].join(', ')}`);\n}","typeGuard":"function isBrowserAction(a: unknown): a is 'open' | 'close' | 'run' {\n\treturn a === 'open' || a === 'close' || a === 'run';\n}","tryCatchPattern":"try {\n\tawait browserTool.execute(params, ...);\n} catch (err) {\n\tif (err instanceof ToolError && err.message.startsWith('Unsupported action')) {\n\t\t// fix params.action to 'open' | 'close' | 'run' and retry\n\t} else throw err;\n}","preventionTips":["Validate params.action against the schema before calling","Only use 'open', 'close', 'run' — element ops live in tab sub-tools","Keep tool-schema docs in sync with BrowserParams","Constrain model tool-calling via strict JSON schema enums"],"tags":["validation","browser","unsupported-action"],"backgroundTag":"invalid-tool-parameters","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}