Skip to content

revert: #18790 (orchestration incarnation reap fallback and bundled Freebuff agent) - #22601

Merged
brennanb2025 merged 1 commit into
mainfrom
brennanb2025/revert-18790
Sep 24, 2026
Merged

brennanb2025 merged 1 commit into
mainfrom
brennanb2025/revert-18790

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 6 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​14 $\color{#cf222e}{\Huge{\mathbf{−}}}$​1302 $\color{#cf222e}{\Huge{\mathbf{−}}}$​1288
Prod 36 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​60 $\color{#cf222e}{\Huge{\mathbf{−}}}$​201 $\color{#cf222e}{\Huge{\mathbf{−}}}$​141

ELI5

This undoes PR #18790 in full. That PR was merged as a single commit that did two unrelated things: it fixed a leak of orchestration worker terminals, and it quietly added a new third-party coding agent called "Freebuff" to Orca. We never meant to ship the Freebuff agent, so we are taking the whole PR back out. The leak fix should come back as its own PR.

What Changed

What users see, before and after:

  • Freebuff agent is gone. Before: "Freebuff" appeared in the agent picker, the agent catalog, mobile's agent list, and the supported-agents tables in the README (all languages) and the docs site. After: none of those mention it. The icon, display name, locale strings, telemetry value, and skills-CLI key are removed too.
  • The leaked-terminal fallback is gone. Before: when an orchestration worker's saved terminal handle had gone stale (for example after the window's terminal graph was rebuilt), releasing or stopping that worker looked the terminal up again by its running process, found the live terminal, and shut it down. After: release/stop again reports that terminal as missing, so the agent process behind it can be left running. On a Remote Server that leak can grow until the host runs out of memory or process slots. It stays that way until the fix is re-submitted on its own.

Mechanism: this is git revert of 0677271709 (the #18790 squash commit). The changed lines are the exact inverse of that commit; the revert applied with no conflicts on today's main.

One test pin also moves. The mobile session page closure census (config/scripts/mobile-web-app-session-terminal-closure.test.mjs) counts the modules the session page bundles. #22119 raised it by one for the Freebuff icon, so the revert lowers it by one. Main was also already two over the pin: #22452 added src/shared/main-agent-status.ts and src/shared/agent-turn-outcome.ts to that page but only touched src/shared, so the mobile bundle job never ran. The count is measured, not worked out by arithmetic: 4,220 on main, 4,219 with this revert. The pin goes 4,218 -> 4,219, and both moves are written up in the file's history.

Why

  • Why revert everything instead of only Freebuff: the team decided to back out the whole PR. It carried an unannounced third-party agent inside an unrelated fix, and we would rather review the terminal-leak fix by itself than keep half of a mixed commit.
  • Why accept the leak coming back for now: the fix was not reviewed as a separate change. A clean re-submission lets it go through review without the extra agent. A partial revert would leave main with a fix whose review was mixed up with unrelated scope.

This change will also ship in a release: the same revert is being applied to the v1.4.210 release branch (release/adhoc-1.4.210-daily-202609221832-cherrypicks), so that build will not include Freebuff either.

Linked Issue

Reverts #18790.

Visual Proof

N/A. This removes code: one agent entry disappears from lists that are data-driven, and a background cleanup path goes away. There is no new UI to show.

Testing

  • I manually tested these changes locally
  • Automated tests added/updated, or explained why not below

Run locally on macOS:

  • pnpm tc: pass.
  • vitest over the orchestration worker/runtime/CLI tests, the shared TUI-agent/agent-kind/telemetry tests, the renderer agent catalog and launch-routing tests, and the locale script tests: 3,238 passed. The other 2, both CLI task-list tests that fail under a local ORCA_STRUCTURED_SESSION=1 shell variable, pass once it is unset (a local environment leak, not related to this change).
  • Mobile agent icon and task tests (mobile/): 577 passed.
  • Mobile web app census/bundle family with ORCA_MOBILE_WEB_APP_DEPS_REQUIRED=1: the session closure census passes at the new pin, and all bundle and Chrome render checks pass. The WebKit render checks could not run locally because WebKit is not installed, so CI covers them.
  • verify:localization-catalog, verify:localization-runtime-catalog, verify:localization-extraction, verify:localization-coverage, check:readme-local-links: pass.
  • check:code-quality:changed, oxlint, and oxfmt --check on changed files: pass.
  • git grep -i freebuff finds nothing outside the census file's historical note (and nothing existed before fix(orchestration): reap leaked worker terminals via process-incarnation fallback — stops an unbounded PTY/process leak on Remote Server (OOM / cgroup PID exhaustion) #18790).

AI Disclosure

Review

Agent skill upstream boundary

  • Not applicable, or this change follows docs/reference/agent-skill-sharing-upstream-boundary.md and copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Ensure no issues in: Security, Cross-platoform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance

  • Remote/SSH: the terminal-leak fallback that goes away was aimed at Remote Server hosts, so that leak is back there until the fix is re-submitted.
  • Compatibility: freebuff is no longer a known agent id, so anyone who picked it will no longer see it offered. I did not separately test how a saved freebuff preference behaves after this change.
  • Mobile: Freebuff drops out of the mobile agent list and icon table, and the session page bundles one module fewer.

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)
  • 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 lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

…reebuff agent)

