Repository navigation
fix(agents): open a shell, not an unrequested chat, in empty workspaces when the default agent is Auto - #36927
Conversation
…efault agent is Auto
|
No actionable comments were generated in the recent review.
|
There was a problem hiding this comment.
Actionable comments posted: 2

Review info
-
Run configuration-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
b7082d9a-c963-46ea-a3d7-5d96799d1e9b
Files selected for processing: 2-
src/renderer/src/lib/empty-workspace-default-agent-chat.test.tssrc/renderer/src/lib/empty-workspace-default-agent-chat.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
-
ELI5
If you never picked a default agent (Settings still says Auto), opening an empty workspace started a Claude chat on its own. Claude just happens to be first in Orca's agent list. Now an empty workspace opens a plain shell until you save a default agent. A saved agent, or a saved Blank Terminal, works the same as before.
What Changed
defaultTuiAgent: null), opening a workspace with no tabs ranopenDefaultAgentChatInEmptyWorkspace. It handednulltopickTuiAgent, which falls back to the first detected agent inTUI_AGENT_AUTO_PICK_ORDER, so you got Claude.defaultChatHost(renamed fromdefaultChatDetectionTarget) only returns a host when a real agent is saved as the default. Auto and Blank Terminal return nothing, and all three exports share that answer:openDefaultAgentChatInEmptyWorkspacereturnsnull, and the seeding step opens its usual shell.emptyWorkspaceDefaultChatAwaitsDetectionandloadEmptyWorkspaceDefaultChatDetectionstop holding the workspace for up to 5 s while agent detection runs, since nothing can open anyway.readAgentLaunchPreferencesForWorktree), not the desktop's own settings. The tab-bar shortcuts andlaunchAgentInNewTabalready read them this way. On a paired runtime host, "is a default saved?" now means the host's default. Local and SSH workspaces still read the desktop settings, exactly as before.What doesn't change:
Why
This empty-workspace path is the only place Orca starts an agent without a click. #23693 made it opt-in so it couldn't start an unrequested agent, but Auto slipped through: an unset default was read as a request for the first agent in the catalog. The onboarding folder path (
onboardingFolderDefaultAgent) already treats an unset default as "no agent", and this brings the empty-workspace path into line with it.Alternatives I ruled out:
pickTuiAgentor the pick order: that would change every click-driven launch, where Auto picking an agent is the point. Reordering would just start a different unrequested agent.Linked Issue
Fixes #36594
Visual Proof
Default agent left on Auto, chat mode on, Claude and Codex both installed. A new workspace is created and opened from the sidebar. Hidden dev build on macOS.
Before (main): a Claude Chat tab opens without being asked for.

After: the workspace opens a plain shell.

Testing
Reproduced on main in a hidden dev build: Auto plus chat mode opened a Claude Chat tab in a new empty workspace. On this branch the same steps open a shell. Saving Codex as the default and opening another new workspace still opens a Codex Chat tab.
Two regression assertions in
empty-workspace-default-agent-chat.test.ts: Auto launches nothing (any launch fails, not only Claude), and Auto doesn't wait on an unloaded SSH host's agent list. Both failed on main and pass with the fix.pnpm testonempty-workspace-default-agent-chat.test.tsandworktree-activation-default-agent-chat.test.ts(21/21),check:code-quality:changed,check:react-doctor:changed,oxlint,oxfmt.macOS only. Linux, Windows and a real SSH or paired host weren't run by hand. The SSH wait is covered by the unit test.
I manually tested these changes locally
Automated tests added/updated, or explained why not below
AI Disclosure
Review
Agent skill upstream boundary
Notes
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)