Skip to content

refactor(checks): extract prop-driven ChecksPanelInner from active-worktree wrapper - #6103

Closed
zaridan wants to merge 23 commits into
stablyai:mainfrom
zaridan:zaridan/refactor-mission-control-extract-checks-inner
Closed

zaridan wants to merge 23 commits into
stablyai:mainfrom
zaridan:zaridan/refactor-mission-control-extract-checks-inner

Conversation

@zaridan

@zaridan zaridan commented Jun 22, 2026 •

Copy link
Copy Markdown
Contributor

What

Behavior-preserving refactor of the right-sidebar Checks tab. Splits the
~3.6k-line ChecksPanel into:

  • ChecksPanel.tsx — thin wrapper (default export, unchanged public surface).
    Reads the active worktree / id / repo / git-identity / linked-review identity
    from the store and passes them down as explicit props.
  • ChecksPanelInner.tsx — the actual PR / checks / merge / comments UI,
    parameterized entirely by props. Reads no active-worktree globals.

This unblocks rendering "the PR for some other worktree" (Orcastrator Mission
Control, PR2) without touching OrchestratorMissionControl.tsx.

ChecksPanelInner prop contract

type ChecksPanelInnerProps = {
  worktree: Worktree | null          // optional live checkout (see PR2 gating)
  worktreeId: string | null
  repo: Repo | null
  gitIdentityDisplay: WorktreeGitIdentityDisplay | null   // → branch / detached
  linkedPR: number | null
  linkedGitLabMR: number | null
  linkedBitbucketPR: number | null
  linkedAzureDevOpsPR: number | null
  linkedGiteaPR: number | null
}

repo, gitIdentityDisplay, and the linked* numbers are explicit props so a
shipped-PR caller can drive the UI from a branch/PR identity without a live
worktree
. worktree is optional and only gates the actions that genuinely need
a local checkout. connectionId, branch, detachedHeadDisplay, worktree path /
push target, and all cache keys are derived inside the inner from these props, so
they no-op cleanly when no worktree is present.

Provider-agnostic paths (GitHub + GitLab/Bitbucket/Azure/Gitea) are preserved.

New file layout

  • ChecksPanel.tsx — active-worktree wrapper (default export)
  • ChecksPanelInner.tsx — prop-driven inner
  • ChecksPanelReviewHeader.tsx — extracted review header (was inline; test import updated)
  • checks-panel-gitlab-review-rpc.ts — GitLab MR fetch/resolve + isGitLabChecksPanelReview
  • checks-panel-inner-types.ts — ChecksPanelInnerProps, HostedReviewCreationSnapshot, ChecksAgentComposerState

// PR2: spots the Mission Control consumer must supply (worktree-gated)

These genuinely require a live Worktree; each is isolated and no-ops when the
worktree is absent, with an inline // PR2: note:

  1. Rename / link-another-PR modal (handleLinkAnotherPullRequest) — edits worktree meta.
  2. Push (pushBeforeCreatePullRequest) — needs the local checkout path.
  3. Publish branch (handlePublishBranch) — needs the local checkout path.
  4. HostedReviewActions (merge / delete-workspace) — requires a Worktree; gated off when absent.

Mission Control must supply a worktree, or a shipped-PR-aware surface, for these.

Verification

  • tsgo typecheck: web / node / cli all pass
  • oxlint: clean on all touched files
  • Renderer build (vite build --config vite.web.config.ts): success
  • Affected vitest suites pass (32 tests), incl. the relocated review-header test.

max-lines disable (intentional, inherited)

ChecksPanelInner.tsx carries the same documented eslint-disable max-lines
that the original ChecksPanel.tsx already had (the comment mirrors it and
notes it is inherited from the pre-split file). This refactor carries inherited
debt forward — it does not add net-new debt — while shrinking the file and
extracting real modules. A deeper split of the inner into sub-300-line
hook/component modules is possible future cleanup but explicitly out of scope
here: it is a static-only decomposition of deeply-interleaved, merge-bearing
effects and belongs in its own change, separate from this behavior-preserving
prop-extraction.

Not for merge (draft). Does not touch OrchestratorMissionControl.tsx.

🤖 Generated with Claude Code

@ghost

ghost commented Jun 22, 2026 •

Copy link
Copy Markdown

@coderabbitai

coderabbitai Bot commented Jun 23, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 7b20864f-c4c5-44d3-9c33-969cac7d29b2

📥 Commits

Reviewing files that changed from the base of the PR and between 1f59fb25640c462510312368a2ac274293c673d9 and fe0ce9d.

📒 Files selected for processing (26)
  • .nvmrc
  • ORCASTRATORS-SPEC.md
  • src/main/jira/client.test.ts
  • src/main/jira/issues.test.ts
  • 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/hover-reveal-touch-action-visibility.test.ts
  • src/renderer/src/components/right-sidebar/ChecksPanel.review-header.test.tsx
  • src/renderer/src/components/right-sidebar/ChecksPanel.tsx
  • src/renderer/src/components/right-sidebar/ChecksPanelInner.tsx
  • src/renderer/src/components/right-sidebar/ChecksPanelReviewHeader.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/checks-panel-gitlab-review-rpc.ts
  • src/renderer/src/components/right-sidebar/checks-panel-inner-types.ts
  • 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
💤 Files with no reviewable changes (13)
  • src/renderer/src/components/settings/orchestrators-search-entry.ts
  • src/renderer/src/components/right-sidebar/OrchestratorPanelNotice.tsx
  • src/renderer/src/components/hover-reveal-touch-action-visibility.test.ts
  • src/renderer/src/components/right-sidebar/right-sidebar-panel-content.tsx
  • src/renderer/src/components/settings/experimental-search.ts
  • src/renderer/src/components/right-sidebar/checks-panel-inner-types.ts
  • src/renderer/src/components/right-sidebar/checks-panel-gitlab-review-rpc.ts
  • src/renderer/src/components/right-sidebar/ChecksPanel.review-header.test.tsx
  • src/renderer/src/components/settings/ExperimentalPane.tsx
  • src/renderer/src/components/right-sidebar/SourceControl.tsx
  • src/renderer/src/components/settings/OrchestratorsExperimentalToggle.tsx
  • src/renderer/src/components/right-sidebar/ChecksPanelReviewHeader.tsx
  • src/renderer/src/components/right-sidebar/OrchestratorMissionControl.tsx
✅ Files skipped from review due to trivial changes (1)
  • .nvmrc
🚧 Files skipped from review as they are similar to previous changes (9)
  • src/renderer/src/components/Landing.tsx
  • src/renderer/src/App.tsx
  • src/renderer/src/components/NewWorkspaceComposerModal.tsx
  • src/renderer/src/components/TaskPage.tsx
  • src/renderer/src/assets/main.css
  • src/main/jira/issues.test.ts
  • src/renderer/src/components/OrchestratorLaunchModal.tsx
  • src/renderer/src/components/NewWorkspaceComposerCard.tsx
  • src/main/jira/client.test.ts

📝 Walkthrough

Walkthrough

This pull request introduces an experimental "Orcastrators" feature (behind experimentalOrchestrators flag) that adds a persistent director-level coordinator to the Orca sidebar. It adds a Zustand orchestratorsSlice for registry persistence/reattach, a launchOrchestratorForProject function that creates a dedicated worktree and pastes /orcastrate, an OrchestratorLaunchModal, an OrchestratorsSidebarSection, an OrchestratorMissionControl right-sidebar panel, and "Send to Orcastrator" entry points in Landing, TaskPage, and NewWorkspaceComposer. Separately, ChecksPanelReviewHeader is extracted into its own file with multi-provider support, GitLab RPC helpers are added for the checks panel, and new Vitest tests cover Jira User-Agent headers and multi-site fan-out error semantics. A feature spec document (ORCASTRATORS-SPEC.md) is included. The .nvmrc Node.js version is also updated.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ❓ Inconclusive The PR description is comprehensive and well-structured, covering the What/Why, the new prop contract, file layout, verification steps, and technical debt notes, but it does not include Screenshots or the complete AI Review Report and Security Audit sections required by the template. Add Screenshots section (or note 'No visual change') and complete the AI Review Report and Security Audit sections as specified in the template, including cross-platform verification and security checks.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The PR title accurately captures the main refactoring: extracting ChecksPanelInner from the active-worktree wrapper and making it prop-driven, which is the primary technical change.
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: 14

🧹 Nitpick comments (2)
src/main/jira/client.test.ts (1)

173-198: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add one test that exercises the jiraRequest path for User-Agent too.

This case validates requestWithCredentials via testConnection, but the PR also changed jiraRequest. A companion test through a jiraRequest-backed call will lock both header injection points.

src/main/jira/issues.ts (1)

350-375: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Make the all-sites-failed thrown error deterministic.

failures.push(error) records completion order, so throw failures[0] can vary by timing. Prefer indexing failures by entries order (or keeping a dedicated first-entry failure) to keep surfaced error messaging stable.


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 097ed126-f404-46b5-9701-0c24135f056b

📥 Commits

Reviewing files that changed from the base of the PR and between 185175a and ee8ddf8.

📒 Files selected for processing (66)
  • .nvmrc
  • MAINTAINING-OUR-FORK.md
  • ORCASTRATORS-SPEC.md
  • config/electron-builder.config.cjs
  • scripts/rebuild-ours.sh
  • src/main/jira/client.test.ts
  • src/main/jira/client.ts
  • src/main/jira/issues.test.ts
  • src/main/jira/issues.ts
  • 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/ChecksPanel.review-header.test.tsx
  • src/renderer/src/components/right-sidebar/ChecksPanel.tsx
  • src/renderer/src/components/right-sidebar/ChecksPanelInner.tsx
  • src/renderer/src/components/right-sidebar/ChecksPanelReviewHeader.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/checks-panel-gitlab-review-rpc.ts
  • src/renderer/src/components/right-sidebar/checks-panel-inner-types.ts
  • 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/jira.test.ts
  • src/renderer/src/store/slices/jira.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

Comment thread MAINTAINING-OUR-FORK.md Outdated
open dist/mac-arm64/Orca.app # run it
```

Install it if you like: `cp -R dist/mac-arm64/Orca.app /Applications/`.

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.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Use a non-conflicting install path in the quick-start command.

Line [19] copies to /Applications/Orca.app, which can overwrite the official app and conflicts with the isolation model documented later in this file and in the install script.

Suggested doc fix
-Install it if you like: `cp -R dist/mac-arm64/Orca.app /Applications/`.
+Install it if you like: `cp -R dist/mac-arm64/Orca.app "/Applications/Orca (Ours).app"`.
📝 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
Install it if you like: `cp -R dist/mac-arm64/Orca.app /Applications/`.
Install it if you like: `cp -R dist/mac-arm64/Orca.app "/Applications/Orca (Ours).app"`.

Comment thread scripts/rebuild-ours.sh Outdated
Comment on lines +43 to +51
if [ "$WANT_SYNC" -eq 1 ]; then
echo "==> Pulling the latest official changes from upstream/main"
git fetch upstream
if ! git merge --no-edit upstream/main; then
echo "!! Conflict merging upstream. Resolve the files, 'git commit', then re-run." >&2
exit 1
fi
git push origin main || echo "(could not push main; continuing with the local build)"
fi

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.

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Abort --sync when push fails instead of continuing.

Line [50] masks git push failures, so a “synced” run can still leave origin/main stale while continuing to build.

Suggested fix
-  git push origin main || echo "(could not push main; continuing with the local build)"
+  if ! git push origin main; then
+    echo "!! Failed to push origin/main. Aborting so sync state is explicit." >&2
+    exit 1
+  fi
📝 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
if [ "$WANT_SYNC" -eq 1 ]; then
echo "==> Pulling the latest official changes from upstream/main"
git fetch upstream
if ! git merge --no-edit upstream/main; then
echo "!! Conflict merging upstream. Resolve the files, 'git commit', then re-run." >&2
exit 1
fi
git push origin main || echo "(could not push main; continuing with the local build)"
fi
if [ "$WANT_SYNC" -eq 1 ]; then
echo "==> Pulling the latest official changes from upstream/main"
git fetch upstream
if ! git merge --no-edit upstream/main; then
echo "!! Conflict merging upstream. Resolve the files, 'git commit', then re-run." >&2
exit 1
fi
if ! git push origin main; then
echo "!! Failed to push origin/main. Aborting so sync state is explicit." >&2
exit 1
fi
fi

Comment thread scripts/rebuild-ours.sh Outdated
Comment on lines +53 to +54
echo "==> Installing dependencies (pnpm via corepack)"
corepack pnpm install --frozen-lockfile || corepack pnpm install

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.

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Keep dependency installation deterministic for rebuilds.

Lines [53-54] fall back to a non-frozen install, which can mutate dependency resolution in the same command intended for reproducible rebuilds.

Suggested fix
-echo "==> Installing dependencies (pnpm via corepack)"
-corepack pnpm install --frozen-lockfile || corepack pnpm install
+echo "==> Installing dependencies (pnpm via corepack, frozen lockfile)"
+if ! corepack pnpm install --frozen-lockfile; then
+  echo "!! pnpm-lock.yaml is out of sync. Update it intentionally, review changes, then re-run." >&2
+  exit 1
+fi
📝 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
echo "==> Installing dependencies (pnpm via corepack)"
corepack pnpm install --frozen-lockfile || corepack pnpm install
echo "==> Installing dependencies (pnpm via corepack, frozen lockfile)"
if ! corepack pnpm install --frozen-lockfile; then
echo "!! pnpm-lock.yaml is out of sync. Update it intentionally, review changes, then re-run." >&2
exit 1
fi

@zaridan
zaridan force-pushed the zaridan/refactor-mission-control-extract-checks-inner branch from ee8ddf8 to 1f59fb2 Compare June 23, 2026 04:59
@zaridan

zaridan commented Jun 23, 2026

Copy link
Copy Markdown
Contributor Author

CodeRabbit feedback addressed

History was also cleaned: the four fork-only commits (auto-update feed → our fork, MAINTAINING-OUR-FORK.md + scripts/rebuild-ours.sh, the --install rebuild flag, and the darwin-x64 native-module strip) were dropped via git rebase --onto so this PR's diff vs upstream/main is just the checks refactor + its genuine base (jira fixes, orchestrator base, rename feature). Force-pushed with --force-with-lease.

Each inline/nitpick comment and how it was resolved:

  • ChecksPanelReviewHeader.tsx (~40) — non-exhaustive provider handling: added an exhaustive reviewProviderPresentation() switch over HostedReviewProvider. Bitbucket/Azure DevOps/Gitea now show their own host label/icon (pull-request style) instead of defaulting to "GitHub"; only GitLab keeps the merge-request icon + ! notation. No default case, so a new provider is a compile error. Added a Bitbucket test case.
  • OrchestratorMissionControl.tsx (~57) — raw hex PR-state colors: removed the hardcoded hex map and reuse the existing token-based prStateColor palette (the same one the checks header uses), so state pills stay theme-consistent.
  • OrchestratorMissionControl.tsx (~211) — bypassed repo-slug contract: now resolves the slug through resolveRepoSlug(directorRepo, settings) (exported from repo-slug-index), which routes through the active runtime target (environment RPC for remote/SSH, local IPC otherwise) and normalizes the slug — instead of calling window.api.gh.repoSlug directly.
  • OrchestratorLaunchModal.tsx (~134) — modal closed on failed launch: handleLaunch is now async and only calls closeModal() when launchOrchestratorForProject returns true, so a failed launch keeps the user's input.
  • OrchestratorsSidebarSection.tsx (~43) — rename divergence on write failure: persist the worktree displayName first, then update the in-memory entry, so a failed persist never lands a divergent name in the UI.
  • OrchestratorsSidebarSection.tsx (~133) — focus/touch a11y: added focus-visible ring to the row, and made the close control visible on touch (can-hover inversion) and on keyboard focus with a ring. Also registered the file in the hover-reveal touch-visibility test.
  • WorktreeCardAgents.tsx (~77) & WorktreeList.tsx (~4602) — filtering ran with the flag off: both orchestrator exclusions are now gated on experimentalOrchestrators, so disabling the feature never hides real agent rows / worktrees.
  • orchestrators.ts (~67) — teardown failure swallowed: closeOrchestrator now restores the registry entry in the catch so the sidebar stays consistent with the actual worktree state. Updated the slice test to assert the restore.
  • worktrees.ts (~1893) — detection used input displayName: isOrchestratorWorktree now derives from the persisted result.worktree.displayName, not the caller input.
  • SourceControl.tsx (~5076) — director switch below the heavy hooks: moved the director check into a SourceControlGate wrapper above SourceControlInner, so a director worktree never mounts the branch/status/review hooks and effects.
  • jira/issues.ts (~350-375) — all-sites-failed error non-deterministic: results are now captured positionally (Promise.all preserves entry order), and the surfaced error is the first entry's failure rather than the first to complete. Added a determinism test that rejects out of completion order.
  • jira/client.test.ts (~173-198) — only requestWithCredentials covered: added a companion test through the jiraRequest POST path asserting the Orca User-Agent and auth header, locking both injection points.

Intentionally skipped / moot:

  • MAINTAINING-OUR-FORK.md:19 and scripts/rebuild-ours.sh:51/54 — these files were the fork-only artifacts dropped in the history cleanup above, so the comments no longer apply to this PR.

While localizing for the coverage gate, the new PR #{number} string in Mission Control was moved behind a translate() key (added to all five locale catalogs).

Verification: pnpm run typecheck ✓, pnpm run lint ✓ (incl. localization catalog + coverage), and all touched-area tests pass.

zaridan and others added 20 commits June 22, 2026 22:32
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]>
…", 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
Double-click an Orcastrator's name in the sidebar to edit it inline,
matching the existing worktree-title rename UX. Reuses
WorktreeTitleInlineRename (Enter commits, Escape cancels, blur commits,
empty/unchanged guarded).

The rename updates both sources of truth: an optimistic in-memory
updateOrchestrator for instant UI, then the durable worktree displayName
(prefixed with ORCASTRATOR_DISPLAY_PREFIX) via the existing
updateWorktreeMeta path so reattachOrchestrators reconstructs the name
after a reload. The activate target became a role="button" div because an
Input nested in a <button> is invalid HTML; Enter/Space keep it
keyboard-accessible and the close (X) button is unaffected.

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

reattachOrchestrators preferred project?.displayName over the persisted
worktree displayName, so a renamed Orcastrator with a matching project
reverted to the project name on reload — silently discarding the rename.

Treat the prefix-stripped worktree displayName as the durable source of
truth (it's `prefix + project.displayName` at launch, so un-renamed
directors reconstruct identically), falling back to project/repo only
when no name survives the prefix. Adds a test that fails against the old
precedence, and a "why" note on the optimistic rename update.

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

Split ChecksPanel into a thin active-worktree wrapper (default export) and a
prop-driven ChecksPanelInner that reads no active-worktree globals. The wrapper
supplies worktree/repo/gitIdentityDisplay/linked-review identity as explicit
props; the inner is agnostic about whether its target is the active worktree, so
a shipped-PR caller (Mission Control, PR2) can drive the same UI from a branch/PR
identity without a live worktree.

Also extracted leaf modules: ChecksPanelReviewHeader, GitLab review RPC helpers,
and the inner prop/types. Behavior-preserving for the existing Checks tab.

(In progress) max-lines split of ChecksPanelInner still pending; temporary
eslint-disable retained until the hook/component extraction lands.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
zaridan and others added 3 commits June 22, 2026 22:35
…max-lines follow-up

Annotate the spots in ChecksPanelInner that genuinely require a live Worktree
(rename/link-PR modal, push/publish, HostedReviewActions merge) with // PR2: notes
so the Mission Control consumer knows what to supply. Make the inherited max-lines
disable comment reference the focused file-split follow-up.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Replace the temporary disable framing on ChecksPanelInner with the original
ChecksPanel.tsx '-- Why:' rationale, noting it is inherited from the pre-split
file and that a deeper sub-module split is out of scope for this behavior-
preserving prop-extraction.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Apply CodeRabbit feedback across the checks refactor + orchestrator base:
- ChecksPanelReviewHeader: exhaustive HostedReviewProvider handling so
  Bitbucket/Azure DevOps/Gitea show their own host label, not "GitHub".
- OrchestratorMissionControl: reuse the token-based prStateColor palette
  instead of hardcoded hex PR-state colors; resolve the repo slug through
  the repo-slug contract (env-target routing) instead of direct IPC.
- OrchestratorLaunchModal: keep the modal open on a failed launch so user
  input isn't dropped.
- OrchestratorsSidebarSection: persist the worktree displayName before the
  optimistic in-memory rename; restore focus-visible + touch discoverability
  on the row and close control.
- WorktreeCardAgents / WorktreeList: gate orchestrator filtering behind the
  experimentalOrchestrators toggle so disabling it never hides real rows.
- orchestrators slice: roll back the registry entry when worktree teardown
  fails so the sidebar stays consistent with actual worktree state.
- worktrees slice: classify orchestrator worktrees off the persisted
  result.worktree.displayName, not the caller input.
- SourceControl: gate the director switch above SourceControlInner so a
  director worktree never mounts its branch/status/review hooks.
- jira/issues: surface the first connected-site failure deterministically
  (entries order) instead of completion order.
- jira/client.test: lock the jiraRequest User-Agent/auth header path.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@zaridan
zaridan force-pushed the zaridan/refactor-mission-control-extract-checks-inner branch from 1f59fb2 to fe0ce9d Compare June 23, 2026 05:40
@zaridan

zaridan commented Jun 23, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto current upstream/main — now mergeable

Rebased this branch onto the latest upstream/main (was ~108 commits behind) and resolved all conflicts. git merge-tree upstream/main HEAD now reports 0 conflicts.

Conflicts resolved:

  • 5 locale catalogs (en/es/ja/ko/zh.json) — union-merged: kept upstream's new keys (incl. its translated wsl*, reuseExistingBranch*, preflightDismiss, notePasteTooLarge strings) and our orchestrator keys (orchestrator.launch.*, orchestrator_cta, send_to_orchestrator). All five locales verified at parity for our keys.
  • src/main/jira/issues.ts — took upstream's version. Upstream independently implemented the same intent as our fork fix (surface issue-search failures instead of an empty list) as a superset: it records per-site failures by entry order, prefers a non-auth/operational error, and wraps the status code. Our deterministic-error change is subsumed.
  • src/main/jira/issues.test.ts — union: kept upstream's "prefers operational failures" test and our "deterministic regardless of completion order" test (both pass against upstream's implementation).
  • src/main/jira/client.test.ts, src/renderer/src/store/slices/jira.test.ts — took upstream's versions (they cover the same paths).
  • src/renderer/src/store/slices/worktrees.ts — kept both imports (upstream's showPreservedBranchToast + our ORCASTRATOR_DISPLAY_PREFIX).

Both of our fork's Jira fixes are already in upstream/main: the non-browser User-Agent: Orca header on Jira requests (avoids the XSRF 403 on POSTs) and the surfaced search-failure handling. Our redundant jira commits collapsed to empty during the rebase; the fixes' intent is fully preserved upstream.

Verification: typecheck ✓, oxlint ✓, switch-exhaustiveness ✓, styled-scrollbars ✓, localization-coverage ✓, and all touched-area tests pass (jira, orchestrators, checks header). Note: verify:localization-catalog reports pre-existing missing TerminalPane.scrollSpeed.* keys that are also absent on upstream/main itself (an upstream feature's keys, unrelated to this PR) — intentionally left untouched to avoid scope creep.

zaridan added a commit to zaridan/orca that referenced this pull request Jun 23, 2026
Apply the remaining open CodeRabbit comments on the PR-cards work (the
shared stablyai#6103 fixes arrived via rebase onto the fixed parent):

- OrchestratorMissionControl: scope worktreeByBranch to the director's
  repo so a same-named branch in another repo can't pair a foreign live
  worktree with directorRepo, producing a mismatched card action target.
- OrchestratorLaunchModal: seed the form only on the closed→open
  transition so a prefill prop changing while open can't overwrite the
  user's in-progress edits.
- orchestrator-launch: roll back the just-created worktree when activation
  fails (no orphaned hidden worktree); surface a toast when the
  /orcastrate paste doesn't land instead of dropping it silently.
- orchestrators slice: also roll back on removeWorktree { ok: false }
  (soft failure, not just a throw); prune stale registry entries on
  reattach so removed/renamed directors don't linger as zombie cards.
- ORCASTRATORS-SPEC: mark the v2 plan's registry/persistence steps as
  superseded by shipped behavior (tabId not agentTabId, no status field,
  displayName-marker reattach).
- Add the prompt_failed locale string across all 5 locales, plus tests
  for the soft-failure rollback and the stale-entry prune.

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

zaridan commented Jun 24, 2026

Copy link
Copy Markdown
Contributor Author

Folded into the consolidated Orcastrator PR #6293.

@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