This reverts commit 0677271.

#18790 was merged as one squash commit that carried two unrelated changes:
a process-incarnation fallback for reaping leaked orchestration worker
terminals, and an unannounced "Freebuff" third-party agent (catalog entry,
icon, locale strings, README rows). The Freebuff agent was never meant to
ship, so the whole PR is reverted; the reap fix should be re-submitted on
its own.

Until that re-land, a worker whose durable terminal handle goes stale is
again reported missing on release/stop instead of being re-found through
its process incarnation, so its terminal can leak on Remote Server.

The mobile session page closure pin moves 4218 -> 4219: the revert drops
the freebuff icon #22119 pinned (-1), and #22452 had already added two
src/shared modules without re-pinning (+2).
@coderabbitai

coderabbitai Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

📝 Walkthrough

Walkthrough

Freebuff was removed from shared agent definitions, desktop and mobile catalogs, icons, locale entries, and supported-agent documentation. Worker terminal observation and release no longer remint terminal handles from process incarnations. Release paths now use the durable terminal handle, and missing or unattached liveness settling is limited to recovery mode. Related incarnation-recovery test suites were removed.

Priority: ➖ Normal

Merge Risk: 🟡 Moderate · up to 00b8d

After an unproven worker release, following the displayed retry instructions may only return the same result instead of retrying the close. Correct the instructions before merging.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 8 files. 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 identifies this as a revert of PR #18790 and names both primary reverted changes: the orchestration incarnation reap fallback and the bundled Freebuff agent.
Description check ✅ Passed The description follows the required template and clearly explains the user impact, mechanism, rationale, linked issue, visual proof, testing, compatibility considerations, and checklist status. It al…
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.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR

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


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: efc5f84b-9f2e-4662-b832-4be87e1a6330

📥 Commits

Reviewing files that changed from the base of the PR and between 3ea15dd and 00b8d4f.

