Repository navigation
Show and Filter Automation-Created Workspaces - #5697
Conversation
Co-authored-by: Orca <[email protected]>
|
Ready to review this PR? Stage has broken it down into 15 individual chapters for you: Chapters generated by Stage for commit e8edd6b on Jun 18, 2026 7:53pm UTC. |
|
Note Reviews pausedIt 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 Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughThis PR adds end-to-end automation workspace provenance tracking and a sidebar filter to hide automation-generated workspaces. Shared types ( 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
There was a problem hiding this comment.
Actionable comments posted: 3
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/renderer/src/hooks/useAutomationDispatchEvents.ts (1)
87-175:⚠️ Potential issue | 🟠 Major | ⚡ Quick winExpand the error boundary to include preflight IPC awaits.
Line 88, Line 104, and Line 158 await IPC calls before the
tryat Line 175. If one throws, the run can exit without amarkDispatchResult, leaving dispatch lifecycle state incomplete.Suggested patch direction
- if (repo.connectionId) { + try { + if (repo.connectionId) { const needsPrompt = await window.api.ssh.needsPassphrasePrompt({ targetId: repo.connectionId }) ... - } + } - if (run.trigger === 'scheduled' && automation.precheck) { - precheckResult = await window.api.automations.runPrecheck({ - automationId: automation.id, - runId: run.id - }) - ... - } - - try { + if (run.trigger === 'scheduled' && automation.precheck) { + precheckResult = await window.api.automations.runPrecheck({ + automationId: automation.id, + runId: run.id + }) + ... + } + const automationWorkspaceCreateRequestId = createBrowserUuid() ... } catch (error) { await markDispatchResult({ runId: run.id, status: 'dispatch_failed', workspaceId: dispatchWorkspaceId, workspaceDisplayName: dispatchWorkspaceDisplayName, precheckResult, error: error instanceof Error ? error.message : String(error) }) }
🧹 Nitpick comments (3)
src/renderer/src/components/automations/AutomationsPage.tsx (1)
939-961: 💤 Low valueRedundant dependency
selected?.idin useEffect array.
selected?.idis fully derived fromselected—ifselectedchanges, the effect runs regardless, andselected?.idalone cannot change withoutselectedchanging. Removing it simplifies the dependency array without altering behavior.♻️ Suggested simplification
return () => { cancelled = true } - }, [pendingAutomationRunNavigation, selected, selected?.id, runs, settings]) + }, [pendingAutomationRunNavigation, selected, runs, settings])src/renderer/src/store/slices/worktree-helpers.ts (1)
151-152: ⚡ Quick winAdd a short “why” comment for
automationProvenanceRequestin the new options bag.This parameter carries a non-obvious, system-owned create constraint; a 1–2 line rationale here will prevent accidental misuse by normal callers.
💡 Suggested diff
- compareBaseRef?: string, - options?: { automationProvenanceRequest?: CreateWorktreeArgs['automationProvenanceRequest'] } + compareBaseRef?: string, + // Why: reserved for automation-dispatch flows so host-side provenance + // can be minted securely; regular create callers should omit this. + options?: { automationProvenanceRequest?: CreateWorktreeArgs['automationProvenanceRequest'] }As per coding guidelines:
**/*.{ts,tsx,js,jsx}requires a short comment when behavior is driven by non-obvious constraints.Source: Coding guidelines
src/main/runtime/rpc/methods/worktree.ts (1)
74-127: ⚡ Quick winAdd a short why-comment for the finish/release token lifecycle.
This try/catch flow is non-obvious; a 1–2 line rationale would prevent accidental regressions in reservation semantics.
As per coding guidelines, “When writing or modifying code driven by a design doc or non-obvious constraint, add a comment explaining why the code behaves the way it does.”
Source: Coding guidelines
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 4edc9761-6301-4853-8754-4a985ad77cd8
📒 Files selected for processing (53)
config/tsconfig.tc.web.jsonsrc/main/automations/dispatch-tokens.tssrc/main/automations/headless-workspace-create.test.tssrc/main/automations/headless-workspace-create.tssrc/main/automations/service.tssrc/main/automations/workspace-provenance.tssrc/main/index.tssrc/main/ipc/worktree-logic.test.tssrc/main/ipc/worktree-logic.tssrc/main/ipc/worktree-metadata-merge.tssrc/main/ipc/worktree-remote.tssrc/main/ipc/worktrees.test.tssrc/main/ipc/worktrees.tssrc/main/runtime/orca-runtime.tssrc/main/runtime/rpc/methods/client-ui.test.tssrc/main/runtime/rpc/methods/client-ui.tssrc/main/runtime/rpc/methods/worktree-schemas.tssrc/main/runtime/rpc/methods/worktree.test.tssrc/main/runtime/rpc/methods/worktree.tssrc/main/worktree-removal-authority.test.tssrc/main/worktree-removal-safety.tssrc/renderer/src/App.tsxsrc/renderer/src/components/WorktreeJumpPalette.tsxsrc/renderer/src/components/automations/AutomationsPage.tsxsrc/renderer/src/components/automations/automation-host-client.tssrc/renderer/src/components/sidebar/SidebarFilter.tsxsrc/renderer/src/components/sidebar/SidebarWorkspaceFilterSection.tsxsrc/renderer/src/components/sidebar/SidebarWorkspaceOptionsMenu.tsxsrc/renderer/src/components/sidebar/WorktreeCard.tsxsrc/renderer/src/components/sidebar/WorktreeCardAutomationDetailSection.tsxsrc/renderer/src/components/sidebar/WorktreeCardMeta.tsxsrc/renderer/src/components/sidebar/WorktreeList.tsxsrc/renderer/src/components/sidebar/use-visible-workspace-kanban-worktree-ids.tssrc/renderer/src/components/sidebar/visible-worktrees.test.tssrc/renderer/src/components/sidebar/visible-worktrees.tssrc/renderer/src/components/sidebar/worktree-card-meta-types.tssrc/renderer/src/hooks/useAutomationDispatchEvents.tssrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/i18n/locales/es.jsonsrc/renderer/src/i18n/locales/ja.jsonsrc/renderer/src/i18n/locales/ko.jsonsrc/renderer/src/i18n/locales/zh.jsonsrc/renderer/src/lib/startup-ui-hydration.tssrc/renderer/src/lib/worktree-activation-automation-filter.test.tssrc/renderer/src/lib/worktree-activation.tssrc/renderer/src/store/slices/ui.tssrc/renderer/src/store/slices/worktree-helpers.tssrc/renderer/src/store/slices/worktrees.tssrc/renderer/src/web/web-preload-api.tssrc/shared/automation-workspace-provenance.tssrc/shared/automations-types.tssrc/shared/constants.tssrc/shared/types.ts
Co-authored-by: Orca <[email protected]>
Co-authored-by: Orca <[email protected]>
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/renderer/src/components/sidebar/WorktreeCard.tsx (1)
1319-1319: ⚡ Quick winUse tokenized sizing utilities for the new automation badge.
Line 1319 uses
h-[16px]andtext-[10px], which bypass shared sizing tokens. Please switch to documented size tokens/classes used by the design system for badge sizing/typography consistency.Suggested adjustment
- className="h-[16px] gap-1 px-1.5 text-[10px] font-medium rounded shrink-0 text-muted-foreground bg-accent border border-border dark:bg-accent/80 dark:border-border/50 leading-none" + className="h-4 gap-1 px-1.5 text-xs font-medium rounded shrink-0 text-muted-foreground bg-accent border border-border dark:bg-accent/80 dark:border-border/50 leading-none"As per coding guidelines, “Never invent new color values, font sizes, or shadow tiers when a documented one in STYLEGUIDE.md already covers the role” and “All UI work ... must follow
docs/STYLEGUIDE.mdand use tokens defined insrc/renderer/src/assets/main.css.”Source: Coding guidelines
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 0673ed3c-90c4-4174-9f51-f3181c54df5a
📒 Files selected for processing (9)
src/renderer/src/components/sidebar/WorktreeCard.pr-display.test.tsxsrc/renderer/src/components/sidebar/WorktreeCard.tsxsrc/renderer/src/components/sidebar/WorktreeCardDisplayMenuSection.tsxsrc/renderer/src/components/sidebar/sidebar-workspace-option-items.test.tssrc/renderer/src/components/sidebar/sidebar-workspace-option-items.tssrc/renderer/src/components/sidebar/worktree-card-display-property-options.tssrc/shared/types.tssrc/shared/worktree-card-properties.test.tssrc/shared/worktree-card-properties.ts
✅ Files skipped from review due to trivial changes (2)
- src/renderer/src/components/sidebar/worktree-card-display-property-options.ts
- src/renderer/src/components/sidebar/WorktreeCardDisplayMenuSection.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
- src/shared/types.ts
Co-authored-by: Orca <[email protected]>
Co-authored-by: Orca <[email protected]>
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/renderer/src/hooks/useAutomationDispatchEvents.ts (1)
176-220: 💤 Low valueThe 25+ positional parameters with many
undefinedvalues is fragile.The
createWorktreecall uses positional parameters where most areundefined, making it easy to miscount positions if the signature changes. Consider whether the store API could accept an options object instead in a future refactor.This isn't blocking since it follows the existing API pattern, but the new
automationProvenanceRequestaddition compounds the maintenance burden.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: fdc28586-577b-402e-bb54-39ecd135370d
📒 Files selected for processing (8)
src/main/automations/headless-workspace-create.test.tssrc/main/automations/headless-workspace-create.tssrc/main/persistence.test.tssrc/main/runtime/rpc/methods/worktree.test.tssrc/main/runtime/rpc/methods/worktree.tssrc/renderer/src/components/sidebar/WorktreeCard.tsxsrc/renderer/src/hooks/useAutomationDispatchEvents.tssrc/renderer/src/store/slices/worktree-helpers.ts
🚧 Files skipped from review as they are similar to previous changes (5)
- src/main/automations/headless-workspace-create.test.ts
- src/renderer/src/store/slices/worktree-helpers.ts
- src/main/runtime/rpc/methods/worktree.ts
- src/main/automations/headless-workspace-create.ts
- src/renderer/src/components/sidebar/WorktreeCard.tsx
Co-authored-by: Orca <[email protected]>
Co-authored-by: Orca <[email protected]>
* upstream/main: (220 commits) Show and Filter Automation-Created Workspaces (stablyai#5697) Fix premature project header truncation Send review notes to any running agent of a worktree (stablyai#5654) Fix workspace sidebar appearance setting (stablyai#5725) Highlight the open file in the Source Control sidebar (stablyai#5667) release: v1.4.80-rc.1 Fix premature Codex completion notifications (stablyai#5682) Improve Codex startup prompt reliability (stablyai#5686) Keep hibernated agent completions visible (stablyai#5689) Move Prompt Cache Timer setting to Agents pane, simplify expired state (stablyai#5691) release: v1.4.80-rc.0 Skip GitHub CLI preflight checks if no GitHub projects exist fix: restore font family keyboard navigation in settings Update README downloads badge fix(landing): make GitHub CLI setup nudge dismissible and provider-aware (stablyai#5688) Fix nested workspace card indentation (stablyai#5684) Fix flaky e2e tests (stablyai#5680) Replace plus icon with play button on quick command entry (stablyai#5674) Use managed Pi and OMP extensions (stablyai#5681) Narrow computer-use e2e trigger (stablyai#5685) ... # Conflicts: # mobile/src/terminal/TerminalWebView.tsx # mobile/src/terminal/terminal-webview-text-zoom.test.ts
* upstream/main: (78 commits) Show and Filter Automation-Created Workspaces (stablyai#5697) Fix premature project header truncation Send review notes to any running agent of a worktree (stablyai#5654) Fix workspace sidebar appearance setting (stablyai#5725) Highlight the open file in the Source Control sidebar (stablyai#5667) release: v1.4.80-rc.1 Fix premature Codex completion notifications (stablyai#5682) Improve Codex startup prompt reliability (stablyai#5686) Keep hibernated agent completions visible (stablyai#5689) Move Prompt Cache Timer setting to Agents pane, simplify expired state (stablyai#5691) release: v1.4.80-rc.0 Skip GitHub CLI preflight checks if no GitHub projects exist fix: restore font family keyboard navigation in settings Update README downloads badge fix(landing): make GitHub CLI setup nudge dismissible and provider-aware (stablyai#5688) Fix nested workspace card indentation (stablyai#5684) Fix flaky e2e tests (stablyai#5680) Replace plus icon with play button on quick command entry (stablyai#5674) Use managed Pi and OMP extensions (stablyai#5681) Narrow computer-use e2e trigger (stablyai#5685) ... # Conflicts: # mobile/app/h/[hostId]/session/[worktreeId].tsx # mobile/src/terminal/TerminalWebView.tsx # mobile/src/terminal/terminal-webview-html.ts
* upstream/main: (220 commits) Show and Filter Automation-Created Workspaces (stablyai#5697) Fix premature project header truncation Send review notes to any running agent of a worktree (stablyai#5654) Fix workspace sidebar appearance setting (stablyai#5725) Highlight the open file in the Source Control sidebar (stablyai#5667) release: v1.4.80-rc.1 Fix premature Codex completion notifications (stablyai#5682) Improve Codex startup prompt reliability (stablyai#5686) Keep hibernated agent completions visible (stablyai#5689) Move Prompt Cache Timer setting to Agents pane, simplify expired state (stablyai#5691) release: v1.4.80-rc.0 Skip GitHub CLI preflight checks if no GitHub projects exist fix: restore font family keyboard navigation in settings Update README downloads badge fix(landing): make GitHub CLI setup nudge dismissible and provider-aware (stablyai#5688) Fix nested workspace card indentation (stablyai#5684) Fix flaky e2e tests (stablyai#5680) Replace plus icon with play button on quick command entry (stablyai#5674) Use managed Pi and OMP extensions (stablyai#5681) Narrow computer-use e2e trigger (stablyai#5685) ... # Conflicts: # src/renderer/src/i18n/locales/en.json # src/renderer/src/i18n/locales/es.json # src/renderer/src/i18n/locales/ja.json # src/renderer/src/i18n/locales/ko.json # src/renderer/src/i18n/locales/zh.json
* upstream/main: (341 commits) Show and Filter Automation-Created Workspaces (stablyai#5697) Fix premature project header truncation Send review notes to any running agent of a worktree (stablyai#5654) Fix workspace sidebar appearance setting (stablyai#5725) Highlight the open file in the Source Control sidebar (stablyai#5667) release: v1.4.80-rc.1 Fix premature Codex completion notifications (stablyai#5682) Improve Codex startup prompt reliability (stablyai#5686) Keep hibernated agent completions visible (stablyai#5689) Move Prompt Cache Timer setting to Agents pane, simplify expired state (stablyai#5691) release: v1.4.80-rc.0 Skip GitHub CLI preflight checks if no GitHub projects exist fix: restore font family keyboard navigation in settings Update README downloads badge fix(landing): make GitHub CLI setup nudge dismissible and provider-aware (stablyai#5688) Fix nested workspace card indentation (stablyai#5684) Fix flaky e2e tests (stablyai#5680) Replace plus icon with play button on quick command entry (stablyai#5674) Use managed Pi and OMP extensions (stablyai#5681) Narrow computer-use e2e trigger (stablyai#5685) ... # Conflicts: # src/main/text-generation/commit-message-text-generation.test.ts # src/main/text-generation/commit-message-text-generation.ts
Co-authored-by: Orca <[email protected]>
Summary
Adds system-owned provenance for workspaces created by automations, then surfaces that provenance in workspace filtering and navigation:
automationProvenancemetadata on new-per-run automation workspacesThis stays scoped to the automation-specific slice and does not add generic workspace folders/tags/saved views.
Design Review
The Brennan YOLO Lite scratch design was written first and reviewed through
auto-design-review-fixuntil clean. I then re-read it before implementation and kept the product scope to automation provenance/filter/navigation only.Implementation Notes
Implementation follows the reviewed design with a few hardening additions found during review:
hostIdfalls back to the owning worktree host for hover availability and actionsworktree-metadata-merge.tsand the automation reveal regression test was split to satisfy max-lines without disablesCompleteness Verification
Completeness verification was delegated after implementation and confirmed the requested automation-specific surface was present: provenance visibility, hide/filter behavior, workspace-to-automation/run navigation, run-to-workspace navigation, stale state handling, cleanup/archive compatibility, and remoting-aware host identity handling.
Code Review Loop
Multiple two-reviewer rounds were run as required. Actionable findings were fixed and re-reviewed, including:
The final fresh reviewer pair both returned
No issues found.on the current diff.Brennan Test Changes
brennan-test-changesverdict: land.Product validation launched Electron from this exact worktree and verified identity:
devBranch: brennanb2025/automation-workspace-filteringdevRepoRoot: /Users/thebr/orca/workspaces/orca/automation-workspace-filteringValidated against
demo-project:Run NowResume workspacerevealed the generated workspaceOpen automationandOpen runHide automation-createdhid the generated card, and resume/reveal cleared the filter and restored itworktree.showandworktree.listreturned provenance intactAccepted validation gaps:
brennan-test-sshwas not run because this change handles host IDs/SSH-aware state but does not add SSH transport behaviorTests
pnpm run typecheckpnpm run typecheck:nodepnpm run typecheck:webpnpm run typecheck:clipnpm run lint(passes with a pre-existingSourceControl.tsxhooks warning)pnpm run lint:react-doctor:changedpnpm run verify:localization-cataloggit diff --checkdemo-projectviabrennan-test-changesAssumptions / Risks
Existing workspaces are not migrated; only newly automation-created workspaces get provenance. Future cleanup/archive UX can query this system-owned field without conflating it with user-authored tags.
Made with Orca 🐋
Follow-up Stabilization
After the scanability follow-up, automation-created workspace cards now show a default-on
Automationbadge that is controlled by the existing Show properties menu. Merge conflicts withorigin/mainwere resolved and pushed.Final screenshot evidence captured locally, not committed:
.playwright-cli/screenshots/automation-workspace-badge-final-row.png.playwright-cli/screenshots/automation-workspace-badge-final-viewport.png.playwright-cli/screenshots/automation-property-menu-final.png.playwright-cli/screenshots/automation-property-hidden-final.pngAdditional validation after the follow-up:
pnpm vitest run --config config/vitest.config.ts src/main/persistence.test.ts -t "(adds split-out default card properties|derives fresh default profiles without branch|uses the default preset when card properties are missing)"pnpm vitest run --config config/vitest.config.ts src/main/runtime/rpc/methods/worktree.test.ts src/main/automations/headless-workspace-create.test.ts src/shared/worktree-card-properties.test.ts src/renderer/src/components/sidebar/sidebar-workspace-option-items.test.ts src/renderer/src/components/sidebar/WorktreeCard.pr-display.test.tsxpnpm run typecheck:webpnpm run typecheck:nodepnpm run lint:react-doctor:changedgit diff --checkverifypassed on3255e258aa9c1a03fadbe5a9b0309dc3077968b5.CodeRabbit follow-up: addressed the concrete comments for badge token sizing, headless fixture paths, workspace-name comment, forged-token test specificity, provenance token lifecycle comment, automation provenance options comment, and dispatch preflight error handling. Remaining latest note is a non-blocking low-value observation about the existing positional
createWorktreeAPI shape.Metadata Icon Follow-up
Moved the automation-created indicator out of the title row and into the same metadata icon cluster used by notes/issues/reviews, using the same
CalendarClockicon as the top-left Automations nav.Latest screenshot evidence captured locally, not committed:
.playwright-cli/screenshots/automation-metadata-icon-row.png.playwright-cli/screenshots/automation-metadata-icon-viewport.png.playwright-cli/screenshots/automation-metadata-icon-property-menu.png.playwright-cli/screenshots/automation-metadata-icon-hidden.pngValidation for this follow-up:
pnpm vitest run --config config/vitest.config.ts src/renderer/src/components/sidebar/WorktreeCard.pr-display.test.tsx src/shared/worktree-card-properties.test.ts src/renderer/src/components/sidebar/sidebar-workspace-option-items.test.tspnpm run typecheck:webpnpm run typecheck:nodepnpm run lint:react-doctor:changedgit diff --checkverifypassed on87b3cb1d14096bb43ce6dffa1972eb5d27ad48c2.Compact Metadata Icon Correction
Follow-up fix for compact workspace rows: compact cards now render the automation metadata icon in the same right-side title-row icon lane as notes/ports-style metadata and the primary-worktree star. The icon remains controlled by the
Automationproperty in Show properties.Latest screenshot evidence captured locally, not committed:
.playwright-cli/screenshots/automation-compact-icon-card.png.playwright-cli/screenshots/automation-compact-icon-worktree-list.png.playwright-cli/screenshots/automation-compact-icon-restored.png.playwright-cli/screenshots/automation-property-menu-checked.png.playwright-cli/screenshots/automation-compact-icon-hidden.pngValidation for this correction:
pnpm vitest run --config config/vitest.config.ts src/renderer/src/components/sidebar/WorktreeCard.pr-display.test.tsx src/shared/worktree-card-properties.test.ts src/renderer/src/components/sidebar/sidebar-workspace-option-items.test.tspnpm run typecheck:webpnpm run typecheck:nodepnpm run lint:react-doctor:changedgit diff --check HEAD~1..HEADverifypassed one8edd6b008ebc3114a9dc5e912ccdd042a9d2c0c.