Repository navigation
test(launch): pin what the "+" launchers produce on main today - #27691
Conversation
…oute produce on main
Row 1 ("+": menu, shortcut, dashboard) joins the window-tab table on both halves;
saved-arg tokenize failures before routing, the restart of a never-mounted "+" tab
and the AI-button host gate are pinned at the window planner.
… internals Drop the AI-button and restart tests and the duplicate \\wsl$ folder and macOS unclosed-quote rows; the Q5 pair now checks that no tab or startup was made.
Review status (coordinator)The problem. A planned series of PRs moves every way Orca starts a terminal agent onto one host launch path. Each step must keep each launcher behaving as it does on main today unless a change is decided on purpose. The earlier baseline (#27189) covered every launcher except the "+" new-tab launchers, because their route was being reverted (#27173). This PR records what the "+" launchers produce on main now, plus the answers to the open questions about "+". The user-facing change. None. Tests only; no production code changes. Review.
Live QA. Not applicable: no production change. CI. Green at 2eb1c44: 14 required checks pass, 18 skipped by path filters, no failures. Not verified.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to No merge-blocking issue is established for these test-only changes; merge after normal checks. Pre-merge checks |
|
ELI5
Orca is about to change how a new agent tab starts. Today the "+" button and its siblings (the new-agent shortcut, the dashboard's spawn button and the tab bar's Quick Launch items) build the agent's command line in the window and type it into a fresh terminal. The plan (step C2) moves them onto the same path the AI buttons use.
Before anyone moves them, we need a record of exactly what main does today, so the move can be checked byte for byte. This PR adds that record for the "+" family. It only adds tests. Nothing a user sees changes.
What Changed
User-facing change: none. Tests only; no production file is touched. The size table above counts the two
*.test-fixture.tsfiles as production, but both are test-only modules that no production code imports.Follows #27189, which has merged. #27189 pinned every other launcher with shared case tables and a test harness. This PR adds the "+" family to those tables and one small planner test.
What it pins, all expectations being what main does today, even where that looks wrong:
The "+" table (row 1), both halves. A new case table,
src/shared/launch-parity-plus-cases.test-fixture.ts, joins test(launch): pin what each agent launcher produces on main today #27189's window-tab table. Each row goes through the real store and the real terminal pane to the exactpty:spawnrequest (renderer half). That request is then fed to main'spty:spawn, and the test checks what reaches the fake terminal provider (main half). One row per entry point:C:\repo with the default PowerShell. Also hand-built, for the same reason.launchDashboardAgent.Quick Launch items are not a separate row. They omit the launch source, and
launchAgentInNewTabdefaults it to the menu's (tab_bar_quick_launch,launch-agent-in-new-tab.ts:293). So they send the same request as the menu row, from a different input.Every row saves the default argument
--append-system-prompt "Bob's rules". The apostrophe shows which shell the command was quoted for:'Bob'"'"'s rules'is bash,'Bob''s rules'is PowerShell. Each row checks:agent_startedtelemetry with each entry point's launch source (tab_bar_quick_launch,shortcut,unknown).The window planner, before any tab (
src/renderer/src/lib/launch-parity-plus-planner.test.ts). Whether saved default arguments stop "+" depends on the shell the window quotes for (Q5 below). Each case checks the outcome: whether a tab and a queued startup exist.#27189's shared files get small additive hooks only: a
plusproducer kind and an optionalagentArgsfact in the request builder, one producer branch in the window-tab test, and the new cases added to both tables. No existing expectation changed.Why
C2 replaces the "+" launch path. Without a record of today's bytes, a reviewer of C2 cannot tell a deliberate change from an accident. The bar for each test was: C2 relies on it, one case per rule, nothing main already pins, and nothing that an already-made decision changes. So this PR leaves out:
agent-launch-through-host.test.ts:110, theagent-launch-caller-*suites);terminal-startup-queue-restart.test.ts);\\wsl$folder, which goes through the same resolver as test(launch): pin what each agent launcher produces on main today #27189's\\wsl$folder row;agent-launch-caller-routing.test.ts:395);pty-spawn-cwd-fallback.test.ts);Answers to the open questions about "+"
Q5. Can "+" fail at the window planner when saved default arguments have an unclosed quote? VERIFIED (test)
Yes. Before it makes a tab, the window re-splits the saved default arguments using the quoting rules of the shell it targets. Pinned on a Windows client:
--x it\'sfails for aC:\repo, where the window quotes for PowerShell, which has no backslash escape. No tab opens and nothing is queued.--x it\'slaunches for a\\wsl$repo, which is quoted for bash.An unbalanced quote fails everywhere; main already pins that (
agent-launch-caller-routing.test.ts:395).The toast the user sees ("Could not build launch command for Claude.") comes from each caller, except the dashboard spawn: it returns a result that its caller (
useDashboardPopoutBridge.ts:117) ignores, so a dashboard "+" fails with no message. Read in code, not run.UNVERIFIED: that this also blocks a "+" that would have opened a chat. The check runs before the route is chosen in
launch-agent-in-new-tab.ts, so it should, but no test exercises it.\\wsl$folder "+": quoting and terminal shell on main now. VERIFIED (test, #27189)Since #27259, "+" in a
\\wsl$folder workspace on Windows quotes the command for Linux (bash) and runswsl.exewith distroUbuntu, so the quoting and the shell agree. "+" goes through the same resolver as #27189's\\wsl$folder row, which pins this. An earlier code reading, done before #27259 and not re-checked first-hand, found PowerShell quoting typed intowsl.exe.B6. A "+" tab that never showed its terminal, across a restart. VERIFIED (main's test)
The queued command is not saved. After a restart the tab comes back as the agent's tab with no terminal and nothing queued, so its pane opens a plain shell. Main's
terminal-startup-queue-restart.test.tspins this with the samecreateTabandqueueTabStartupCommandcalls "+" makes.Still UNVERIFIED (needs a live app):
§7 item 7. Does any other real "+" fail at the window planner? VERIFIED (code reading; not pinned)
Yes, one more, added by #27259: a workspace whose host has not reported its operating system. Examples are an SSH host that is not connected yet, an Orca server too old to report it, or rival host rows. No tab opens and the user sees two toasts. The planner shows the reason, such as "The SSH host has not reported its operating system yet. Connect to it and try again.", and then the caller adds "Could not build launch command for Claude." (the dashboard spawn adds nothing, so it shows only the first) All three examples come from one check in
execution-host-facts.ts, read in code.An earlier local version of this PR pinned the SSH case. It was dropped once #27189 removed SSH from the shared test model, because SSH is out of scope for this plan.
No other window-planner failure is reachable from a "+" input (read in code; the remaining planner failures need a prompt, and "+" passes none). With chat on, a "+" that would open a chat can also return nothing after routing, when Orca cannot tell which host owns the workspace. That is a route failure, not a planner one, and it is not pinned here.
Floating "Open ". UNVERIFIED (end to end)
Its exact input is pinned on main (
FloatingTerminalWindowControls.test.tsx:180), and so is the planner's handling of the floating workspace (launch-agent-in-new-tab.test.ts:217). Its pane request is not pinned, because the shared harness has no floating-workspace model.C2 should add a floating case. When "+" moves to the host, the host must resolve the floating workspace, which has no repo or folder row. That is where this launch is most likely to break.
Linked Issue
N/A (internal plan step; no issue).
Visual Proof
N/A: tests only, no visual or interaction change.
Testing
C:\row red. Making a resolved WSL project use the client's OS turns only the\\wsl$row red. Both lines were restored by explicit edit, and the tree is clean.tc-gate pnpm tc:nodeandtc-gate pnpm tc:webpass.orca-ci-checks --no-typecheckpassed 24 of 25 locally. The one failure is its bundled typecheck, which stops on a local tooling error ("Script not found check"). The plain typechecks above are the real result.Platforms: the cases model macOS, Linux and Windows clients in unit tests. No live app was run.
I manually tested these changes locally
Automated tests added/updated, or explained why not below
Review
Author: Brennan Benson (X: @BrennanKB5)
Agent skill upstream boundary
Notes
Tests only. They cover macOS, Linux and Windows
C:\and\\wsl$clients for local hosts. SSH "+" rows are out of scope, because main no longer spawns SSH terminals through this path.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)