⛔ Files ignored due to path filters (1)
  • src/shared/agent-icons/freebuff.png is excluded by !**/*.png
📒 Files selected for processing (41)
  • README.md
  • config/scripts/locale-translation-policy.mjs
  • config/scripts/mobile-web-app-session-terminal-closure.test.mjs
  • docs/readme/README.es.md
  • docs/readme/README.fr.md
  • docs/readme/README.ja.md
  • docs/readme/README.ko.md
  • docs/readme/README.pt.md
  • docs/readme/README.zh-CN.md
  • docs/site/content/docs/agents/supported.mdx
  • mobile/src/components/mobile-agent-icon-assets.ts
  • mobile/src/tasks/mobile-tui-agents.ts
  • src/main/runtime/orca-runtime-get-orchestration-dispatch-authority.ts
  • src/main/runtime/orca-runtime-terminal-handle-incarnation.test.ts
  • src/main/runtime/orchestration/worker-terminal-process-liveness.test.ts
  • src/main/runtime/orchestration/worker-terminal-process-liveness.ts
  • src/main/runtime/rpc/methods/orchestration-worker-release-incarnation-fallback.test.ts
  • src/main/runtime/rpc/methods/orchestration-worker-release-reap-fixed.func.test.ts
  • src/main/runtime/rpc/methods/orchestration/worker/structured-worker-release-stop.ts
  • src/main/runtime/rpc/methods/orchestration/worker/worker-control.ts
  • src/main/runtime/rpc/methods/orchestration/worker/worker-observation.ts
  • src/main/runtime/rpc/methods/orchestration/worker/worker-release-completion.ts
  • src/main/runtime/rpc/methods/orchestration/worker/worker-release-runtime-incarnation.test.ts
  • src/main/runtime/rpc/methods/orchestration/worker/worker-stop.ts
  • src/main/runtime/rpc/methods/orchestration/worker/worker-terminal-release-lease.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/fr.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/agent-catalog.tsx
  • src/renderer/src/lib/agent-favicon-assets.ts
  • src/renderer/src/lib/agent-status.ts
  • src/shared/agent-kind.ts
  • src/shared/skills-cli-agent-keys.ts
  • src/shared/telemetry-property-schemas.ts
  • src/shared/tui-agent-config.ts
  • src/shared/tui-agent-display-names.ts
  • src/shared/tui-agent-selection.ts
  • src/shared/tui-agent.ts
💤 Files with no reviewable changes (33)
  • docs/readme/README.ja.md
  • docs/readme/README.ko.md
  • docs/readme/README.fr.md
  • docs/readme/README.pt.md
  • src/shared/telemetry-property-schemas.ts
  • src/shared/agent-kind.ts
  • config/scripts/locale-translation-policy.mjs
  • src/renderer/src/lib/agent-favicon-assets.ts
  • src/shared/skills-cli-agent-keys.ts
  • src/renderer/src/lib/agent-catalog.tsx
  • README.md
  • src/renderer/src/lib/agent-status.ts
  • docs/readme/README.zh-CN.md
  • src/renderer/src/i18n/locales/en.json
  • src/main/runtime/rpc/methods/orchestration/worker/worker-release-runtime-incarnation.test.ts
  • src/main/runtime/rpc/methods/orchestration-worker-release-incarnation-fallback.test.ts
  • src/shared/tui-agent-config.ts
  • docs/site/content/docs/agents/supported.mdx
  • src/shared/tui-agent-display-names.ts
  • mobile/src/components/mobile-agent-icon-assets.ts
  • docs/readme/README.es.md
  • mobile/src/tasks/mobile-tui-agents.ts
  • src/main/runtime/orchestration/worker-terminal-process-liveness.test.ts
  • src/renderer/src/i18n/locales/fr.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/es.json
  • src/main/runtime/rpc/methods/orchestration-worker-release-reap-fixed.func.test.ts
  • src/renderer/src/i18n/locales/zh.json
  • src/shared/tui-agent.ts
  • src/shared/tui-agent-selection.ts
  • src/renderer/src/i18n/locales/ko.json
  • src/main/runtime/orca-runtime-get-orchestration-dispatch-authority.ts
  • src/main/runtime/orca-runtime-terminal-handle-incarnation.test.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 3 remain after this review.

archive: { source: args.archiveSource, status: args.archiveStatus },
lastError: unknown.release_error ?? stop.reason,
recovery: releaseUnknownRecovery(dispatchId)
recovery: `Inspect with: orca orchestration worker-show --dispatch ${dispatchId} --json — then repeat worker-release with the same --retry-request.`

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.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

🔎 Supported by static analysis

🏁 Script executed:

#!/bin/bash
rg -n -C4 'releaseUnknownRecovery|retry-request|retryRequest' src/main/runtime --type=ts -g '!**/*.test.ts' | head -120
rg -n -C6 'orchestrationRequestId|requestId.*replay|replay' src/main/runtime/rpc --type=ts -g '!**/*.test.ts' | head -120

Repository: stablyai/orca

Length of output: 24207


Use releaseUnknownRecovery for the structured release path.

When a structured-worker close is not proven, the current recovery text tells the caller to reuse --retry-request. The shared releaseUnknownRecovery helper states that reusing the prior request ID only replays the existing release_unknown receipt. The caller must use a fresh request ID to retry the close.

🐛 Suggested fix
-import type { WorkerReleaseReceipt } from './worker-release-completion'
+import { releaseUnknownRecovery, type WorkerReleaseReceipt } from './worker-release-completion'
@@
- * proven close may settle; an unproven one reports `release_unknown` and stays retryable under the
- * same request id.
+ * proven close may settle; an unproven one reports `release_unknown` and is retried with a fresh
+ * request id (replaying the prior id returns the same receipt).
@@
-      recovery: `Inspect with: orca orchestration worker-show --dispatch ${dispatchId} --json — then repeat worker-release with the same --retry-request.`
+      recovery: releaseUnknownRecovery(dispatchId)

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

