{"record":{"id":"8ae76b364b88d557","repo":"stablyai/orca","slug":"invalid-argument-8ae76b","errorCode":"invalid_argument","errorMessage":"--direction must be \"up\" or \"down\"","messagePattern":"--direction must be \"up\" or \"down\"","errorType":"exception","errorClass":"RuntimeClientError","httpStatus":null,"severity":"error","filePath":"src/cli/handlers/browser-nav.ts","lineNumber":83,"sourceCode":"  },\n  forward: async ({ flags, client, cwd, json }) => {\n    const target = await getBrowserCommandTarget(flags, cwd, client)\n    const result = await client.call<unknown>('browser.forward', target)\n    printResult(result, json, (v) => {\n      const url = (v as { url?: string } | null | undefined)?.url\n      return url ? `Navigated forward to ${url}` : 'Navigated forward'\n    })\n  },\n  eval: async ({ flags, client, cwd, json }) => {\n    const expression = getRequiredStringFlag(flags, 'expression')\n    const target = await getBrowserCommandTarget(flags, cwd, client)\n    const result = await client.call<BrowserEvalResult>('browser.eval', { expression, ...target })\n    printResult(result, json, (v) => v.result)\n  },\n  scroll: async ({ flags, client, cwd, json }) => {\n    const direction = getRequiredStringFlag(flags, 'direction')\n    if (direction !== 'up' && direction !== 'down') {\n      throw new RuntimeClientError('invalid_argument', '--direction must be \"up\" or \"down\"')\n    }\n    const amount = getOptionalPositiveIntegerFlag(flags, 'amount')\n    const target = await getBrowserCommandTarget(flags, cwd, client)\n    const result = await client.call<BrowserScrollResult>('browser.scroll', {\n      direction,\n      amount,\n      ...target\n    })\n    printResult(result, json, (v) => `Scrolled ${v.scrolled}`)\n  },\n  wait: async ({ flags, client, cwd, json }) => {\n    const selector = getOptionalStringFlag(flags, 'selector')\n    const timeout = getOptionalPositiveIntegerFlag(flags, 'timeout')\n    const text = getOptionalStringFlag(flags, 'text')\n    const url = getOptionalStringFlag(flags, 'url')\n    const load = getOptionalStringFlag(flags, 'load')\n    const fn = getOptionalStringFlag(flags, 'fn')\n    const state = getOptionalStringFlag(flags, 'state')","sourceCodeStart":65,"sourceCodeEnd":101,"githubUrl":"https://github.com/stablyai/orca/blob/1136503c6a231a16dce8f921f6fadb63d181e8db/src/cli/handlers/browser-nav.ts#L65-L101","documentation":"Thrown by the `browser-nav scroll` handler when --direction is set to anything other than the literal 'up' or 'down'. The scroll command only supports vertical directions in this handler, so left/right/empty/garbage are rejected client-side before browser.scroll is called.","triggerScenarios":"Running `browser-nav scroll --direction left` (or 'right', 'top', '', etc.). getRequiredStringFlag('direction') returns the value and the `!== 'up' && !== 'down'` check throws.","commonSituations":"Confusing this scroll handler (vertical-only) with the broader computer-action scroll which supports left/right via validateScrollDirection. Typo like 'Down' (capitalized) or passing an amount as the direction.","solutions":["Use exactly `--direction up` or `--direction down` (lowercase).","For horizontal scrolling, use the computer-action scroll command (validateScrollDirection accepts left/right) instead of browser-nav scroll.","Check for trailing whitespace or capitalization in the value."],"exampleFix":"// before\norca browser-nav scroll --direction left --amount 100\n// after\norca browser-nav scroll --direction down --amount 100","handlingStrategy":"validation","validationCode":"function parseScrollDirection(raw: string): 'up' | 'down' {\n  if (raw !== 'up' && raw !== 'down') {\n    throw new Error(`browser-nav scroll direction must be 'up' or 'down', got ${raw}`)\n  }\n  return raw\n}","typeGuard":"function isVerticalDirection(v: string): v is 'up' | 'down' {\n  return v === 'up' || v === 'down'\n}","tryCatchPattern":null,"preventionTips":["Remember browser-nav scroll is vertical-only; use computer-action scroll for left/right.","Lowercase the value and trim whitespace before validating.","Document the two direction vocabularies side by side to avoid confusion."],"tags":["cli","browser","navigation","scroll","flag-validation","invalid-argument"],"backgroundTag":null,"analyzedSha":"1136503c6a231a16dce8f921f6fadb63d181e8db","analyzedAt":"2026-08-12T23:15:58.167Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}