Skip to content

refactor(floating-workspace): launch the default agent through the shared launcher - #21390

Merged
brennanb2025 merged 10 commits into
mainfrom
brennanb2025/floating-agent-launch
Sep 21, 2026
Merged

brennanb2025 merged 10 commits into
mainfrom
brennanb2025/floating-agent-launch

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 4 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​207 $\color{#cf222e}{\Huge{\mathbf{−}}}$​69 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​138
Prod 3 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​96 $\color{#cf222e}{\Huge{\mathbf{−}}}$​81 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​15

What the button did before

The floating workspace titlebar has a default-agent icon button. It drove tab startup itself — buildAgentStartupPlan → createTab(FLOATING_TERMINAL_WORKTREE_ID, …, { activate: false }) → queueTabStartupCommand(…) → activate + a hand-rolled tab-bar order loop → focus.

That is a second copy of what launchAgentInNewTab already does for every other "start an agent here" button (use-terminal-create-actions.ts:98, QuickLaunchButton.tsx:137, the dashboard, source control, session fork, and six more). A change to the launch point had two places to land.

What it does now

The button calls launchAgentInNewTab({ agent, worktreeId: FLOATING_TERMINAL_WORKTREE_ID, launchSource: 'shortcut', activate: false }) and keeps only its own placement — selecting the tab inside the floating panel's unified group and focusing it. The shared launcher owns the startup plan, the route, and the tab identity.

launchAgentInNewTab gains an optional activate. The floating panel must not take the global selection: activating would move the main window's active tab to a tab it does not show. This matches the floating workspace's other tab creators, which already pass activate: false to createTab and select via activateTab (use-floating-terminal-create-actions.ts:68-72).

Does the renderer place a tab on the launch receipt?

Not on the receipt, and it does not need to. Two mechanisms exist; neither is receipt-driven.

  1. Host-pushed reveal. orca-runtime-create-terminal.ts:256-271 calls notifier.revealTerminalSession(…) whenever presentation !== 'background', and the renderer's terminal-presentation-ipc-bridge.ts:86-107 answers by calling store.createTab(worktreeId, undefined, undefined, { initialPtyId: ptyId, … }). The host creates the tab; the caller places nothing.
  2. Caller reserve-then-adopt. reserveAgentBackgroundSessionIdentity + adoptAgentBackgroundSessionTab (adopt-agent-background-session-tab.ts:97-102, used at launch-agent-background-session.ts:226) mint the tab id before the spawn, bake it into the PTY env, and adopt afterwards.

What the receipt itself carries is only { kind: 'terminal', handle } (agent-launch-intent.ts:61-63). agentLaunchSurfaceFactory.createTerminalAgent (agent-launch-surfaces.ts:92-95) drops the tabId that RuntimeTerminalCreate already computed, and the renderer cannot resolve a term_* handle itself — terminal-handle-links.ts:309-311 says so outright ("main owns the term_* mapping") and defers to a terminal.focus RPC. So placing on the receipt would require adding tabId to AgentLaunchOutcome, i.e. a wire change.

No wire change was needed, because agent.launch is not the shared launch point for a desktop button — launchAgentInNewTab is. It already routes the floating workspace correctly: it builds its route input with workspaceKindForWorktreeId(worktreeId) (launch-agent-in-new-tab.ts:219, the same shared module #21193 added), and structured-native-chat-launch-route.ts:86-87 returns { supported: false, blocker: 'floating-workspace' }. The launch resolves the terminal-backed lane, as required — a PTY, rendered as chat when the user's chat default is on (see the behaviour-change section below). No new target arm, no change to AgentLaunchIntent, no placement or focus on the wire.

What crosses the shared command

Everything the button passed, verified field by field against launch-agent-in-new-tab.ts:149-175:

before after
agent defaultAgent same
cmdOverrides settings.agentCmdOverrides same
agentArgs resolveTuiAgentLaunchArgs(...) same
agentEnv resolveTuiAgentLaunchEnv(...) same
allowEmptyPromptLaunch true true via planLaunchAgentStartupPrompt (launch-agent-startup-prompt-plan.ts:72-77, empty prompt)
platform CLIENT_PLATFORM CLIENT_PLATFORM — the floating sentinel has no worktree row, so repo is null and the helper falls back to the same constant
telemetry launch_source 'shortcut' 'shortcut'
env / launchConfig / startupCommandDelivery queued queued

Prompt transport is untouched: this button passes no prompt.

Two behaviours change, both fixes:

  • Tab-bar order now goes through persistAgentLaunchTabOrder, which reconciles editor and browser tabs. The hand-rolled loop rebuilt order from terminal tabs only, so a floating workspace holding markdown or browser tabs (both creatable from its + menu) would have had them dropped from the order.
  • The startup plan now carries the resolved Windows shell (resolveLocalWindowsAgentStartupShell), so argument quoting matches the shell the PTY actually gets. The button passed no shell.

Nothing was dropped.

Behaviour change: the floating launch now honours the chat-view default

Worth calling out separately, because it goes beyond "route through the shared launcher" and it reverses an assertion that was on main.

main's FloatingTerminalWindowControls.test.tsx deliberately seeded nativeChatSessionOptions and then asserted not.toHaveProperty('sessionOptions') — an intentional pin that the floating launch did not carry the user's model/effort preferences. That pin is gone, and this is why:

  • With experimentalNativeChat + openAgentTabsInChatByDefault on, the floating launch now opens in the chat view and applies the user's model/effort, exactly as every other launch caller does. With the flags off (the default) nothing changes — it is still a plain terminal.
  • This is not new routing. main's own agent-launch-routing.test.ts:115-116 already asserted route({ workspaceKind: 'floating' }) === 'legacy-native-chat'. The shared launcher always resolved the chat view for floating; the button simply was not using the shared launcher. Verified by ablation: main's launch-agent-in-new-tab.ts produces createTab(floating, …, { viewMode: 'chat' }) unchanged.
  • Session options and the chat view are one decision, not two: resolveInitialNativeChatSessionOptions emits options only when viewMode === 'chat', so they cannot diverge.

Structured sessions remain unavailable in the floating workspace, on the pre-existing floating-workspace blocker. That is unchanged here and tracked separately.

Ablation

Originally proved at a7295c19f5. Re-proved at the final head de8fb41006: substituting origin/main's launch-agent-in-new-tab.ts makes the floating placement test fail (it produces no activate: false and calls setActiveTabType), confirming the test is a real pin rather than a no-op. Each scripted substitution asserts it matched exactly once, so a silent no-op fails loudly.

  • Arm A — revert FloatingTerminalWindowControls.tsx to its pre-change content (rg -c launchAgentInNewTab → 0, confirming the ablation landed): Test Files 1 failed (1), Tests 3 failed | 1 passed (4). The one that still passes is the route assertion, which pins the floating→terminal rule independently of the component — correct.
  • Arm B — drop the activate threading in launch-agent-in-new-tab.ts (ablated 1 occurrence): Test Files 1 failed (1), Tests 1 failed | 1 passed (2). The passing one is the default-behaviour control.
  • Restored, verified by content, green again: Test Files 2 passed (2), Tests 6 passed (6).

Verification

All observed on a7295c19f5:

  • pnpm tc — exit 0.
  • pnpm test over the floating-terminal directory, every launch-agent-in-new-tab* suite and the shared route suite — Test Files 24 passed (24), Tests 210 passed (210).
  • pnpm run check:code-quality:changed — 0 new findings across 4 changed files, all seven gates, baselined at 71f3bdb70026. Re-run after committing, after the pre-commit oxfmt --write, and after the merge.
  • pnpm-lock.yaml verified byte-identical to origin/main before the commit and absent from it. Local pnpm rewrote it three times (adding @pnpm/exe); restored each time.
  • No max-lines disable. Adding the activate test pushed launch-agent-in-new-tab.test.ts to 811/800, so the test went into a new launch-agent-in-new-tab-placement.test.ts, following the split the repo already uses for the -cwd, -host-resolution and -windows-quoting suites.

Verified in Electron

Dev instance attached to this worktree, driven through the real button with the chat flags on: the floating panel renders the chat view (.native-chat-pane-shell count inside [data-floating-terminal-panel] = 1), tab created as contentType: terminal / viewMode: chat, 0 console errors. Screenshot in the comments.

UNVERIFIED

  • No Windows run. The Windows shell in the startup plan is reasoned from source and unexercised on that platform here.
  • Tab-bar order reconciliation is reasoned from source. Note the floating panel renders its tab strip from the group's own order, not from tabBarOrderByWorktree, so this affects the mobile/web projections rather than the panel itself.
  • activate is consumed only on the local-terminal route. The structured and host-published routes ignore it; the floating workspace cannot reach either, but another caller passing activate: false for a structured launch would be silently ignored. Documented on the field.

…ared launcher

The floating workspace titlebar agent button drove tab startup itself: it built
its own `buildAgentStartupPlan`, created the tab, queued the startup command and
rebuilt the tab-bar order by hand. That is a second copy of what
`launchAgentInNewTab` already does for every other "start an agent here" button,
so a launch-point change had two places to land.

The button now calls `launchAgentInNewTab` and keeps only its own placement:
selecting the tab inside the floating panel's unified group and focusing it.

`launchAgentInNewTab` gains an optional `activate` so a caller that places the
tab itself can keep the new terminal out of the global selection. The floating
panel needs this — activating would move the main window's active tab to a tab
it does not show — and it matches the other floating tab creators, which already
pass `activate: false` to `createTab` and select via `activateTab`.

Two behaviours change, both fixes:
- tab-bar order now goes through `persistAgentLaunchTabOrder`, which reconciles
  editor and browser tabs. The hand-rolled loop rebuilt order from terminal tabs
  only, dropping the floating workspace's markdown and browser tabs.
- the startup plan now carries the resolved Windows shell, so argument quoting
  matches the shell the PTY actually gets.
@coderabbitai

coderabbitai Bot commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

Understand this PR’s impact

Explore downstream dependencies and potential security impact with Blast Radius.

View blast radius →

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 1429b938-ee5e-44cc-a316-e8db255ed036

📥 Commits

Reviewing files that changed from the base of the PR and between 11807ce and 71e069e.

📒 Files selected for processing (1)
  • src/renderer/src/lib/agent-launch-routing.test.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 5 remain after this review.


📝 Walkthrough

Walkthrough

Floating terminal controls now use launchAgentInNewTab with inactive activation. The shared launcher conditionally updates global tab state and reuses the computed workspace kind. The controls handle failed launches and focus returned local terminal tabs. Placement tests cover floating chat settings and activation behavior. Routing tests update floating workspace expectations for Claude and Codex.

Priority: ⬇️ Low

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 8 functions across 11 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly identifies the main change: routing floating-workspace agent launches through the shared launcher.
Description check ✅ Passed The description is detailed and explains the before-and-after behavior, rationale, implementation, compatibility considerations, and verification results. It does not include the required Linked Issue…
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR

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.

@coderabbitai coderabbitai 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.

Caution

Some comments are outside the diff and can’t be posted inline due to GitHub limitations.

⚠️ Outside diff range comments (1)

🟠 Major · Suppress global activation when activate is false. · launch-agent-in-new-tab.ts:342

src/renderer/src/lib/launch-agent-in-new-tab.ts:342
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Suppress global activation when activate is false.

The floating caller passes activate: false, but launchAgentInNewTabInternal still reaches store.setActiveTabType('terminal'). That store action updates the active worktree's surface, so a floating launch can switch the main window from an editor or browser to the terminal.

-  store.setActiveTabType('terminal')
+  if (activate !== false) {
+    store.setActiveTabType('terminal')
+  }

Extend the placement test to assert that setActiveTabType is not called when activate: false.


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: b9ed3cad-29db-49c3-8255-9b142946d036

📥 Commits

Reviewing files that changed from the base of the PR and between 71f3bdb and a7295c1.

📒 Files selected for processing (4)
  • src/renderer/src/components/floating-terminal/FloatingTerminalWindowControls.test.tsx
  • src/renderer/src/components/floating-terminal/FloatingTerminalWindowControls.tsx
  • src/renderer/src/lib/launch-agent-in-new-tab-placement.test.ts
  • src/renderer/src/lib/launch-agent-in-new-tab.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review.

@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 migration introduces a main-window side effect the inline path did not have: the shared launcher flips the active worktree's activeTabType to terminal, so launching the floating default agent can switch the main window out of an open editor. Details inline.

Reviewed changes

  • Floating default-agent button delegates to the shared launcher — FloatingTerminalWindowControls.tsx now calls launchAgentInNewTab(...) with activate: false and keeps only its own selection and focus, dropping the inline startup plan, createTab, queueTabStartupCommand, and the hand-rolled tab-order loop.
  • launchAgentInNewTab gains an optional activate — forwarded to createTab only when false; the terminal route honors it, the structured and host-published routes do not.
  • Test changes — the component test now mocks the shared launcher and pins the call shape; a new launch-agent-in-new-tab-placement.test.ts pins the activate threading and the floating-to-terminal route.

ℹ️ Floating launches now adopt the native-chat default view mode and session options

The shared launcher resolves initialViewModeProps and sessionOptions from settings and forwards both into createTab and the startup plan, where the inline path passed neither. With experimentalNativeChat and openAgentTabsInChatByDefault on, the floating button now creates a viewMode: 'chat' tab and applies model / effort flags; the removed test asserted no sessionOptions. This is plausibly the intended consistency with every other launch point, but it is not in the PR body, so please confirm the floating surface should follow the native-chat default.

Technical details
# Floating launch adopts native-chat view mode and session options

## Affected sites
- `src/renderer/src/lib/launch-agent-in-new-tab.ts:161-178` — resolves `initialViewModeProps` and `sessionOptions` from settings.
- `src/renderer/src/lib/launch-agent-in-new-tab.ts:268-274` — forwards `viewMode` to `createTab` and seeds the session-option cache.
- `src/renderer/src/components/floating-terminal/FloatingTerminalWindowControls.tsx:70` — the new call site.

## Open questions for the human
- Should the floating workspace follow `openAgentTabsInChatByDefault`, or stay terminal-only?

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

The census exists so a new launchAgentInNewTab caller is a deliberate act. This
entry is a bypass converging, not a bypass appearing: the button previously
hand-rolled the helper's terminal arm against queueTabStartupCommand.
@brennanb2025

Copy link
Copy Markdown
Contributor Author

Review status: clean after fixes

The review/fix loop found and fixed two in-scope regressions in the shared launch boundary:

  • Floating launches with activate: false no longer change the main window's active surface to Terminal.
  • The floating workspace remains terminal-only, so native-chat default view/session options are not applied there.

Fix commit: b89f59578f6241a452f91c20e16987bd3cc61450

Validation on the pushed head:

  • 236 review-scope tests passed across the launch, floating-control, routing, and native-chat boundary suites.
  • pnpm tc passed.
  • pnpm run check:code-quality:changed passed with zero findings across all gates.
  • git diff --check passed.
  • Final readiness audit found no remaining P0/P1/P2 issues; no mobile-facing, SSH/wire, security, or performance regression was introduced.
  • Electron CDP validation attached to the exact PR worktree identity, rendered the floating workspace, exercised the default Claude launch control, and showed the new Claude terminal tab in the floating workspace with no console errors.

Visual proof:

Before launch:

Floating workspace before launch

After clicking “Open Claude in floating workspace”:

Floating workspace after launch

No further in-scope issues remain. The change stays focused on converging the floating launch point onto the shared launcher.

@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

  • Scoped the shared launcher's global tab-type write — launchAgentInNewTab now gates store.setActiveTabType('terminal') on activate !== false, so a caller-placed floating launch no longer flips the main window's active worktree to the terminal view.
  • Made the floating workspace terminal-only end to end — decideInitialAgentTabViewMode returns undefined for workspaceKind === 'floating', and workspaceKind is threaded through initialAgentTabViewModeProps, resolveInitialNativeChatSessionOptions, and resolveAgentLaunchRoute, so a floating launch no longer adopts native-chat view mode, session options, or the legacy-native-chat route under chat-default settings.
  • Tests updated to pin the boundaries — the placement suite now asserts the gated setActiveTabType, terminal-only creation, and omitted session options for floating; routing, initial-view-mode, and session-option suites each add a floating case.

Both prior concerns are addressed. I verified no other launchAgentInNewTab caller passes activate: false, so the gate cannot change behavior for non-floating launches, and the new tests pass locally (46 tests across the five touched suites).

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

@brennanb2025

Copy link
Copy Markdown
Contributor Author

Additional Electron validation with native-chat settings enabled:

  • experimentalNativeChat=true
  • experimentalStructuredNativeChat=true
  • openAgentTabsInChatByDefault=true
  • defaultTuiAgent=codex

Clicking “Open Codex in floating workspace” rendered a terminal tab (expected floating-workspace behavior) rather than native chat, with no console errors.

Native-chat-enabled floating launch

@brennanb2025

Copy link
Copy Markdown
Contributor Author

Corrected Electron visual proof (regular workspace, not floating):

With experimentalNativeChat=true, experimentalStructuredNativeChat=true, openAgentTabsInChatByDefault=true, and defaultTuiAgent=codex, I opened the normal workspace New tab menu and selected Codex. The rendered UI shows the structured Codex Chat view ("Start a chat with Codex" and the "Send a message…" composer).

Structured native chat opened in Electron

The floating workspace remains intentionally terminal-only; its separate screenshot is not evidence for native-chat behavior.

…pace

The floating launch button now routes through the shared launcher, so it should
inherit the same launch policy as every other caller. The previous review pass
added a `workspaceKind === 'floating'` guard to `decideInitialAgentTabViewMode`,
which silently dropped `openAgentTabsInChatByDefault` (and the user's model and
effort preferences) for that one button.

That guard was not justified. `canToggleNativeChat` has no workspace-kind gate,
so a floating terminal can already be switched into the chat view by hand, and
`TerminalPaneNativeChatPortal` mounts into the pane's own container — the panel
already renders it. Refusing the setting at launch while the same view sits one
click away in the same panel is an inconsistency, not an invariant.

Structured sessions stay out of the floating workspace on the pre-existing
blocker in `resolveStructuredNativeChatSupport`: those open an `agent-session`
tab, and the floating panel renders no such surface.

@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

  • Reverted the floating workspace's terminal-only gating — decideInitialAgentTabViewMode, resolveInitialNativeChatSessionOptions, and resolveAgentLaunchRoute no longer read workspaceKind, so a floating launch follows openAgentTabsInChatByDefault and resolves the terminal-backed legacy-native-chat route. It still cannot reach a structured session: the floating-workspace blocker refuses one before the view-mode decider runs.
  • Kept the activate gate from the prior commit — store.setActiveTabType('terminal') is still skipped when activate === false, and createTab still receives { activate: false }, so the button keeps its placement inside the floating group without moving the main window's selection.
  • Re-pinned the boundary tests — the routing suite now asserts floating resolves legacy-native-chat, and the placement suite asserts the floating launch carries viewMode: 'chat' and seeds the resolved session options.

ℹ️ The floating chat path is covered only at mocked/store level

The new commit turns on native-chat rendering for the floating workspace, but no test exercises that rendering: the component test mocks launchAgentInNewTab, and the placement test asserts the createTab args and the session-option seed rather than a rendered pane. The bridge NativeChatView is pane/PTY-keyed and needs no worktree row, so the path looks sound from source, but a render-level regression here would not be caught. The PR body already flags that no Electron run happened — worth confirming in the app that a floating launch under chat-default settings comes up as a working chat pane, especially since worktree-derived chat affordances resolve against the FLOATING_TERMINAL_WORKTREE_ID sentinel.

Technical details
# Floating native-chat rendering has no render-level coverage

## Affected sites
- `src/renderer/src/components/floating-terminal/FloatingTerminalWindowControls.test.tsx` — mocks `@/lib/launch-agent-in-new-tab`, so it never reaches the chat surface.
- `src/renderer/src/lib/launch-agent-in-new-tab-placement.test.ts` — asserts `createTab` args (`viewMode: 'chat'`) and `seedNativeChatAppliedSessionOptions`, not a rendered pane.
- `src/renderer/src/components/floating-terminal/FloatingTerminalPanelSurface.tsx:226` — renders `TerminalPane` for terminal tabs; chat takes over through `TerminalPaneNativeChatPortal`.
- `src/renderer/src/components/terminal-pane/use-terminal-pane-chat-state.ts` — `effectiveChatViewMode` derives from `unifiedTabsByWorktree[FLOATING_TERMINAL_WORKTREE_ID][tabId].viewMode === 'chat'`.

## Required outcome
- Confidence that a floating launch under chat-default settings produces a working chat pane rather than a blank or terminal-only tab.

## Open questions for the human
- Was the floating chat path exercised in a running app? The PR body notes no Electron/UI run.

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

@brennanb2025

Copy link
Copy Markdown
Contributor Author

Correction + visual proof: the floating workspace now honours the chat-view default

My earlier comments on this PR said the floating workspace "remains intentionally terminal-only." That was wrong, and the screenshot I attached alongside it (a regular workspace) was not evidence for the floating behaviour. Correcting both here.

What was wrong

During the review loop I added a workspaceKind === 'floating' guard to decideInitialAgentTabViewMode, which suppressed openAgentTabsInChatByDefault — and the user's model/effort preferences — for the floating launch button only.

That guard was not justified:

  • canToggleNativeChat has no workspace-kind gate, so a floating terminal can already be switched into the chat view by hand.
  • TerminalPaneNativeChatPortal mounts into the pane's own container, and the floating panel already renders that pane.

Refusing the setting at launch while the identical view sits one click away in the same panel is an inconsistency, not an invariant — and it put a second guard beside the one that already exists in resolveStructuredNativeChatSupport. Removed in 11807cef8a.

Visual proof

Floating workspace, with experimentalNativeChat, openAgentTabsInChatByDefault and experimentalStructuredNativeChat enabled and defaultTuiAgent: claude. Clicking Open Claude in floating workspace now opens the chat view in the panel — "Start a chat with Claude", model picker, and the message composer:

pr21390-floating-native-chat.png

Verified in a dev instance attached to this exact worktree (devBranch: brennanb2025/floating-agent-launch), driven through the real button rather than by store mutation:

  • Tab created in global-floating-terminal with contentType: terminal, viewMode: chat.
  • .native-chat-pane-shell count inside [data-floating-terminal-panel]: 1 — the chat is rendering in the panel, not the main window.
  • 0 console errors.

Still out of scope here

Structured sessions remain unavailable in the floating workspace, on the pre-existing blocker in resolveStructuredNativeChatSupport (not introduced by this PR). The cause is that a session's working directory is re-derived from location.workspaceId on every launch and resume, and the floating workspace has no entry that resolver can answer for. That is a separate change — a resolvable identity for the floating workspace plus an agent-session surface in the panel — and will be its own PR.

Worth recording for that work: Orca currently has no fallback when a session's workspace has moved or is gone; resolveWorkspacePath either resolves or it does not. The floating case makes that gap live, because its folder is a setting the user can repoint at any time.

Validation

  • pnpm tc — pass
  • pnpm run check:code-quality:changed — 0 findings across all gates
  • 10,457 tests pass across src/renderer/src/lib, terminal-pane, tab-bar, floating-terminal, native-chat

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