Important

Reverting #18790 also reverts an unrelated, pre-existing bug fix it bundled in — the structured-worker release_unknown recovery guidance. As written, a failed structured-worker close is permanently unretryable with the same request id. The rest of the revert is faithful and complete; details below.

Reviewed changes

  • Removes the bundled Freebuff agent — drops freebuff from the shared TUI-agent registries, renderer catalog/favicon/status, mobile icon assets and favicon domains, locale JSONs, the locale translation policy, the READMEs, and the docs supported-agents table, and deletes src/shared/agent-icons/freebuff.png.
  • Removes the process-incarnation reap fallback — deletes resolveTerminalHandleByProcessIncarnation, inlines matchesProcessIncarnation back into classifyWorkerTerminalProcessIncarnation, and removes the terminalHandle / liveTerminalHandle plumbing from worker-observation, worker-control, worker-stop, worker-release-completion, and worker-terminal-release-lease.
  • Restores the pre-fix release-completion shape — the missing/unattached + provably-exited settle path moves back inside mode === 'recovery', so interactive releases report release_unknown again.
  • Deletes 6 fallback tests and repins the mobile session-page closure census (4218 -> 4219, with a measured-note paragraph for the #22452 delta and the removed icon module).

I verified the revert leaves no dangling references (matchesProcessIncarnation, resolveTerminalHandleByProcessIncarnation, and freebuff no longer appear outside the census file's historical note), that no commit after #18790 touched any reverted file (so no later fix is clobbered), and that the surviving affected tests pass (worker-release-recovery, worker-release, worker-observation, orca-runtime-terminal-handle-incarnation, orca-runtime-process-incarnation-liveness — 63 tests).

The leak coming back on Remote Server hosts is documented and intentional, and the untested saved-freebuff preference degrades safely through the existing isTuiAgent / normalizeDisabledTuiAgents guards, so neither is a finding.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

archive: { source: args.archiveSource, status: args.archiveStatus },
lastError: unknown.release_error ?? stop.reason,
recovery: releaseUnknownRecovery(dispatchId)
recovery: `Inspect with: orca orchestration worker-show --dispatch ${dispatchId} --json — then repeat worker-release with the same --retry-request.`

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.

This hunk reverts more than Freebuff or the terminal-leak fallback: #18790 also fixed a pre-existing bug here. The old inline string tells the caller to retry with the same --retry-request, but a same-request-id replay only returns the recorded release_unknown receipt, so a structured worker whose close failed is permanently unretryable. releaseUnknownRecovery(dispatchId) is still defined in worker-release-completion.ts:310 and used by the terminal and federated release paths; keeping that call here preserves the fix while still removing Freebuff and the incarnation fallback.

Technical details
# Structured-worker release guidance regressed to the unretryable same-request-id form

## Affected sites
- `src/main/runtime/rpc/methods/orchestration/worker/structured-worker-release-stop.ts:39` — `recovery` string restored to "repeat worker-release with the same --retry-request"
- `src/main/runtime/rpc/methods/orchestration/worker/structured-worker-release-stop.ts:14` — doc comment restored to "stays retryable under the same request id"

## Required outcome
- A structured-worker close failure must stay retryable under a fresh request id, matching `releaseUnknownRecovery` and the terminal (`worker-release-completion.ts:183,267,295`) and federated (`federated-worker-release.ts:100`) paths.

## Suggested approach
- Restore `releaseUnknownRecovery(dispatchId)` and its import instead of the inline string; revert only the Freebuff and process-incarnation-fallback hunks.

## Context
- #18790's body records this as a CodeRabbit-driven fix: "stopStructuredWorkerForRelease told the caller to repeat the release with the same --retry-request, which only replays the stale release_unknown receipt and made a structured-worker close failure permanently unretryable."
- No surviving test pins the structured-worker message; `worker-release.test.ts:409,445` only asserts the terminal path's `'fresh request ID'`, so this regression will not be caught by CI.

@brennanb2025
brennanb2025 merged commit 7a4f080 into main Sep 24, 2026
36 checks passed
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