vercel-labs/agent-browser · error

The "${action}" action requires a value.

Error message

The "${action}" action requires a value.

What it means

The eve 'find' tool accepts an action applied to the matched element; the 'fill' action types text, so it requires the optional 'value' field. execute() throws before shelling out to the CLI when action is 'fill' and value is undefined — a cheap input-validation guard so the CLI never receives an incomplete command.

Source

Thrown at packages/@agent-browser/eve/extension/tools/find.ts:29

    by: z.enum(["role", "text", "label", "placeholder", "alt", "title", "testid", "first", "last"]),
    exact: z
      .boolean()
      .default(false)
      .describe(
        'Exact, case-sensitive match. For "role" it applies to the accessible name, whose default is a case-insensitive substring.',
      ),
    name: z
      .string()
      .optional()
      .describe('Accessible name filter when by is "role", e.g. role "button" named "Submit".'),
    query: z
      .string()
      .describe('What to match: the role name, text, label, etc. For "first"/"last", a CSS selector.'),
    value: z.string().optional().describe('Text to enter for the "fill" action.'),
  }),
  async execute({ action, by, exact, name, query, value }, ctx) {
    if (action === "fill" && value === undefined) {
      throw new Error(`The "${action}" action requires a value.`);
    }
    const args = ["find", by, query, action];
    if (value !== undefined) args.push(value);
    if (name !== undefined) args.push("--name", name);
    if (exact) args.push("--exact");
    return await runBrowser(ctx, args);
  },
});

View on GitHub (pinned to 548b159b30)

Solutions

  1. Pass value: tools.find({ action: 'fill', by: 'role', query: 'textbox', value: 'hello@example.com' })
  2. Default it in your caller when the text may be empty: value: text ?? ''
  3. Validate required action/value pairs before invoking the tool

Example fix

// before
await tools.find({ action: "fill", by: "role", query: "textbox", name: "Email" });

// after
await tools.find({ action: "fill", by: "role", query: "textbox", name: "Email", value: "user@example.com" });
Defensive patterns

Strategy: validation

Validate before calling

if (input.action === "fill" && (input.value === undefined || input.value === null)) {
  throw new Error("fill requires the text to type; refusing to call the tool.");
}
await tools.find(input);

Type guard

function isValidFindInput(i: { action: string; value?: string }): boolean {
  return !(i.action === "fill" && i.value === undefined);
}

Prevention

When it happens

Trigger: Invoking the find tool with { action: 'fill', by: 'role', query: 'textbox', ... } but omitting value; models leaving optional fields absent because the schema marks value optional.

Common situations: LLM agents omitting optional parameters; refactors that drop the value field; form-filling flows where the text lives in a separate variable that is undefined.

Related errors


AI-assisted analysis of vercel-labs/agent-browser@548b159b30 (2026-08-16). Data as JSON: /api/errors/f5e78259e7022612. Report an issue: GitHub.