Repository navigation
fix(automations): find folder-workspace targets on the Automations page - #27416
Conversation
📝 Walkthrough
Priority: ⬇️ Low Merge Risk: 🟡 Moderate · up to Folder automations may still appear unavailable or point to a workspace on another host. Match the row’s host before merging. Pre-merge checks |
|
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
c0067026-cc5a-4585-b403-2e02cd32a554
📒 Files selected for processing (5)
src/renderer/src/components/automations/automation-list-row-identity.test.tssrc/renderer/src/components/automations/automation-list-row-identity.tssrc/renderer/src/components/automations/use-automations-page-store-state.folder.test.tsxsrc/renderer/src/components/automations/use-automations-page-store-state.tssrc/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.
| (!authority || | ||
| authorityOwnsHost( | ||
| authority, | ||
| workspace.executionHostId ?? getConnectionExecutionHostId(workspace.connectionId) | ||
| )) |
There was a problem hiding this comment.
🎯 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.
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
folder:<id>target was never found.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
use-automations-page-store-state.folder.test.tsxfails on main (expected undefined to be 'App') and passes here.automation-list-row-identity.test.tscovers the per-host scoping. All automations and worktree-listing tests pass (110 files).pnpm tc:web,oxlint,check:code-quality:changedandpnpm lintpass.Agent skill upstream boundary
Checklist