Skip to content

feat: Orcastrator — a persistent director for multi-worktree orchestration (experimental) - #6036

Closed
zaridan wants to merge 22 commits into
stablyai:mainfrom
zaridan:feat/orcastrator-upstream
Closed

zaridan wants to merge 22 commits into
stablyai:mainfrom
zaridan:feat/orcastrator-upstream

Conversation

@zaridan

@zaridan zaridan commented Jun 22, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds an Orcastrator: a first-class "director" you brief conversationally, which plans multi-worktree work and runs worker agents (via the orchestration engine + the /orcastrate skill) — it directs without writing the code itself, and several can run at once across projects.

Entirely behind the existing experimentalOrchestrators flag (Settings → Experimental → Orcastrators), so it's dormant unless enabled.

What's included

  • ORCASTRATORS sidebar section — directors are listed as persistent nav entries (no worktree/branch shown), reusing the worktree-sidebar styling and AgentStateDot. The list is the navigator.
  • Dedicated director worktree — each director runs in its own worktree (hidden from Projects), survives restart (rebuilt from director worktrees on load), and seeds /orcastrate into a coordinator session.
  • Launch modal mirroring the Create-worktree composer (Project · Name · Agent · task prompt), plus a Landing empty-state entry.
  • Send to Orcastrator — hand a tracked issue (GitHub/GitLab/Linear/Jira) to a director from the GitHub issue-row menu and the New Workspace composer footer (one insertion covering every provider); opens the launch modal prefilled.
  • Mission Control — shown in place of the publish/PR view for a director's worktree (which has no branch of its own): the workers it spawned (linked via lineage parent) with live agent-state dots and PR badges; a director notice on the Checks panel; and a Shipped section read from the director's .orcastrate/log.jsonl (survives worker teardown), each branch matched to its merged PR by head ref.

Design & quality

  • Follows docs/STYLEGUIDE.md — shadcn primitives, AgentStateDot, the sidebar nav highlight, existing tokens. PR-state pill colors live as theme-scoped --pr-state-* tokens in main.css (the same VS-Code-parity exception the --git-decoration-* palette makes), not raw hex in the renderer.
  • Resolution logic (lineage worker selection, agent-dot derivation, PR-badge derivation, log parsing, branch matching) is extracted into pure, unit-tested helpers.
  • Typecheck, lint, full unit suite, build, and localization (keys synced across all five locales) are green.

Notes for maintainers

  • Built on the existing orchestration engine and worktree lineage; no new main-process RPC (Mission Control is derived from already-synced store state + existing fs/gh IPC). A follow-up could add per-worker dispatch state via a small orchestration RPC.
  • Happy to adjust naming, split into smaller PRs, or gate differently — take it or leave it. 🐳

Screenshots

Feature is gated behind Settings → Experimental → Orcastrators. New/changed UI surfaces:

  • ORCASTRATORS sidebar section above Projects (director rows with AgentStateDot, no branch shown)
  • New Orcastrator launch modal (Project · Name · Agent · task prompt)
  • Mission Control in the right sidebar's Source Control slot for a director worktree (spawned workers with live state dots + PR pills, director notice on Checks, Shipped log section)
  • "Send to Orcastrator" entries on the GitHub issue row, Landing empty state, and New Workspace composer footer

