Skip to content

feat(agent-status): profile-driven output status scrape, with IBM Bob - #15936

Closed
trs-80 wants to merge 23 commits into
stablyai:mainfrom
trs-80:feat/agent-output-status-profiles
Closed

trs-80 wants to merge 23 commits into
stablyai:mainfrom
trs-80:feat/agent-output-status-profiles

Conversation

@trs-80

@trs-80 trs-80 commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

Stacked on #14895 (IBM Bob agent support). Review the last three commits; the diff includes that PR's commits until it lands.

ELI5

Agents with no hooks and no title status can now get working / waiting / done rows from their rendered output, through one shared pipeline. IBM Bob is the first profile.

What Changed

  • src/shared/agent-output-status-detector.ts: the Command Code output scrape generalized into profile-driven detection — { agent, launch-command arming, banner, active patterns, idle composer, optional waiting patterns }. The scan machinery (bounded windows, chunk-boundary novelty filter, prompt capture) is unchanged and shared.
  • command-code-output-status.ts becomes the Command Code profile plus its existing wrapper API; all its tests pass unchanged. Command Code also keeps its command-code-working/done fact kinds and policy entry points, so what hosts publish for it is byte-for-byte the same (remote-wire rule 3).
  • New generic facts agent-output-{working,done,waiting} { agent, prompt } for other profiles; handler callbacks, ownership gate (canAgentOutputOwnPane), done-settle executor, parked policy and in-flight seed take the agent. waiting maps to the store's existing 'waiting' state (attention-worthy for free).
  • bob-output-status.ts: IBM Bob profile — ⠋ Processing… (Enter to steer…) = working, ❯ Build Anything, @ for context… composer = idle, → Approve Once / Always Allow … / Reject and Allow Bob to use this skill = waiting. Patterns captured from Bob Shell 2.0.1 in a PTY.
  • Main: the fact scrape stays deferred until a side-effect consumer exists (existing contract); a separate lifecycle-only observer runs for profiles flagged feedsPromptLifecycle (Bob), so prompt-submission verification stays strict and approval prompts surface as agent_prompt_blocked.
  • The gated Bob e2e spec now asserts the scraped sidebar row (bob - IBM Bob, working → done).

Why

Sidebar rows, dashboard cards, status dots, task-complete notifications and prompt-submission verification are all fed by hook events or OSC-title status. Bob emits neither (verified in the bobshell bundle: no title setter, no hook system), so a Bob pane was invisible to all of them and every dispatched prompt was falsely settled as agent_prompt_stalled after 5 s. Command Code already solved the same problem with a bespoke scrape; generalizing it avoids a second copy for the third hookless agent.

Linked Issue

Fixes #

Visual Proof

After: sidebar worktree card shows bob - IBM Bob · now with the done check and the tab carries the status glyph (screenshot attached by the e2e spec as sidebar-bob-row). Before: no row for a Bob pane.

Testing

macOS (Darwin 25.5.0), bobshell 2.0.1:

  • Pipeline suites (detector ×2, ownership, settle, parked policy, byte watcher, facts handler, main-authority pane, tracker parity): 255 passed; runtime side-effect/prompt-submission suites: 98 + 43 passed; full src/shared + terminal-pane + rpc/methods + ipc: 13,092 passed.

  • Live app: Bob worker dispatch → input_accepted → succeeded → worker_done with strict verification (no output fallback in the code).

  • ORCA_E2E_REAL_BOB=1 npx playwright test tests/e2e/bob-agent-first-class.spec.ts --project electron-headless → 5/5 including the sidebar-row assertion.

  • I manually tested these changes locally

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

AI Disclosure

Claude (Fable 5) via Claude Code assisted with analysis, implementation and testing; reviewed and run locally by the author.

Review

Agent skill upstream boundary

N/A

@coderabbitai

coderabbitai Bot commented Aug 22, 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: d4cec217-06eb-410b-b184-5f24649e3688

📥 Commits

Reviewing files that changed from the base of the PR and between 08ac01f9ea1953785edf77a45128836e201ccb4d and 13a9eed18bfcfbd1c9bb938fdfffd7dd39cf8a40.

📒 Files selected for processing (4)
  • src/main/runtime/orca-runtime.ts
  • src/renderer/src/components/terminal-pane/parked-terminal-command-status.test.ts
  • src/renderer/src/components/terminal-pane/parked-terminal-command-status.ts
  • src/renderer/src/components/terminal-pane/pty-connection.ts

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


