Skip to content

feat(agents): add Freebuff launch and sidebar status support - #23567

Merged
nwparker merged 5 commits into
mainfrom
nwparker/freebuff
Sep 28, 2026
Merged

nwparker merged 5 commits into
mainfrom
nwparker/freebuff

Conversation

@nwparker

@nwparker nwparker commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 18 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​602 $\color{#cf222e}{\Huge{\mathbf{−}}}$​1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​601
Prod 28 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​287 $\color{#cf222e}{\Huge{\mathbf{−}}}$​4 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​283

ELI5

Select Freebuff in Orca and see what it is doing in the left sidebar: working, waiting for an answer, blocked on startup, or done. Previously it could launch, but those sidebar status rows were missing.

What Changed

Added Freebuff to the agent catalog, executable detection, CLI selection, desktop/mobile icons, telemetry, and supported-agent documentation. Prompts use the existing interactive terminal delivery path because Freebuff rejects positional prompts. Freebuff and Codebuff remain separate choices with independent settings.

Added an execution-host status producer that reads Freebuff's live composer and question panel from the existing terminal screen model and publishes through Orca's canonical agent status store. Questions include their text and choices. The SSH/WSL relay emits the existing status escape sequence, preserves raw terminal byte accounting, and cleans up its screen model with the terminal. Clients do not infer remote status from their screens.

Screen updates are observed at complete synchronized-frame boundaries, including fragmented escape sequences. Startup sign-in and repository trust prompts report blocked; declining trust clears that state when the first-message composer is ready. Settled, cancelled, and recovered tool-error turns report done.

Why

The terminal title contains task text, not activity state. Reading the live input area avoids mistaking old conversation text for current activity, and publishing through the existing store gives the sidebar and other subscribers the same state without adding renderer-specific guesses. Raw captured transcripts pin the detection rules to real screens.

Linked Issue

Refs #20376, #6871.

Visual Proof

Captured with the visual-proof skill and Playwright CDP in a background Electron instance, verified against this worktree. Real Freebuff 0.1.2, authenticated free usage, GLM 5.3 Flash, and folder workspaces. No status rows were injected. The corrected evidence includes the left sidebar.

Before: Freebuff asks a question, but the sidebar has no agent status row.

Before: missing sidebar status

After: Working

After: Working

After: Waiting for an answer

After: Waiting for an answer

After: Done

After: Done

After: Blocked on repository trust

After: Blocked on repository trust

State coverage

State / transition Evidence Observed sidebar behavior
Ready before first message Screenshot Done; clears the startup block after declining trust.
Thinking / running Screenshot Working on both the workspace and agent row.
Tool executing Screenshot Working while the real sleep subprocess runs.
Choice question Screenshot Waiting, with the real question and choices in the status store.
Custom text answer Screenshot Waiting while entering Orca Demo.
Answer entered, not submitted Screenshot Remains Waiting until Submit.
Answer submitted → completion Screenshot Returns to Done with the answer visible.
Escape cancellation Screenshot Returns to Done; terminal says response interrupted.
Tool error → recovery Screenshot Returns to Done after reporting exit code 7; subsequent question succeeds.
Repository trust Screenshot Blocked / Needs permission before the answer.

Additional launch evidence: Settings, picker, and unauthenticated login. Sign-in blocking also has a captured-transcript runtime test. Earlier manual continuation and exit to shell captures establish terminal behavior only; automatic session restoration is not added here.

Testing

  • Manually verified the rendered left sidebar on macOS through the real new-tab picker, running tasks, answering questions, declining trust, cancellation, and a failed command.
  • 79 status/relay/transcript tests pass: canonical-store transitions, login/trust blocking, trust-to-ready cleanup, remote-client isolation, one-character through whole-transcript input chunks, relay byte accounting, disposal, and transcript secret scanning.
  • Earlier launch checks: 39 focused launch/detection/CLI tests, 128 desktop catalog/status tests, 22 locale tests, 5 mobile catalog/icon tests, and 5 mobile session-bundle checks passed.
  • Node, CLI, and web typechecks; changed-code quality gate; relay build; development Electron build; diff whitespace checks.
  • Live Linux, Windows, WSL, and SSH validation. Relay behavior has automated coverage; those hosts were not exercised live.
  • Full repository test suite and release packaging. Mobile/dashboard/CLI live rendering was not separately exercised.

The installed pnpm auto-switch target is broken on this machine, so typechecks/tests used the installed executables directly. No lockfile changes were needed.

Review

The four canonical sidebar states are implemented and visually verified. Detection is based on captured Freebuff 0.1.2 free-plan screens. Paid/BYOK layouts, provider/network failures, quota exhaustion, and long-running reconnection scenarios were not exercised. Done means the turn is settled; this change does not infer a separate success/failure/interruption verdict from conversation prose. Unknown overlays retain the last observed status.

CI follow-up: the transcript round-trip suite discovers every new capture automatically. The lifecycle and login captures exposed 12 and 10 existing resize-replay differences, respectively. Comparing against the pre-PR serializer at 6835b9b4e3ea proved no byte or behavior regression. Each exact checkpoint and full diff signature is recorded in a baseline generated from the pre-PR serializer; matching totals alone cannot pass; all 32 transcript cases pass, and the differential Freebuff cases pass. CodeRabbit’s new-session boundary and exact-baseline findings are fixed and regression-tested; Pullfrog reported no new issues.

Community cross-reference and credit

Reviewed all Freebuff implementation PRs found across open and closed community contributions:

PR Contributor Coverage carried forward
#17065 @harkaranbrar7 Separate agent identity, interactive prompt delivery, desktop/mobile catalogs, official icon, skills mapping, and documentation.
#20839 @Prarambha369 The same first-class launch surfaces, telemetry, locale brand handling, and independent settings.
#18790 @LesleyMurfin Earlier bundled Freebuff catalog/mobile/documentation wiring; reviewed alongside its revert, #22601. Unrelated orchestration changes are excluded.

The comparison preserves the launch coverage and adds the execution-host status producer and rendered sidebar proof missing from those launch-only implementations. Locale entries follow this branch's current extraction and brand policy. Other search matches (#22119, #22099, #20397, #22127) concern mobile bundle integration or other agents, rather than an additional Freebuff implementation.

All three contributors above will be credited with Co-authored-by trailers in the squash commit.

Agent skill upstream boundary

  • Not applicable: no upstream skill-installer implementation copied or translated.

Checklist

  • Focused on Freebuff launch and status support.
  • Explained user-facing before/after, mechanism, and approach.
  • Before/after proof and all four sidebar states attached.
  • Reviewed status ownership, stream boundaries, cleanup, and byte accounting.
  • Cross-platform, SSH, mobile, and folder-workspace impact considered.
  • Relevant local checks pass; broader unrun checks are identified above.

@nwparker nwparker changed the title feat(agents): add Freebuff terminal support and lifecycle verification feat(agents): add Freebuff launch and sidebar status support Sep 28, 2026
@nwparker
nwparker marked this pull request as ready for review September 28, 2026 08:22
@coderabbitai

coderabbitai Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

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

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: a340b05c-8e33-47ee-9259-1e83333daec3

📥 Commits

Reviewing files that changed from the base of the PR and between fa87dce and 8bc9370.

📒 Files selected for processing (2)
  • src/main/daemon/__fixtures__/freebuff-serialize-baseline.json
  • src/main/daemon/serialize-grid-transcript-replay.test.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/main/daemon/serialize-grid-transcript-replay.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The change adds Freebuff as a supported TUI agent, including launch configuration, detection, display assets, and documentation. It adds parsing for Freebuff terminal status screens and reports status updates from local headless PTYs. The relay projects status information into Freebuff PTY output. Tests cover launch behavior, detection, terminal status parsing, and relay output.

Priority: ➖ Normal

Merge Risk: ⚪ Minimal · up to 8bc93

Freebuff launch and sidebar status support have no established merge-blocking gap; the remote status path reaches the sidebar. The change is ready for normal repository checks.

Security Architecture Review

Security architecture risk: 🔵 Low · up to 8bc93

The new status flow uses existing terminal and status-handling paths, and the review found no demonstrated expansion of access to another session. Some recovery and platform-specific behavior remains unverified.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — A terminal process can influence status content observed for its PTY, including displayed question text. The inspected path attributes the result to that PTY's pane; it does not establish control over another pane or a new privileged operation.

Trust Boundaries and Controls

  • inferred — The existing OSC consumer validates payload structure, not producer provenance. This PR adds a producer, but the inspected base-to-head comparison did not show a new arbitrary-OSC ingestion route. Runtime pane attribution and ingress disposition checks constrain where accepted observations land.

Resilience and Maintainability Implications

  • observed — The tracker defers observations during incomplete frames, resets prompt and work tracking at a recognized session boundary, and deduplicates repeated observations.

Hardening Proposals

  • proposed — If terminal output is treated as untrusted, distinguish execution-host-produced status from application-supplied OSC before granting status authority. This would harden the pre-existing ingestion boundary, not remedy a demonstrated PR-introduced bypass.
🚥 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 27 files. (1 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 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 and concisely summarizes the primary changes: Freebuff launch support and sidebar status support.
Description check ✅ Passed The description is detailed and covers the required user impact, implementation, rationale, linked issues, visual proof, testing, review notes, scope boundary, and checklist. The AI Disclosure and Not…
Full details: Docstring Coverage

Explanation

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 27 files. (1 skipped: 1 unsupported.)

  • 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: 56ce0d3f-ed82-4fad-af71-6115a643d99a

📥 Commits

Reviewing files that changed from the base of the PR and between 080c562 and 7ada239.

⛔ Files ignored due to path filters (1)
  • src/shared/agent-icons/freebuff.png is excluded by !**/*.png
📒 Files selected for processing (43)
  • README.md
  • config/scripts/locale-translation-policy.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/cli/index-worktree-create-freebuff.test.ts
  • src/main/ipc/freebuff-detection.test.ts
  • src/main/preflight/freebuff-remote-detection.test.ts
  • src/main/runtime/__fixtures__/freebuff-lifecycle.meta.json
  • src/main/runtime/__fixtures__/freebuff-lifecycle.txt
  • src/main/runtime/__fixtures__/freebuff-login.meta.json
  • src/main/runtime/__fixtures__/freebuff-login.txt
  • src/main/runtime/__fixtures__/freebuff-ready.meta.json
  • src/main/runtime/__fixtures__/freebuff-ready.txt
  • src/main/runtime/__fixtures__/freebuff-trust.meta.json
  • src/main/runtime/__fixtures__/freebuff-trust.txt
  • src/main/runtime/freebuff-status-transcript.test.ts
  • src/main/runtime/freebuff-terminal-status.ts
  • src/main/runtime/orca-runtime-maybe-hydrate-headless-from-renderer.ts
  • src/relay/freebuff-status-projection.test.ts
  • src/relay/freebuff-status-projection.ts
  • src/relay/pty-handler-output-streaming.test.ts
  • src/relay/pty-handler.ts
  • src/renderer/src/i18n/locales/en.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/freebuff-launch.test.ts
  • src/shared/freebuff-screen-status.ts
  • src/shared/freebuff-startup.test.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

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

Comment thread src/shared/freebuff-screen-status.ts Resolved

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

✅ No new issues found.

Reviewed changes

Adds Freebuff as a first-class terminal agent and adds an execution-host status producer that reads Freebuff's composer and question panel from the headless terminal screen model and publishes into the canonical agent status store. Prompts use the existing stdin-after-start interactive path; Freebuff and Codebuff stay independent.

  • Agent plumbing: freebuff added to TuiAgent, TUI_AGENT_CONFIG (detectCmd: 'freebuff', stdin-after-start), agent-kind, telemetry AGENT_KIND_VALUES, auto-pick order, display names, skills CLI keys (null), renderer catalog + favicon assets, mobile icon/favicon maps, docs, 8 localized READMEs, and the locale no-translate set.
  • Local status producer: observeFreebuffTerminalStatus plus FreebuffScreenStatusTracker split PTY output at synchronized-frame boundaries (\x1b[?2026l), read visible screen lines, and emit working/waiting/blocked/done payloads through emitTerminalAgentStatusEvents on the local execution host only (!pty.connectionId, identity-checked).
  • Relay producer: FreebuffStatusProjection mirrors Freebuff PTYs on the relay and appends the existing OSC 9999 status frame while preserving raw byte credit (rawLength/seq, transformed: true).
  • Tests/fixtures: four captured transcripts, plus transcript, relay-projection (1/137/4096/full chunk sizes), launch/detection/CLI, remote-detection, and relay byte-accounting tests.

I traced the two riskiest seams. The local producer funnels through the same emitTerminalAgentStatusEvents → onTerminalAgentStatus → ingestTerminalStatus path as the OSC producer, so equivalence and normalization still apply; cleanData: '' is unused by that function, recordAgentPromptLifecycleState is still invoked, and restoreAgentPromptLifecycleByteOrder is a genuine no-op with a null offset. Every sessionBoundary-sensitive consumer (completion time, finished timestamps, unread count, automation completion, completion-hook observer) already excludes the launch done. On the relay, rawLength/seq match the existing transformed frame contract clients already charge, and replay bytes bypass the renderer's OSC processor on the pty:replay lane, so injected frames are inert.

ℹ️ Remote status only arms when Orca launched Freebuff

The relay creates FreebuffStatusProjection only when launchAgent === 'freebuff' (src/relay/pty-handler.ts:2018), while the local producer also identifies Freebuff from the startup command and the Freebuff: OSC title (src/main/runtime/freebuff-terminal-status.ts:15-18). A remote Freebuff a user starts manually in a shell, or a resumed session that drops launchAgent, therefore reports no status over SSH/WSL where the same pane would locally. Worth confirming that's intended.

ℹ️ Scraped working/waiting persists until a recognized idle screen

The tracker only leaves working/waiting when readFreebuffScreenStatus matches the captured idle layout (quota line plus End session), and the producer never clears lastExplicitAgentStatus on an unrecognized screen. Since paid/BYOK layouts were not exercised, footer-layout drift could leave the sidebar latched on working. The captured-transcript approach is the right guard; flagging only so the plan/BYOK gap is on record.

Pullfrog  | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

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

✅ No new issues found.

Reviewed changes

Incremental review of e13c1a5 (fix(agents): reset Freebuff status at a new session boundary) since the prior review at 7ada239. The session-boundary signal now originates in the screen reader and the tracker resets per-session state on it:

  • Boundary in the reader: readFreebuffScreenStatus returns { state: 'done', sessionBoundary: true } for the first-message ready screen instead of the tracker inferring it from worked (src/shared/freebuff-screen-status.ts:84-86).
  • Tracker reset: on a sessionBoundary result the tracker clears prompt and worked before building the payload, so a fresh Freebuff session starts clean rather than inheriting the previous session's task text (src/shared/freebuff-screen-status.ts:132-141).
  • Test: the transcript test now replays trust → ready → lifecycle → ready and asserts sessionBoundary: true with prompt: '' on each ready screen, and sessionBoundary not true on the lifecycle's completed turn (src/main/runtime/freebuff-status-transcript.test.ts:87-124).

The reset ordering is right — worked is cleared before the !this.worked boundary check, so the ready screen keeps its boundary flag, and the signature dedup still suppresses repeated observations of the same screen while allowing the second session's boundary to re-emit. No new concerns; prior observations (relay arming only on launchAgent, scraped-state latch on untested layouts) still stand.

Pullfrog  | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

@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: 8e112539-19c4-4f8f-b4f0-0a6711cb4821

📥 Commits

Reviewing files that changed from the base of the PR and between e13c1a5 and fa87dce.

📒 Files selected for processing (1)
  • src/main/daemon/serialize-grid-transcript-replay.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.

@nwparker
nwparker merged commit 400e4e7 into main Sep 28, 2026
60 checks passed
@OrcaWin OrcaWin mentioned this pull request Oct 9, 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.

1 participant