Skip to content

fix(automations): find folder-workspace targets on the Automations page - #27416

Merged
OrcaWin merged 1 commit into
mainfrom
nwparker/automation-folder-workspace-row
Oct 11, 2026
Merged

OrcaWin merged 1 commit into
mainfrom
nwparker/automation-folder-workspace-row

Conversation

@OrcaWin

@OrcaWin OrcaWin commented Oct 11, 2026 •

Copy link
Copy Markdown
Collaborator
Files Added Deleted Net
Test 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​47 $\color{#cf222e}{\Huge{\mathbf{−}}}$​1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​46
Prod 3 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​55 $\color{#cf222e}{\Huge{\mathbf{−}}}$​20 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​35

ELI5

An automation can target an existing folder workspace (not just a git worktree). On the Automations page those automations showed "The target workspace is no longer available", greyed out Run now, and "Open workspace" from a run failed, even though the folder workspace was right there and the scheduler could run it.

What Changed

  • Before: the Automations page looked up an automation's workspace only among git worktrees, so a folder:<id> target was never found.
  • After: a folder target is looked up in the folder workspace list, scoped to the row's host the same way projects already are (a paired server's row only matches that server's folder workspace; a duplicate is not guessed). Run now and opening the run's workspace work again.
  • The cached folder-to-workspace conversion used by the existing workspace lookup is now a small exported function, so both callers share it.

Why

The run dispatcher already resolves folder targets through the known-workspace lookup; the page's row lookup simply never learned about them. Reusing the same conversion keeps one code path and stable object identity for rendering.

Linked Issue

No issue; found while triaging #27055, which this replaces for the folder case.

Visual Proof

N/A — enables an action that was wrongly disabled; covered by tests below.

Testing

  • I manually tested these changes locally
  • Automated tests added/updated

use-automations-page-store-state.folder.test.tsx fails on main (expected undefined to be 'App') and passes here. automation-list-row-identity.test.ts covers the per-host scoping. All automations and worktree-listing tests pass (110 files). pnpm tc:web, oxlint, check:code-quality:changed and pnpm lint pass.

Agent skill upstream boundary

  • Not applicable.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • N/A visual proof with reason
  • Self-reviewed for correctness, security, and performance
  • Folder workspaces, SSH and paired hosts considered (row scoping by host)

@coderabbitai

coderabbitai Bot commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

📝 Walkthrough

Walkthrough

Automation rows with folder workspace targets now resolve to matching folder worktrees, using folder ID and available catalog authority. The page store checks folder workspaces before falling back to repo worktrees. Synthetic folder worktrees are cached, and tests cover authority-specific matching and page-state resolution.


Priority: ⬇️ Low

Merge Risk: 🟡 Moderate · up to 2270c

Folder automations may still appear unavailable or point to a workspace on another host. Match the row’s host before merging.

Pre-merge checks | Passed 4 | Failed 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 37.50% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 8 functions across 5 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check Passed The title clearly identifies the primary change: fixing folder-workspace target resolution on the Automations page.
Description check Passed The description is mostly complete. It includes the user impact, changes, rationale, testing, visual-proof explanation, and checklist. It omits the AI Disclosure, Review, and Notes sections and does n…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 2
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR

🛠️ Fix failing CI checks 💡
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c0067026-cc5a-4585-b403-2e02cd32a554
📥 Commits

Reviewing files that changed from the base of the PR and between 6b747f8 and 2270c1d.

📒 Files selected for processing (5)
  • src/renderer/src/components/automations/automation-list-row-identity.test.ts
  • src/renderer/src/components/automations/automation-list-row-identity.ts
  • src/renderer/src/components/automations/use-automations-page-store-state.folder.test.tsx
  • src/renderer/src/components/automations/use-automations-page-store-state.ts
  • src/renderer/src/store/slices/worktrees/listing/detected-worktree-meta.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.

Comment on lines +115 to +119
(!authority ||
authorityOwnsHost(
authority,
workspace.executionHostId ?? getConnectionExecutionHostId(workspace.connectionId)
))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift

Match the row’s host, not only its authority.

If two desktop SSH hosts contain a folder with the same ID, both pass authorityOwnsHost, so matches.length is two and the target appears unavailable. If only the other SSH host has that ID, the row can resolve to the wrong folder. Use the row’s host selector to distinguish hosts within the authority before converting the workspace.

@OrcaWin
OrcaWin merged commit 264dc34 into main Oct 11, 2026
49 of 51 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant