{"record":{"id":"7ee1c2036f603cfd","repo":"stablyai/orca","slug":"invalid-argument-7ee1c2","errorCode":"invalid_argument","errorMessage":"Missing value for --port.","messagePattern":"Missing value for --port\\.","errorType":"exception","errorClass":"RuntimeClientError","httpStatus":null,"severity":"error","filePath":"src/cli/handlers/core.ts","lineNumber":51,"sourceCode":"    })\n    child.once('error', reject)\n    child.once('exit', (code, signal) => {\n      if (typeof code === 'number') {\n        resolve(code)\n        return\n      }\n      resolve(signal ? 1 : 0)\n    })\n  })\n}\n\nfunction getOptionalServePort(flags: Map<string, string | boolean>): string | null {\n  if (!flags.has('port')) {\n    return null\n  }\n  const rawPort = flags.get('port')\n  if (typeof rawPort !== 'string' || rawPort.length === 0) {\n    throw new RuntimeClientError('invalid_argument', 'Missing value for --port.')\n  }\n  const port = Number(rawPort)\n  if (!Number.isInteger(port) || port < 0 || port > 65535) {\n    throw new RuntimeClientError('invalid_argument', `Invalid --port value: ${rawPort}`)\n  }\n  return rawPort\n}\n\nexport const CORE_HANDLERS: Record<string, CommandHandler> = {\n  'claude-teams': async ({ client, rawArgs }) => {\n    if (process.platform === 'win32') {\n      throw new RuntimeClientError(\n        'unsupported_platform',\n        'Claude Agent Teams native panes are not supported on Windows.'\n      )\n    }\n    const paneKey = process.env.ORCA_PANE_KEY\n    if (!paneKey) {","sourceCodeStart":33,"sourceCodeEnd":69,"githubUrl":"https://github.com/stablyai/orca/blob/1136503c6a231a16dce8f921f6fadb63d181e8db/src/cli/handlers/core.ts#L33-L69","documentation":"getOptionalServePort (core.ts:51) throws when --port is present but carries no string value — i.e. the argument parser stored boolean true because --port was passed bare (no =NNNN and no following token consumed). The serve command needs a concrete port, so a valueless --port is rejected before range validation.","triggerScenarios":"`orca serve --port` with nothing after it; `--port` at the end of the line; a shell that swallowed the value via quoting.","commonSituations":"Forgetting the port number; writing --port as the last token; env-var expansion that produced an empty value (`--port=$PORT` with PORT unset) — note that case may instead yield an empty string which also hits this branch.","solutions":["Provide the port explicitly: --port 4321 or --port=4321","Use a value in 0-65535 (0 lets the runtime pick a free port)","Guard env-var expansion: --port=${PORT:-4321}"],"exampleFix":"// before\norca serve --port\n// after\norca serve --port 4321","handlingStrategy":"validation","validationCode":"function assertServePortValue(rawPort) {\n  if (typeof rawPort !== 'string' || rawPort.length === 0) {\n    throw new Error('Missing value for --port')\n  }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always pass --port with a value (--port 4321 or --port=4321), never bare","When expanding an env var, provide a fallback: --port=${PORT:-4321}"],"tags":["cli","serve","validation"],"backgroundTag":null,"analyzedSha":"1136503c6a231a16dce8f921f6fadb63d181e8db","analyzedAt":"2026-08-12T23:15:58.167Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}