Skip to content

Show the Source Control AI CLI arguments box only where it actually works - #21149

Merged
brennanb2025 merged 3 commits into
mainfrom
brennanb2025/remove-per-action-cli-args
Sep 17, 2026
Merged

brennanb2025 merged 3 commits into
mainfrom
brennanb2025/remove-per-action-cli-args

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 5 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​265 $\color{#cf222e}{\Huge{\mathbf{−}}}$​3 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​262
Prod 11 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​197 $\color{#cf222e}{\Huge{\mathbf{−}}}$​55 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​142

ELI5

The Source Control AI dialogs (like "Fix Broken Checks") have a box where you can type command-line arguments for the agent. Depending on how you've set Orca up, those arguments sometimes reach the agent and sometimes vanish without a trace. This makes the box appear only when it will actually do something.

What Changed

Before: every Source Control AI launch dialog showed a "CLI arguments" box. If your agent tabs open as structured native chat, that launch talks to the agent over a protocol that reads no command-line arguments at all — so whatever you typed was silently discarded. Nothing told you.

After: the box appears only on launches that really pass arguments to the agent. If this particular launch would open as structured native chat, the box is gone — not greyed out, just absent. Structured chat uses its own settings instead. If you launch into a terminal, nothing changes: the box is there and behaves exactly as before, including any value saved in your Source Control AI recipe.

The mechanism: the dialog now resolves the route this specific launch would take, rather than reading your default view setting alone. That distinction matters, because a user whose default is chat still gets a real terminal when the agent has no structured session, when the workspace runs on a remote SSH host, or in a floating workspace. In each of those the arguments genuinely work, so the field stays.

When the field is hidden, the dialog sends no per-action arguments at all rather than an empty string. That is the load-bearing detail: the launch path falls back to your global Settings → Agents → Arguments only when the value is absent, and an empty string would have counted as an explicit "no arguments" and suppressed your global setting.

Two files were split to stay under the repo's max-lines limit: the arguments input moved into its own component, and a pure label-building helper moved into the existing dialog support module. No behavior change in either.

Why

Merged #20944 established deliberately that structured native chat reads no CLI arguments. That left the dialogs promising something one of their routes cannot deliver.

An earlier attempt (#21103) fixed this by routing such launches to a terminal so the field would keep working. That was closed: it preserved the input at the cost of pulling users off structured chat.

Deleting the field outright was the other option considered. It was rejected because the field is not useless — it is useless on one route. Terminal launches apply these arguments verbatim, and per-action overrides there are a real capability. Removing it would have taken that away from terminal users and made saved recipe values stop working, including where they work today. Showing the field exactly where it has an effect keeps the capability and removes the false promise.

Resolving the real route rather than just the default setting was chosen over the simpler predicate because the simpler one is wrong in the cases users actually hit — remote hosts and agents without a structured session are terminal launches where the arguments work.

No saved value is lost or rewritten. Launching with the field hidden still saves your recipe with the arguments you had stored, so switching back to a terminal launch brings them back. Nothing is migrated or deleted, and the global Settings → Agents → Arguments field is untouched.

The per-action arguments in the commit message / PR description / branch name dialogs are also untouched: that path always builds a command line and splices the arguments into it, so they always apply there.

Linked Issue

Fixes #

Visual Proof

Not attached. The change is the presence or absence of one input, and which state you see depends on your own agent/host/settings combination rather than on anything a screenshot of my machine would establish. The two states are pinned by tests instead: the field renders when arguments apply and is absent from the markup when they do not (SourceControlAgentActionDialogForm.test.tsx).

Testing

Reviewer steps:

  1. Settings → Agents: set an Arguments value for your agent (e.g. --model sonnet).
  2. With agent tabs set to open as structured native chat, open a Source Control AI action (Fix Broken Checks / Resolve Conflicts). The CLI arguments box should be absent.
  3. Turn the chat default off, or use a remote SSH workspace, and reopen. The box should be present and editable.
  4. Start from the state in step 2, then switch back to a terminal launch: any per-action arguments you had saved previously should still be there.

Automated (macOS):

  • Full unfiltered suite: 8,907 files / 83,163 tests, 4 failures in 5 files. All were baselined against clean origin/main: 3 fail identically there (a real-CLI handshake test, a cross-version release-checkout test whose harness runs git rev-parse ~2, and a recipe-shell cleanup test), and the fourth passes in isolation on this branch — a timeout flake under full-suite load. None touch this code.
  • Affected area after merging current origin/main: 1,399 files / 13,137 tests, all passing.
  • pnpm tc and pnpm run check:code-quality:changed both clean.
  • New tests were ablation-checked: reverting each behavior change makes them fail, so they are not passing vacuously.

New coverage: the applicability predicate (terminal default, structured launch, and the chat-default-but-terminal-launch case), the field's presence/absence in the rendered form, and — as requested — a pin that a launch naming no per-action arguments resolves the user's global Arguments setting, plus that an explicit per-action value still wins over it.

  • I manually tested these changes locally — see note below
  • Automated tests added/updated, or explained why not below

Manual testing was limited to the automated runs above; I did not exercise the dialog in a running app, and did not test on Linux, Windows, or against a live SSH host.

AI Disclosure

Claude Opus 5.

Review

Agent skill upstream boundary

  • Not applicable.

Notes

  • Cross-platform: no platform-conditional code added; the route resolution is shared logic.
  • Remote SSH: explicitly considered — a remote execution host cannot run a structured session, so SSH launches keep the field and keep applying arguments.
  • Backwards compatibility: no persisted shape changed and no migration runs. Old recipes keep their agentArgs.
  • Performance: the applicability check is a synchronous store read done per dialog render.
  • Security: no change to what is executed; only to whether a value is offered.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • Before/after: N/A with reason given above
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered
  • pnpm typecheck, changed-code quality gate, and the full test suite run locally

@coderabbitai

coderabbitai Bot commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

Next included review available in 38 seconds.

Check out review usage here.

View limit details

Limit details: You’ve used all 10 included reviews currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: ff1af485-a256-4372-b5a2-d447912432e6

📥 Commits

Reviewing files that changed from the base of the PR and between fbe7b19 and 589e184.

📒 Files selected for processing (16)
  • src/renderer/src/components/pull-request-page/checks/fix-launch.ts
  • src/renderer/src/components/right-sidebar/SourceControlAgentActionDialog.test.tsx
  • src/renderer/src/components/right-sidebar/SourceControlAgentActionDialog.tsx
  • src/renderer/src/components/right-sidebar/SourceControlAgentActionDialogForm.test.tsx
  • src/renderer/src/components/right-sidebar/SourceControlAgentActionDialogForm.tsx
  • src/renderer/src/components/right-sidebar/SourceControlAgentCliArgsField.tsx
  • src/renderer/src/components/right-sidebar/buildSourceControlAgentDeliveryPlan.ts
  • src/renderer/src/components/right-sidebar/runSourceControlAgentActionStart.test.ts
  • src/renderer/src/components/right-sidebar/runSourceControlAgentActionStart.ts
  • src/renderer/src/components/right-sidebar/source-control-agent-action-dialog-result.ts
  • src/renderer/src/components/right-sidebar/source-control-agent-action-dialog-support.ts
  • src/renderer/src/components/right-sidebar/source-control-launch-agent-args-applicability.test.ts
  • src/renderer/src/components/right-sidebar/source-control-launch-agent-args-applicability.ts
  • src/renderer/src/components/right-sidebar/useSourceControlAgentActionDialog.ts
  • src/renderer/src/components/right-sidebar/useSourceControlAgentActionStart.ts
  • src/renderer/src/lib/launch-work-item-direct-agent.test.ts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

The new applicability predicate resolves a repo-only launch as local, so on a remote (SSH) repo it hides the CLI arguments field and replaces saved per-action arguments with the global default on a launch that would have applied them. The fix is small and anchored below.

Reviewed changes

  • Per-launch CLI-argument applicability — new sourceControlLaunchAppliesAgentArgs decides whether arguments reach the agent this launch would start; agentArgsApply flows into the start hook, the start runner, and the delivery preview.
  • Field extraction and hiding — the CLI arguments input moved into SourceControlAgentCliArgsField, which renders nothing when applies is false (absent, not disabled).
  • Global-arguments fallback — when the field is hidden, runSourceControlAgentActionStart sends agentArgs: undefined rather than '', so the launch falls back to Settings → Agents → Arguments; the saved recipe still stores the raw value.
  • Capability settling on open — dialog open now awaits ensureLocalRuntimeCapabilities() alongside agent detection; buildSourceControlAgentScopeNote was extracted to the dialog support module.
  • Coverage — new tests for the predicate, field presence/absence, argument omission and recipe retention, and the global-arguments fallback in buildDirectWorkItemAgentStartupPlan.

ℹ️ Nitpicks

  • useSourceControlAgentActionDialog.ts:116-118 claims settling capabilities alongside detection "keeps the field from appearing for a frame on a launch that turns out to be structured". An effect cannot affect the first paint: with a cold capability cache the first render still reads hostCapabilities === null, so applies is true and the field paints for a frame before the next render corrects it. Usually moot because the boot probe has already populated the cache — this is a comment-accuracy nit, not a defect worth restructuring.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes — incremental review of 589e184 against the prior Pullfrog review at 8ef6d0c.

  • Resolved the launch route with planAgentSessionLaunch instead of the feasibility query, so applicability now matches the route this launch will really take.
  • Threaded the repo's execution host into the predicate, so a repo-only remote launch (e.g. Fix Broken Checks, which passes repoId + connectionId and no worktreeId) keeps the CLI arguments field and passes saved agentArgs through.
  • Aligned the delivery preview to omit per-action arguments when they do not apply.
  • Added a behavioral SSH-versus-structured launch regression test and a repo-host forwarding test.

The prior [!IMPORTANT] remote-host finding is resolved and its thread was retired this run. All 47 tests across the five affected test files pass and typecheck:web is clean.

Pullfrog  | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

@brennanb2025

Copy link
Copy Markdown
Contributor Author

Rendered QA evidence (PR 21149 @ 589e184)

App identity matched this worktree and branch (Orca: brennanb2025/remove-per-action-cli-args). Isolated user-data + CDP session; no production files changed.

Local structured Claude — CLI arguments hidden

Opened Resolve Conflicts With AI with native chat + structured chat + open-in-chat defaults, agent Claude. The dialog showed Agent and Prompt template only. #source-control-agent-cli-args was not in the DOM. Delivery plan was Launch: claude.

Local structured launch hides CLI arguments

Local terminal — field present, saved value reappears

Saved per-action arguments --qa-pr21149-local-reappear, then hid the field under structured chat. Switching to a terminal launch restored the field with that exact value.

Local terminal launch shows saved CLI arguments

SSH terminal — field visible; saved args reached remote startup

Throwaway Linux Docker SSH host with a real demo-project clone (HTTPS clone blocked; cloned from a local git bundle). Resolve Conflicts With AI on the SSH workspace showed CLI arguments with --qa-pr21149-ssh-launch. Direct launch created /work/demo-project-issue-88888-qa-launch-per (issue-88888-qa-launch-per). Remote process: codex --qa-pr21149-ssh-launch. Stub argv file matched.

SSH terminal launch shows CLI arguments

Remaining gap

The GitHub Checks composer for a repo with no attached workspace could not be opened through GitHub details (synthetic PR details did not load over SSH). SSH field proof used the same Source Control AI dialog on the SSH host; the no-attached-workspace create+start path was still exercised by the direct launch above.

Relay deployed (linux-arm64). Temporary SSH container, keys, user data, and remote worktrees/branches were cleaned up after capture.

@brennanb2025

Copy link
Copy Markdown
Contributor Author

Additional rendered QA — prospective SSH (demo-project PR #22)

Used the real open PR with a failed check (stablyai/demo-project#22, check test failed). The SSH-owned repo had no attached Orca workspace (linkedPR null on the primary checkout).

Fix Broken Checks With AI opened from the Checks tab. CLI arguments were visible with the saved per-action value --qa-pr21149-ssh-launch. Delivery plan: Launch: codex '--qa-pr21149-ssh-launch'.

Prospective SSH Fix Broken Checks shows CLI arguments

Direct start after the orca.yaml trust prompt created /work/demo-project-pr-22-qa-args at PR head c490fc2 (pr-22-qa-args). Remote process: /usr/local/bin/codex --qa-pr21149-ssh-launch.

launchWorkItemDirect from the dialog itself returned the setup-policy fallback (openModalFallback) until hooks were trusted; the Checks composer still proved field visibility on the no-attached-workspace SSH repo. The create+start path above then proved the saved arguments reached the remote terminal.

Earlier local structured-hidden and local terminal-reappear screenshots remain valid. MaxListenersExceededWarning on BrowserWindow during hidden Electron launch is unrelated to this change.

@brennanb2025

Copy link
Copy Markdown
Contributor Author

Review status: clean

The review found and repaired one meaningful issue in 589e1844c7: a prospective SSH-owned repository was treated as local before its worktree existed, hiding saved per-action CLI arguments even though the launch would use a remote terminal. The decision now uses the canonical session-launch planner with the repository's execution host.

Two senior review loops and both the initial and final readiness audits found no remaining functional, architectural, compatibility, performance, security, or organizational blockers. The change adds no polling, listener, timer, or subprocess fanout.

Validation: 47/47 directly changed tests independently rerun in the final audit; 82 focused tests recorded earlier in this review; pnpm tc:web, changed-code quality, and git diff --check passed. Full CI is green at the pushed head, including all eight test shards, typecheck, static analysis, macOS and Windows packaging, and verify.

Hidden Electron/CDP checks confirmed that local structured launches hide the field and local terminal launches restore the saved value. A real prospective SSH PR launch displayed the saved argument, created its remote worktree, and ran codex --qa-pr21149-ssh-launch. Screenshots and flow details:

A MaxListenersExceededWarning appeared during isolated Electron startup. The changed files add no listener or BrowserWindow lifecycle registration; its underlying baseline or harness cause was not diagnosed in this review. Live folder-workspace and WSL UI flows were not exercised, but use the same reviewed launch planner. No blocking issues remain.

@brennanb2025

Copy link
Copy Markdown
Contributor Author

Additional Electron verification: structured native chat setting

In an isolated local Orca instance, I opened the real Resolve Conflicts With AI dialog for a merge-conflicted repository with Chat UI enabled and Default view: Chat UI. With Use updated structured native chat switched off, the CLI arguments field was visible:

Structured native chat off: CLI arguments visible

I then switched Use updated structured native chat on through Settings and reopened the same dialog with the same agent and repository. The CLI arguments field was absent:

Structured native chat on: CLI arguments hidden

The renderer settings and dialog DOM agreed in both states (experimentalNativeChat=true, openAgentTabsInChatByDefault=true; experimentalStructuredNativeChat=false → field count 1, then true → field count 0). No launch was performed in this toggle check.

@brennanb2025
brennanb2025 merged commit 73b3330 into main Sep 17, 2026
28 checks passed
gum798 pushed a commit to gum798/orca that referenced this pull request Sep 17, 2026
… default applies

stablyai#21149 established that `undefined` is what lets a launch fall back to the
global Agents arguments, and that an empty string beats that fallback. The
dialog seeds its arguments field from the saved recipe, and an untouched field
is stored as '' -- so every launch action still strips the agent's configured
arguments: Gemini launches without --yolo, Codex without its bypass flag.

Report a blank field as absent at the three places a launch action starts an
agent: the dialog path, the one-click commit/push failure notice, and both
fix-checks call sites. Those two read the saved recipe directly, so a recipe
saved once keeps stripping the default there even after the dialog is fixed.

The saved recipe still stores the raw field, so an untouched one compares equal
to a stored blank and the auto-start path does not rewrite settings.

Fixes stablyai#19379

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01T6zUCU6cyicLSBNzHWQnh4
ivanvykopal pushed a commit to ivanvykopal/orca that referenced this pull request Sep 20, 2026
…orks (stablyai#21149)

* Show the Source Control AI CLI arguments field only where it applies

* Fix Source Control arguments on remote launches
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant