Skip to content

In-process CLI-form serve skips the CLI's flag validation and cross-flag guards #13006

Closed

Description

@Jinwoo-H

Summary

#12818 lets the packaged binary handle a CLI-form serve launch in-process (<binary> serve --port 6768 …). That path reaches getServeOptions directly instead of going through the orca CLI, so it skips two layers of validation the CLI performs.

Nothing here regresses a valid launch — these are all invalid or typo'd invocations that the CLI rejects and the in-process path silently accepts.

1. Unknown flags are silently ignored

The CLI rejects unknown flags (src/cli/args.ts:304):

Flag --no-pairng is not valid for `orca serve`.

The in-process path passes anything it doesn't recognize straight through (src/main/startup/serve-mode-argv.ts:150), and getServeOptions only looks for the names it knows. So:

$ /opt/Orca/orca-ide serve --port 6768 --no-pairng
# starts, pairing ENABLED, no warning

--no-pairing is security-shaped, so a typo reading as "accepted" is the same failure mode as #12677 — a flag that looks like it took effect but didn't.

2. Cross-flag guards are CLI-only

src/cli/handlers/core.ts:94-115 rejects these combinations; the in-process path accepts all three:

combination CLI in-process
--no-pairing + --mobile-pairing error accepted
--recipe-json + --no-pairing error accepted
--recipe-json + --mobile-pairing error accepted

(--recipe-json without --project-root is already guarded in printServeReady.)

Why it wasn't reachable before

Main's --serve path was previously only ever entered by the CLI, which had already validated. #12818 makes it reachable directly, so the asymmetry now has user-visible consequences.

Suggested fix

Mirror the handlers/core.ts guards into getServeOptions, and warn on (or reject) unrecognized --* tokens once serve mode is active. Rejecting unknown flags outright needs care — Chromium/Electron switches are an open set and legitimately appear in argv — so a targeted check against the known CLI serve flag names, or a warning rather than a hard error, is probably the right shape.

Related: #13004 (the AppImage redirect gate). Fixing that would route more launches back through the CLI, which validates — but it is Linux-only and does not cover Orca.exe serve … or the macOS binary, both of which reach the in-process path.

Activity

  1. added theissue type on Sep 19, 2026
  2. nwparker commented on Sep 27, 2026

    @nwparker
    Contributor

    Closing as fixed by #17683. In-process CLI-form serve now applies the CLI flag validation and cross-flag guards before startup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions