Repository navigation
Conversation
…AG control panel Re-applies the complete, recipe-free Orcastrator feature on top of current upstream/main. An Orcastrator is a persistent "director" agent that runs in its own dedicated worktree, decomposes work, and dispatches workers — coordinated through Orca's orchestration runtime. What's included: - Orcastrators sidebar section + launch flow, Create Orcastrator modal (name + project + agent + task), inline rename, persistence via reattach/close-cleanup, and a registry store slice. - Orchestration bridge (F1–F4): per-run isolation of the orchestration DB, coordinator creates lineage-visible worktrees, worktree-per-track reuse with serialization + multi-track concurrency, coordinator resume-on-boot, and a preload binding exposing run/taskCreate to the renderer. - Live Control Panel: syncs and renders the coordinator DAG in Mission Control with a live activity line; director console with workers, shipped history, and PR links; collapsible PR review cards; token-sourced PR-state pills. - Focus handling: don't steal active-tab focus when a director opens a worktree or spawns a worker via the CLI; supervising dot for background-active directors. - Shipped-scope fix: Mission Control "Shipped" is scoped to the director's lifetime. "+" styling/weight/alignment to match the Projects section. - "Send to Orcastrator" action on the new-workspace composer; experimental orchestrators feature flag + Settings toggle. Recipe-free: the recipe-director layer was removed; the only residual `recipe` field is a mode-agnostic, always-null snapshot column for LLM directors. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
📝 WalkthroughWalkthroughThis PR implements "Orcastrators" — persistent director agents that coordinate multi-task work by spawning per-track child worktrees. The orchestration SQLite schema is bumped to v10, adding per-run isolation via 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
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: 19
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
src/renderer/src/store/slices/worktrees.ts (1)
2200-2259: 🩺 Stability & Availability | 🟡 MinorForward
suppressActivationthrough local worktree creates. The remote RPC path passesactivate, but the localwindow.api.worktrees.createpath drops it andcreateLocalWorktreenever reads an activation flag. If programmatic/local creates should avoid switching the active tab, thread that flag through the local IPC path too.src/main/runtime/rpc/methods/orchestration-gates.ts (1)
161-165: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick winHandle coordinator loop rejections on initial run start.
This fire-and-forget promise only uses
.finally(), so a rejected coordinator loop becomes an unhandled rejection and can leave the DB rowrunninguntil the next boot reconcile. Mirror the boot-resume fail-safe here.Proposed fix
- coordinator.runFromExistingRun(run.id).finally(() => { - if (activeCoordinator === coordinator) { - activeCoordinator = null - } - }) + coordinator + .runFromExistingRun(run.id) + .catch((err) => { + console.error(`Coordinator run ${run.id} rejected; marking failed:`, err) + try { + db.updateCoordinatorRun(run.id, 'failed') + } catch { + // best effort only + } + }) + .finally(() => { + if (activeCoordinator === coordinator) { + activeCoordinator = null + } + })
🧹 Nitpick comments (2)
src/renderer/src/components/right-sidebar/SourceControl.tsx (1)
5171-5176: 🚀 Performance & Scalability | 🔵 Trivial | 🏗️ Heavy liftHoist the director gate out of
SourceControlInner.This only swaps the render tree; the branch/PR polling and mutation effects above still run for director worktrees. That keeps unnecessary git/API work alive behind Mission Control and can leave stale Source Control state mounted for a screen that no longer uses it.
src/renderer/src/components/OrchestratorLaunchModal.tsx (1)
215-225: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winUse the shadcn textarea primitive here.
This manually recreates textarea styling in a renderer UI surface; use the shared
Textareaprimitive so focus, border, and token behavior stay centralized. As per coding guidelines, “All UI work … must followdocs/STYLEGUIDE.mdand use tokens defined insrc/renderer/src/assets/main.cssand shadcn primitives insrc/renderer/src/components/ui/.”Proposed refactor
import { Button } from '`@/components/ui/button`' +import { Textarea } from '`@/components/ui/textarea`' @@ - <textarea + <Textarea id={promptId} value={prompt} onChange={(event) => setPrompt(event.target.value)} rows={4} @@ - className="flex w-full resize-none rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-xs transition-[color,box-shadow] outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50" + className="resize-none" />Source: Coding guidelines
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: f80c2b3b-8960-4bc9-870e-3c0d34b7872e
📒 Files selected for processing (113)
skills/orchestration/SKILL.mdsrc/cli/handlers/orchestration.test.tssrc/cli/handlers/orchestration.tssrc/cli/handlers/worktree.tssrc/cli/index.test.tssrc/cli/selectors.tssrc/cli/test-fixtures.tssrc/main/index.tssrc/main/runtime/orca-runtime.test.tssrc/main/runtime/orca-runtime.tssrc/main/runtime/orchestration/boot-resume.test.tssrc/main/runtime/orchestration/boot-resume.tssrc/main/runtime/orchestration/coordinator.test.tssrc/main/runtime/orchestration/coordinator.tssrc/main/runtime/orchestration/db.test.tssrc/main/runtime/orchestration/db.tssrc/main/runtime/orchestration/per-run-isolation.test.tssrc/main/runtime/orchestration/run-dag-snapshot.test.tssrc/main/runtime/orchestration/run-dag-snapshot.tssrc/main/runtime/orchestration/types.tssrc/main/runtime/rpc/methods/orchestration-gates.tssrc/main/runtime/rpc/methods/orchestration-resume-on-boot.test.tssrc/main/runtime/rpc/methods/orchestration.test.tssrc/main/runtime/rpc/methods/orchestration.tssrc/preload/api-types.tssrc/preload/index.tssrc/renderer/src/App.tsxsrc/renderer/src/assets/main.csssrc/renderer/src/components/AgentStateDot.tsxsrc/renderer/src/components/Landing.tsxsrc/renderer/src/components/NewWorkspaceComposerCard.tsxsrc/renderer/src/components/NewWorkspaceComposerModal.tsxsrc/renderer/src/components/OrchestratorLaunchModal.tsxsrc/renderer/src/components/TaskPage.tsxsrc/renderer/src/components/right-sidebar/ChecksPanel.review-header.test.tsxsrc/renderer/src/components/right-sidebar/ChecksPanel.tsxsrc/renderer/src/components/right-sidebar/ChecksPanelInner.tsxsrc/renderer/src/components/right-sidebar/ChecksPanelReviewHeader.tsxsrc/renderer/src/components/right-sidebar/MissionControlPrReviewCard.tsxsrc/renderer/src/components/right-sidebar/MissionControlPrStatePill.tsxsrc/renderer/src/components/right-sidebar/MissionControlSupervisionSummary.tsxsrc/renderer/src/components/right-sidebar/MissionControlTaskRow.test.tsxsrc/renderer/src/components/right-sidebar/MissionControlTaskRow.tsxsrc/renderer/src/components/right-sidebar/MissionControlTasksSection.test.tsxsrc/renderer/src/components/right-sidebar/MissionControlTasksSection.tsxsrc/renderer/src/components/right-sidebar/OrchestratorMissionControl.dag.test.tsxsrc/renderer/src/components/right-sidebar/OrchestratorMissionControl.spawned-activity.test.tsxsrc/renderer/src/components/right-sidebar/OrchestratorMissionControl.tsxsrc/renderer/src/components/right-sidebar/OrchestratorPanelNotice.tsxsrc/renderer/src/components/right-sidebar/SourceControl.tsxsrc/renderer/src/components/right-sidebar/checks-panel-gitlab-review-rpc.tssrc/renderer/src/components/right-sidebar/checks-panel-inner-types.tssrc/renderer/src/components/right-sidebar/right-sidebar-panel-content.tsxsrc/renderer/src/components/settings/ExperimentalPane.tsxsrc/renderer/src/components/settings/OrchestratorsExperimentalToggle.tsxsrc/renderer/src/components/settings/experimental-search.tssrc/renderer/src/components/settings/orchestrators-search-entry.tssrc/renderer/src/components/sidebar/OrchestratorsSidebarSection.tsxsrc/renderer/src/components/sidebar/WorktreeCardAgents.tsxsrc/renderer/src/components/sidebar/WorktreeList.tsxsrc/renderer/src/components/sidebar/index.tsxsrc/renderer/src/components/sidebar/worktree-card-agent-summary.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/director-worktree-shell.test.tssrc/renderer/src/lib/director-worktree-shell.tssrc/renderer/src/lib/github-pr-search-url.test.tssrc/renderer/src/lib/github-pr-search-url.tssrc/renderer/src/lib/mission-control-card-target.tssrc/renderer/src/lib/orcastrate-log-shipped-work.test.tssrc/renderer/src/lib/orcastrate-log-shipped-work.tssrc/renderer/src/lib/orcastrator-dot-state.test.tssrc/renderer/src/lib/orcastrator-dot-state.tssrc/renderer/src/lib/orchestrator-launch.test.tssrc/renderer/src/lib/orchestrator-launch.tssrc/renderer/src/lib/orchestrator-mission-control-data.test.tssrc/renderer/src/lib/orchestrator-mission-control-data.tssrc/renderer/src/lib/orchestrator-task-row.test.tssrc/renderer/src/lib/orchestrator-task-row.tssrc/renderer/src/lib/orchestrator-work-item-prompt.test.tssrc/renderer/src/lib/orchestrator-work-item-prompt.tssrc/renderer/src/lib/orchestrator-worker-pr-badge.test.tssrc/renderer/src/lib/orchestrator-worker-pr-badge.tssrc/renderer/src/lib/send-work-item-to-orchestrator.tssrc/renderer/src/lib/shipped-branch-pr-match.test.tssrc/renderer/src/lib/shipped-branch-pr-match.tssrc/renderer/src/lib/use-orchestrator-active-worktree.tssrc/renderer/src/lib/worktree-activation-suppress.test.tssrc/renderer/src/lib/worktree-activation.tssrc/renderer/src/lib/worktree-agent-activity-text.tssrc/renderer/src/lib/worktree-agent-dot-state.tssrc/renderer/src/runtime/sync-runtime-graph.tssrc/renderer/src/store/index.tssrc/renderer/src/store/slices/diffComments.test.tssrc/renderer/src/store/slices/orchestration-activity.tssrc/renderer/src/store/slices/orchestration-run-dag.test.tssrc/renderer/src/store/slices/orchestration-run-dag.tssrc/renderer/src/store/slices/orchestrators.test.tssrc/renderer/src/store/slices/orchestrators.tssrc/renderer/src/store/slices/store-test-helpers.tssrc/renderer/src/store/slices/ui.tssrc/renderer/src/store/slices/worktree-helpers.tssrc/renderer/src/store/slices/worktrees.tssrc/renderer/src/store/types.tssrc/renderer/src/web/web-preload-api.test.tssrc/renderer/src/web/web-preload-api.tssrc/shared/orchestration-binding.tssrc/shared/orchestrator-identity.tssrc/shared/runtime-types.tssrc/shared/types.ts
| if (store.getSettings().experimentalOrchestrators) { | ||
| void runOrchestrationBootReconcile(runtimeService, (msg) => | ||
| console.log('[orchestration-resume]', msg) | ||
| ).catch((error) => { | ||
| console.error('[orchestration-resume] boot reconcile failed:', error) | ||
| }) |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
Await boot reconcile before exposing launch paths.
The comment says this lands before a user-triggered run can hit the guard, but void lets startup continue immediately. A fast launch after restart can still see the stale running row and fail with an active-run conflict.
Proposed fix
if (store.getSettings().experimentalOrchestrators) {
- void runOrchestrationBootReconcile(runtimeService, (msg) =>
+ await runOrchestrationBootReconcile(runtimeService, (msg) =>
console.log('[orchestration-resume]', msg)
).catch((error) => {
console.error('[orchestration-resume] boot reconcile failed:', error)
})
}📝 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.
| if (store.getSettings().experimentalOrchestrators) { | |
| void runOrchestrationBootReconcile(runtimeService, (msg) => | |
| console.log('[orchestration-resume]', msg) | |
| ).catch((error) => { | |
| console.error('[orchestration-resume] boot reconcile failed:', error) | |
| }) | |
| if (store.getSettings().experimentalOrchestrators) { | |
| await runOrchestrationBootReconcile(runtimeService, (msg) => | |
| console.log('[orchestration-resume]', msg) | |
| ).catch((error) => { | |
| console.error('[orchestration-resume] boot reconcile failed:', error) | |
| }) |
| function makeDagTaskRow(overrides: { | ||
| id: string | ||
| assignee_handle?: string | ||
| }): Record<string, unknown> { | ||
| return { | ||
| id: overrides.id, | ||
| parent_id: null, | ||
| created_by_terminal_handle: null, | ||
| coordinator_run_id: 'run-a', | ||
| target_key: 'repo:/x', | ||
| task_title: overrides.id, | ||
| display_name: null, | ||
| spec: overrides.id, | ||
| status: 'dispatched', | ||
| deps: '[]', | ||
| result: null, | ||
| created_at: '2026-01-01T00:00:00.000Z', | ||
| completed_at: null, | ||
| assignee_handle: overrides.assignee_handle ?? 'term_worker', | ||
| dispatch_id: `ctx_${overrides.id}`, | ||
| dispatch_status: 'dispatched', | ||
| dispatch_last_heartbeat_at: '2026-06-01T00:00:00.000Z', | ||
| dispatch_dispatched_at: '2025-06-01T00:00:00.000Z' | ||
| } |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Parameterize the DAG fixture’s run id.
makeDagTaskRow() always emits coordinator_run_id: 'run-a', so the run-b branch builds a task row that claims it belongs to run-a. Let the helper accept coordinatorRunId and set run-b explicitly in this test.
Proposed fix
function makeDagTaskRow(overrides: {
id: string
assignee_handle?: string
+ coordinatorRunId?: string
}): Record<string, unknown> {
return {
id: overrides.id,
@@
- coordinator_run_id: 'run-a',
+ coordinator_run_id: overrides.coordinatorRunId ?? 'run-a',
@@
listTasksWithDispatch: vi.fn(({ coordinatorRunId }: { coordinatorRunId: string }) =>
coordinatorRunId === 'run-a'
? [makeDagTaskRow({ id: 'task-a', assignee_handle: 'term_worker_a' })]
- : [makeDagTaskRow({ id: 'task-b', assignee_handle: 'term_worker_b' })]
+ : [
+ makeDagTaskRow({
+ id: 'task-b',
+ assignee_handle: 'term_worker_b',
+ coordinatorRunId: 'run-b'
+ })
+ ]
),Also applies to: 17694-17698
| const runPromise = coordinator.run() | ||
|
|
||
| // Wait for the worktree to be created + dispatch to happen. | ||
| await new Promise((r) => { | ||
| setTimeout(r, 100) | ||
| }) |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win
Use waitFor and always drain runPromise in async coordinator tests.
This fixed sleep pattern repeats through the new suite. If the tick is late or an assertion fails before runPromise is awaited, the coordinator loop can survive into DB teardown. Wrap these cases in try/finally like the existing max-concurrency/resume tests and wait on conditions instead of time.
| if (CODE_FENCE_RE.test(lines[i])) { | ||
| inFence = !inFence |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Close only the matching fence type when parsing track:.
The current toggle treats any ``` or ~~~ line as opening/closing the same fence. A `~~~` line inside a backtick fence flips `inFence` off, so a later example `track:` inside that code block can be parsed and stripped as the real track.
Proposed fix
-const CODE_FENCE_RE = /^[ \t]*(?:```|~~~)/
+const CODE_FENCE_RE = /^[ \t]*(```+|~~~+)/
@@
- let inFence = false
+ let fenceMarker: string | null = null
for (let i = 0; i < lines.length; i++) {
- if (CODE_FENCE_RE.test(lines[i])) {
- inFence = !inFence
+ const fence = lines[i].match(CODE_FENCE_RE)?.[1]
+ if (fence) {
+ if (!fenceMarker) {
+ fenceMarker = fence
+ } else if (fence[0] === fenceMarker[0] && fence.length >= fenceMarker.length) {
+ fenceMarker = null
+ }
continue
}
- if (inFence) {
+ if (fenceMarker) {
continue
}Also applies to: 137-143
| const dependsOn = (a: string, b: string): boolean => { | ||
| const seen = new Set<string>() | ||
| const stack = [...(directDeps.get(a) ?? [])] | ||
| while (stack.length > 0) { | ||
| const next = stack.pop()! | ||
| if (next === b) { | ||
| return true | ||
| } | ||
| if (seen.has(next) || !taskIds.has(next)) { | ||
| continue | ||
| } | ||
| seen.add(next) | ||
| stack.push(...(directDeps.get(next) ?? [])) | ||
| } | ||
| return false | ||
| } | ||
|
|
||
| for (const [trackKey, group] of byTrack) { | ||
| if (group.length < 2) { | ||
| continue | ||
| } | ||
| for (let i = 0; i < group.length; i++) { | ||
| for (let j = i + 1; j < group.length; j++) { | ||
| const a = group[i] | ||
| const b = group[j] | ||
| if (!dependsOn(a.id, b.id) && !dependsOn(b.id, a.id)) { |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
Reject cyclic same-track dependency chains.
A cycle like A depends on B and B depends on A satisfies the pairwise “depends on” check, so the run passes decompose() with every task stuck pending. checkConvergence() treats pending tasks as active, so the coordinator can poll forever. Add cycle detection before accepting the same-track ordering.
| <DropdownMenuItem disabled={!canUnlinkPullRequest} onSelect={onUnlinkPullRequest}> | ||
| <Unlink className="size-3.5" /> | ||
| {translate('auto.components.right.sidebar.ChecksPanel.7202f4a40a', 'unlink PR')} | ||
| </DropdownMenuItem> | ||
| <DropdownMenuItem onSelect={onLinkAnotherPullRequest}> | ||
| <Link className="size-3.5" /> | ||
| {translate('auto.components.right.sidebar.ChecksPanel.07871c0589', 'Link another PR')} | ||
| </DropdownMenuItem> |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Inconsistent capitalization in menu item labels.
The unlink action defaults to 'unlink PR' (lowercase) while the sibling item uses 'Link another PR' (title case). Align the casing for visual consistency in the dropdown.
✏️ Proposed fix
- {translate('auto.components.right.sidebar.ChecksPanel.7202f4a40a', 'unlink PR')}
+ {translate('auto.components.right.sidebar.ChecksPanel.7202f4a40a', 'Unlink PR')}📝 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.
| <DropdownMenuItem disabled={!canUnlinkPullRequest} onSelect={onUnlinkPullRequest}> | |
| <Unlink className="size-3.5" /> | |
| {translate('auto.components.right.sidebar.ChecksPanel.7202f4a40a', 'unlink PR')} | |
| </DropdownMenuItem> | |
| <DropdownMenuItem onSelect={onLinkAnotherPullRequest}> | |
| <Link className="size-3.5" /> | |
| {translate('auto.components.right.sidebar.ChecksPanel.07871c0589', 'Link another PR')} | |
| </DropdownMenuItem> | |
| <DropdownMenuItem disabled={!canUnlinkPullRequest} onSelect={onUnlinkPullRequest}> | |
| <Unlink className="size-3.5" /> | |
| {translate('auto.components.right.sidebar.ChecksPanel.7202f4a40a', 'Unlink PR')} | |
| </DropdownMenuItem> | |
| <DropdownMenuItem onSelect={onLinkAnotherPullRequest}> | |
| <Link className="size-3.5" /> | |
| {translate('auto.components.right.sidebar.ChecksPanel.07871c0589', 'Link another PR')} | |
| </DropdownMenuItem> |
| import type { GlobalSettings } from '../../../../shared/types' | ||
| import { Label } from '../ui/label' | ||
| import { SettingsSwitch } from './SettingsFormControls' | ||
| import { SearchableSetting } from './SearchableSetting' | ||
| import { matchesSettingsSearch } from './settings-search' | ||
| import { getExperimentalSearchEntry } from './experimental-search' | ||
| import { translate } from '@/i18n/i18n' | ||
|
|
||
| type OrchestratorsExperimentalToggleProps = { | ||
| settings: GlobalSettings | ||
| updateSettings: (updates: Partial<GlobalSettings>) => void | ||
| searchQuery: string | ||
| } | ||
|
|
||
| // Why: extracted from ExperimentalPane to keep that file under the max-lines | ||
| // cap; this owns the single Orcastrators experimental toggle row. | ||
| export function OrchestratorsExperimentalToggle({ | ||
| settings, | ||
| updateSettings, | ||
| searchQuery | ||
| }: OrchestratorsExperimentalToggleProps): React.JSX.Element | null { |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Does the codebase import React when using React.JSX.Element, or rely on a global?
rg -nP 'React\.JSX\.Element' -g '*.tsx' -l | head -20
# Check whether sibling settings components import React explicitly
rg -nP "^import .*\bReact\b" src/renderer/src/components/settings/SearchableSetting.tsx src/renderer/src/components/settings/ExperimentalPane.tsx
# Inspect tsconfig for jsx + any React global typing
fd -t f 'tsconfig*.json' -a | xargs rg -nP '"jsx"|jsxImportSource|"types"' 2>/dev/nullRepository: stablyai/orca
Length of output: 151
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Locate relevant TypeScript config and the target component/siblings.
git ls-files 'tsconfig*.json' 'src/renderer/src/components/settings/*.tsx' | sed 's#^`#FILE` #'
# Show the exact return-type usage and nearby imports in the target file.
cat -n src/renderer/src/components/settings/OrchestratorsExperimentalToggle.tsx | sed -n '1,40p'
# Inspect sibling files for import style and JSX typing.
printf '\n--- SearchableSetting ---\n'
cat -n src/renderer/src/components/settings/SearchableSetting.tsx | sed -n '1,40p'
printf '\n--- ExperimentalPane ---\n'
cat -n src/renderer/src/components/settings/ExperimentalPane.tsx | sed -n '1,60p'
# Inspect tsconfig JSX settings and React typings.
printf '\n--- tsconfig snippets ---\n'
for f in $(git ls-files 'tsconfig*.json'); do
echo "### $f"
rg -n '"jsx"|"jsxImportSource"|"types"|"typeRoots"' "$f" || true
doneRepository: stablyai/orca
Length of output: 20623
🏁 Script executed:
#!/bin/bash
set -euo pipefail
git ls-files 'tsconfig*.json' 'src/renderer/src/components/settings/*.tsx' | sed 's#^`#FILE` #'
printf '\n--- OrchestratorsExperimentalToggle.tsx ---\n'
cat -n src/renderer/src/components/settings/OrchestratorsExperimentalToggle.tsx | sed -n '1,40p'
printf '\n--- SearchableSetting.tsx ---\n'
cat -n src/renderer/src/components/settings/SearchableSetting.tsx | sed -n '1,40p'
printf '\n--- ExperimentalPane.tsx ---\n'
cat -n src/renderer/src/components/settings/ExperimentalPane.tsx | sed -n '1,80p'
printf '\n--- tsconfig snippets ---\n'
for f in $(git ls-files 'tsconfig*.json'); do
echo "### $f"
rg -n '"jsx"|"jsxImportSource"|"types"|"typeRoots"' "$f" || true
doneRepository: stablyai/orca
Length of output: 21976
🏁 Script executed:
#!/bin/bash
set -euo pipefail
git ls-files 'tsconfig*.json' 'src/renderer/src/components/settings/*.tsx' | sed 's#^`#FILE` #'
printf '\n--- OrchestratorsExperimentalToggle.tsx ---\n'
cat -n src/renderer/src/components/settings/OrchestratorsExperimentalToggle.tsx | sed -n '1,40p'
printf '\n--- SearchableSetting.tsx ---\n'
cat -n src/renderer/src/components/settings/SearchableSetting.tsx | sed -n '1,40p'
printf '\n--- ExperimentalPane.tsx ---\n'
cat -n src/renderer/src/components/settings/ExperimentalPane.tsx | sed -n '1,80p'
printf '\n--- tsconfig snippets ---\n'
for f in $(git ls-files 'tsconfig*.json'); do
echo "### $f"
rg -n '"jsx"|"jsxImportSource"|"types"|"typeRoots"' "$f" || true
doneRepository: stablyai/orca
Length of output: 21976
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Show tsconfig files and relevant JSX settings.
for f in $(git ls-files 'tsconfig*.json'); do
echo "### $f"
cat -n "$f" | sed -n '1,220p' | rg -n '"jsx"|"jsxImportSource"|"types"|"typeRoots"|extends|include|compilerOptions'
done
echo '### target file'
cat -n src/renderer/src/components/settings/OrchestratorsExperimentalToggle.tsx | sed -n '1,40p'
echo '### sibling files'
cat -n src/renderer/src/components/settings/SearchableSetting.tsx | sed -n '1,40p'
cat -n src/renderer/src/components/settings/ExperimentalPane.tsx | sed -n '1,60p'Repository: stablyai/orca
Length of output: 6147
🏁 Script executed:
#!/bin/bash
set -euo pipefail
git ls-files | rg '(^|/)(tsconfig[^/]*\.json|OrchestratorsExperimentalToggle\.tsx|SearchableSetting\.tsx|ExperimentalPane\.tsx)$'Repository: stablyai/orca
Length of output: 584
🏁 Script executed:
#!/bin/bash
set -euo pipefail
printf '--- tsconfig.json ---\n'
cat -n tsconfig.json | sed -n '1,220p'
printf '\n--- React namespace usage in this area ---\n'
rg -n "React\.JSX\.Element|import type React from 'react'|import React from 'react'" src/renderer/src/components/settings/*.tsx | sed -n '1,200p'
printf '\n--- explicit React namespace declarations ---\n'
rg -n "declare namespace React|export as namespace React|namespace React" . --glob '!**/node_modules/**' --glob '!**/dist/**' | sed -n '1,200p'Repository: stablyai/orca
Length of output: 242
🏁 Script executed:
#!/bin/bash
set -euo pipefail
printf -- '--- tsconfig.json ---\n'
cat -n tsconfig.json | sed -n '1,220p'
printf '\n--- React namespace usage in this area ---\n'
rg -n "React\.JSX\.Element|import type React from 'react'|import React from 'react'" src/renderer/src/components/settings/*.tsx | sed -n '1,200p'
printf '\n--- explicit React namespace declarations ---\n'
rg -n "declare namespace React|export as namespace React|namespace React" . --glob '!**/node_modules/**' --glob '!**/dist/**' | sed -n '1,200p'Repository: stablyai/orca
Length of output: 24115
🏁 Script executed:
#!/bin/bash
set -euo pipefail
printf -- '--- tsconfig.json ---\n'
cat -n tsconfig.json | sed -n '1,220p'
printf '\n--- React namespace usage in this area ---\n'
rg -n "React\.JSX\.Element|import type React from 'react'|import React from 'react'" src/renderer/src/components/settings/*.tsx | sed -n '1,200p'
printf '\n--- explicit React namespace declarations ---\n'
rg -n "declare namespace React|export as namespace React|namespace React" . --glob '!**/node_modules/**' --glob '!**/dist/**' | sed -n '1,200p'Repository: stablyai/orca
Length of output: 24130
🏁 Script executed:
#!/bin/bash
set -euo pipefail
printf -- '--- tsconfig.json ---\n'
cat -n tsconfig.json | sed -n '1,220p'
printf '\n--- React namespace usage in this area ---\n'
rg -n "React\.JSX\.Element|import type React from 'react'|import React from 'react'" src/renderer/src/components/settings/*.tsx | sed -n '1,200p'
printf '\n--- explicit React namespace declarations ---\n'
rg -n "declare namespace React|export as namespace React|namespace React" . --glob '!**/node_modules/**' --glob '!**/dist/**' | sed -n '1,200p'Repository: stablyai/orca
Length of output: 24171
🏁 Script executed:
#!/bin/bash
set -euo pipefail
printf -- '--- config/tsconfig.web.json ---\n'
cat -n config/tsconfig.web.json | sed -n '1,220p'
printf '\n--- config/tsconfig.node.json ---\n'
cat -n config/tsconfig.node.json | sed -n '1,220p'
printf '\n--- config/tsconfig.relay.json ---\n'
cat -n config/tsconfig.relay.json | sed -n '1,220p'
printf '\n--- react type imports in settings files ---\n'
rg -n "import (type )?React from 'react'|import type React from 'react'" src/renderer/src/components/settings/*.tsx | sed -n '1,200p'
printf '\n--- any JSX config / React types in referenced configs ---\n'
rg -n '"jsx"|"jsxImportSource"|"types"|"typeRoots"' config/tsconfig*.json tsconfig.json | sed -n '1,200p'Repository: stablyai/orca
Length of output: 5236
🏁 Script executed:
#!/bin/bash
set -euo pipefail
printf -- '--- config/tsconfig.web.json ---\n'
cat -n config/tsconfig.web.json | sed -n '1,220p'
printf '\n--- config/tsconfig.node.json ---\n'
cat -n config/tsconfig.node.json | sed -n '1,220p'
printf '\n--- config/tsconfig.relay.json ---\n'
cat -n config/tsconfig.relay.json | sed -n '1,220p'
printf '\n--- package.json deps ---\n'
cat -n package.json | sed -n '1,220p' | rg -n '"typescript"|"react"|`@types/react`|`@vitejs/plugin-react`|jsx|allowUmdGlobalAccess'
printf '\n--- any JSX/type settings in config tsconfigs ---\n'
rg -n '"jsx"|"jsxImportSource"|"types"|"typeRoots"|"allowUmdGlobalAccess"' config/tsconfig*.json tsconfig.jsonRepository: stablyai/orca
Length of output: 2153
Import React for the return type Add import type React from 'react'; React.JSX.Element needs the React namespace in scope, and this file currently omits it.
| const result = await store.createWorktree( | ||
| repoId, | ||
| `orcastrator-${options.label}`, | ||
| repo?.worktreeBaseRef, | ||
| 'skip', | ||
| undefined, | ||
| undefined, | ||
| `${ORCASTRATOR_DISPLAY_PREFIX}${options.label}`, | ||
| // Why: positional args up to compareBaseRef are unused for a director | ||
| // shell; the trailing options carries suppressActivation so a remote | ||
| // (SSH) create reveals the worktree without switching the user's active | ||
| // tab — matching the renderer-side activation suppression at the call site. | ||
| undefined, | ||
| undefined, | ||
| undefined, | ||
| undefined, | ||
| undefined, | ||
| undefined, | ||
| undefined, | ||
| undefined, | ||
| undefined, | ||
| undefined, | ||
| undefined, | ||
| undefined, | ||
| undefined, | ||
| undefined, | ||
| undefined, | ||
| undefined, | ||
| undefined, | ||
| undefined, | ||
| { suppressActivation: true } | ||
| ) |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟡 Minor
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Locate createWorktree definition and print its parameter list to confirm
# the displayName position, the createdWithAgent slot, and that the trailing
# options object (suppressActivation) is the final parameter.
fd -t f -e ts -e tsx | xargs rg -nP 'createWorktree\s*[:(=]' -l | head
ast-grep run --pattern 'createWorktree($$$) { $$$ }' --lang typescript || true
rg -nP -C2 'createWorktree\s*[:(]' --type=ts src/renderer/src/store/slices/worktrees.tsRepository: stablyai/orca
Length of output: 1073
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Inspect the worktree store API definition and the director shell call site.
sed -n '2088,2165p' src/renderer/src/store/slices/worktrees.ts
printf '\n---\n'
sed -n '1,140p' src/renderer/src/lib/director-worktree-shell.ts
printf '\n---\n'
sed -n '1,220p' src/renderer/src/lib/director-worktree-shell.test.tsRepository: stablyai/orca
Length of output: 9201
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Inspect the worktree store API definition and the director shell call site.
sed -n '2088,2165p' src/renderer/src/store/slices/worktrees.ts
printf '\n---\n'
sed -n '1,140p' src/renderer/src/lib/director-worktree-shell.ts
printf '\n---\n'
sed -n '1,220p' src/renderer/src/lib/director-worktree-shell.test.tsRepository: stablyai/orca
Length of output: 9201
Avoid relying on the positional createWorktree contract here. createdWithAgent must stay undefined and { suppressActivation: true } must remain the last argument; any signature change in createWorktree will silently break the activation-suppression behavior.
| // Why: the freshest in-flight orchestration run among a worktree's tabs, found | ||
| // by matching the activity map's coordinator paneKeys (`${tabId}:${leafId}`) to | ||
| // the worktree's tab ids. Presence means the director's run is still `running`. | ||
| function findOrchestrationActivityForTabs( | ||
| tabIds: readonly string[], | ||
| orchestrationActivityByPaneKey: Record<string, OrchestrationActivity> | ||
| ): OrchestrationActivity | null { | ||
| for (const [paneKey, activity] of Object.entries(orchestrationActivityByPaneKey)) { | ||
| const colon = paneKey.indexOf(':') | ||
| if (colon <= 0 || !tabIds.includes(paneKey.slice(0, colon))) { | ||
| continue | ||
| } | ||
| return activity | ||
| } | ||
| return null | ||
| } |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Inspect how orchestrationActivityByPaneKey is populated and whether one worktree maps to multiple pane keys.
rg -nP --type=ts -C4 'orchestrationActivityByPaneKey' src/renderer/src
rg -nP --type=ts -C4 'OrchestrationActivity\b' src/shared src/main/runtimeRepository: stablyai/orca
Length of output: 27105
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Inspect the runtime builder that populates orchestrationActivityByPaneKey and the helper used here.
ast-grep outline src/main/runtime/orca-runtime.ts --view expanded | sed -n '17660,17740p'
ast-grep outline src/renderer/src/lib/orchestrator-mission-control-data.ts --view expanded | sed -n '1,120p'
cat -n src/shared/runtime-types.ts | sed -n '115,214p'Repository: stablyai/orca
Length of output: 5501
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Inspect the runtime builder that populates orchestrationActivityByPaneKey and the helper used here.
ast-grep outline src/main/runtime/orca-runtime.ts --view expanded | sed -n '17660,17740p'
ast-grep outline src/renderer/src/lib/orchestrator-mission-control-data.ts --view expanded | sed -n '1,120p'
cat -n src/shared/runtime-types.ts | sed -n '115,214p'Repository: stablyai/orca
Length of output: 5501
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Inspect the runtime builder and any constraints on how many orchestration activities/runs a worktree can expose.
sed -n '17669,17735p' src/main/runtime/orca-runtime.ts
sed -n '1,120p' src/renderer/src/lib/orchestrator-mission-control-data.ts
rg -n -C3 'single.*worktree|one.*worktree|multiple.*orchestrationActivityByPaneKey|orchestrationActivityByPaneKey.*worktree|runningRuns|coordinator_runs|tabsByWorktree' src/main src/renderer src/sharedRepository: stablyai/orca
Length of output: 50370
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Read the helper and the runtime builder with tight line ranges.
sed -n '1,80p' src/renderer/src/lib/orchestrator-mission-control-data.ts
sed -n '17669,17720p' src/main/runtime/orca-runtime.ts
# Find any invariants or comments stating whether a worktree can expose multiple running orchestrations.
rg -n -C2 'one.*running|single.*running|per-worktree|coordinator paneKey|orchestrationActivityByPaneKey|multiple concurrent runs|shared across runs' src/main/runtime src/shared src/renderer/src/lib src/renderer/src/components/sidebarRepository: stablyai/orca
Length of output: 27439
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Read the helper and the runtime builder with tight line ranges.
sed -n '1,80p' src/renderer/src/lib/orchestrator-mission-control-data.ts
sed -n '17669,17720p' src/main/runtime/orca-runtime.ts
# Find any invariants or comments stating whether a worktree can expose multiple running orchestrations.
rg -n -C2 'one.*running|single.*running|per-worktree|coordinator paneKey|orchestrationActivityByPaneKey|multiple concurrent runs|shared across runs' src/main/runtime src/shared src/renderer/src/lib src/renderer/src/components/sidebarRepository: stablyai/orca
Length of output: 27439
🏁 Script executed:
#!/bin/bash
set -euo pipefail
sed -n '1,80p' src/renderer/src/lib/orchestrator-mission-control-data.ts
sed -n '17669,17720p' src/main/runtime/orca-runtime.ts
rg -n -C2 'one.*running|single.*running|per-worktree|coordinator paneKey|orchestrationActivityByPaneKey|multiple concurrent runs|shared across runs' src/main/runtime src/shared src/renderer/src/lib src/renderer/src/components/sidebarRepository: stablyai/orca
Length of output: 27439
🏁 Script executed:
#!/bin/bash
set -euo pipefail
sed -n '1,80p' src/renderer/src/lib/orchestrator-mission-control-data.ts
sed -n '17669,17720p' src/main/runtime/orca-runtime.ts
rg -n -C2 'one.*running|single.*running|per-worktree|coordinator paneKey|orchestrationActivityByPaneKey|multiple concurrent runs|shared across runs' src/main/runtime src/shared src/renderer/src/lib src/renderer/src/components/sidebarRepository: stablyai/orca
Length of output: 27439
🏁 Script executed:
#!/bin/bash
set -euo pipefail
sed -n '1,80p' src/renderer/src/lib/orchestrator-mission-control-data.ts
sed -n '17669,17720p' src/main/runtime/orca-runtime.ts
rg -n -C2 'one.*running|single.*running|per-worktree|coordinator paneKey|orchestrationActivityByPaneKey|multiple concurrent runs|shared across runs' src/main/runtime src/shared src/renderer/src/lib src/renderer/src/components/sidebarRepository: stablyai/orca
Length of output: 27439
findOrchestrationActivityForTabs returns the first matching pane, not the freshest. If a worktree can expose multiple live coordinator panes, the selected dot state follows Object.entries insertion order. Either make the selection deterministic across matches or change the comment to say first match.
| const shell = await createDirectorWorktreeShell(project, { label }) | ||
| if (!shell) { | ||
| return false | ||
| } |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Show feedback when shell creation fails.
createDirectorWorktreeShell can fail before activation, but this branch returns false without any user-visible error.
Proposed fix
const shell = await createDirectorWorktreeShell(project, { label })
if (!shell) {
+ toast.error(
+ translate('auto.lib.orchestrator.launch.no_workspace', 'Could not open the Orcastrator.')
+ )
return false
}📝 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.
| const shell = await createDirectorWorktreeShell(project, { label }) | |
| if (!shell) { | |
| return false | |
| } | |
| const shell = await createDirectorWorktreeShell(project, { label }) | |
| if (!shell) { | |
| toast.error( | |
| translate('auto.lib.orchestrator.launch.no_workspace', 'Could not open the Orcastrator.') | |
| ) | |
| return false | |
| } |
|
This still looks like a valuable product direction, but the implementation now appears far enough behind current Would maintainers still like the persistent director / Orcastrator concept upstream? If so, would you prefer this to be re-cut as a smaller current-main implementation that treats the existing orchestration runtime as the source of truth, rather than trying to revive the original stack wholesale? The concept still seems compelling: a long-lived project-level director that decomposes work, dispatches workers, resumes after restart, and exposes a Mission Control view. Clarifying whether that UX/product direction is still wanted would help avoid spending effort rebasing code against an architecture that has since changed a lot. |
Re-applies the complete, recipe-free Orcastrator feature on top of current
upstream/main. An Orcastrator is a persistent "director" agent that runs in its
own dedicated worktree, decomposes work, and dispatches workers — coordinated
through Orca's orchestration runtime.
What's included:
(name + project + agent + task), inline rename, persistence via
reattach/close-cleanup, and a registry store slice.
coordinator creates lineage-visible worktrees, worktree-per-track reuse with
serialization + multi-track concurrency, coordinator resume-on-boot, and a
preload binding exposing run/taskCreate to the renderer.
with a live activity line; director console with workers, shipped history,
and PR links; collapsible PR review cards; token-sourced PR-state pills.
or spawns a worker via the CLI; supervising dot for background-active directors.
lifetime. "+" styling/weight/alignment to match the Projects section.
orchestrators feature flag + Settings toggle.
Recipe-free: the recipe-director layer was removed; the only residual
recipefield is a mode-agnostic, always-null snapshot column for LLM directors.
Co-Authored-By: Claude Opus 4.8 (1M context) [email protected]
ELI5
Orcastrator is a persistent “director” agent in its own worktree that breaks work up and dispatches worker agents. Adds UI to create and manage multi-worktree orchestration.