Repository navigation
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: 📥 CommitsReviewing files that changed from the base of the PR and between 05fccb8049d7e0d1f43d49b8f29da842438d529b and 373b3afcbac943edce5a3804bef288827526f310. 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughInitial terminal seeding moved into worktree activation logic. Terminals are created on first activation or when explicit activation work is requested, while reselecting an emptied worktree leaves it empty. Terminal rendering no longer performs automatic tab creation. Tests cover empty reselection and explicit startup seeding, and the 🚥 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 2f72ea4c-4471-4ccd-a64b-cb21c5b64028
📥 Commits
Reviewing files that changed from the base of the PR and between 0404f27 and f04a52aca3da17e3e6a82f7de2b0753cf01c3677.
📒 Files selected for processing (5)
src/renderer/src/components/Terminal.tsxsrc/renderer/src/lib/worktree-activation-created-agent.test.tssrc/renderer/src/lib/worktree-activation-empty-reselect.test.tssrc/renderer/src/lib/worktree-activation.tssrc/shared/types.ts
f04a52a to
05fccb8
Compare
Sync update (
|
Greptile SummaryThis PR fixes #11108 by ensuring that re-selecting a workspace whose tabs were all closed no longer auto-creates a blank terminal or relaunches a sleeping agent session. The fix moves terminal seeding responsibility from a reactive
Confidence Score: 5/5Safe to merge — the change is tightly scoped to the activation path with no impact on explicit create/launch flows or cold-restore hydration. The Files Needing Attention: No files require special attention.
|
| Filename | Overview |
|---|---|
| src/renderer/src/lib/worktree-activation.ts | Core logic change: introduces shouldSeedInitialTerminal gate before calling ensureWorktreeHasInitialTerminal and resumeSleepingAgentSessionsForWorktree in both activation functions. Ordering is correct — isFirstActivation is captured from the pre-setActiveWorktree snapshot. |
| src/renderer/src/components/Terminal.tsx | Removes the useEffect that auto-created a terminal tab on workspace activation. The cold-restore startupResumeWorktreeIdsRef effect is intentionally kept and bounded to fire at most once per worktree per session. |
| src/renderer/src/lib/worktree-activation-empty-reselect.test.ts | New test file covering empty-reselect policy for both worktrees and folder workspaces across 4 scenarios. |
| src/shared/types.ts | JSDoc update for createdWithAgent to reflect narrowed semantics — seeds only first-activation terminal, not every reselect. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[activateAndRevealWorktree / activateAndRevealFolderWorkspace] --> B{shouldSeedInitialTerminal?}
B -- "isFirstActivation OR hasActivationWork OR initialCwd" --> C[resumeSleepingAgentSessionsForWorktree]
C --> D[ensureWorktreeHasInitialTerminal]
D --> E{renderableTabCount == 0?}
E -- yes --> F[createTab + queueTabStartupCommand]
E -- no --> G[return existing tabId or null]
B -- "previously activated + no explicit work" --> H[skip resume + skip tab creation]
H --> I[primaryTabId = null]
F --> J[return primaryTabId]
G --> J
I --> J
Reviews (2): Last reviewed commit: "test(workspace): cover folder empty rese..." | Re-trigger Greptile
|
Re: sleeping-agent resume on empty reselect — already gated on current HEAD:
No further code change in this pass. Folder-workspace empty-reselect unit coverage is a nice-to-have follow-up if reviewers want it. |
Sync update (
|
Stop auto-creating a terminal/agent when re-selecting a workspace that has no open tabs; keep create-flow launch behavior unchanged. Fixes stablyai#11108
…stablyai#11159) Greptile/CodeRabbit: assert empty folder reselect seeds nothing and does not call resumeSleepingAgentSessionsForWorktree; keep git worktree cases. Co-Authored-By: Grok Companion <[email protected]>
373b3af to
6458172
Compare
|
Thank you so much, @innocarpe, for the earlier implementation and follow-up coverage here, and for clearly documenting the remaining local/remote gaps when you closed this branch. We referred to this PR and its discussion while checking the scope of the empty-pane launch UI that has now landed in #32182. I have added a named acknowledgment and a link back to your PR in #32182. Your work separating intentional activation from unwanted terminal/agent recreation remains valuable context, and the remaining last-tab selection behavior is explicitly distinguished from the UI work in #32182. Thank you again for the contribution and the care you put into the tests and discussion. |
Description
Re-selecting a workspace after all tabs were closed no longer auto-creates a blank terminal or relaunches the creation agent. The workspace can stay empty until the user explicitly opens a tab.
Focused fix
ensureWorktreeHasInitialTerminalon first-activation / explicit create work; remove Terminal.tsx auto-create-on-activate effect; regression testsPreserves
Evidence
User-regression-tradeoffs
everActivatedis session-scoped). Same-session empty reselect is fixed.Fixes #11108