From 08c2463b6f006b4862569931743700eee68b990f Mon Sep 17 00:00:00 2001 From: "buf0-bot[bot]" <252831055+buf0-bot[bot]@users.noreply.github.com> Date: Fri, 15 May 2026 17:00:20 -0700 Subject: [PATCH] fix: pr-bug-scan validated finding from #1878 (#1962) Co-authored-by: orca-bug-scan-bot --- src/cli/index.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/cli/index.ts b/src/cli/index.ts index 00a96e904..d80789c47 100644 --- a/src/cli/index.ts +++ b/src/cli/index.ts @@ -47,11 +47,19 @@ export async function main(argv = process.argv.slice(2), cwd = process.cwd()): P const ignoreRemoteSelection = shouldIgnoreRemoteSelection(parsed.commandPath) const pairingCode = ignoreRemoteSelection ? null : parsed.flags.get('pairing-code') const environmentSelector = ignoreRemoteSelection ? null : parsed.flags.get('environment') + // Why: pass `null` (not `undefined`) when remote selection is suppressed + // so the RuntimeClient default parameter does not re-activate the + // ORCA_PAIRING_CODE / ORCA_ENVIRONMENT env-var fallback for commands + // that must run locally (environment / serve). const client = new RuntimeClient( undefined, undefined, - typeof pairingCode === 'string' ? pairingCode : undefined, - typeof environmentSelector === 'string' ? environmentSelector : undefined + typeof pairingCode === 'string' ? pairingCode : ignoreRemoteSelection ? null : undefined, + typeof environmentSelector === 'string' + ? environmentSelector + : ignoreRemoteSelection + ? null + : undefined ) await dispatch(parsed.commandPath, { flags: parsed.flags,