📝 Walkthrough

Walkthrough

Adds IBM Bob as a supported TUI agent across shared configuration, catalogs, icons, labels, permissions, telemetry, and mobile settings. Adds command classification and identity filtering for conflicting executables. Introduces shared output-status detection for Bob and Command Code, with working, waiting, and done lifecycle facts. Extends terminal pane status handling and delayed completion to generic agents. Adds a one-time default-disabled settings migration and coverage for runtime, persistence, process detection, and gated real-binary end-to-end flows.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description explains the implementation and testing, but the issue link, checklist, Notes section, and explicit visual attachments are incomplete. Add a valid linked issue, complete the required checklist and Notes section, and attach before-and-after visual proof.
Docstring Coverage ⚠️ Warning Docstring coverage is 17.95% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 39 functions across 53 files. (1 skipped: 1 too large.) Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately identifies the two primary changes: profile-driven output-status scraping and IBM Bob support.
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.

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

🧹 Nitpick comments (4)
src/shared/agent-output-status-detector.ts (1)

80-93: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick win

Cache the global-flag clones instead of recompiling per chunk.

patternOverlapsSanitizedText calls new RegExp(pattern.source, 'g') on every invocation. patternOverlapsStatusContext calls it twice per pattern, and the observer runs every profile against every PTY chunk. The Command Code ACTIVE_LLM_STATUS_RE source contains a ~75-item alternation, so this recompiles a large pattern many times per second on the PTY hot path.

Use a WeakMap keyed by the profile pattern to compile each global clone once.

Note on the static analysis hints for Line 84: the sources come from internal profile constants, not from user input, so the ReDoS finding does not apply here.

