chore: account for undefined arguments (#400)

This commit is contained in:
Pavel Feldman
2025-05-12 09:35:33 -07:00
committed by GitHub
parent 05dc5d915b
commit dd5b41f1d8
11 changed files with 3 additions and 19 deletions

View File

@@ -125,7 +125,7 @@ export class Context {
async run(tool: Tool, params: Record<string, unknown> | undefined) {
// Tab management is done outside of the action() call.
const toolResult = await tool.handle(this, tool.schema.inputSchema.parse(params));
const toolResult = await tool.handle(this, tool.schema.inputSchema.parse(params || {}));
const { code, action, waitForNetwork, captureSnapshot, resultOverride } = toolResult;
const racingAction = action ? () => this._raceAgainstModalDialogs(action) : undefined;