Skip to content

feat(new-workspace): add "None" agent option that opens only the setup script - #25617

Merged
nwparker merged 14 commits into
stablyai:mainfrom
leog:feat/new-workspace-setup-only
Oct 14, 2026
Merged

nwparker merged 14 commits into
stablyai:mainfrom
leog:feat/new-workspace-setup-only

Conversation

@leog

@leog leog commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

ELI5

Choose None when a project’s setup script already starts the tools you need. Orca opens the Setup tab without adding an extra blank terminal.

What Changed

  • Before, creation required an agent or Blank Terminal, so setup ran beside another terminal.
  • The workspace picker and Settings → Agents now offer None. Without a setup script, or when setup is skipped, creation still opens a blank terminal.
  • None can be saved as the default. Picking another default clears it, including Blank Terminal updates from older mobile clients.
  • The execution host now receives the composer’s per-create choice, including an explicit Blank Terminal override. CLI creation uses the host’s saved default.
  • Updated the feature for the current host-owned settings API, including durable writes and rollback after a failed save. Fixed the picker’s default action for Blank Terminal when None is saved.

Why

The setting keeps the existing blank value and adds an optional flag, so older clients can continue reading it. The create request also uses an optional boolean, so older hosts ignore it safely. Reusing the existing setup-tab and host-settings flows preserves configured splits and default tabs, instead of building a second creation path.

Linked Issue

Fixes #25247

Visual Proof

Blank Terminal with setup (existing behavior):

Blank Terminal with a separate Setup tab

None with setup (new behavior; Setup is the only active tab):

None opens only the Setup tab

Updated picker and saved default:

Picker label is None

None selected in agent settings

Testing

  • 586 focused and neighboring tests passed, covering workspace creation/activation, composer state, host provisioning, settings, and picker behavior. Final checks also cover the RPC choice mapping and durable rollback; 36 host-settings tests pass after reproducing and fixing the older-client Blank Terminal regression.

  • pnpm tc, pnpm run build:electron-vite, changed-code quality (including design system), max-lines, and localization catalog/extraction checks passed.

  • Hidden Electron on macOS, driven through Playwright CDP: saved None in Settings; confirmed the picker label; created with None and setup (one active Setup tab); skipped setup (one shell); selected Blank Terminal over a saved None default (shell plus Setup).

  • Remote choice propagation and older-host settings presentation were reviewed; live SSH, Linux, and Windows were not exercised locally. CI covers the platform checks.

  • I manually tested these changes locally

  • Automated tests added/updated, or explained why not below

AI Disclosure

Original contribution: Claude Fable 5.1 via Claude Code. Maintainer follow-up: Codex.

Review

Maintainer review traced local and remote creation, settings ownership/persistence, failed setup spawning, failed database writes, concurrent default changes, split setup, configured default tabs, and agent-only pickers. Fixed the settings integration, per-create host choice, and incorrect Blank Terminal default action, and legacy clients retaining the None flag after choosing Blank Terminal.

Agent skill upstream boundary

  • Not applicable; no upstream skill-installer material is copied.

Notes

  • Split setup still requires a host terminal; configured default tabs are preserved.
  • Folder workspaces without setup keep their existing blank-terminal fallback.
  • Older hosts may fall back to a blank terminal for a one-off None choice. The settings pane only offers the remote None default when the host reports support.
  • No new process launcher, Git command, platform-specific branch, or agent-status store.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, before/after, mechanism, and alternatives)
  • Before/after screenshots attached
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, folder, and backwards compatibility considered
  • Local typecheck, focused tests, build, and changed-file lint pass; remaining checks run in CI

leog and others added 4 commits October 5, 2026 01:49
…p script

New workspaces previously required choosing an agent or a blank terminal,
so a setup script that launches its own agent always ran next to an extra
shell. The quick-create agent picker and Settings > Agents now offer
"None (setup script only)": when setup runs, the workspace opens with just
the Setup tab focused; without a setup script it falls back to a blank
terminal.

The default is stored as defaultTuiAgent 'blank' plus a new optional
newWorkspaceSetupOnly flag, so clients and servers that only know 'blank'
degrade to a blank terminal instead of rejecting an unknown value.

Closes stablyai#25247
"None (setup script only)" only took effect in the new-workspace dialog.
A workspace created with `orca worktree create` still opened a blank
terminal first and left it selected, because the main process builds
those tabs and never read the setting.

