You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(automations): let a host create workspaces for another owner's automation run - #35978
Scheduled automations that a desktop runs on a managed Orca host failed every time with "Invalid automation provenance request". The desktop sent the host a ticket that only the desktop itself can check. #34525 stopped new desktops from sending that ticket. This change makes the host accept the run anyway when an older desktop still sends it.
What Changed
On a runtime host's RPC create paths (worktree.create and agent launch), a provenance request for an automation the host doesn't hold (or a host with no automation store) now creates a plain workspace instead of failing.
Requests for the host's own automations are still fully verified: run, status, repo and dispatch token.
Other store errors (I/O, a corrupt store) still propagate.
The desktop's own IPC create path stays strict.
Why
The dispatch token lives in the desktop main process's memory, so a host can never verify a token another owner minted. Rejecting it breaks every scheduled run. Accepting it can't leak anything, because the result is exactly what a client gets by leaving the field out: a workspace with no automation metadata. It crosses no boundary, and it can't touch the host's own run records.
Desktop automation workspaces on a host still have no automation badge, and their run pane closes instead of sleeping when the run finishes. The follow-up records the desktop's provenance on the host behind a capability.
Thanks @nm7-jp for the detailed report and diagnosis.
Visual Proof
N/A. This is host-side validation only; there's no UI change.
Testing
New worktree.create and agent-launch tests. Each fails on base and passes with the fix. The agent-launch test also checks that a store error is still thrown.
The existing provenance tests (forged and invalid requests for known automations) still pass.
Typecheck, the full static job, the changed-code quality gate, and the orcad terminal smoke all pass locally.
…tomation run
A desktop older than #34525 still sends the host its own dispatch token, which
only that desktop can verify, so the host rejected every run with "Invalid
automation provenance request". A runtime host now ignores a provenance
request for an automation it does not own and creates a plain workspace;
requests for its own automations are still verified.
Refs #34433
Lets worktree.create and agent.launch create plain workspaces when the host cannot find the requested automation or has no automation store.
Runtime hosts create plain workspaces for automation requests they cannot verify.
nwparker acknowledges that these workspaces lack automation badges and close their run panes instead of sleeping them. Host-side attribution is deferred.
Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[RPC workspace create] --> B{Host finds automation?}
B -->|Missing automation or no store| C[Create plain workspace]
B -->|Other error| D[Return error]
B -->|Yes| E[Check run, repo, status, and token]
E -->|Valid| F[Create workspace with automation metadata]
E -->|Invalid| D
The provenance resolver now accepts an optional ignoreUnknownAutomation flag. When enabled, it returns undefined for recognized unknown-automation or unavailable-runtime errors, and rethrows other errors. The worktree.create handler and agent launch worktree factory enable this option. Tests cover unknown automation provenance and propagation of an unrelated lookup error.
Priority: Normal
Merge Risk: Minimal · up to 97637
Foreign automation requests can create plain workspaces while owned runs remain subject to validation. No merge-blocking defect was established.
Pre-merge checks: 3 · 2
Failed checks: 2 warnings
Check name
Status
Explanation
Resolution
Description check
The description covers the user impact, implementation, rationale, compatibility behavior, testing, and visual-proof requirement. However, the required Linked Issue section uses "Refs #34433" instead …
Replace "Refs #34433" with a valid linked issue reference that satisfies the repository template, such as "Fixes #34433" if appropriate.
Docstring Coverage
Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta…
Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed checks: 3 passed
Check name
Status
Explanation
Title check
The title clearly and concisely describes the primary change: allowing a host to create workspaces for another owner's automation run.
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Description check
Explanation
The description covers the user impact, implementation, rationale, compatibility behavior, testing, and visual-proof requirement. However, the required Linked Issue section uses "Refs #34433" instead of an actual issue link or "Fixes #" reference.
Resolution
Replace "Refs #34433" with a valid linked issue reference that satisfies the repository template, such as "Fixes #34433" if appropriate.
Full details: Docstring Coverage
Explanation
Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 2 functions across 5 files.
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
Finishing Touches: 💡 1
📝 Generate docstrings: 💡
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.
Cover the no-automation-store branch in worktree.create.
runtime_unavailable represents a host with no automation store. This test covers only Automation not found. The existing runtime_unavailable test covers a prestart launch failure, not this dispatcher path. Add the missing case so this compatibility behavior cannot regress unnoticed.
Suggested fix
-it('creates a plain workspace for a dispatch token from another automation owner', async () => {+it.each(['Automation not found', 'runtime_unavailable'])(+ 'creates a plain workspace when the automation lookup returns %s',+ async (automationLookupError) => {
...
- throw new Error('Automation not found')+ throw new Error(automationLookupError)
...
-})+ }+)
Review info
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: 61520dc1-abdf-4a91-8ad8-9757d0fbf381
Commits
Reviewing files that changed from the base of the PR and between 5cd7b5d and 976370b.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 2 remain after this review.
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
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.
ELI5
Scheduled automations that a desktop runs on a managed Orca host failed every time with "Invalid automation provenance request". The desktop sent the host a ticket that only the desktop itself can check. #34525 stopped new desktops from sending that ticket. This change makes the host accept the run anyway when an older desktop still sends it.
What Changed
worktree.createand agent launch), a provenance request for an automation the host doesn't hold (or a host with no automation store) now creates a plain workspace instead of failing.Why
The dispatch token lives in the desktop main process's memory, so a host can never verify a token another owner minted. Rejecting it breaks every scheduled run. Accepting it can't leak anything, because the result is exactly what a client gets by leaving the field out: a workspace with no automation metadata. It crosses no boundary, and it can't touch the host's own run records.
Mixed versions:
Desktop automation workspaces on a host still have no automation badge, and their run pane closes instead of sleeping when the run finishes. The follow-up records the desktop's provenance on the host behind a capability.
Linked Issue
Refs #34433
Thanks @nm7-jp for the detailed report and diagnosis.
Visual Proof
N/A. This is host-side validation only; there's no UI change.
Testing
worktree.createand agent-launch tests. Each fails on base and passes with the fix. The agent-launch test also checks that a store error is still thrown.