Skip to content

fix(orchestration): expose unsupervised dispatch lanes - #15105

Merged
Jinwoo-H merged 8 commits into
mainfrom
aug17-p1-sta3848-dispatch-inject-supervision
Aug 17, 2026
Merged

Jinwoo-H merged 8 commits into
mainfrom
aug17-p1-sta3848-dispatch-inject-supervision

Conversation

@Jinwoo-H

@Jinwoo-H Jinwoo-H commented Aug 17, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 8 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​418 $\color{#cf222e}{\Huge{\mathbf{−}}}$​13 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​405
Prod 14 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​182 $\color{#cf222e}{\Huge{\mathbf{−}}}$​54 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​128

ELI5

orchestration dispatch --inject adopts an operator-started agent pane without taking supervision ownership. It records a durable Dispatch context but intentionally creates no worker_dispatches row. The landed context-only stop/abandon fix (#13376) protected the pane, but show/read/list/retain/release still treated the lane as missing.

This change exposes a truthful degraded unsupervised read model at the dispatch-context boundary. It does not add supervision and never makes worker-stop, worker-abandon, worker-retain, or worker-release close an operator-started pane.

Addresses #13678
Linear: https://linear.app/stably/issue/STA-3848

Behavior

  • worker-show and worker-read use the Dispatch's exact pane/process identity and report unsupervised
  • worker-list includes context-only lanes as unsupervised / retained
  • settled worker-retain and worker-release return retained, no_owned_resource, processAction: none
  • unknown and active-release errors remain honest
  • stop/abandon retain the operator process
  • stage distinguishes capability-backed injected contexts from neutral context_only contexts

Deterministic evidence

Invariant: a Dispatch with an assignee handle, pane key, and process incarnation remains observable and manageable even without a worker row, while no lifecycle verb closes its operator-owned process.

The same regression test file (SHA-256 c4da2fef1d02adbc28510e8a21780ca5ef302274dbee5b3ddb2027f093759acd) produced:

Version Result
v1.4.180 red: list/show/read/retain/release missing; stop/abandon also missing
origin/main 7ae6aedc02 red: observation lane missing; stop/abandon green from #13376
candidate c7b236b16c green: all three oracle cases
candidate with fix disabled same byte-identical origin/main red control

Independent signals are the persisted Dispatch/absent worker row and the RPC/terminal observation; stop/abandon additionally assert DB fencing and zero closeTerminal calls.

Validation

  • 7 focused lifecycle files, 81 tests passed
  • Node and CLI typechecks passed
  • oxlint and oxfmt passed on all touched files
  • bundled orchestration guide verification passed
  • orchestration skill guidance: 20 tests passed
  • isolated Electron dev instance: correct worktree identity, rendered Orca shell, zero console errors
  • three fresh gpt-5.6-luna reviews: code and compatibility clean; performance found only the existing unpaginated worker-list contract is now wider (explicit CLI path, run-indexed, no polling/provider fanout)

Design choice

PR #13681's --supervise proposal changes ownership and lifecycle semantics. That is unnecessary here and risks conflating supervised workers with operator-started panes. The narrower dispatch-context projection preserves that distinction and is compatible with mixed client/host versions: no new RPC parameter, required field, or stream opcode.

Downside: unfiltered worker-list remains O(history) and now includes context-only Dispatch history. Pagination should be designed separately rather than expanding this ownership fix.

@Jinwoo-H
Jinwoo-H marked this pull request as ready for review August 17, 2026 19:39
@coderabbitai

coderabbitai Bot commented Aug 17, 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

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 3918b934-6451-4699-9f55-fbe6a45436bd

📥 Commits

Reviewing files that changed from the base of the PR and between e3d2f23 and 9a84d2f.

📒 Files selected for processing (1)
  • src/main/runtime/rpc/methods/orchestration-workers-recovery.test.ts

Included review availability: Your plan includes up to 10 reviews per rolling hour; 5 remain after this review.


📝 Walkthrough

Walkthrough

The change adds unsupervised handling for operator-started dispatch --inject terminals. Dispatch contexts without worker records now appear in listings and support terminal observation and reads through the dispatch assignee. Retain and release operations validate settlement and report retained results without owned resources. Stop and abandon operations verify terminal ownership before process actions. Tests and CLI specifications cover these behaviors.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 8.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ⚠️ Warning The description explains the change, rationale, linked issue, behavior, and validation, but it omits several required template sections and checklist items. Add the required What Changed, Why, Visual Proof or N/A, Testing, AI Disclosure, Review, boundary, Notes, Checklist, and Author sections.
✅ Passed checks (3 passed)
Check name Status Explanation
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.
Title check ✅ Passed The title clearly summarizes the primary change: exposing unsupervised orchestration dispatch lanes.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch

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

🧹 Nitpick comments (1)
src/main/runtime/rpc/methods/orchestration-manual-dispatch-observation.test.ts (1)

231-241: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Assert the fencing warning text.

contextOnlyAbandonWarning is new shared code in this change, and contextOnlyStopWarning selects between two messages based on releasedCurrentTask. No test in this change asserts either output. Add the warning field to this assertion so the branch selection is covered.

♻️ Proposed assertion
-    expect(result).toMatchObject({ state, processAction: 'none' })
+    expect(result).toMatchObject({
+      state,
+      processAction: 'none',
+      warning: expect.stringContaining('terminal process')
+    })

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 111707f5-a0e4-482e-ad97-2fe87f15024a

📥 Commits

Reviewing files that changed from the base of the PR and between 7ae6aed and a83f8ae.

📒 Files selected for processing (14)
  • skill-guides/orchestration.md
  • src/cli/bundled-skill-guides.ts
  • src/cli/specs/orchestration-worker-specs.ts
  • src/main/runtime/orchestration/context-only-dispatch-release.ts
  • src/main/runtime/orchestration/db/worker-terminal/worker-terminal-archive.ts
  • src/main/runtime/orchestration/db/worker-terminal/worker-terminal-listing.ts
  • src/main/runtime/orchestration/db/worker-terminal/worker-terminal-release.ts
  • src/main/runtime/orchestration/worker-terminal-ownership.ts
  • src/main/runtime/rpc/methods/orchestration-manual-dispatch-observation.test.ts
  • src/main/runtime/rpc/methods/orchestration-worker-control.ts
  • src/main/runtime/rpc/methods/orchestration-worker-observation.ts
  • src/main/runtime/rpc/methods/orchestration-worker-release.ts
  • src/main/runtime/rpc/methods/orchestration-worker-stop-liveness-verdict.test.ts
  • src/main/runtime/rpc/methods/orchestration-worker-stop.ts
💤 Files with no reviewable changes (1)
  • src/main/runtime/rpc/methods/orchestration-worker-release.ts

Included review availability: Your plan includes up to 10 reviews per rolling hour; 8 remain after this review.

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/main/runtime/orchestration/db/worker-terminal/worker-terminal-listing.ts (1)

92-111: 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

Preserve dispatch identity and deterministic ordering. The join returns one row per dispatch and correctly defaults missing workers to unsupervised, but the list omits the current dispatch pane/process identity and orders equal timestamps nondeterministically. Return the assignee identity and add a unique tie-breaker such as d.id ASC.


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 3ac4a0b7-5aa6-460f-997d-8980defadc15

📥 Commits

Reviewing files that changed from the base of the PR and between a83f8ae and 8ccc9ff.

📒 Files selected for processing (2)
  • src/main/runtime/orchestration/db/worker-terminal/worker-terminal-listing.ts
  • src/main/runtime/rpc/methods/orchestration-worker-stop-liveness-verdict.test.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/main/runtime/rpc/methods/orchestration-worker-stop-liveness-verdict.test.ts

Included review availability: Your plan includes up to 10 reviews per rolling hour; 7 remain after this review.

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.

1 participant