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
feat(orchestration): start a worker in one step; worker-start creates the coordinator's Run - #34900
A coordinator can start a worker with one command. When worker-start --spec finds no Run bound to its caller, it creates one and binds it to that caller, so the coordinator's terminal or chat is still the one woken by worker_done. run-create stays for Task graphs and for starting a new goal.
Shared path: the Run is created by createBoundRun, which run-create now uses too. It makes the same binding and cancels the same waiters.
Coordinators only: the Run is created only for a caller at root depth (resolveCreatorDepth === ROOT_DISPATCH_DEPTH) that passed --spec without --run. A worker on an active Dispatch still starts helpers in its own Run. Nesting and depth rules are unchanged.
Receipt: every receipt now carries run: { id, objective, created }, and the CLI prints Created and bound Run … or In Run …. A reused Run left over from an earlier goal is therefore visible. Nothing guesses whether a Run is stale.
Objective: the new Run's objective is the title the first Task gets, from --task-title or the spec's first line, built by the existing buildOrchestrationTaskDisplayMetadata.
Checks first: the spec budget check runs before a Run can be created.
Docs: the skill guide and CLI help now lead with the one-step form, and the bundled guides were regenerated.
Mixed versions
Old CLI → new server: works. The receipt only gains an optional field.
New CLI → older server: keeps today's refusal; the guide says to run-create first there. An earlier commit on this branch tried a CLI-side catch-and-retry fallback. Review found it could not work safely:
the client decorates the refusal text it matched on;
an older server's refusal cannot prove the caller is a root coordinator (remote and legacy workers get the same text);
recovery of its inner run-create would have been reported under the worker-start command.
So it was removed.
Known trade-off
If a deeper launch check fails (agent preflight, placement, remote capability) after a Run was created, that Run stays bound. That is the same state as running run-create and then a failed worker-start today, and the next receipt names it.
… the coordinator's Run when none is bound
worker-start --spec now creates and binds a Run for a root coordinator with
no bound Run, through the same path run-create uses, and names the Run it
created or joined in every receipt. Workers on a Dispatch keep starting
helpers in their own Run and never get a new one. A new CLI against an older
runtime runs run-create and retries; old CLIs need no change.
…efore a Run is created
The CLI fallback matched a refusal text the client decorates, could not
prove the caller was a root coordinator on an older runtime, and recovered
an inner run-create under the worker-start command. Older runtimes keep
their refusal and the guide says to run-create first there. The prompt
budget check now runs before worker-start can create a Run.
Worker start can now create and bind a Run for an eligible unbound coordinator. Receipts include the Run ID, objective, and creation status. The changes also update Run creation helper logic, worker-start validation, tests, and CLI guidance for independent waves and planned Task graphs.
Priority: Normal
Merge Risk: Moderate · up to 926ba
Workers can join an earlier goal, and the retry instructions can create the wrong Task or fail. Correct the guidance before merging.
Pre-merge checks: 4 · 1
Failed checks: 1 warning
Check name
Status
Explanation
Resolution
Docstring Coverage
Docstring coverage is 66.67% 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: 4 passed
Check name
Status
Explanation
Title check
The title names the feature (one-step worker start, with worker-start creating the coordinator's Run), which matches the main change in the changeset: worker-start --spec creates and binds a Run for r…
Description check
The description covers the required sections: an ELI5-style Summary, what changed (shared createBoundRun path, coordinator-only creation, receipt fields, objective source, check ordering, docs), the r…
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: Title check
Explanation
The title names the feature (one-step worker start, with worker-start creating the coordinator's Run), which matches the main change in the changeset: worker-start --spec creates and binds a Run for root coordinators, plus the shared createBoundRun helper, receipt changes, and docs. The title is specific and concise, so it passes.
Full details: Description check
Explanation
The description covers the required sections: an ELI5-style Summary, what changed (shared createBoundRun path, coordinator-only creation, receipt fields, objective source, check ordering, docs), the rationale and trade-offs, mixed-version compatibility, and testing with commands and a before/after real-app report. Several template sections are missing or unfilled: the ELI5 heading and 'Why' section are not labeled as in the template, the Linked Issue section has no 'Fixes #' issue reference, the Visual Proof section is absent or lacks a before/after attachment for a behavior change, the AI Disclosure section is blank, the Agent skill upstream boundary checkbox is not ticked, and the testing checklist items are not checked. Because the description is mostly complete, the check passes, but the author should add the linked issue, a visual before/after or the N/A reason, the AI disclosure, and the checklist state.
Full details: Docstring Coverage
Explanation
Docstring coverage is 66.67% 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 3 functions across 8 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.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.
The reason will be displayed to describe this comment to others. Learn more.
Major · Data Integrity & Integration · Quick win
Check the bound Run before starting the wave.
If the coordinator is bound to an earlier Run, the first worker-start --spec creates the Task and Dispatch in that Run. The receipt arrives after this mutation. Running run-create afterward does not move the first Dispatch, so the later bound check --wait can miss its worker_done. Run run-current --json first and create the intended Run before the first worker start. (raw.githubusercontent.com)
The reason will be displayed to describe this comment to others. Learn more.
Major · Functional Correctness · Quick win
Do not create a new Run when retrying an existing Task.
worker-start --task <task_id> requires the resolved Run to match the Task's Run. After run-create, the new binding differs, so the retry fails with task_not_found. Use run-create only for new planned fan-out. For a known Task, use its owning Run and pass --retry-of <dispatch_id>. (raw.githubusercontent.com)
The reason will be displayed to describe this comment to others. Learn more.
Minor · Functional Correctness · Quick win
Document the older-runtime refusal.
worker-start --spec does not always create a Run. This revision calls orchestration.workerStart directly, so an older runtime can return its refusal and require run-create first. Add this caveat here and in the matching note at src/cli/specs/orchestration.ts:13. (raw.githubusercontent.com)
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
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: 0e063cb9-4f4c-423d-a136-9090ce7a1d4a
Commits
Reviewing files that changed from the base of the PR and between bc3ad67 and 926ba06.
Files selected for processing: 1
src/cli/bundled-skill-guides.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.
The reason will be displayed to describe this comment to others. Learn more.
Minor · Functional Correctness · Quick win
Supported by static analysis
Script executed:
sed -n '1,130p' src/main/runtime/rpc/methods/orchestration/worker/worker-start-authority.ts
sed -n '1,120p' config/scripts/generate-bundled-skill-guides.mjs
Repository: stablyai/orca
Length of output: 7688
Limit the Run-creation rule to a root coordinator in the canonical guide.
worker-start --spec creates a Run only for a coordinator at root dispatch depth, with --spec and without --run. A worker on an active Dispatch starts helpers in that Dispatch's Run and cannot create one. Other unbound callers are fenced with consumer_fenced.
Change skill-guides/orchestration.md, then regenerate the bundle. Do not edit only src/cli/bundled-skill-guides.ts, because regeneration overwrites direct edits.
Canonical guide wording
-`worker-start --spec` creates the Task and its attempt in one call; with no Run-bound, it also creates one bound to you (an older Orca refuses instead; then+`worker-start --spec` creates the Task and its attempt in one call; for a root+coordinator with no bound Run and no `--run`, it also creates one (an older Orca+refuses instead; then
`run-create` first). Its receipt's `run` names the Run it created or joined; if
Then run pnpm generate:bundled-skill-guides to update the generated bundle.
worker-start resolves an existing coordinator Run before it creates the Task and Dispatch. The current guide checks the receipt only after the launch commands. If that Run belongs to an earlier goal, the first worker is created in the stale Run, and run-create only affects later workers. Add a run-current check before the first launch in both guide copies.
Suggested fix
-Confirm the runtime and start the full independent wave before waiting.-`worker-start --spec` creates the Task and its attempt in one call; with no Run-bound, it also creates one bound to you (an older Orca refuses instead; then-`run-create` first). Its receipt's `run` names the Run it created or joined; if-that is an earlier goal's Run, `run-create` first:+Confirm the runtime and inspect the bound Run before starting any worker.+Run `run-current --json`. If it names an earlier goal's Run, run+`run-create --objective "<objective>" --json` before any `worker-start`.+If no Run is bound, `worker-start --spec` creates one bound to you (an older+Orca refuses instead; then `run-create` first). Its receipt's `run` identifies+the Run it created or joined:
```text
ORCA status --json
+ORCA orchestration run-current --json
ORCA orchestration worker-start --spec "<worker A task>" --worktree current --agent codex --json
The reason will be displayed to describe this comment to others. Learn more.
Major · Data Integrity & Integration · Quick win
Separate planned fan-out from Task retry instructions.
A retry must use the Run that owns the existing Task. Creating a new Run makes worker-start --task reject the Task because its run_id differs from the selected Run. A retry also requires --retry-of <dispatch_id>. (raw.githubusercontent.com)
Do not run task-create for a known Task. Instruct users to resume or bind the existing Run, then run worker-start --task <task_id> --retry-of <dispatch_id>.
Proposed wording
- "Use `run-create --objective \"<objective>\"`, then `task-create` plus",- "`worker-start --task <task_id>`, for planned fan-out with dependencies or a",- "retry of a known Task. Use dependencies only for real ordering",+ "For planned fan-out with dependencies, use `run-create --objective \"<objective>\"`,",+ "then `task-create` and `worker-start --task <task_id>`. To retry a known Task,",+ "bind its existing Run with `run-use --id <run_id>`, then use",+ "`worker-start --task <task_id> --retry-of <dispatch_id>`. Use dependencies only",+ "for real ordering",
Committable suggestion
IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
Suggested change
"Use `run-create --objective \"<objective>\"`, then `task-create` plus",
"`worker-start --task <task_id>`, for planned fan-out with dependencies or a",
"retry of a known Task. Use dependencies only for real ordering",
"For planned fan-out with dependencies, use `run-create --objective \"<objective>\"`,",
"then `task-create` and `worker-start --task <task_id>`. To retry a known Task,",
"bind its existing Run with `run-use --id <run_id>`, then use",
"`worker-start --task <task_id> --retry-of <dispatch_id>`. Use dependencies only",
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.
Summary
A coordinator can start a worker with one command. When
worker-start --specfinds no Run bound to its caller, it creates one and binds it to that caller, so the coordinator's terminal or chat is still the one woken byworker_done.run-createstays for Task graphs and for starting a new goal.createBoundRun, whichrun-createnow uses too. It makes the same binding and cancels the same waiters.resolveCreatorDepth === ROOT_DISPATCH_DEPTH) that passed--specwithout--run. A worker on an active Dispatch still starts helpers in its own Run. Nesting and depth rules are unchanged.run: { id, objective, created }, and the CLI printsCreated and bound Run …orIn Run …. A reused Run left over from an earlier goal is therefore visible. Nothing guesses whether a Run is stale.--task-titleor the spec's first line, built by the existingbuildOrchestrationTaskDisplayMetadata.Mixed versions
Old CLI → new server: works. The receipt only gains an optional field.
New CLI → older server: keeps today's refusal; the guide says to
run-createfirst there. An earlier commit on this branch tried a CLI-side catch-and-retry fallback. Review found it could not work safely:run-createwould have been reported under theworker-startcommand.So it was removed.
Known trade-off
If a deeper launch check fails (agent preflight, placement, remote capability) after a Run was created, that Run stays bound. That is the same state as running
run-createand then a failedworker-starttoday, and the next receipt names it.Testing
pnpm check:changed --maxWorkers=2: 21 checks passed.created: false;--taskwith no bound Run still refuses and creates no Run.worker-start --spec … --agent claude→consumer_fenced, no worker.run.created: true; the worker sentworker_doneand Orca woke the coordinator with it.