Repository navigation
feat(worktree): seed the default agent when activating an empty worktree - #15912
CodeHourra wants to merge 1 commit into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (10)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughThe change adds shared logic to resolve a configured or detected default TUI agent and build its startup payload. Onboarding startup now uses this builder. Empty worktree activation uses the default-agent payload when no other startup command exists. Initial terminal creation now uses Merge Risk: ⚪ Minimal · up to This change makes the first tab in an empty worktree follow the configured default agent while preserving blank-terminal and existing-tab behavior. No actionable merge-blocking risk remains beyond normal checks and review. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
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. Comment |
ELI5
Clicking a worktree that has no tabs used to open a blank terminal. It now opens the same default agent you already picked in Settings → Agents, unless you set that default to a blank terminal.
What Changed
Settings → Agents → Default Agent = blankstill opens a blank terminal.buildDefaultAgentStartupPayloadwith this path.Why
The default agent already applied to new agent tabs and onboarding. Activating an empty workspace ignored it, so the first click felt like a different product from Settings. This makes the empty-workspace first tab follow the same setting.
Linked Issue
No existing issue.
Visual Proof
N/A — no layout, chrome, or copy change. The only interaction change is which process the first tab launches:
defaultTuiAgent(or auto-pick from detected agents when unset);blankkeeps a shellTesting
Covered in unit tests:
blank/ disabled default / no detections → no agent launchPlatforms exercised by tests: launch plan is built with host platform, remote
isRemote, and Windows shell resolution. I did not run a packaged macOS/Linux/Windows/SSH smoke in this PR.pnpm exec vitest run --config config/vitest.config.ts \ src/renderer/src/lib/worktree-default-agent-startup.test.ts \ src/renderer/src/components/terminal/initial-terminal-wiring.test.ts \ src/renderer/src/lib/worktree-activation-agent-startup.test.ts \ src/renderer/src/lib/worktree-activation-default-tabs.test.ts \ src/renderer/src/components/onboarding/onboarding-folder-agent-startup.test.ts44 tests passed.
AI Disclosure
Cursor Grok 4.6 authored the implementation, tests, and this PR description.
Review
getAgentLaunchPlatformForRepo) or renderer platform; Windows shell goes throughresolveLocalWindowsAgentStartupShell.connectionId+remoteDetectedAgentIdsand passisRemoteinto the existing startup plan. Folder workspaces shareensureWorktreeHasInitialTerminal; onboarding folders share the payload builder.defaultTuiAgent/disabledTuiAgents/pickTuiAgentand existingbuildAgentStartupPlan(cmd overrides, default args/env, native-chat session options). No GitHub-only naming.Agent skill upstream boundary
docs/reference/agent-skill-sharing-upstream-boundary.mdand copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.Notes
Ensure no issues in: Security, Cross-platoform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)Summary
Test plan
Made with Cursor