Skip to content

fix(orchestration): name the current owner when a reused terminal's old dispatch is released - #67

Merged
DoozyX merged 1 commit into
mainfrom
DoozyX/retro-2-release-reused-terminal-port
Nov 15, 2026
Merged

DoozyX merged 1 commit into
mainfrom
DoozyX/retro-2-release-reused-terminal-port

Conversation

@DoozyX

@DoozyX DoozyX commented Nov 15, 2026

Copy link
Copy Markdown
Owner

ELI5

When a coordinator reuses one terminal for a follow-up worker, the terminal now belongs to the newest Dispatch. If the coordinator then releases the old Dispatch, Orca correctly refuses to close the terminal, but the answer just said "retained, ownership transferred" and never said who owns it. Now the answer names the Dispatch that owns the terminal and the exact command to run.

What Changed

Before: worker-release --dispatch <old> on a reused terminal returned retained / ownership_transferred with no recovery text. The coordinator had to dig through worker-show to find which Dispatch to release, and a retry after the new owner had already closed the terminal looked identical.

After: that receipt also carries currentOwnerDispatchId, terminalReleaseState, and, while the terminal is still open, a recovery line: release that Dispatch instead: orca orchestration worker-release --dispatch <owner>. Once the owner has released, the fields stay but the recovery line is dropped. The CLI already prints recovery as next, so no CLI change was needed.

Mechanism: a new ownershipTransferredReceiptFields in worker-terminal-resource-presentation.ts builds the fields from the transferred resource row. The local workerRelease handler and the legacy-remote execution-host release both spread it into their retained receipt, and the home-side federated release now parses and forwards the two new fields. retainedReason is exported from worker-release-completion.ts so the legacy-remote host reuses it instead of keeping a copy.

Why

The receipt already knew the reason (ownership_transferred) and the resource row already knows the owner, so surfacing both is the smallest fix. Auto-closing the terminal when the old Dispatch is released was rejected: it would close a terminal a live Dispatch still uses.

Linked Issue

Fixes #2

Ports DoozyX/retro-2-release-reused-terminal onto current main. The old branch's worker-output.ts CLI type change and worker-release-inventory.test.ts are dropped: the CLI file moved and prints recovery already, and that test file no longer exists (the case lives in worker-release.test.ts now).

Visual Proof

N/A: orchestration RPC/CLI receipt text; no UI change.

Testing

  • pnpm tc:node exit 0.
  • pnpm test on federated-release-safety.test.ts, federated-transport-safety.test.ts, worker-release.test.ts: 3 files, 14 tests passed. With the source change reverted, the 3 new/updated tests fail (3 failed, 11 passed).
  • ORCA_CODE_QUALITY_BASE=fork/main pnpm check:changed: GATE_EXIT=0, 26 of 26 checks passed.
  • Not run against a live Orca. macOS only.
  • I manually tested these changes locally (no live Orca run; verified by tests only)
  • Automated tests added/updated

Risk

Level: Low

Only adds optional fields to an already-retained receipt and one recovery string. Older hosts that omit the fields still parse. Plain revert backs it out.

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • I stated the risk: what could break, for whom, and how to back it out
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm tc:node, scoped tests and pnpm check:changed pass locally

Copilot AI balanced review requested due to automatic review settings November 15, 2026 21:03
@DoozyX
DoozyX merged commit 76d34d8 into main Nov 15, 2026
@coderabbitai

coderabbitai Bot commented Nov 15, 2026

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 776b05f2-8034-44cb-a606-f19403d68889
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@DoozyX
DoozyX deleted the DoozyX/retro-2-release-reused-terminal-port branch November 15, 2026 21:04
DoozyX added a commit that referenced this pull request Nov 23, 2026
Upstream origin/main 0b23e7a (388 commits) into fork main 6f98610.

Accepted upstream's test-suite cut (stablyai#46786) and dead card components (stablyai#46833)
on all 44 modify/delete conflicts. Fork-feature regression tests removed with it:
- #63: federation-worker-brief-agent-in-front, orchestration-structured-worker-retry
- #67: federated-release-safety, federated-transport-safety, worker-release
- #69: worker-list-pagination
- claude accounts: repo-update-host-guard, claude-session-account-move
- git graph: hosted-review-creation-gitlab-self-hosted
- passkeys: main-process-ready-persistence-cleanup
- branch cleanup: remove-worktree-branch-cleanup, worktree-remove-branch-deletion, remove-worktree
- test isolation: dependency-security-release
Fork-only tests that imported upstream-deleted fixtures were removed too.

Code conflicts keep both sides:
- Claude background evidence helper now uses upstream's running-task map
  (stablyai#47081); status payload carries fork monitoredWork + upstream backgroundCommands.
- Worker start: upstream bindTerminal/handOver split reads the re-minted pane
  handle from setupStage (#29/#61); fork deadline brief guard (#63) plus upstream
  abort checks in preamble delivery.
- Status bar: fork per-account usage roster with upstream's unreachable-host
  gating (stablyai#42644); a null account owner now shows no roster instead of local
  accounts.
- client-ui-params.ts: moved feature-interaction schemas to their own module to
  stay under max-lines with the fork's omp status-bar fields.

Gates: install:release, mobile frozen install, pnpm tc, mobile typecheck and
typecheck:tests, conflict-area tests (38 files), independent review (1 finding,
fixed), check:changed vs fork parent (only finding: upstream's unchanged
bot-run-results.test.ts casts).
@DoozyX DoozyX mentioned this pull request Nov 23, 2026
DoozyX added a commit that referenced this pull request Nov 25, 2026
Merges stablyai/orca 752c757 (277 commits).

Conflicts resolved by hand (independently reviewed, no defects):
- Gemini CLI removal (stablyai#48447) vs fork omp usage provider: StatusBarItem moved to
  client-ui-status-bar-params with omp kept; fork-retained status-bar tests
  repointed from gemini to kimi.
- Worker release custody (stablyai#42264) vs fork #67 ownership-transferred receipt
  fields: fields now spread on upstream's former-owner branch; retainedReason
  imported from its new presentation module.
- Source Control scope menu (stablyai#44229) vs fork Git Graph ref rail, Branches & Tags
  and redesigned commit pane: upstream panel-content taken, Branches & Tags dock
  moved to panel-ready, fork use-git-graph-support replaced by upstream's hook,
  git-history-panel deleted with upstream.
- Structured worker setup wait (stablyai#48202), agent row model chip (stablyai#48489), project
  badges (stablyai#48565/stablyai#48572) vs fork host badge, usage docs.
- Open diff button extracted and mobile page package aliases moved into
  mobile-web-app-aliased-packages to stay under max-lines after the merge.
- React Compiler baseline pruned.

Claude-Session: https://claude.ai/code/session_01BPjp5xBHHzDpEqwBtKH8Ac
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.

orchestration: worker-release cannot close a terminal reused via worker-start --terminal; only the last dispatch's release closes it

2 participants