Skip to content

fix(orchestration): stop worker-list reporting a handed-on terminal as retained - #69

Merged
DoozyX merged 1 commit into
mainfrom
DoozyX/retro-38-worker-list-terminal-state
Nov 22, 2026
Merged

DoozyX merged 1 commit into
mainfrom
DoozyX/retro-38-worker-list-terminal-state

Conversation

@DoozyX

@DoozyX DoozyX commented Nov 22, 2026

Copy link
Copy Markdown
Owner

ELI5

orca orchestration worker-list told you a finished worker still held a terminal when that terminal had already been handed to a later worker. It now only says so when the worker really still has it.

What Changed

Before: a failed worker whose terminal was reused by a later Dispatch showed terminalState: retained in worker-list, while worker-show and the fleet projection said it had no terminal resource (absent / not_materialized). After: that worker shows no terminal state, matching the projection. A worker that owns a retained resource still shows retained.

Mechanism: reusing a settled terminal moves its resource to the later Dispatch and records the old owner as a former owner. The old Dispatch kept its terminal handle and no resource, so deriveWorkerTerminalListState fell into its "handle without resource means retained" branch. WORKER_TERMINAL_HANDED_ON_SQL already hid the handle for a same-process follow-up; it now also hides it when a resource names the Dispatch as a former owner. Listing, counts, the --terminal-state filter and report-wait candidates share that constant, so they stay consistent.

Why

The fix sits in the existing hand-on rule instead of changing the derive function, so legacy rows that have a handle and were never handed on keep their current retained value and nothing else is reinterpreted.

Linked Issue

Fixes #38

Visual Proof

N/A: no UI change; CLI/runtime data only.

Testing

  • pnpm test src/main/runtime/rpc/methods/orchestration/worker/fleet/worker-list-pagination.test.ts --maxWorkers=2: 6 passed. The new test fails with the old worker-terminal-inventory-counts.ts restored (retained instead of null).

  • pnpm check:changed: 53 checks passed.

  • Platform: macOS only; the change is a SQL predicate with no platform-specific code.

  • I manually tested these changes locally

  • Automated tests added/updated, or explained why not below

  • Every added test fails without this change and avoids the test anti-patterns

Risk

Low. An extra index lookup runs per listed Dispatch that owns no resource. If it were wrong, a worker row would show no terminal state instead of retained. A plain revert backs it out; no saved data changes.

Level: Low

Review

Independent review round 1: clean (4 optional nits, 1 deferred pre-existing note).

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.

Notes

Security, cross-platform, remote SSH, mobile and compatibility: no impact; internal query only.

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

…s retained

A Dispatch whose terminal was transferred to a later Dispatch's resource has no
owned resource, yet worker-list kept its handle and derived 'retained'. Treat a
former owner named by a resource's prior owners as handed on, alongside the
legacy same-process follow-up proof, so rows, counts and filters agree.
Copilot AI balanced review requested due to automatic review settings November 22, 2026 03:14
@coderabbitai

coderabbitai Bot commented Nov 22, 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: f17ab3c9-14c0-40ae-905b-dfaf9278475b
  • 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 merged commit f917ca1 into main Nov 22, 2026
1 check passed
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 26, 2026
Merges stablyai/orca 840eeac (288 commits) into fork main 0d21b21.

Conflict resolutions:
- worker-terminal handed-on SQL: upstream names the follow-up a terminal went
  to (stablyai#48686); the fork also treats a terminal transferred to a later
  Dispatch's resource as handed on (#69). handed_on_to now names the
  follow-up, else the current holder of the row the Dispatch formerly owned,
  and handed_on is handed_on_to IS NOT NULL (every row has a holder).
- federation: upstream's readiness deadline plus the fork's #29 rebinding
  pushed federation.ts past max-lines; the rebinding wait and its outcome
  move into federation-setup's waitForFederatedAgentReady.
- local-worker-start: keep the fork's reminted pane handle (#29) and add
  upstream's slept-agent wake incarnation.
- Claude launch: keep the fork's chrome-args split; add upstream's host MCP
  delivery imports.
- Status bar usage: keep the fork's per-account entries and omp slot; carry
  upstream's compact bar, host label and WSL owner actions into them. The WSL
  owner placeholders use provider ids, since opencodeGo's id differs.
- package.json: fork build:mac via build:native (now includes upstream's
  socket-owner helper) and build:mac:install; upstream build:mac:release.
- Skills: keep the fork's plain `orca` CLI resolution (macOS-only fork);
  union the add-only digest ledger and regenerate manifest/sources.
- Baselines pruned; the codex pane-isolation test now expects upstream's
  resume update-prompt suppression.

Claude-Session: https://claude.ai/code/session_01BPjp5xUE1zMqoP6MDpiAdJ
DoozyX added a commit that referenced this pull request Nov 30, 2026
Merge stablyai/orca 395b551 (342 commits) into fork main 30107dc.

Conflict resolutions (9 files), keeping fork behavior and upstream intent:
- worker-terminal inventory: upstream SQL pushdown of terminal-state filters
  and counts (stablyai#52172) over the fork's JS scan; the fork's prior-owner handoff
  (#69) stays in WORKER_TERMINAL_HANDED_ON_TO_SQL, which the pushed-down
  retained predicate uses, so a handed-on Dispatch still lists no terminal.
- electron-builder config: fork signing-identity / Touch ID requires plus
  upstream rmSync import; upstream's daily-channel removal (stablyai#52449) kept, and
  the fork-only channel test drops its daily cases.
- build-computer-macos: fork single-arch copy vs universal lipo, then
  upstream's strip -x.
- tsconfig.node: upstream inherited-git-env-setup rename (list now equals
  upstream).
- package.json: upstream build:mac / build:mac:release via build:native, fork
  build:mac:install.
- mobile client-context: fork RpcClientContext module plus upstream holdEntry.
- status bar usage: fork account-entry roster plus upstream Antigravity
  notice row (stablyai#52953) and ProviderIcon size prop, fork omp icon sized too.

Gates: install:release, mobile frozen install, pnpm tc, 22 conflict-area test
files (94 tests), 3 worker-terminal perf contracts, #69 handed-on repro
(fails on upstream's old SQL), check:changed --base=30107dced9e 54/55 with
the load-timed-out worktree-removal-real-git test passing alone (16/16),
build:mobile-web.

Claude-Session: https://claude.ai/code/session_01BPjp5z8knubqaxZaD7QKW6
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-list says retained when terminal resource is absent

2 participants