Repository navigation
Fix task workspace handoff after switching workspaces - #8226
Merged
Merged
Conversation
Co-authored-by: Orca <help@stably.ai>
Contributor
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughWorktree creation completion now activates and reveals a worktree when its pending entry remains and either the creation surface is visible or the terminal view is active without a pending creation selection. Terminal focus queuing uses the same completion condition. Tests cover workspace switching during background creation and cancellation during trust preflight. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
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 |
6 tasks
Merged
8 of 9 tasks
enrick-dev
pushed a commit
to enrick-dev/orca
that referenced
this pull request
Oct 15, 2026
Co-authored-by: Orca <help@stably.ai>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When a workspace created from Tasks finishes after the user switches to another workspace, complete the handoff and open the new workspace instead of dropping its pending row and leaving it inactive.
Leaving the creation flow for Tasks, Settings, or another app view still keeps creation in the background without stealing focus. Cancelled creations also remain cancelled when post-create trust preflight finishes late.
Screenshots
No visual change. This changes the completion/navigation behavior of the existing pending workspace row.
Testing
pnpm lint(full repository lint not run)pnpm run typecheck:webpnpm test(full repository suite not run)pnpm build(not run)pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/lib/worktree-creation-flow.test.ts src/renderer/src/store/slices/worktrees.test.ts— 211 passedpnpm check:max-lines-ratchetandgit diff --checkpassedAI Review Report
Ran two adversarial review/fix rounds with
review-until-cleanagainst the branch diff.Round 1 found a cancellation race: if the pending row was cancelled while agent-trust preflight was still awaiting, the new completion predicate could misclassify the cleared pending pointer as a workspace switch. Added an entry-existence guard and a regression test. Round 2 found no remaining in-scope issues.
The review checked success, failure, cancellation, retry/concurrency state, terminal startup handoff, Tasks/settings focus preservation, local/SSH/runtime ownership, and test depth. It explicitly checked macOS, Linux, and Windows compatibility; this renderer-only state change touches no shortcuts, labels, paths, shell commands, Git commands, or platform-specific Electron APIs.
Performance risk is negligible: completion adds one Zustand state read/map lookup and predicate evaluation once per workspace creation, with no polling, listeners, timers, IPC/RPC, storage, or render fanout.
Security Audit
No new external inputs, command execution, path handling, authentication, secrets, dependencies, or IPC surfaces are introduced. Existing agent-trust and workspace-create boundaries are unchanged. The cancellation guard prevents a late async trust result from reviving a user-cancelled workspace.
Notes
The fix is renderer-state based and applies equally to local, SSH, and runtime-backed workspace creation. Temporary workspaces created for manual reproduction and validation were removed.
Made with Orca 🐋