♻️ Proposed caching of the global clones
+const GLOBAL_PATTERN_CACHE = new WeakMap<RegExp, RegExp>()
+
+function globalPattern(pattern: RegExp): RegExp {
+  const cached = GLOBAL_PATTERN_CACHE.get(pattern)
+  if (cached) {
+    return cached
+  }
+  const compiled = new RegExp(pattern.source, pattern.flags.includes('g') ? pattern.flags : `${pattern.flags}g`)
+  GLOBAL_PATTERN_CACHE.set(pattern, compiled)
+  return compiled
+}
+
 function patternOverlapsSanitizedText(
   pattern: RegExp,
   previousTextLength: number,
   combinedText: string
 ): boolean {
-  const re = new RegExp(pattern.source, 'g')
+  const re = globalPattern(pattern)
+  re.lastIndex = 0
   for (const match of combinedText.matchAll(re)) {

matchAll rejects a non-global regex and clones internally, so the shared instance keeps lastIndex at 0.

Source: Linters/SAST tools

src/shared/bob-output-status.ts (2)

19-25: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Escape BOB_COMPOSER_PLACEHOLDER before interpolation.

BOB_COMPOSER_PLACEHOLDER is interpolated into three RegExp sources without escaping. The current value contains no regex metacharacters, so behavior is correct today. If Bob changes the placeholder to a string with (, ., ?, or [, these patterns break silently or throw. command-code-output-status.ts already defines escapeRegExp for this reason.

Also note the group structure on Line 20: the ) after steer closes the outer (?: group, so the matched literal is (Enter to steer without the closing parenthesis. Confirm this is intended and not a misplaced escape.


34-40: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Recognize path-based Bob launch commands

startupCommand can use an absolute-path override, but the current predicate ignores /usr/local/bin/bob chat and node …/bob.js chat. Match path-based executable tokens without treating argument text such as echo /bob chat as a Bob launch. Add direct-path and wrapper-command tests.

src/shared/bob-headless-command.ts (1)

4-6: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Reduce the new explanatory comments.

Keep only the non-obvious constraint in each comment. The current comments restate command behavior across multiple lines.

  • src/shared/bob-headless-command.ts#L4-L6: reduce the subcommand explanation to one concise line.
  • src/shared/tui-agent-config.ts#L270-L285: reduce the launch, identity, and prompt-injection explanations to concise comments.

Source: Coding guidelines


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 3dca0506-f9e8-48ea-a772-e37bf4a44f28

📥 Commits

Reviewing files that changed from the base of the PR and between 6b51ef4 and 53bd02ca0ffdda00e53684115f313f0dfe03e89b.

⛔ Files ignored due to path filters (1)
  • src/shared/agent-icons/bob.png is excluded by !**/*.png
📒 Files selected for processing (59)
  • README.md
  • mobile/src/components/mobile-agent-icon-assets.ts
  • mobile/src/tasks/mobile-tui-agents.ts
  • src/main/ipc/preflight-agent-detection.test.ts
  • src/main/ipc/preflight-agent-identity-exclusion.ts
  • src/main/ipc/preflight.ts
  • src/main/persistence-settings-update.test.ts
  • src/main/persistence/loading-store/store.ts
  • src/main/runtime/agent-prompt-submission-runtime.test.ts
  • src/main/runtime/orca-runtime.test.ts
  • src/main/runtime/orca-runtime.ts
  • src/renderer/src/components/terminal-pane/command-code-done-settle.test.ts
  • src/renderer/src/components/terminal-pane/command-code-done-settle.ts
  • src/renderer/src/components/terminal-pane/command-code-output-ownership.test.ts
  • src/renderer/src/components/terminal-pane/command-code-output-ownership.ts
  • src/renderer/src/components/terminal-pane/parked-terminal-byte-watcher.ts
  • src/renderer/src/components/terminal-pane/parked-terminal-command-status.test.ts
  • src/renderer/src/components/terminal-pane/parked-terminal-command-status.ts
  • src/renderer/src/components/terminal-pane/pty-connection.ts
  • src/renderer/src/components/terminal-pane/terminal-side-effect-facts-handler.test.ts
  • src/renderer/src/components/terminal-pane/terminal-side-effect-facts-handler.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/es.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-draft-readiness.ts
  • src/renderer/src/lib/agent-favicon-assets.ts
  • src/renderer/src/lib/agent-status.ts
  • src/shared/agent-headless-command.ts
  • src/shared/agent-kind.ts
  • src/shared/agent-output-status-detector.ts
  • src/shared/agent-output-status-profiles.ts
  • src/shared/agent-process-recognition.test.ts
  • src/shared/agent-process-recognition.ts
  • src/shared/agent-status-types.ts
  • src/shared/agent-type-label.ts
  • src/shared/bob-headless-command.ts
  • src/shared/bob-output-status.test.ts
  • src/shared/bob-output-status.ts
  • src/shared/command-code-output-status.ts
  • src/shared/constants.ts
  • src/shared/draft-paste-ready-scanner-grok-trace-replay.test.ts
  • src/shared/draft-paste-ready-scanner.ts
  • src/shared/global-settings-types.ts
  • src/shared/skills-cli-agent-keys.ts
  • src/shared/telemetry-events.ts
  • src/shared/terminal-side-effect-facts.ts
  • src/shared/tui-agent-config-types.ts
  • src/shared/tui-agent-config.ts
  • src/shared/tui-agent-detection-commands.ts
  • src/shared/tui-agent-display-names.ts
  • src/shared/tui-agent-permissions.test.ts
  • src/shared/tui-agent-permissions.ts
  • src/shared/tui-agent-selection.ts
  • src/shared/tui-agent-startup-bob.test.ts
  • src/shared/tui-agent.ts
  • tests/e2e/bob-agent-first-class.spec.ts

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

Comment thread mobile/src/tasks/mobile-tui-agents.ts Resolved
Comment thread src/shared/agent-headless-command.ts Resolved
Comment thread src/shared/agent-process-recognition.ts Resolved
Comment thread src/shared/skills-cli-agent-keys.ts Resolved
Comment thread tests/e2e/bob-agent-first-class.spec.ts Resolved
Comment thread tests/e2e/bob-agent-first-class.spec.ts Resolved
@trs-80
trs-80 force-pushed the feat/agent-output-status-profiles branch 2 times, most recently from 2edfaa5 to ea272fa Compare August 22, 2026 11:47
@trs-80

trs-80 commented Aug 22, 2026

Copy link
Copy Markdown
Contributor Author

CodeRabbit feedback addressed

  • isAnteHeadlessOneShotCommand import (🔴) — false positive: it is imported on line 1 of agent-headless-command.ts; the file typechecks and the existing Ante tests pass.
  • Observer doc comment — fixed in ea272fabee: every detector sees every chunk (each keeps its own rolling window); a PTY normally arms one profile, and the write side's pane-ownership gate decides which agent may own the row if two ever fire.
  • Propagate the identity probe to runtime recognition — not applied. Runtime recognition is by process name for every agent (codex, gemini, … behave the same); the --help probe is a one-time detection-side check and isn't viable per observed process. What protects the status row is the write-side ownership gate (canAgentOutputOwnPane: foreground agent / pane owner must be Bob or unknown), which this PR keeps. The Neovim bob is also a short-lived command, not a TUI that would arm the scrape.
  • Mobile opt-out default and skills-cli-agent-keys.ts comment — those files belong to feat: add IBM Bob agent support (Bob Shell 2.x) #14895; fixed there in a37cb50f44.
  • e2e identity / Default scoping / Windows pgrep — duplicates of the feat: add IBM Bob agent support (Bob Shell 2.x) #14895 review; fixed there in 5cc49119f5 and now included here via the restack (tabAgent === 'bob', Default button scoped to the IBM Bob row, win32 skip on the pgrep-based test).

Branch restacked on the updated #14895 head; ORCA_E2E_REAL_BOB=1 suite 5/5 on the restacked branch.

@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

🧹 Nitpick comments (1)
tests/e2e/bob-agent-first-class.spec.ts (1)

286-287: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Reduce the test-comment detail.

Keep each comment to one concise line that states only the non-obvious constraint.

  • tests/e2e/bob-agent-first-class.spec.ts#L286-L287: State that the Default agent control must be scoped to the IBM Bob row.
  • tests/e2e/bob-agent-first-class.spec.ts#L327-L329: State that output-status detection requires a submitted prompt.

As per coding guidelines: “Comments must be concise, non-obvious, and brief—prefer one line; do not explain obvious behavior or walk through code.”

Source: Coding guidelines


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 109e16d8-226d-4363-8824-9c88b04364f5

📥 Commits

Reviewing files that changed from the base of the PR and between 53bd02ca0ffdda00e53684115f313f0dfe03e89b and 2edfaa5b721a3acd01211c9af626340072a4dae6.

📒 Files selected for processing (3)
  • src/shared/bob-headless-command.test.ts
  • src/shared/bob-headless-command.ts
  • tests/e2e/bob-agent-first-class.spec.ts

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

Comment thread src/shared/bob-headless-command.ts Resolved
@trs-80

trs-80 commented Aug 22, 2026

Copy link
Copy Markdown
Contributor Author

Follow-up from an internal audit (08ac01f9ea, branch restacked on the current #14895 head):

  • Stuck waiting rows — both done-settle executors now accept a waiting row as the same unfinished turn (an approval that ends the turn returns straight to the composer with no spinner); detector + policy tests added for waiting → idle.
  • Skill-approval pattern is line-anchored so a prompt mentioning the phrase is not read as a permission stop (test added).
  • One Bob scrape per chunk in main — the lifecycle observer owns Bob (and now emits its facts); the consumer-gated fact observer scans the remaining profiles. Bob's banner prefilter now keys on Anything/steer instead of single letters.
  • Idle settle in main — idle is recorded only after the same 1.5 s window the renderer uses, cancelled by a working/waiting repaint, so mid-turn composer repaints can't mint idle → working transitions; timers are cleared with the tracker.
  • Dead exports removed (isOutputStatusAgent, readInFlightCommandCodeTurn, canCommandCodeOutputOwnPane), the stale "only 'working'" comment fixed, and agent-output-status-profiles.test.ts added (per-profile routing, every detector sees every chunk, per-agent in-flight seeding).

Verified: terminal-pane + shared + submission suites 3,879 passed; runtime side-effect/prompt suites 98 passed; ORCA_E2E_REAL_BOB=1 suite 5/5 including the scraped sidebar row.

@trs-80
trs-80 force-pushed the feat/agent-output-status-profiles branch from ea272fa to 08ac01f Compare August 22, 2026 20:35

@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


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 2bcfe7f3-87fa-4ecc-aecc-052f4ecec1c0

📥 Commits

Reviewing files that changed from the base of the PR and between ea272fabee18c2ca63da12aa59806857298c3d71 and 08ac01f9ea1953785edf77a45128836e201ccb4d.

📒 Files selected for processing (12)
  • src/main/runtime/orca-runtime.ts
  • src/renderer/src/components/terminal-pane/command-code-output-ownership.test.ts
  • src/renderer/src/components/terminal-pane/command-code-output-ownership.ts
  • src/renderer/src/components/terminal-pane/parked-terminal-byte-watcher.test.ts
  • src/renderer/src/components/terminal-pane/parked-terminal-command-status.test.ts
  • src/renderer/src/components/terminal-pane/parked-terminal-command-status.ts
  • src/renderer/src/components/terminal-pane/pty-connection.ts
  • src/shared/agent-output-status-profiles.test.ts
  • src/shared/agent-output-status-profiles.ts
  • src/shared/bob-output-status.test.ts
  • src/shared/bob-output-status.ts
  • tests/e2e/bob-agent-first-class.spec.ts

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

Comment thread src/main/runtime/orca-runtime.ts Resolved
@trs-80

trs-80 commented Aug 22, 2026

Copy link
Copy Markdown
Contributor Author

Addressed (13a9eed18b):

  • Idle settle vs. PTY generation — the pending idle timer is now cleared in advancePtyLifecycleGeneration (which runs on every generation change), not only on the conditional full-tracker reset, via a shared clearAgentOutputIdleSettle.
  • Prompt lend scoped to the same agent — both the mounted and parked seeds only reuse currentEntry.prompt when currentEntry.agentType === agent; regression test added (Claude working row + empty Bob seed → Bob row with empty prompt).

@kiyeonjeon21

Copy link
Copy Markdown

Confirming the Bob profile against a live bobshell 2.0.1 session, same PTY setup I described on #14895 (isolated BOB_DIR, 120x45, fresh profile). I drove one prompt through to a command approval and captured all three states.

Working, with the steer hint your banner regex depends on:

⠦ Processing… (Enter to steer, Tab to queue)

Idle composer, full string:

❯   Build Anything, @ for context, / for commands, $ for skills

Three spaces after the glyph rather than one, so ❯\s+Build Anything, @ for context is doing real work there. A literal single space would have missed.

Waiting, on ls -1:

Execute Command
Command:          ls -1
Approve commands:
→ Approve Once
  Always Allow Command for task
  Reject
Wait for input after execution: No (Tab to toggle)

Two of your three waitingRes fire on that frame. I did not exercise the skill-approval path.

The status bar also picks up usage once a turn has run, Agent Mode · 7.7k / 270.0k (3%) · 0.015 🅞. None of the patterns touch it; I mention it only because it is the one line whose shape changes mid-session.

One behavior worth pinning in a test: the spinner and the idle composer placeholder render in the same frame. Every Processing… capture I took also contained ❯ Build Anything, @ for context. Your ordering handles it, waiting then active then idle with an early return on each, and the comment above the active branch says why. But that means the idle branch is only correct because active runs first, and a reordering would read a working pane as done without a single pattern changing. Feeding one chunk that contains both and asserting onWorking would hold that in place.


AI disclosure: Claude Code assisted with the analysis and with drafting this comment. Every line of output quoted above is from a live bobshell 2.0.1 session I ran on my own machine.

@trs-80
trs-80 force-pushed the feat/agent-output-status-profiles branch from 13a9eed to c2d6a14 Compare August 23, 2026 22:18
@trs-80

trs-80 commented Aug 25, 2026

Copy link
Copy Markdown
Contributor Author

Added in c2d6a147d9: the detector suite now feeds one chunk holding the prompt echo, the Processing… spinner, and the idle composer placeholder together — the same-frame render every one of your captures showed — and asserts onWorking fires with the submitted prompt while onDone stays uncalled. Reordering the idle branch ahead of the active check now fails a test instead of silently reading a working pane as done.

Also noted from your capture that the three-space composer gap is what \s+ is carrying, and that the mid-session usage line in the status bar stays untouched by all three pattern groups. The skill-approval path you didn't exercise is covered by the existing test against the Allow Bob to use this skill frame.

The branch was restacked on the current #14895 head, so it also carries the help-text fixture from your other comment.

🤖 Generated with Claude Code

@trs-80
trs-80 force-pushed the feat/agent-output-status-profiles branch from c2d6a14 to 802d627 Compare August 27, 2026 12:00
@trs-80
trs-80 force-pushed the feat/agent-output-status-profiles branch from 802d627 to 9118014 Compare September 1, 2026 02:14
@greptile-apps

greptile-apps Bot commented Sep 1, 2026

Copy link
Copy Markdown

Greptile Summary

This PR adds IBM Bob as a first-class TUI agent and generalizes terminal-output status detection into profile-driven working, waiting, and done observations.

  • Adds Bob detection, launch configuration, defaults, icons, localization, and mobile/desktop selection support.
  • Generalizes the Command Code output scraper and wires Bob observations into status presentation and prompt lifecycle verification.
  • Adds persistence migration, runtime, renderer, unit, and gated end-to-end coverage.

Confidence Score: 4/5

The PR should not merge until mobile agent-list filtering consistently preserves Bob's default-disabled state for hosts that omit the setting.

The new fallback correctly protects direct selection helpers, but visible mobile option lists bypass it and can offer Bob even though downstream creation policy still considers it disabled.

Files Needing Attention: mobile/src/tasks/mobile-tui-agents.ts

Important Files Changed

Filename Overview
src/shared/agent-output-status-detector.ts Introduces the shared bounded, profile-driven terminal-output detector used by Command Code and Bob.
src/shared/bob-output-status.ts Defines Bob's launch arming, banner, working, idle-composer, and approval-waiting patterns.
src/main/runtime/orca-runtime.ts Adds an always-on Bob output observer for prompt lifecycle verification while retaining deferred side-effect publication.
src/renderer/src/components/terminal-pane/parked-terminal-command-status.ts Generalizes parked-pane status handling and settlement from Command Code to agent-specific output facts.
src/main/persistence/loading-store/prepare-loaded-profile-settings.ts Migrates existing profiles once so Bob remains opt-in by default while preserving later explicit choices.
mobile/src/tasks/mobile-tui-agents.ts Adds Bob and absent-setting defaults, but list filtering bypasses the new default and exposes Bob as enabled for hosts that omit the field.
src/shared/tui-agent-config.ts Adds Bob launch, identity-exclusion, prompt injection, permissions, and status-profile configuration.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  PTY[Bob PTY output] --> Detector[Profile-driven output detector]
  Detector --> Working[Working observation]
  Detector --> Waiting[Waiting observation]
  Detector --> Done[Done observation]
  Working --> Status[Agent status presentation]
  Waiting --> Status
  Done --> Status
  Detector --> Lifecycle[Prompt lifecycle verification]
Loading

Reviews (1): Last reviewed commit: "test(agent-status): pin working over don..." | Re-trigger Greptile

Comment on lines 57 to +60
function asDisabledList(disabled: unknown): Iterable<unknown> | null {
if (disabled === undefined) {
return DEFAULT_DISABLED_TUI_AGENTS
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Absent defaults leak Bob

When a connected host omits disabledTuiAgents, filterEnabledMobileTuiAgents bypasses this fallback and treats the disabled set as empty, causing mobile pickers to offer Bob even though downstream creation policy considers it disabled.

Knowledge Base Used:

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in ec9e9e6d1b — filterEnabledMobileTuiAgents now routes through the same absent-means-default fallback as the pick/enabled helpers (delegating to the shared filterEnabledTuiAgents via asDisabledList), so a host that omits disabledTuiAgents keeps Bob hidden while an explicit [] still enables all. Test added in mobile-new-tab-agent-options.test.ts.

@trs-80
trs-80 force-pushed the feat/agent-output-status-profiles branch from 9118014 to 76bfe9c Compare September 1, 2026 10:08
trs-80 and others added 6 commits September 1, 2026 22:02
Rebase of stablyai#7698 (by @kiyeonjeon21) onto current main, which had drifted
1102 commits since the original merge base. Agent behavior is unchanged
from the original PR; only the landing sites moved.

Relocations forced by two refactors on main:

- stablyai#14447 dropped the src/shared/types.ts barrel, so the TuiAgent union
  member moves to src/shared/tui-agent.ts and bobDefaultDisabledMigrated
  moves to src/shared/global-settings-types.ts.
- src/main/persistence.ts is now an 8-line barrel; the three opt-in
  migration hunks move to persistence/loading-store/store.ts.
- stablyai#14728 split the oversized test files, so the Bob detection test moves
  to preflight-agent-detection.test.ts and the disabledTuiAgents tests
  move to persistence-settings-update.test.ts.
- i18n locales and agent-headless-command.ts took both sides of the
  collision with Prime Agent (stablyai#12935).

Co-Authored-By: Kiyeon Jeon <[email protected]>
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Adding IBM Bob pushed src/shared/tui-agent-config.ts to 303 effective
lines, over the 300-line max-lines cap for .ts files. AGENTS.md forbids
a max-lines suppression, so move the four type declarations into
tui-agent-config-types.ts, matching the existing *-types.ts convention
in src/shared.

Leaves the config module at 272 lines, so the next agent addition has
headroom rather than hitting the same wall.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Two unresolved review threads on stablyai#14895.

Flush the migrated Store before rewriting its state file. The opt-in
migration calls scheduleSave(), which debounces a write 1s out; that
write could land after the second fixture and clobber it, and the
orphaned timer could bleed into later tests in the file.

Disambiguate the `bob` executable. MordechaiHadad/bob is a Neovim
version manager that also installs as `bob`, and detection treated any
PATH hit as IBM Bob once a user opted in. Add an optional
detectIdentityExclusion probe, applied only to agents that declare one,
and use it to drop `bob` when the help text names Neovim.

The probe is deliberately negative and fail-open: an errored, timed-out
or unrecognized probe keeps the agent. Requiring a positive IBM Bob
signature would risk hiding real installs, since no stable identity
string for IBM Bob could be verified.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
…ection

Bob Shell 2.0.1 removed --prompt-interactive (fatal unknown option) and
deprecated --yolo (falls into headless mode). Launch `bob chat --trust`
and inject the prompt after startup, use `--auto-approve` for yolo, and
rewrite the headless classifier around the chat/run/mcp subcommands.
Detection now also requires Bob Shell's own help signature so a stray
`bob` binary that isn't the Neovim manager is not misidentified.

Co-Authored-By: Claude Fable 5 <[email protected]>
…real binary

Opt-in via ORCA_E2E_REAL_BOB=1 (needs a logged-in ~/.bob, copied into the
isolated HOME). Covers New-tab launch identity, auto-approve default args,
Create Workspace defaulting to Bob, the Settings agents pane, and tab close
stopping the process. Records the known sidebar-row gap (Bob emits no
hook/title status) rather than asserting it.

Co-Authored-By: Claude Fable 5 <[email protected]>
- Only the bobshell package script counts as a Bob executable token; an
  unrelated bob.js never positions the subcommand scan.
- e2e: assert the launched tab's agent is bob, scope the Default marker to
  the IBM Bob row, and skip the pgrep-based close test on Windows.

Co-Authored-By: Claude Fable 5 <[email protected]>
trs-80 and others added 17 commits September 1, 2026 22:02
…bledTuiAgents

Mobile treated a missing field as "nothing disabled", so an incomplete
settings payload could surface IBM Bob despite the desktop opt-in default.
Also clarify the skills-CLI key comment.

Co-Authored-By: Claude Fable 5 <[email protected]>
Copy settings.json and auth-secrets.json (owner-only) instead of the whole
~/.bob, honor ORCA_E2E_BOB_HOME, and drop the hard wait and debug dumps.

Co-Authored-By: Claude Fable 5 <[email protected]>
…xture

Both identity-probe anchors are prose and the probe fails open, so a
reworded --help on a future Bob would silently false-positive on the
Neovim bob. Recording the real 2.0.1 output (commit e6a3e508) makes a
fixture refresh either keep matching requirePattern or fail in review,
per review feedback on stablyai#14895.

Co-Authored-By: Claude Fable 5 <[email protected]>
…usion

Main renamed execCommandInWsl/execLocalPreflightCommand to their OrThrow
variants; the identity-exclusion probe callbacks already catch rejections.
filterEnabledMobileTuiAgents normalized the raw setting directly, so a host
that never sent disabledTuiAgents exposed Bob in mobile pickers while
pick/enabled helpers treated it as disabled. Route the filter through the
same absent-means-default fallback.

Co-Authored-By: Claude Fable 5 <[email protected]>
…ell path

/repo/fake-node_modules/bobshell/dist/bob.js matched the package-path check
and classified an unrelated script as IBM Bob.

Co-Authored-By: Claude Fable 5 <[email protected]>
…mand

The catalog `cmd` fed the override editor a bare `bob`, so any override
(even an absolute path) silently dropped `chat --trust`; the yolo default
`--auto-approve` then landed at top level, which Bob Shell 2.x rejects as
an unknown option. Derive it from the launch command like claude-agent-teams.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
…ion host

The identity check that keeps the Neovim `bob` out of detection ran only in
the local and WSL detectors, and it re-resolved a bare name on PATH:

- SSH relay: the wire carried no exclusion, so a same-named tool on the
  remote host was reported as IBM Bob. Serialize the exclusion onto the
  detection command (new optional field, old relays ignore it) and run the
  same fail-open probe in the relay handler.
- Local: an install-dir hit (PATH not yet hydrated) or a Windows `.cmd`
  shim made execFile ENOENT and fail open, and a `bob.exe` later on PATH
  could answer for the `bob.cmd` the shell would run. Detection now keeps
  the path it matched and probes exactly that through runProcess.
- WSL: the login-PATH walk already printed the resolved path; carry it to
  the probe instead of re-resolving.

Cache probe output per resolved path for the process lifetime (Refresh and
the test reset clear it) so repeated detections stop re-spawning `bob --help`.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
…d the matcher

Process recognition matched the package marker by substring while the
headless matcher required a segment boundary, so a look-alike path could be
recognized as Bob and then reclassified one-shot by falling back to index 1.
Move the marker table and the boundary rule into one module both consume,
and note the 2.0.2 `acp` subcommand the matcher already treats as headless.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
`promptVisible` was a hard-coded false, so its poll and annotation never
ran; remove them. The process-count test reads a system-wide pgrep, so the
file now runs serially instead of under fullyParallel. Also drop the
`expectedProcess` line that only restated the builder default.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Generalize the Command Code TUI scrape into agent output-status profiles
(working / waiting / done patterns) so hookless agents share one
pipeline. Command Code keeps its fact kinds and policy entry points
unchanged; other agents emit agent-output-{working,done,waiting} facts
carrying the agent. The IBM Bob profile keys on its spinner, composer
placeholder and approval menu, and also drives main's prompt-submission
lifecycle so Bob dispatches verify strictly and report blocked prompts.

Co-Authored-By: Claude Fable 5 <[email protected]>
… fact consumer

The fact scrape stays deferred until a side-effect consumer exists; a
separate lifecycle-only observer (IBM Bob profile) always runs so prompt
submission verification and blocked-prompt detection stay honest.

Co-Authored-By: Claude Fable 5 <[email protected]>
…n's idle

- Done-settle executors accept a waiting (approval) row as the same
  unfinished turn, so an approval that ends the turn no longer strands it.
- The skill-approval waiting pattern is line-anchored so a prompt that
  mentions it is not read as a permission stop.
- Bob is scraped by the lifecycle observer only (which now also emits its
  facts); the fact observer scans the remaining profiles. Tighter banner
  prefilter.
- Main records idle only after the same settle window the renderer uses,
  so mid-turn composer repaints don't mint idle→working transitions.
- Drop dead exports (isOutputStatusAgent, readInFlightCommandCodeTurn,
  canCommandCodeOutputOwnPane); add observer-level tests.

Co-Authored-By: Claude Fable 5 <[email protected]>
…e prompt lend to one agent

Co-Authored-By: Claude Fable 5 <[email protected]>
…oser share a frame

Every live Processing… frame from bobshell 2.0.1 also carries the idle
composer placeholder, so the idle branch is only correct because the
active check runs first; review feedback on stablyai#15936 asked to hold that
ordering in place.

Co-Authored-By: Claude Fable 5 <[email protected]>
@trs-80

trs-80 commented Sep 12, 2026

Copy link
Copy Markdown
Contributor Author

Closing as part of consolidating the IBM Bob work into a single PR, #20397.

To be precise about what that does and does not carry over: this PR's content is not in #20397. The Bob half is superseded in effect but not in code, and the generalized half is not included at all.

One real gap #20397 documents as a known limitation: Bob has no hook signal for its command-approval modal — PreToolUse fires and then Bob emits nothing until the user answers, so an approval-blocked pane reads as working. That state is only visible on screen, which is exactly what this PR's machinery solves. Worth reviving for that, on its own merits and for command-code, rather than as part of the Bob story.

@trs-80 trs-80 closed this Sep 12, 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.

2 participants