The main-process tab provisioning now skips the blank terminal when the
default is "None" and a setup script runs in its own tab, so Setup is the
only tab. The same rule applies to CLI creates that activate the
workspace, and to dialog creates the user navigated away from before
they finished. A split setup or repo default tabs still get their shell.

The setup-only check moved to src/shared so main and renderer share it.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
… the line limit

The CLI activation path now passes providesInitialSurface for the "None"
default, so it has to appear in the test that lists every caller using
that option; the full test run failed without it.

Merging main pushed worktree-creation-flow-execute.ts to 301 lines against
the 300-line limit. Naming the background-create condition brings it back
to 300 with no behavior change.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@leog
leog marked this pull request as ready for review October 5, 2026 19:20
@leog
leog requested a review from brennanb2025 as a code owner October 5, 2026 19:20
@pullfrog

pullfrog Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

This run croaked 😵

The workflow encountered an error before any progress could be reported. Please check the link below for details.

Pullfrog  | Rerun failed job ➔ | View workflow run | via Pullfrog | 𝕏

@coderabbitai

coderabbitai Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

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
📝 Walkthrough

Adds a “None” choice for new workspaces that stores setup-only behavior alongside the blank-agent default. The choice can be selected in the composer or set as the default. Quick-create requests carry the optional setupOnly flag through worktree creation. When setup-only applies and setup uses a new tab, terminal provisioning skips the initial shell and attempts a fallback shell if setup terminal creation fails. Activation and background seeding also treat returned setup data as the initial surface.

Priority: ➖ Normal

Merge Risk: 🟡 Moderate · up to e5860

Choosing None can still produce an extra blank terminal, or suppress one incorrectly. This happens when the renderer's view of the saved default or setup launch mode differs from the execution host's view, such as with remote or older hosts. The settings tooltip also overstates the behavior when Setup runs in a split. Resolve the surface-decision mismatch before merging.

Security Architecture Review

Security architecture risk: 🔵 Low · up to ae808

The change primarily affects which tabs open, rather than which scripts may run. Risk is low, but the workspace-specific selection can differ from the saved default used by connected servers, and interruption recovery is not fully established.

Retained concerns

  • Low · architecture · inferred: The per-create setupOnly choice stops at the renderer boundary, while runtime terminal provisioning derives the same decision from saved settings. On runtime-owned creation paths, a composer override can therefore disagree with the host's initial-surface decision. Successful host setup spawning also removes setup metadata from the result, preventing the renderer's setup-only activation path from reconciling that decision. This is lifecycle ownership drift; elevated command authority has not been demonstrated.
Security review details

Security Blast Radius

  • inferred — The directly evidenced exposure is terminal-surface selection for newly created workspaces on the provisioning host. Because runtime provisioning reads a saved default, its decision can affect multiple eligible creations rather than only the request carrying setupOnly. Broader tenant, credential, or environment exposure is not established.

Trust Boundaries and Controls

  • observed — Runtime provisioning retains the canSpawn gate and existing workspace selector when invoking terminal creation or splitting. The new flag carries no script path, command, or environment values; those sensitive inputs remain in the pre-existing setup payload.

Resilience and Maintainability Implications

  • inferred — When setup is the sole intended surface, a setup-terminal spawn failure can leave this provisioning call with no terminal. Awaited remote provisioning retains setup metadata and can report spawn_failed; non-awaited provisioning marks setup handed off before completion. Complete recovery after runtime interruption remains unproven, rather than evidence of a security bypass.

