stablyai/orca · error · RuntimeClientError
invalid_argument
invalid_argument
Error message
Missing value for --port.
What it means
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.
Source
Thrown at src/cli/handlers/core.ts:51
})
child.once('error', reject)
child.once('exit', (code, signal) => {
if (typeof code === 'number') {
resolve(code)
return
}
resolve(signal ? 1 : 0)
})
})
}
function getOptionalServePort(flags: Map<string, string | boolean>): string | null {
if (!flags.has('port')) {
return null
}
const rawPort = flags.get('port')
if (typeof rawPort !== 'string' || rawPort.length === 0) {
throw new RuntimeClientError('invalid_argument', 'Missing value for --port.')
}
const port = Number(rawPort)
if (!Number.isInteger(port) || port < 0 || port > 65535) {
throw new RuntimeClientError('invalid_argument', `Invalid --port value: ${rawPort}`)
}
return rawPort
}
export const CORE_HANDLERS: Record<string, CommandHandler> = {
'claude-teams': async ({ client, rawArgs }) => {
if (process.platform === 'win32') {
throw new RuntimeClientError(
'unsupported_platform',
'Claude Agent Teams native panes are not supported on Windows.'
)
}
const paneKey = process.env.ORCA_PANE_KEY
if (!paneKey) {View on GitHub (pinned to 1136503c6a)
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}
Example fix
// before orca serve --port // after orca serve --port 4321
Defensive patterns
Strategy: validation
Validate before calling
function assertServePortValue(rawPort) {
if (typeof rawPort !== 'string' || rawPort.length === 0) {
throw new Error('Missing value for --port')
}
} Prevention
- Always pass --port with a value (--port 4321 or --port=4321), never bare
- When expanding an env var, provide a fallback: --port=${PORT:-4321}
When it happens
Trigger: `orca serve --port` with nothing after it; `--port` at the end of the line; a shell that swallowed the value via quoting.
Common situations: 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.
Related errors
- Invalid --serve-port value: ${rawPort}
- --serve-project-root must be absolute: ${options.projectRoot
- --serve-project-root must be a directory: ${options.projectR
- --higher-is-better requires a metric key
- Usage: node config/scripts/compare-benchmark-artifacts.mjs -
AI-assisted analysis of stablyai/orca@1136503c6a (2026-08-12).
Data as JSON: /api/errors/7ee1c2036f603cfd.
Report an issue: GitHub.