mirror of
https://github.com/stablyai/orca.git
synced 2026-10-21 16:03:26 +00:00
* fix(serve): recognize CLI-form serve args on the Electron process When the binary is launched as `… serve --port …` without the CLI rewrite that injects `--serve`, normalize argv so isServeMode, headless GPU flags, and serve option parsing all engage. Preserves existing `--serve*` flag behavior for the CLI-spawned path. Fixes #12677 * fix(serve): treat only CLI subcommand position as serve Parse bare `serve` as the first positional token after flags/values so an option value named `serve` cannot enable headless mode. Addresses CodeRabbit on #12818. * fix(serve): keep CLI redirects ahead of the serve argv rewrite Rewriting argv before maybeRedirectAppImageCliLaunch replaced the `serve` positional with `--serve`, so the redirect's command-name lookup saw a port number and bailed — dropping AppImage serve launches out of the CLI path. Also translate `--port=6768` (the CLI accepts it, getServeOptions only reads the next token) and the mixed `--serve --port` form, so a security-shaped flag like `--no-pairing` can no longer read as accepted while pairing stays on. Map lookups replace `in` on object literals, which turned a stray `serve toString` positional into a function spliced onto argv. * fix(serve): close the CLI-form serve gaps found in review second-instance: shouldActivateDesktopForSecondInstance matched only `--serve`, so a duplicate `<binary> serve --port …` — the ExecStart shape documented in docs/reference/headless-linux-server.md — promoted the live headless server to a desktop window, un-fixing #11935 on exactly the launch shape this PR legitimizes. findServeSubcommandIndex consumed a flag's value unconditionally while the rewrite consumed it only when the next token was not flag-shaped. The two could disagree and swallow the `serve` token, leaving `--serve` uninjected: #12677 again in a new shape (`--port --port serve`, `--port -- serve`). Both scans now share one definition of value consumption. `<binary> serve --help` / `serve help` bound a network-exposed runtime server with pairing on and printed nothing; the AppImage redirect already routes those three tokens to the CLI, so refuse them here too. `--no-pairing=false` translated to `--serve-no-pairing` with the value dropped, disabling pairing for an operator who asked for the opposite. The CLI reads its serve booleans as `flags.get(name) === true`, so a boolean is now translated only in its bare form and the `=` form rides through as the CLI treats it. Tests: spec-derived parity between src/cli/specs/serve.ts and the rewrite, covering both ends of the contract (serveOrcaApp and getServeOptions); a source-text lock on the index.ts redirect/rewrite ordering, which reverted silently green before; an exhaustive self-consistency property test; and the real GUI launch argv shapes that must never enter serve mode. --------- Co-authored-by: Jinwoo-H <Jinwoo-H@users.noreply.github.com>
32 lines
1.0 KiB
JSON
32 lines
1.0 KiB
JSON
{
|
|
"extends": "./tsconfig.web.json",
|
|
"include": [
|
|
"../src/renderer/src/env.d.ts",
|
|
"../src/renderer/src/**/*",
|
|
"../src/renderer/src/**/*.tsx",
|
|
"../src/preload/api-types.ts",
|
|
"../src/shared/**/*",
|
|
"../src/main/gitlab/mappers.ts",
|
|
"../src/main/ipc/worktree-branch-name.ts",
|
|
"../src/main/ipc/worktree-logic.ts",
|
|
"../src/main/ipc/worktree-linked-work-item-metadata.ts",
|
|
"../src/main/ipc/worktree-metadata-merge.ts",
|
|
"../src/main/ipc/worktree-path-comparison.ts",
|
|
"../src/main/wsl-distro-list-output.ts",
|
|
"../src/main/wsl-distro-retry.ts",
|
|
"../src/main/wsl.ts",
|
|
"../src/main/startup/serve-desktop-activation.ts",
|
|
"../src/main/startup/serve-mode-argv.ts",
|
|
"../src/main/startup/single-instance-lock.ts",
|
|
"../src/main/startup/startup-diagnostics.ts",
|
|
"../src/main/window/focus-existing-window.ts",
|
|
"../src/main/window/macos-app-activation.ts"
|
|
],
|
|
"compilerOptions": {
|
|
"paths": {
|
|
"@renderer/*": ["../src/renderer/src/*"],
|
|
"@/*": ["../src/renderer/src/*"]
|
|
}
|
|
}
|
|
}
|