Hardening Proposals

  • proposed — Use one captured per-create surface decision across renderer and runtime ownership, with explicit provisioning outcomes before treating setup ownership as settled. Preserve the existing setup decision and execution-host controls independently of this presentation choice.
Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 9.38% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 32 functions across 46 files. (1 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: adding a None agent option that opens only the setup script.
Description check Passed The description follows the repository template and covers the user-facing change, rationale, linked issue, visual proof, testing, AI disclosure, compatibility, platform considerations, and checklist …
Linked Issues check Passed Issue #25247 requests a None choice that opens the Setup Script without an extra terminal. The current implementation skips the initial shell when setup exists, setupScriptLaunchMode is new-tab, a…
Out of Scope Changes check Passed The picker, settings, persistence, request propagation, activation, terminal provisioning, fallback behavior, localization, and tests directly support issue #25247. No unrelated change is demonstrated…
Full details: Docstring Coverage

Explanation

Docstring coverage is 9.38% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 32 functions across 46 files. (1 skipped: 1 unsupported.)

  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

leog and others added 2 commits October 6, 2026 15:40
…ew-workspace-setup-only

Conflict: upstream removed worktree-activation-surface-caller-wiring.test.ts
(stablyai#25791), which this branch had extended with two callers. Took the deletion.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…setup-only

# Conflicts:
#	src/main/runtime/runtime-worktree-terminal-provisioning.test.ts
#	src/renderer/src/hooks/composer-state/composer-submit-model.ts
#	src/renderer/src/hooks/useComposerState.ts

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

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ccb99905-39e6-4526-8349-aa7b4fe660a8
📥 Commits

Reviewing files that changed from the base of the PR and between ae808c0 and 54d2665.

📒 Files selected for processing (10)
  • src/main/runtime/runtime-store-contract.ts
  • src/main/runtime/runtime-worktree-terminal-provisioning.test.ts
  • src/main/runtime/runtime-worktree-terminal-provisioning.ts
  • src/renderer/src/components/NewWorkspaceComposerModal.tsx
  • src/renderer/src/hooks/composer-state/composer-submit-model.ts
  • src/renderer/src/hooks/ipc-events/worktree-event-runtime.ts
  • src/renderer/src/hooks/useComposerState.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/lib/worktree-creation-flow-execute.ts
  • src/shared/global-settings-types.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/renderer/src/i18n/locales/en.json

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

…ab fails to spawn

The "None" default skips the blank shell because the Setup tab will be the
only surface. If that spawn fails, the workspace was left with no terminal.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@leog

leog commented Oct 7, 2026

Copy link
Copy Markdown
Contributor Author

On the Linked Issues warning about split launch modes: keeping a shell there is intentional. A split setup needs an existing pane to split from, so "None" with split-vertical or split-horizontal opens one shell and splits the Setup script into it, which is still a single tab. Suppressing the shell only applies to new-tab mode, where the Setup tab can be the only surface. The "keeps the shell a split setup needs" test pins this.

leog and others added 2 commits October 10, 2026 14:38
…setup-only

# Conflicts:
#	src/renderer/src/components/agent/AgentCombobox.tsx
#	src/renderer/src/hooks/composer-state/composer-submit-model.ts
#	src/renderer/src/hooks/composer-state/quick-creation-execution.ts
#	src/renderer/src/hooks/composer-state/quick-submit-action.ts
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

@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)

🟡 Minor · Hide setup-only selection for project-group targets. · quick-submit-action.ts:70

src/renderer/src/hooks/composer-state/quick-submit-action.ts:70
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Hide setup-only selection for project-group targets.

Project-group submission drops setupOnly, so “None (setup script only)” behaves like “Blank Terminal” and cannot run a setup script. Do not pass the setup-only option to AgentCombobox for project-group targets.


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f1b6cc54-7523-4804-9787-26b940f8afb1
📥 Commits

Reviewing files that changed from the base of the PR and between 7af3eed and f2b2e01.

📒 Files selected for processing (13)
  • src/main/runtime/runtime-store-contract.ts
  • src/main/runtime/runtime-worktree-terminal-provisioning.ts
  • src/renderer/src/components/NewWorkspaceComposerCard.tsx
  • src/renderer/src/components/agent/AgentCombobox.tsx
  • src/renderer/src/components/new-workspace/NewWorkspaceComposerAgentSection.test.tsx
  • src/renderer/src/components/new-workspace/NewWorkspaceComposerAgentSection.tsx
  • src/renderer/src/components/new-workspace/new-workspace-composer-card-props.ts
  • src/renderer/src/components/settings/AgentsPane.tsx
  • src/renderer/src/hooks/composer-state/composer-submit-model.ts
  • src/renderer/src/hooks/composer-state/quick-creation-execution.ts
  • src/renderer/src/hooks/composer-state/quick-submit-action.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/lib/worktree-creation-flow.test.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/renderer/src/i18n/locales/en.json

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

@nwparker
nwparker enabled auto-merge (squash) October 14, 2026 01:04

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

Reviewed adversarially and took over the follow-up. Fixed the label, integrated None with the current execution-host settings API and durable rollback, carried the composer’s one-off choice to host provisioning, and repaired the Blank Terminal default action when None is saved. Resolved the main conflict while preserving the newer host-owned settings UI.

Validation: 586 focused and neighboring tests; final RPC/durability/creation checks; typecheck; Electron production build; changed-code/design-system gate; localization checks. Hidden Electron CDP confirmed the rendered None label, saved default, Setup-only creation, skipped-setup shell fallback, and explicit Blank Terminal override. Updated screenshots are in the PR body.

No remaining blocker found in the reviewed code. Live SSH/Linux/Windows were not exercised locally; required CI remains the merge gate.

@nwparker
nwparker disabled auto-merge October 14, 2026 01:10
@nwparker
nwparker enabled auto-merge (squash) October 14, 2026 01:11

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

Actionable comments posted: 1

Caution

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

⚠️ Outside diff range comments (1)

🟠 Major · Propagate the host-resolved initial-surface decision to… · worktree-creation-flow-execute.ts:174

src/renderer/src/lib/worktree-creation-flow-execute.ts:174
🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift

Propagate the host-resolved initial-surface decision to both renderer paths.

The host resolves setup-only using the explicit choice or saved default, and only skips the shell in new-tab mode. The create path derives the decision from preparedRequest.setupOnly and result.setup, while the activation-event path uses the receiving renderer’s settings. These inputs can differ from the host’s resolved decision.

A missing or older setupOnly request can make the host apply its saved None default while the renderer does not set providesInitialSurface; activation then proceeds to ensureWorktreeHasInitialTerminal and can seed an extra shell. A different launch mode can also make callerProvidesSurface suppress or retain a shell incorrectly. Normal split provisioning does not return setup because it creates the shell and split itself, so use the host’s resolved decision rather than treating every returned setup as setup-only.

Carry that resolved decision in the create result and activation event, then pass it to providesInitialSurface and callerProvidesSurface.


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 490e832b-f09e-44ad-9c43-a5644e9f0791
📥 Commits

Reviewing files that changed from the base of the PR and between f2b2e01 and e5860d1.

📒 Files selected for processing: 31
  • src/main/runtime/agent-launch-settings-rollback.ts
  • src/main/runtime/orca-runtime-activate-managed-worktree.ts
  • src/main/runtime/rpc/methods/worktree-create-args.ts
  • src/main/runtime/rpc/methods/worktree-create-setup-choice.test.ts
  • src/main/runtime/runtime-client-agent-launch-settings-durability.test.ts
  • src/main/runtime/runtime-client-agent-launch-settings.test.ts
  • src/main/runtime/runtime-client-settings-shape.ts
  • src/main/runtime/runtime-client-settings.ts
  • src/main/runtime/runtime-local-worktree-terminal-startup.test.ts
  • src/main/runtime/runtime-local-worktree-terminal-startup.ts
  • src/main/runtime/runtime-managed-worktree-create-types.ts
  • src/main/runtime/runtime-store-contract.ts
  • src/main/runtime/runtime-worktree-terminal-provisioning.test.ts
  • src/main/runtime/runtime-worktree-terminal-provisioning.ts
  • src/renderer/src/components/agent/AgentCombobox.test.tsx
  • src/renderer/src/components/agent/AgentCombobox.tsx
  • src/renderer/src/components/settings/AgentDefaultSetting.tsx
  • src/renderer/src/components/settings/AgentLaunchSettingsCatalog.tsx
  • src/renderer/src/hooks/composer-state/quick-creation-execution.ts
  • src/renderer/src/hooks/composer-state/quick-creation-request.test.ts
  • src/renderer/src/hooks/composer-state/quick-creation-request.ts
  • src/renderer/src/hooks/ipc-events/worktree-event-runtime.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/lib/worktree-creation-flow-execute.ts
  • src/renderer/src/lib/worktree-creation-flow.test.ts
  • src/renderer/src/store/slices/worktrees/create/worktree-create-payload.ts
  • src/shared/agent-launch-settings.ts
  • src/shared/global-settings-types.ts
  • src/shared/rpc-contract/agent-launch-settings-params.ts
  • src/shared/rpc-contract/worktree-create-params.ts
  • src/shared/worktree/create-types.ts
🚧 Files skipped from review as they are similar to previous changes: 1
  • src/renderer/src/i18n/locales/en.json

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 2 remain after this review.

@nwparker
nwparker disabled auto-merge October 14, 2026 01:24
@nwparker
nwparker enabled auto-merge (squash) October 14, 2026 02:48
@nwparker
nwparker merged commit 701e9f2 into stablyai:main Oct 14, 2026
32 checks passed
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.

[Feature] New workspace custom terminal logic

2 participants