Screen recording walking through enable → launch → Mission Control to be attached in the PR conversation (per repo policy, evidence images aren't committed to the description).

Testing

Verified locally on macOS (Apple Silicon):

  • pnpm lint — oxlint + switch-exhaustiveness + styled-scrollbars + localization catalog/coverage all pass
  • pnpm typecheck — node + cli + web projects clean
  • pnpm test — 1977 files, 19833 passed / 15 skipped / 0 failed
  • pnpm build — build:desktop (relay, cli, electron-vite, web) + build:native succeed; out/ artifacts produced
  • Added/updated high-quality tests — pure helpers for log parsing, PR matching, prompt builders, agent-dot/PR-badge derivation, and the orchestrators slice (register/dedupe/remove, reattach-by-prefix, skip-reattach-when-no-live-tab, fallback naming, close/teardown). Renderer-only change set; tests run cross-platform in CI.

AI Review Report

Reviewed with CodeRabbit (automated) plus a Claude Code pass.

Risks checked: worktree lifecycle/cleanup (orphaned director worktrees), error handling (silent teardown failures), React state correctness (stale fetch results, effect re-init clobbering edits, reattach producing unactivatable entries), feature-flag gating, design-token compliance, and localization coverage.

Flagged & resolved (9 findings, all in fc7833d34):

  1. Tear down the created worktree when activation fails (orchestrator-launch.ts).
  2. Log teardown failures instead of swallowing them (closeOrchestrator).
  3. Skip reattach when no live tab exists — no orphan tabId: '' entries (reattachOrchestrators, + test).
  4. Use authoritative result.worktree.displayName for toast suppression (worktrees.ts).
  5. Gate director-worktree exclusion behind experimentalOrchestrators so disabling the flag keeps worktrees reachable (WorktreeList.tsx).
  6. Move PR-state pill colors to theme-scoped --pr-state-* tokens (no raw hex in renderer).
  7. Clear stale prItems when fetch preconditions fail.
  8. Seed launch-modal form state only on open (don't clobber in-progress edits).
  9. Keep the launch modal open when launch fails.

Also localized the PR #N label (PR #{{number}}) that was failing verify:localization-coverage.

Cross-platform (macOS / Linux / Windows): explicitly checked. This is a renderer-only change set — no main/preload/IPC files added. No keyboard shortcuts introduced (no metaKey/ctrlKey). File paths go through the cross-platform joinPath helper; the director log is read via the SSH-aware window.api.fs.readFile({ filePath, connectionId }) so it works for remote hosts, not local-only. No shell/command execution added in this layer (agent launch reuses the existing buildAgentStartupPlan path). CSS tokens are theme-scoped, not OS-specific.

Security Audit

  • Input handling: localized strings use i18next interpolation with a numeric PR number — no markup injection. The director's task prompt is user text seeded into the agent session via the existing prompt-paste path (same trust model as typing it).
  • Command execution: none added here; agent startup reuses buildAgentStartupPlan / resolveTuiAgentLaunch{Args,Env}.
  • Path handling: director log path built with joinPath from the worktree path + a constant relative path; read through the existing fs IPC with connectionId (SSH-safe). The log parser is a pure string function (no fs/path access).
  • IPC: no new channels — reuses window.api.fs.readFile, window.api.gh.listWorkItems, and window.api.shell.openUrl.
  • Auth / secrets / dependencies: none touched; no new deps.
  • Follow-up: none required for this change set.

Notes

  • Whole feature is dormant unless experimentalOrchestrators is enabled.
  • pnpm build/pnpm test were run on macOS; Linux/Windows behavior is covered by the cross-platform helpers above and CI, with no platform-specific code paths in this PR.
  • Conflict with main (a zh.json i18n collision) is resolved; the branch now merges cleanly (verified by a local test-merge against the current main tip).

🤖 Generated with Claude Code


Open in Stage

@coderabbitai

coderabbitai Bot commented Jun 22, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

This PR implements the experimental "Orcastrators" feature—a persistent director/coordinator role that runs the /orcastrate skill. It introduces a Zustand orchestratorsSlice tracking registry/lifecycle (register, remove, close, reattach across restarts). A new OrchestratorsSidebarSection appears above Projects, filtered from the existing worktree list. OrchestratorLaunchModal handles project/agent/task input, backed by launchOrchestratorForProject which creates a dedicated hidden worktree and seeds the /orcastrate prompt. "Send to Orcastrator" entry points are added to Landing, TaskPage, and NewWorkspaceComposer. The right-sidebar Source Control tab is replaced by OrchestratorMissionControl for director worktrees, showing spawned workers and a shipped log parsed from .orcastrate/log.jsonl. An experimental settings toggle gates the entire feature via GlobalSettings.experimentalOrchestrators. Full i18n coverage spans five locales (en, es, ja, ko, zh), and unit tests cover the slice, log parsing, PR matching, prompt builders, and spawned-worktree selection. Skill documents define the Orcastrate decision-planning protocol, director constraints, isolation rules, and coordinator guardrails. The Electron builder configuration is updated to clean unused macOS arm64 binaries.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 39.53% which is insufficient. The required threshold is 80.00%. 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 and concisely describes the main feature: introducing Orcastrators as a persistent director for multi-worktree orchestration, with the experimental status appropriately noted.
Description check ✅ Passed The PR description fully adheres to the repository template with comprehensive Summary, Screenshots reference, detailed Testing checklist (all items confirmed passing), thorough AI Review Report documenting 9 flagged issues and their resolutions, and a complete Security Audit section. All required information is present and well-documented.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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: 9


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 55c1a7fe-d9c0-4cfb-aed8-b78a78c2cd8c

📥 Commits

Reviewing files that changed from the base of the PR and between a8feafe and 93eb719.

📒 Files selected for processing (51)
  • .nvmrc
  • ORCASTRATORS-SPEC.md
  • src/renderer/src/App.tsx
  • src/renderer/src/assets/main.css
  • src/renderer/src/components/Landing.tsx
  • src/renderer/src/components/NewWorkspaceComposerCard.tsx
  • src/renderer/src/components/NewWorkspaceComposerModal.tsx
  • src/renderer/src/components/OrchestratorLaunchModal.tsx
  • src/renderer/src/components/TaskPage.tsx
  • src/renderer/src/components/right-sidebar/OrchestratorMissionControl.tsx
  • src/renderer/src/components/right-sidebar/OrchestratorPanelNotice.tsx
  • src/renderer/src/components/right-sidebar/SourceControl.tsx
  • src/renderer/src/components/right-sidebar/right-sidebar-panel-content.tsx
  • src/renderer/src/components/settings/ExperimentalPane.tsx
  • src/renderer/src/components/settings/OrchestratorsExperimentalToggle.tsx
  • src/renderer/src/components/settings/experimental-search.ts
  • src/renderer/src/components/settings/orchestrators-search-entry.ts
  • src/renderer/src/components/sidebar/OrchestratorsSidebarSection.tsx
  • src/renderer/src/components/sidebar/WorktreeCardAgents.tsx
  • src/renderer/src/components/sidebar/WorktreeList.tsx
  • src/renderer/src/components/sidebar/index.tsx
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/ko.json
  • src/renderer/src/i18n/locales/zh.json
  • src/renderer/src/lib/github-pr-search-url.test.ts
  • src/renderer/src/lib/github-pr-search-url.ts
  • src/renderer/src/lib/orcastrate-log-shipped-work.test.ts
  • src/renderer/src/lib/orcastrate-log-shipped-work.ts
  • src/renderer/src/lib/orchestrator-launch.ts
  • src/renderer/src/lib/orchestrator-mission-control-data.test.ts
  • src/renderer/src/lib/orchestrator-mission-control-data.ts
  • src/renderer/src/lib/orchestrator-work-item-prompt.test.ts
  • src/renderer/src/lib/orchestrator-work-item-prompt.ts
  • src/renderer/src/lib/orchestrator-worker-pr-badge.test.ts
  • src/renderer/src/lib/orchestrator-worker-pr-badge.ts
  • src/renderer/src/lib/send-work-item-to-orchestrator.ts
  • src/renderer/src/lib/shipped-branch-pr-match.test.ts
  • src/renderer/src/lib/shipped-branch-pr-match.ts
  • src/renderer/src/lib/use-orchestrator-active-worktree.ts
  • src/renderer/src/lib/worktree-agent-dot-state.ts
  • src/renderer/src/store/index.ts
  • src/renderer/src/store/slices/diffComments.test.ts
  • src/renderer/src/store/slices/orchestrators.test.ts
  • src/renderer/src/store/slices/orchestrators.ts
  • src/renderer/src/store/slices/store-test-helpers.ts
  • src/renderer/src/store/slices/ui.ts
  • src/renderer/src/store/slices/worktrees.ts
  • src/renderer/src/store/types.ts
  • src/shared/types.ts

zaridan added a commit to zaridan/orca that referenced this pull request Jun 22, 2026
Resolves the 9 CodeRabbit findings on stablyai#6036:

- launch: tear down the created worktree when activation fails, so a failed
  launch doesn't leave an orphaned hidden director workspace.
- close: surface (log) teardown failures instead of swallowing every error.
- reattach: skip directors with no live tab — a blank tabId created orphan
  entries unreachable from the sidebar (+ tests for the new contract).
- worktrees: key the Orcastrator toast suppression off the authoritative
  result.worktree.displayName, not the input displayName.
- sidebar: gate director-worktree exclusion behind experimentalOrchestrators,
  so disabling the flag keeps those worktrees reachable.
- mission control: move PR-state pill colors to theme-scoped --pr-state-*
  tokens in main.css (no raw hex in the renderer); clear stale prItems when
  fetch preconditions fail; localize the "PR #N" label.
- launch modal: seed form state only on open (don't clobber in-progress
  edits), and keep the modal open when launch fails.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@zaridan

zaridan commented Jun 22, 2026

Copy link
Copy Markdown
Contributor Author

Review feedback addressed + conflict resolved

Pushed fc7833d34 (plus the main merge resolving the zh.json conflict). The branch now merges cleanly into main (verified with a local test-merge against the current tip — 0 unmerged files; GitHub's mergeability flag may lag a few minutes).

CodeRabbit findings (all 9)

# File Fix
1 orchestrator-launch.ts Tear down the created worktree when activation fails — no more orphaned hidden director workspace
2 orchestrators.ts (closeOrchestrator) Log teardown failures instead of swallowing every error
3 orchestrators.ts (reattachOrchestrators) Skip reattach when no live tab exists (no orphan tabId: '' entries) + test for the new contract
4 worktrees.ts Key the Orcastrator toast suppression off the authoritative result.worktree.displayName
5 WorktreeList.tsx Gate director-worktree exclusion behind experimentalOrchestrators so disabling the flag keeps those worktrees reachable
6 OrchestratorMissionControl.tsx PR-state pill colors moved to theme-scoped --pr-state-* tokens in main.css (no raw hex in the renderer), mirroring the existing --git-decoration-* VS-Code-parity precedent
7 OrchestratorMissionControl.tsx Clear stale prItems when fetch preconditions fail
8 OrchestratorLaunchModal.tsx Seed form state only on open — no longer clobbers in-progress edits
9 OrchestratorLaunchModal.tsx Keep the modal open when launch fails

Also fixed

  • Localization coverage gate (came from main after this branch forked): the PR #N label was unlocalized and failing verify:localization-coverage. Now localized as PR #{{number}} across all five locales; orchestrator strings in zh.json translated rather than left as English placeholders.

Verification

typecheck:web ✅ · full lint (oxlint + switch-exhaustiveness + localization catalog/coverage) ✅ · orchestrator unit tests 21/21 ✅ · WorktreeList tests 34/34 ✅

@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.

🧹 Nitpick comments (6)
skills/orcastrate/SKILL.md (2)

30-48: 🧹 Nitpick | 🔵 Trivial | ⚡ Quick win

Specify language for the graphviz/dot diagram.

Code blocks should declare their language for proper syntax highlighting. The decision tree uses DOT notation but lacks a language identifier.

Add language identifier
-```dot
+```dot
 digraph orca_decision {

64-75: 🧹 Nitpick | 🔵 Trivial | ⚡ Quick win

Specify language for the plan format block.

The plan format template should declare a language identifier (e.g., text or plain) for consistency with markdown linting standards.

Add language identifier
-```
+```text
 Plan: <one-line task summary>
skills/orcastrate/orcastrate-coordinator.md (4)

106-117: 🧹 Nitpick | 🔵 Trivial | ⚡ Quick win

Specify language for the plan format block.

Code blocks should declare a language identifier for consistency. The plan format template uses a text example format.

Add language identifier
-```
+```text
 Plan: <one-line task summary>

138-157: 🧹 Nitpick | 🔵 Trivial | ⚡ Quick win

Specify bash language for the execution command blocks.

The orchestration commands in this section are shell/bash syntax but lack language identifiers. Add bash to both blocks for proper highlighting.

Add language identifiers
-```
+```bash
 # 1. create the worktree + launch the agent in one shot
 orca worktree create --name <name> --agent <default_agent> --json

and

-```
+```bash
 orca orchestration task-create --spec "<the pre-written task for this worktree>" --json

162-165: 🧹 Nitpick | 🔵 Trivial | ⚡ Quick win

Specify bash language for the check command block.

The orca orchestration check command uses bash syntax but lacks a language identifier.

Add language identifier
-```
+```bash
 orca orchestration check --wait \

230-236: 🧹 Nitpick | 🔵 Trivial | ⚡ Quick win

Specify language for the review report format block.

The review loop report template should declare a language identifier (e.g., text).

Add language identifier
-```
+```text
 Orcastrate review — <window>

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: a478a6b6-91f4-4efc-9201-efde0017d4c5

📥 Commits

Reviewing files that changed from the base of the PR and between fc7833d and f69f06f.

📒 Files selected for processing (2)
  • skills/orcastrate/SKILL.md
  • skills/orcastrate/orcastrate-coordinator.md

@zaridan

zaridan commented Jun 22, 2026

Copy link
Copy Markdown
Contributor Author

Pushed 3ae397d34 — adds one behavior-neutral guardrail bullet to skills/orcastrate/orcastrate-coordinator.md (in ## Guardrails, right after the --inject bullet):

Verify the dispatch landed — don't trust a truncated tail. After dispatching, confirm the JSON shows "status":"dispatched" and "injected":true. A worker idling with its task still ready in task-list usually means a prior task on that terminal was never closed — worker_done does not auto-close a task, so the dispatch lock stays held. Mark the prior task completed (or failed) with orca orchestration task-update, then re-dispatch.

The underlying core behavior (worker_done not releasing the dispatch lock) is tracked separately in #6090.

@zaridan

zaridan commented Jun 23, 2026

Copy link
Copy Markdown
Contributor Author

CodeRabbit feedback — addressed

Pushed 8320c23d3.

1. orchestrators.ts — closeOrchestrator state drift (the remaining open item from the follow-up thread)
Previously the registry entry was dropped optimistically and a removeWorktree failure was only logged, so a real teardown error (fs locked / permission denied) left the director gone from the sidebar and the registry while its worktree survived on disk — unreachable for retry. Now the catch block rolls back the optimistic removal so the entry stays visible and reachable. The re-add is dedupe-safe (filter(e.id !== entry.id) before append, mirroring registerOrchestrator) to avoid a duplicate React key if a concurrent re-add slipped in. Updated the unit test to assert rollback (entry stays, length 1, no dup).

2. Markdown fence language identifiers (markdownlint nits)
Added text to the remaining bare fenced blocks:

  • skills/orcastrate/SKILL.md — Plan format block
  • skills/orcastrate/orcastrate-coordinator.md — Plan format block + review report block

(The dot and bash blocks flagged earlier were already fixed in prior commits.)

Verification: pnpm run lint ✅, pnpm run typecheck ✅, orchestrators slice tests ✅ (8/8). All other inline CodeRabbit comments on this PR were already addressed in commits 6c93d31→fc7833d and were re-confirmed present (no regressions).

Note: one unrelated test reported a runtime_timeout during the full suite run (environmental/flaky under load); it does not touch the store slice or docs changed here.

zaridan and others added 15 commits June 22, 2026 22:29
Captures the proposed "Orcastrators" sidebar section + create-flow,
build phases, settings (mapped to coordinator TUNABLES + external-LLM
adversarial review), multi-coordinator isolation, and integration points.
Planning doc for the feat/orcastrators-sidebar prototype.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
…ggle

First slice of the Orcastrators feature (see ORCASTRATORS-SPEC.md): the
GlobalSettings.experimentalOrchestrators flag, an Experimental-pane toggle
(extracted to OrchestratorsExperimentalToggle to respect max-lines), and a
settings-search entry (extracted to orchestrators-search-entry). Gates the
upcoming sidebar section; no behavior yet beyond the toggle.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Records the traced, confirmed renderer call sequence for spawning a
coordinator in a repo's existing primary worktree with /orcastrate seeded
(primary-worktree lookup, createTab, startup payload, ensureAgentStartup-
InTerminal / pasteDraftWhenAgentReady), plus the two args left to copy from
the composer submit path. De-risks the launch slice.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Adds the experimental "Orcastrators" section above Projects with a + that
opens a project picker; selecting a project launches a coordinator agent in
that project's primary worktree and seeds /orcastrate.

- orchestrator-launch.ts: resolves the project's primary worktree, builds the
  agent startup plan, activates the worktree with that startup command, and
  paste-submits /orcastrate when the TUI is ready (reuses the verified
  launch-work-item-direct agent helpers).
- OrchestratorsSidebarSection.tsx: the gated section + picker, wired into the
  sidebar above the project list.

Gated behind experimentalOrchestrators. typecheck + lint clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Locks the revised design from the working session: the Orcastrator is a
persistent *director* (lives in the ORCASTRATORS section, no worktree shown,
runs in the primary checkout but display-decoupled), survives restart, allows
several per project, and uses disposition (delegate / decide-done / adversarial
review / write-as-last-resort) rather than a permission sandbox. Adds an
ordered v2 build plan (launch robustness, registry, persistence/reattach,
display-decoupling) with a verify-before-commit risk note.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Replaces the activation-startup approach (which no-ops when the worktree is
already active, so relaunch spawned nothing) with createTab +
queueTabStartupCommand: forces a fresh agent tab and queues the launch command
directly onto it, working whether or not the worktree is already open. Also
delivers /orcastrate via pasteDraftWhenAgentReady with a 90s window so a cold
agent boot no longer drops the prompt with a "took too long" toast.

Verified live: relaunch into an open worktree spawns a fresh director and
/orcastrate auto-runs.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Adds an OrchestratorsSlice tracking launched directors (id/project/worktree/
tab/launchedAt); launchOrchestratorForProject registers one on launch. The
ORCASTRATORS sidebar section now lists live directors as clickable entries
(project name, no worktree shown) and drops entries whose tab was closed.
Wired the slice into the store + both test-store helpers.

Verified live: launching shows a persistent "my-project" entry under
ORCASTRATORS.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Display-decoupling (step 4, part 1): exclude an Orcastrator's agent tab from
the worktree card's agent rows so the director no longer appears under
Projects, and show the director's live state (working spinner / ready dot) on
its ORCASTRATORS entry instead.

Verified live: the /orcastrate agent row is gone from under the worktree and
the section entry shows a status indicator.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Make the ORCASTRATORS list a navigator: highlight the active director's entry
with the worktree card's exact active-surface styling — adds an
`.orcastrator-active-surface` class to the shared active-surface CSS rule group
in main.css (single source of truth) and reuses `worktree-sidebar-card-hover`
for hover. Status now renders via the shared AgentStateDot. No invented styles.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
The Orcastrator is now a first-class director, fully decoupled from the
project's primary checkout: launch creates a *dedicated* worktree via
createWorktree (skip-setup), runs the coordinator + /orcastrate there, and
registers it by worktree id. WorktreeList excludes director worktrees so they
never appear under Projects — they live only in the ORCASTRATORS section.

Verified live: launching spawns a director in its own worktree
(workspaces/<project>/orcastrator-<project>), shown only under ORCASTRATORS,
with nothing leaking into Projects.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Step 3 + lifecycle. The in-memory registry doesn't survive a reload, so on
load (and when worktrees change) reattachOrchestrators rebuilds it by detecting
director worktrees via the ORCASTRATOR_DISPLAY_PREFIX displayName marker —
re-hiding them from Projects and re-showing them under ORCASTRATORS, reattached
to their still-running agent. The section now keys off worktree existence
(robust to tab-id drift on reattach) and derives status from the worktree's
tabs. Adds closeOrchestrator (X-on-hover) which tears down the director's
dedicated worktree and drops it from the registry.

Note: pending live verification (author away); typecheck + lint clean and gated
behind experimentalOrchestrators.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Covers register/dedupe/remove, reattach detection (by displayName prefix,
project mapping, fallback to repo id + stripped name, idempotency, skipping
non-directors), and closeOrchestrator teardown (incl. the worktree-removal-
failure path). 7 tests, all passing.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
…tores

The Orcastrator feature reads new store fields (orchestrators registry,
worktreesByRepo) in WorktreeList, WorktreeCardAgents, and the section. Older
component test mocks build partial stores without these, so the reads threw.
Guard them (?? [] / ?? {}). Fixes 49 renderer test regressions; full renderer
suite green. (Remaining failures are pre-existing main/relay PTY/bash/relay
env tests, unrelated to this branch.)

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Records the implemented state of the director rearchitect (flag, launch,
registry/navigator, dedicated worktree, reattach, close/cleanup), the
dedicated-worktree design decision, and known follow-ups.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
… + task)

Replaces the +-dropdown with a native modal matching the "Create worktree"
composer (same Dialog + ProjectCombobox + AgentCombobox). Fields: Name (shown
in the ORCASTRATORS list), Project, Agent, and a task prompt — the prompt is
seeded after /orcastrate so the director starts planning the task instead of
asking for it. Also adds a gated "Create Orcastrator" button to the Landing
empty state next to Add Project / Create worktree.

launchOrchestratorForProject now takes { name, agent, prompt }. Verified live:
a named director ("Build Site") launched with a task, planned it, and spun up
worker worktrees under the project while staying in the ORCASTRATORS section.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
zaridan and others added 7 commits June 22, 2026 22:32
…", design polish

- Source Control: show a director explainer instead of the publish/PR empty state for an Orcastrator's worktree (it has no branch of its own to publish).
- Suppress the "local main is behind" suggestion toast for director worktrees.
- Send to Orcastrator: hand a tracked issue (GitHub/GitLab/Linear/Jira) to a director from the GitHub issue-row menu and the New Workspace composer footer; opens the launch modal prefilled, pre-selecting the project when the issue is repo-bound.
- Launch modal: read prefill from modalData; align with the Create-worktree composer (max-w-lg, auto-focus Name, matching textarea focus/shadow tokens).
- Experimental toggle: use the shared SettingsSwitch for the focus ring + a11y.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01FNy4vrv3mvyjpPnhJMZr82
… shipped history, and PR links

Replaces the misleading publish/PR view for a director's worktree with a Mission Control console, consistent across the right-sidebar panels:

- Source Control: director header + 'no branch to publish' summary, plus the worker worktrees it spawned (linked via lineage parent) with each worker's live agent-state dot and a clickable PR badge.
- Checks (and other branch/PR panels): a director notice with an 'Open Mission Control' jump, routed centrally so directors read correctly on every tab.
- Shipped: the director's completed work, read from its own .orcastrate/log.jsonl so it survives worker teardown. Each branch is matched to its merged PR by head ref — prefix-agnostic, so branch-rename-on-push still resolves — with a direct PR link.
- PR state renders as GitHub-styled pills (merged/open/closed/draft) with an external-link affordance.

Shared logic (lineage worker selection, agent-dot derivation, PR-badge derivation, log parsing, branch matching, PR-search-URL fallback) is extracted into pure, unit-tested helpers.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01FNy4vrv3mvyjpPnhJMZr82
The runtime node_modules closure bundles x86_64 copies of @parcel/watcher and
node-pty alongside the arm64 ones. They're never loaded on Apple silicon, but
recent macOS warns that the app 'includes an Intel component'. Remove them in
afterPack for darwin/arm64 builds.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01FNy4vrv3mvyjpPnhJMZr82
Resolves the 9 CodeRabbit findings on stablyai#6036:

- launch: tear down the created worktree when activation fails, so a failed
  launch doesn't leave an orphaned hidden director workspace.
- close: surface (log) teardown failures instead of swallowing every error.
- reattach: skip directors with no live tab — a blank tabId created orphan
  entries unreachable from the sidebar (+ tests for the new contract).
- worktrees: key the Orcastrator toast suppression off the authoritative
  result.worktree.displayName, not the input displayName.
- sidebar: gate director-worktree exclusion behind experimentalOrchestrators,
  so disabling the flag keeps those worktrees reachable.
- mission control: move PR-state pill colors to theme-scoped --pr-state-*
  tokens in main.css (no raw hex in the renderer); clear stale prItems when
  fetch preconditions fail; localize the "PR #N" label.
- launch modal: seed form state only on open (don't clobber in-progress
  edits), and keep the modal open when launch fails.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
…-implement gap

Ship the orcastrate skill (SKILL.md) and its coordinator spec as a bundled
skill under skills/orcastrate/, instead of leaving them honor-system in
~/.claude. This makes the Orcastrator's director behavior part of the build.

Tightening: the skill front-door framed the whole decision around worktree
*count*, so a single-PR task read as "no split needed → do it inline" — the
exact failure where an Orcastrator resolved a conflict and applied review
fixes itself. SKILL.md now separates two questions (how many PRs vs who does
the work), and the coordinator calls out "one PR" as the most common trap:
one PR still means one worktree with one worker, never zero workers.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
(cherry picked from commit a4a83f2)
…ch landed

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
…c fence langs

closeOrchestrator removed the registry entry optimistically and only logged on
removeWorktree failure, so a real teardown error (fs locked, perms) left the
director gone from the sidebar while its worktree survived on disk — unreachable
for retry. Restore the entry on failure (dedupe-safe). Update the test to assert
rollback. Add text language identifiers to the remaining bare fenced blocks in
the orcastrate skill docs (CodeRabbit markdownlint nits).

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@zaridan
zaridan force-pushed the feat/orcastrator-upstream branch from 8320c23 to 5ca486e Compare June 23, 2026 05:34
@zaridan

zaridan commented Jun 23, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto current upstream/main — now mergeable

Rebased feat/orcastrator-upstream onto upstream/main (6090c671c). git merge-tree upstream/main HEAD now reports 0 conflicts; GitHub shows the PR as MERGEABLE.

Conflicts resolved (all in i18n locale catalogs + one import):

  • src/renderer/src/i18n/locales/{en,es,ja,ko,zh}.json — union-merged. Where upstream and our branch added distinct keys at the same spot (upstream's 40eaf2c27c "Details" vs our send_to_orchestrator), kept both. Where the same key existed on both sides with upstream now translated (projectSkillRuntime.*, preflightDismiss, notePasteTooLarge/reuseExistingBranch* in zh), kept upstream's translated values and added our new orchestrator keys. Dropped nothing from either side.
  • src/renderer/src/store/slices/worktrees.ts — import collision; kept both imports (showPreservedBranchToast from upstream + ORCASTRATOR_DISPLAY_PREFIX from our branch).

Verification:

  • Locale parity: all 5 catalogs now have an identical key set (9588 keys each, 0 missing / 0 extra vs en); verify:localization-coverage ✅.
  • pnpm run typecheck ✅, oxlint ✅, orchestrator + worktrees slice tests ✅ (orchestrators 8/8, work-item-prompt 5/5, worktrees 152/152).

Note (pre-existing, not from this PR): verify:localization-catalog flags missing TerminalPane.scrollSpeed.* keys. These were introduced by upstream commit c2353fd98 ("Tune terminal scroll defaults", #6068) — our branch doesn't touch that file and upstream/main's own en.json lacks those keys too. Left untouched to avoid polluting this PR with unrelated catalog changes.

@brennanb2025

Copy link
Copy Markdown
Contributor

This is really cool! We'll definitely take a look at this. Thanks for the PR!

@zaridan

zaridan commented Jun 24, 2026

Copy link
Copy Markdown
Contributor Author

w00t! Adding some fixes, and a few additions. Will send over when the work is done.

@zaridan

zaridan commented Jun 24, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by the consolidated, recipe-free Orcastrator PR #6293, which folds this in.

@zaridan zaridan closed this Jun 24, 2026
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.

2 participants