Skip to content

feat(agents): add first-class Muse Code support - #22127

Closed
nwparker wants to merge 1 commit into
mainfrom
nwparker/muse-harness-speaking-head-book
Closed

nwparker wants to merge 1 commit into
mainfrom
nwparker/muse-harness-speaking-head-book

Conversation

@nwparker

@nwparker nwparker commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​16 $\color{#cf222e}{\Huge{\mathbf{−}}}$​1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​15
Prod 32 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​155 $\color{#cf222e}{\Huge{\mathbf{−}}}$​27 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​128

What changed

Muse Code is now a first-class Orca TUI agent. Orca can detect the installed muse CLI, launch it safely, inject orchestration prompts, recognize Muse's versioned foreground process, and keep muse exec headless runs out of interactive-agent detection.

Muse launches with muse --trust-workspace and uses stdin-after-start prompt delivery. This avoids Muse interpreting task text such as exec, resume, or init as CLI subcommands. Muse readiness is recognized from its stable body screen (Muse Code, Skills: … loaded, and the ❯ composer) only after output quiesces, and approval/question screens remain actionable; the real Orca PTY evidence includes Muse's workspace trust question with Trust/Quit choices.

Desktop and mobile catalogs include the bundled Muse icon, permissions, telemetry, labels, skills discovery mapping, and localized picker entries. The implementation is cross-platform at the shared agent/config layer, including paired Windows runtimes. The awin check found Git Bash did not inherit the user-local Muse install, so the Windows launch config now bridges through PowerShell; the real remote TUI then reached Muse Code 1.3.0 successfully.

Validation

  • pnpm tc
  • Real Orca PTY on macOS: interactive Muse TUI reached readiness and returned echo: Say MUSE_ORCA_LOCAL_OK
  • Real Orca paired Windows awin: PowerShell bridge resolved muse.cmd and reached the interactive Muse 1.3.0 TUI
  • Targeted startup, process-recognition, config, idle-evidence, and wait-detection tests: 130 passing
  • Local Muse 1.3.0 muse --help and muse exec --provider echo --json evidence
  • Muse rendered request user input screen: Orca now detects the live numbered-choice menu as an interactive wait and reports it through the terminal status path; narration and stale screens are rejected

Community work reviewed

  • #18791: baseline registry and launch behavior
  • #19188: hooks/history exploration; its own notes document that Muse clears ORCA_*, so live hook attribution is not treated as reliable
  • #21494: versioned process recognition, headless filtering, and readiness behavior

Visual proof

Muse CLI help

Muse JSONL run

Muse interactive PTY

Muse workspace trust question

Cross-platform contract

Co-authored-by: homesh-dev [email protected]
Co-authored-by: Jeff Huen [email protected]
Co-authored-by: Adrien De Oliveira [email protected]
Co-authored-by: John Cusack [email protected]

Muse question detected in Orca

The final screenshot shows the live worktree changing to Needs permission while the terminal remains open, proving the numbered Muse question is surfaced through Orca's visible status path.

Live Muse question surfaced in Orca

Live CDP verification after a fresh Electron launch: a real PTY emitted the numbered Muse question transcript, and Orca rendered Needs permission, Needs attention, and an Agents → Waiting for input → Muse row.

@nwparker
nwparker force-pushed the nwparker/muse-harness-speaking-head-book branch from b4d0f5b to 949bf2a Compare September 22, 2026 02:46
@coderabbitai

coderabbitai Bot commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

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

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

Run ID: c15a8915-a5cc-40cc-82f7-cea7e1c21856

📥 Commits

Reviewing files that changed from the base of the PR and between 5abd8316efe618d96db68581b75efa09789cfd30 and 7cd9dcd.

⛔ Files ignored due to path filters (1)
  • src/shared/agent-icons/muse.png is excluded by !**/*.png
📒 Files selected for processing (2)
  • src/renderer/src/components/skills/SkillInstallAgentPicker.tsx
  • src/shared/tui-agent-selection.ts

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


📝 Walkthrough

Walkthrough

The pull request adds Muse as a supported agent. It defines Muse configuration, selection, permissions, process and headless-command recognition, skills handling, telemetry mapping, and client presentation data. It adds localized labels and favicon assets. Runtime terminal logic detects the Muse ready prompt and uses quiet prompt evidence for idle satisfaction. Tests cover Muse readiness detection and the Windows launch command.

Priority: ➖ Normal

Merge Risk: 🟡 Moderate · up to 7cd9d

The integration launches Muse with workspace trust already granted and adds Muse prompt detection to terminal completion handling. This can bypass consent or misclassify a later blocked dialog, while changed code still has static-analysis violations; resolve these issues before merging.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 16.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 18 functions across 29 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ⚠️ Warning The description provides a clear change summary, rationale, validation details, and visual proof. However, it omits the required linked issue and does not complete several template sections and checkl… Add a valid issue reference under “Linked Issue” using “Fixes #…”. Complete or explicitly mark the ELI5, Why, Testing, AI Disclosure, Review, Notes, Agent skill upstream boundary, and Checklist sections. Mark the testing and checklist items…
✅ Passed checks (3 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 describes the primary change: adding first-class Muse Code support for agents.
Full details: Description check

Explanation

The description provides a clear change summary, rationale, validation details, and visual proof. However, it omits the required linked issue and does not complete several template sections and checklist items.

Resolution

Add a valid issue reference under “Linked Issue” using “Fixes #…”. Complete or explicitly mark the ELI5, Why, Testing, AI Disclosure, Review, Notes, Agent skill upstream boundary, and Checklist sections. Mark the testing and checklist items that the validation evidence supports, or explain why they remain unchecked.

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


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 75e65420-645d-424b-8b21-8e6be606f631

📥 Commits

Reviewing files that changed from the base of the PR and between 197550c and 949bf2ab891d7b9f2ff0f04976e29e03f540e40e.

⛔ Files ignored due to path filters (1)
  • src/shared/agent-icons/muse.png is excluded by !**/*.png
📒 Files selected for processing (24)
  • mobile/src/components/mobile-agent-icon-assets.ts
  • mobile/src/tasks/mobile-tui-agents.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-headless-command.ts
  • src/shared/agent-kind.ts
  • src/shared/agent-process-recognition.ts
  • src/shared/agent-type-label.ts
  • src/shared/muse-headless-command.ts
  • src/shared/skill-install-providers.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-permissions.ts
  • src/shared/tui-agent-selection.ts
  • src/shared/tui-agent.ts

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

Comment thread src/shared/tui-agent-config.ts Outdated
Comment on lines 127 to 133
opencode2: { detectCmd: 'opencode2', launchCmd: 'opencode2 --standalone', expectedProcess: 'opencode2', promptInjectionMode: 'flag-prompt' },
opencode: {
detectCmd: 'opencode',
promptInjectionMode: 'flag-prompt',
// Why: opencode enables bracketed paste before its composer mounts; wait for the post-\x1b[?2004h show-cursor so paste lands.
draftPasteReadySignal: 'render-cursor-after-bracketed-paste'
},

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 | 🟡 Minor | ⚡ Quick win

🔎 Supported by static analysis

🏁 Script executed:

sed -n '1,230p' src/shared/tui-agent-config.ts
rg -n "draftPasteReadySignal|render-cursor-after-bracketed-paste|opencode2|quiet-render" src test* . --glob '!node_modules' --glob '!dist'

Repository: stablyai/orca

Length of output: 41962


🏁 Script executed:

#!/bin/bash
set -e
printf '%s\n' '--- agent-paste-draft.ts ---'
sed -n '1,240p' src/renderer/src/lib/agent-paste-draft.ts
printf '%s\n' '--- draft-paste-ready-scanner.ts ---'
sed -n '1,220p' src/shared/draft-paste-ready-scanner.ts
printf '%s\n' '--- startup readiness ---'
sed -n '1,180p' src/main/runtime/runtime-worktree-startup-readiness.ts
printf '%s\n' '--- readiness tests ---'
sed -n '1,180p' src/renderer/src/lib/agent-paste-draft-readiness-budget.test.ts
printf '%s\n' '--- startup tests around config ---'
sed -n '520,620p' src/shared/tui-agent-startup.test.ts
printf '%s\n' '--- focused diff ---'
git diff -- src/shared/tui-agent-config.ts
printf '%s\n' '--- focused history ---'
git log --oneline -12 -- src/shared/tui-agent-config.ts src/renderer/src/lib/agent-paste-draft.ts src/shared/draft-paste-ready-scanner.ts

Repository: stablyai/orca

Length of output: 30798


🏁 Script executed:

#!/bin/bash
set -e
printf '%s\n' '--- prompt injection and draft launch references ---'
rg -n -C 5 "buildAgentDraftLaunchPlan|promptInjectionMode|pasteDraftWhenAgentReady|pasteWorktreeStartupDraftWhenReady|startupDraft" src/shared src/renderer/src src/main --glob '*.ts' --glob '*.tsx'
printf '%s\n' '--- OpenCode 2 introduction commit summary ---'
git show --stat --oneline ee354a35d72
printf '%s\n' '--- OpenCode 2 introduction config/history ---'
git show ee354a35d72^:src/shared/tui-agent-config.ts | sed -n '105,150p'
git show ee354a35d72:src/shared/tui-agent-config.ts | sed -n '105,150p'
printf '%s\n' '--- history touching OpenCode 2 config lines ---'
git log --all -p -G "opencode2:|draftPasteReadySignal" -- src/shared/tui-agent-config.ts | sed -n '1,260p'

Repository: stablyai/orca

Length of output: 42429


🏁 Script executed:

#!/bin/bash
set -e
printf '%s\n' '--- tui-agent-startup implementation ---'
rg -n "export function buildAgentStartupPlan|export function buildAgentDraftLaunchPlan|function buildAgentStartupPlan|function buildAgentDraftLaunchPlan|promptInjectionMode|draftPromptFlag|draftPromptEnvVar" src/renderer/src/lib/tui-agent-startup.ts
sed -n '1,260p' src/renderer/src/lib/tui-agent-startup.ts
printf '%s\n' '--- startup draft dispatch ---'
rg -n -C 8 "startupDraftPaste|pasteWorktreeStartupDraftWhenReady|buildStartupForDraft|draftPrompt|startupDraft" src/main/runtime src/renderer/src/hooks/composer-state src/shared --glob '*.ts' --glob '*.tsx'

Repository: stablyai/orca

Length of output: 192


🏁 Script executed:

#!/bin/bash
set +e
printf '%s\n' '--- candidate files ---'
fd -i 'tui-agent-startup' .
printf '%s\n' '--- definitions ---'
rg -n -C 6 "buildAgentStartupPlan|buildAgentDraftLaunchPlan|promptInjectionMode|draftPromptFlag|draftPromptEnvVar" src/renderer/src/lib src/shared --glob '*.ts' --glob '*.tsx'
printf '%s\n' '--- startup draft dispatch ---'
rg -n -C 8 "startupDraftPaste|pasteWorktreeStartupDraftWhenReady|buildStartupForDraft|draftPrompt|startupDraft" src/main/runtime src/renderer/src/hooks/composer-state src/shared --glob '*.ts' --glob '*.tsx'

Repository: stablyai/orca

Length of output: 45539


🏁 Script executed:

#!/bin/bash
set -e
printf '%s\n' '--- draft launch plan ---'
sed -n '180,310p' src/shared/tui-agent-startup.ts
printf '%s\n' '--- worktree draft construction ---'
sed -n '105,190p' src/main/runtime/orca-runtime-activate-managed-worktree.ts
printf '%s\n' '--- startup draft readiness test ---'
sed -n '455,495p' src/main/runtime/orca-runtime-tests/worktree-setup-and-startup-part-03.spec.ts
printf '%s\n' '--- config current lines ---'
sed -n '120,142p' src/shared/tui-agent-config.ts

Repository: stablyai/orca

Length of output: 9883


Restore the cursor-gated readiness signal for OpenCode 2. OpenCode 2 startup drafts use the paste-after-ready path because it has no native draft flag or environment variable. Without this signal, the default 1500 ms quiet window can send the bracketed paste before the @opentui composer mounts. The draft can be lost or fail to appear as one editable prompt, especially for multiline input. Add draftPasteReadySignal: 'render-cursor-after-bracketed-paste' to the opencode2 configuration.

// Why: skip the workspace trust menu so it cannot consume the drafted task — the TUI
// would otherwise sit on the dialog while Orca pastes into it. Permission bypass
// stays configurable via the yolo default args.
launchCmd: 'muse --trust-workspace',

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.

🔒 Security & Privacy | 🛡️ Detected with Advanced Tier | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -e
printf '%s\n' '--- relevant config ---'
cat -n src/shared/tui-agent-config.ts | sed -n '260,325p'
printf '%s\n' '--- launchCmd references ---'
rg -n -C 4 'launchCmd|trust-workspace|tui-agent-config' src/shared

Repository: stablyai/orca

Length of output: 41461


🏁 Script executed:

#!/bin/bash
set -e
cat -n src/shared/tui-agent-config.ts | sed -n '260,325p'
rg -n -C 4 'launchCmd|trust-workspace|tui-agent-config' src/shared

Repository: stablyai/orca

Length of output: 41644


🏁 Script executed:

#!/bin/bash
set -e
printf '%s\n' '--- launch command assembly ---'
cat -n src/shared/tui-agent-launch-command.ts | sed -n '1,180p'
printf '%s\n' '--- startup launch use ---'
rg -n -C 8 'resolveAgentLaunchCommand|getTuiAgentLaunchCommand|launchCmd|YOLO_TUI_AGENT_ARGS|permission' src/shared/tui-agent-startup.ts src/shared/tui-agent-launch-defaults.ts src/shared/tui-agent-startup-shell.ts

Repository: stablyai/orca

Length of output: 15785


🌐 Web query:

Muse Code official documentation --trust-workspace workspace trust project-local rules skills hooks

💡 Result:

Inspection citation: inspection_cd23f4e6b4f2b5d615e8bdf848e76713

<source_evidence>

<title>Result 1</title> https://dev.meta.ai/docs/muse-code Run `muse` in any project directory to start an interactive session. On first entry Muse Code asks whether to [trust the workspace](/docs/muse-code/permissions.md#trust-scopes) and prompts you to authenticate with a browser sign-in or an API key. When you trust the workspace, Muse Code loads the project&`#39`;s skills, rules, and hooks. The default model is `muse-spark-1.2`. ... - **[Extending and automating](/docs/muse-code/extending.md)**: subagents, skills, hooks, MCP, and headless runs. <title>Result 2</title> https://ai.developer.meta.com/docs/muse-code/ Run `muse` in any project directory to start an interactive session. On first entry Muse Code asks whether to [trust the workspace](/docs/muse-code/permissions.md#trust-scopes) and prompts you to authenticate with a browser sign-in or an API key. When you trust the workspace, Muse Code loads the project&`#39`;s skills, rules, and hooks. The default model is `muse-spark-1.2`. ... - **[Extending and automating](/docs/muse-code/extending.md)**: subagents, skills, hooks, MCP, and headless runs. <title>Configuration and context - Meta Model API</title> https://dev.meta.ai/docs/muse-code/configuration - model defaults - terminal-UI preferences, including voice, reasoning display, and the terminal theme (`tui.terminal_background`, set with `/theme`) - the default permission profile (`permissions.default_profile`) - tool configuration, including workflow selection and session messaging - MCP servers - a first-class `hooks` block, plus a `managed_hooks_path` pointer (see hooks) - a `runtime_capabilities` map that toggles capabilities such as the observer agents - telemetry options ... `muse init` seeds your project&`#39`;s agent rules. It writes a single `AGENTS.md` into the current directory. It creates no other files, and does not change `settings.json`: ... How Muse Code loads instruction files. From your workspace root, Muse Code walks up to the nearest `.git` boundary. At each directory level, it checks `AGENTS.md`, `CLAUDE.md`, `.agents/AGENTS.md`, then `.claude/CLAUDE.md`; the first existing file in that order wins for that level. Precedence when guidance conflicts: ... - Project rules win over user rules. - Among project files, the deeper file wins over a shallower one. ... Your machine-wide user rules always load. Project rules load only after you trust the workspace. On an untrusted checkout, Muse Code ignores project `AGENTS.md` and `CLAUDE.md` until you trust it. ... - `--model `, `--reasoning-effort `: model and reasoning depth. - `--sandbox-network `, `--disable-sandbox`, `--disable-approval`, `--yolo`, `--trust-workspace`: permissions and sandbox. - `--approval-mode `, `--approval-judge <on|off>`: tune approvals. - `--subagent-worktree-isolation`: compatibility flag. Isolation is requested per subagent; the flag does not isolate every child. - `--workspace `: root policy-gated workspace tools at a path. - `--no-session-log`: don&`#39`;t retain the session event log. ... Memory loads in untrusted ... Muse Code reads committed project memory into the model&`#39`;s context even in an untrusted workspace. Skills, rules, and hooks differ: they load only after you trust it. Treat a repo&`#39`;s `MEMORY.md` as a prompt-injection surface, and review it on checkouts you don&`#39`;t control. <title>Result 4</title> https://dev.meta.ai/docs/muse-code/permissions > [!NOTE] Guardrails are on by default > Both guardrails are on unless you opt out. `muse --yolo` turns off approval and the sandbox, and instructs the harness to trust the workspace for the run. Use it only in an already-isolated environment such as a disposable CI container. ... ## Grant trust at the right scope {`#trust-scopes`} ... When a stage holds, you choose how much trust to grant: ... - **Allow once**: run this stage one time only. Muse Code saves nothing. - **Always allow in this workspace**: save a rule for this command&`#39`;s prefix, scoped to this workspace root. The rule does not apply to other projects, and it does not cover a different command. - **Reject**: deny the whole command. ... interpreter prefix such as ` ... `, `bash ... `node` ... interpreter is arbitrary code ... The first time you open a workspace, Muse Code asks whether to trust it. When you trust a workspace, Muse Code loads its project-local skills, rules, and hooks. Muse Code remembers this trust for each workspace root. ... remove the guardrails: ... - **`--yolo`**: disable approval and the sandbox, and trust the workspace, for this run. - **`--disable-approval`**: keep the sandbox, but skip approval prompts. - **`--disable-sandbox`**: keep approval, but skip the sandbox. This flag also removes workspace confinement from the file tools, so `write_file` and `edit_file` can write anywhere on the filesystem. It also forces the network to full egress and overrides `--sandbox-network`. ... > [!WARNING] Use --yolo only when isolated > Use `--yolo` only where you already trust both the environment and the code, such as a disposable CI container. Never use it on a workstation with access to real credentials or infrastructure. `--yolo` removes both layers and trusts the workspace, so it loads the checkout&`#39`;s `AGENTS.md`, rules, and skills. On a pull-request or fork checkout, those files are attacker-controlled instructions. <title>Result 5</title> https://dev.meta.ai/docs/muse-code/permissions.md > [!NOTE] Guardrails are on by default > Both guardrails are on unless you opt out. `muse --yolo` turns off approval and the sandbox, and instructs the harness to trust the workspace for the run. Use it only in an already-isolated environment such as a disposable CI container. ... ## Grant trust at the right scope {`#trust-scopes`} ... When a stage holds, you choose how much trust to grant: ... - **Allow once**: run this stage one time only. Muse Code saves nothing. - **Always allow in this workspace**: save a rule for this command&`#39`;s prefix, scoped to this workspace root. The rule does not apply to other projects, and it does not cover a different command. - **Reject**: deny the whole command. ... by specificity. A deny rule always overrides an ... rule, whatever the specificity. You cannot save ... interpreter prefix such as `python`, `bash`, or `node` as a broad allow, ... everything after the interpreter is arbitrary code ... The first time you open a workspace, Muse Code asks whether to trust it. When you trust a workspace, Muse Code loads its project-local skills, rules, and hooks. Muse Code remembers this trust for each workspace root. ... - **`--yolo`**: disable approval and the sandbox, and trust the workspace, for this run. - **`--disable-approval`**: keep the sandbox, but skip approval prompts. - **`--disable-sandbox`**: keep approval, but skip the sandbox. This flag also removes workspace confinement from the file tools, so `write_file` and `edit_file` can write anywhere on the filesystem. It also forces the network to full egress and overrides `--sandbox-network`. ... > [!WARNING] Use --yolo only when isolated > Use `--yolo` only where you already trust both the environment and the code, such as a disposable CI container. Never use it on a workstation with access to real credentials or infrastructure. `--yolo` removes both layers and trusts the workspace, so it loads the checkout&`#39`;s `AGENTS.md`, rules, and skills. On a pull-request or fork checkout, those files are attacker-controlled instructions.

Citations:


Security Misconfiguration

Reachability: External
Exploitability: Moderate
CWE: CWE-16

Do not trust every workspace by default.

muse --trust-workspace skips Muse's workspace trust prompt and loads project-local skills, rules, and hooks. An attacker can place these files in a repository and influence a Muse session when a user opens that repository through Orca. This trust boundary is separate from --yolo.

Remove this flag from the default launch command. Preserve the prompt flow, or add it only after explicit user consent.

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

Caution

This PR breaks quick-workspace-agent-selection.test.ts and silently reverts three unrelated behaviors that exist on main — opencode2's paste-readiness signal and display label, and freebuff's mobile icon. They look like stale-branch rebase casualties; please rebase on current main and restore them before merging.

Reviewed changes

  • Muse added to the agent registry — muse is threaded through tui-agent.ts, agent-kind.ts, AGENT_KIND_VALUES, tui-agent-display-names.ts, agent-type-label.ts, agent-status.ts, and tui-agent-permissions.ts (--yolo), and configured in tui-agent-config.ts as muse --trust-workspace with stdin-after-start injection.
  • Muse process and headless recognition — agent-process-recognition.ts recognizes a muse-bin-* foreground binary, and the new muse-headless-command.ts treats an exec token after the binary as a headless one-shot.
  • Catalog, skills, and mobile surfaces — agent-catalog.tsx, agent-favicon-assets.ts, both mobile maps, and agent-icons/muse.png; skill-install-providers.ts places Muse on the canonical .agents/skills root; skills-cli-agent-keys.ts maps it to null.
  • Unrelated edits folded in — the opencode2/freebuff removals and the auto-pick reordering described inline.

ℹ️ No test coverage for the new Muse behavior

Muse introduces a versioned-binary prefix, a headless exec matcher, and a --trust-workspace launch, but the PR adds no tests and no existing suite exercises muse (agent-process-recognition.test.ts and tui-agent-startup.test.ts have no Muse case). A case pinning muse --trust-workspace → recognized and muse exec → headless would guard the two new matchers; without it the muse-bin- spelling and the exec scan are asserted, not demonstrated.

ℹ️ Nitpicks

  • isMuseHeadlessOneShotCommand (muse-headless-command.ts:8) matches exec at any position after the binary, so a value-taking flag whose value is exec (e.g. muse --model exec) would classify a live TUI as headless. Low risk unless Muse has such a flag — restricting the match to the subcommand position would remove the ambiguity.
  • The submitLineSettleMsPerLine doc comment and antigravity's "Why" rationale (tui-agent-config.ts) were dropped while the 45 value stayed; comment-only, but the reasoning is no longer recoverable.

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

Comment thread src/shared/tui-agent-selection.ts Resolved
Comment thread src/shared/tui-agent-config.ts Resolved
Comment thread src/shared/agent-type-label.ts Resolved
Comment thread src/renderer/src/i18n/locales/en.json Resolved
@nwparker
nwparker force-pushed the nwparker/muse-harness-speaking-head-book branch 4 times, most recently from c96d4b9 to 10e289f Compare September 22, 2026 03:27

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

Run ID: b57b8207-2ab2-49fc-808f-be51f3cbca1c

📥 Commits

Reviewing files that changed from the base of the PR and between 949bf2ab891d7b9f2ff0f04976e29e03f540e40e and 10e289feea70ea5f82f5ec22d769ec70b9886b4c.

⛔ Files ignored due to path filters (1)
  • src/shared/agent-icons/muse.png is excluded by !**/*.png
📒 Files selected for processing (8)
  • src/main/runtime/orca-runtime-resolve-exit-waiters.ts
  • src/main/runtime/runtime-terminal-idle-polls.ts
  • src/main/runtime/runtime-terminal-wait.ts
  • src/main/runtime/terminal-wait-detection.test.ts
  • src/main/runtime/terminal-wait-detection.ts
  • src/main/runtime/tui-idle-evidence.ts
  • src/shared/tui-agent-config.test.ts
  • src/shared/tui-agent-config.ts

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

Comment on lines +69 to +74
export function isMuseReadyPromptPreview(preview: string): boolean {
const normalized = preview.toLowerCase()
const index = normalized.lastIndexOf('muse code')
if (index < 0) return false
const segment = normalized.slice(index)
return segment.includes('skills:') && segment.includes('loaded') && segment.includes('❯')

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:

sed -n '1,130p' src/main/runtime/terminal-wait-detection.ts
sed -n '80,135p' src/main/runtime/orca-runtime-resolve-exit-waiters.ts
sed -n '180,220p' src/main/runtime/orca-runtime-resolve-exit-waiters.ts
rg -n "findTerminalWaitBlockedSignal|detectTerminalWaitBlockedReason|isKnownReadyPromptPreview|isMuseReadyPromptPreview" src/main/runtime

Repository: stablyai/orca

Length of output: 18985


🏁 Script executed:

sed -n '230,390p' src/main/runtime/terminal-wait-detection.ts
rg -n "function isTuiIdleSatisfied|isTuiIdleSatisfied\\(|resolvePtyTuiIdleWaiters|resolveLeafTuiIdleWaiters|resolveWaiter|tui-idle|isAgentSettledForDelivery|deliver" src/main/runtime --glob '*.ts'
sed -n '1,250p' src/main/runtime/orca-runtime-resolve-exit-waiters.ts
sed -n '1,260p' src/main/runtime/runtime-terminal-idle-polls.ts

Repository: stablyai/orca

Length of output: 45507


🏁 Script executed:

sed -n '1,240p' src/main/runtime/orca-runtime-resolve-exit-waiters.ts; rg -n "export function isTuiIdleSatisfied|function isTuiIdleSatisfied|isAgentSettledForDelivery|readMuseReadyBodyEvidence|readPositiveBodyEvidence" src/main/runtime --glob '*.ts'; sed -n '235,330p' src/main/runtime/terminal-wait-detection.ts

Repository: stablyai/orca

Length of output: 17434


🏁 Script executed:

sed -n '100,175p' src/main/runtime/tui-idle-evidence.ts
sed -n '55,95p' src/main/runtime/orchestration/mailbox-pointer-delivery.ts
sed -n '1,90p' src/main/runtime/orchestration/mailbox-pointer-delivery-contract.ts
sed -n '1,35p' src/main/runtime/terminal-wait-detection.ts
sed -n '245,340p' src/main/runtime/terminal-wait-detection.ts

Repository: stablyai/orca

Length of output: 12276


Reject Muse readiness when a later blocked signal exists.

isTuiIdleSatisfied accepts quiet Muse body evidence without checking blocked state. The event-driven waiter and mailbox delivery paths call it directly. A retained Muse banner followed by a trust or permission signal can therefore settle tui-idle and allow mailbox delivery into the dialog.

Match isKnownReadyPromptPreview:

  const blockedSignal = findTerminalWaitBlockedSignal(normalized)
  if (blockedSignal !== null && blockedSignal.index > index) {
    return false
  }
  return segment.includes('skills:') && segment.includes('loaded') && segment.includes('❯')

Comment thread src/main/runtime/tui-idle-evidence.ts Outdated
Comment on lines +135 to +158
@@ -134,5 +147,14 @@ export function isTuiIdleSatisfied(input: TuiIdleSatisfactionInput): boolean {
if (hasFreshWorkingFirstPartyStatus(input.firstPartyStatus)) {
return false
}
if (
hasQuietMuseReadyPrompt(
input.record,
input.agent,
input.readMuseReadyBodyEvidence,
input.quiescenceMs
)
)
return true

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.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

🔎 Supported by static analysis

🏁 Script executed:

rg -n '"lint"|eslint|curly' package.json pnpm-workspace.yaml eslint.config.* .eslintrc* config src --glob '!node_modules'
sed -n '120,165p' src/main/runtime/tui-idle-evidence.ts

Repository: stablyai/orca

Length of output: 45546


🏁 Script executed:

#!/bin/bash
set -eu

printf '%s\n' '--- candidate config and package files ---'
git ls-files | rg '(^|/)(package\.json|pnpm-workspace\.yaml|eslint\.config\..*|\.eslintrc.*|oxlint\.json.*|\.oxlintrc.*|lint-staged.*|\.lintstagedrc.*|biome\.json.*)$' | sort

printf '%s\n' '--- package scripts and lint-related config references ---'
python3 - <<'PY'
import json
from pathlib import Path
p = Path('package.json')
data = json.loads(p.read_text())
print('package.json scripts:')
for k, v in data.get('scripts', {}).items():
    if 'lint' in k.lower() or 'eslint' in str(v).lower() or 'oxlint' in str(v).lower():
        print(f'{k}: {v}')
print('package.json devDependencies lint tools:')
for section in ('dependencies', 'devDependencies', 'optionalDependencies'):
    for k, v in data.get(section, {}).items():
        if 'lint' in k.lower() or 'eslint' in k.lower():
            print(f'{section}.{k}: {v}')
PY

for f in $(git ls-files | rg '(^|/)(eslint\.config\..*|\.eslintrc.*|oxlint\.json.*|\.oxlintrc.*|package\.json)$' | sort); do
  case "$f" in
    package.json) ;;
    *) printf '%s\n' "--- $f ---"; sed -n '1,240p' "$f" ;;
  esac
done

printf '%s\n' '--- target file directives and cited lines ---'
rg -n -C 3 'eslint|oxlint|if \(' src/main/runtime/tui-idle-evidence.ts

Repository: stablyai/orca

Length of output: 30745


🏁 Script executed:

#!/bin/bash
set -eu
git ls-files | rg '(^|/)(package\.json|pnpm-workspace\.yaml|eslint\.config\..*|\.eslintrc.*|oxlint\.json.*|\.oxlintrc.*|lint-staged.*|\.lintstagedrc.*|biome\.json.*)$' | sort
printf '%s\n' '--- package lint scripts ---'
python3 - <<'PY'
import json
from pathlib import Path
data=json.loads(Path('package.json').read_text())
for k,v in data.get('scripts',{}).items():
    if 'lint' in k.lower() or 'eslint' in str(v).lower() or 'oxlint' in str(v).lower():
        print(f'{k}: {v}')
PY
printf '%s\n' '--- config contents ---'
while IFS= read -r f; do
  case "$f" in package.json|pnpm-workspace.yaml) continue;; esac
  printf '%s\n' "--- $f ---"
  sed -n '1,260p' "$f"
done < <(git ls-files | rg '(^|/)(eslint\.config\..*|\.eslintrc.*|oxlint\.json.*|\.oxlintrc.*|lint-staged.*|\.lintstagedrc.*|biome\.json.*)$' | sort)
printf '%s\n' '--- target directives and conditionals ---'
rg -n -C 3 'eslint|oxlint|if \(' src/main/runtime/tui-idle-evidence.ts

Repository: stablyai/orca

Length of output: 2503


🏁 Script executed:

printf '%s\n' '--- files ---'
git ls-files | rg '(^|/)(package\.json|eslint\.config\..*|\.eslintrc.*|oxlint\.json.*|\.oxlintrc.*)$' | sort
printf '%s\n' '--- scripts ---'
node -e "const p=require('./package.json'); for (const [k,v] of Object.entries(p.scripts||{})) if (/lint|eslint|oxlint/i.test(k+' '+v)) console.log(k+': '+v)"
printf '%s\n' '--- config rule references ---'
rg -n -C 4 'curly|eslint|oxlint|src/main|main/runtime' eslint.config.* .eslintrc* oxlint.json* .oxlintrc* package.json 2>/dev/null || true
printf '%s\n' '--- target ---'
sed -n '125,165p' src/main/runtime/tui-idle-evidence.ts

Repository: stablyai/orca

Length of output: 13311


Add braces to satisfy the enforced Oxlint curly rule.

The repository runs Oxlint, not ESLint. The root configuration enables curly as an error, and no exception excludes this file. These three changed if statements can fail the lint workflow until their bodies use braces.

Proposed fix
-  if (agent !== null && agent !== undefined && agent !== 'muse') return false
-  if (!readBody?.() || record.lastOutputAt === null) return false
+  if (agent !== null && agent !== undefined && agent !== 'muse') {
+    return false
+  }
+  if (!readBody?.() || record.lastOutputAt === null) {
+    return false
+  }
...
-  )
-    return true
+  ) {
+    return true
+  }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if (agent !== null && agent !== undefined && agent !== 'muse') {
return false
}
if (!readBody?.() || record.lastOutputAt === null) {
return false
}
return Date.now() - record.lastOutputAt >= quiescenceMs
}
/** The one place the three tiers are combined; every satisfaction site routes here. */
export function isTuiIdleSatisfied(input: TuiIdleSatisfactionInput): boolean {
// Why the title before the body: both are tier 1, so either settles, but the title is a
// memoized lookup and the body is a fresh multi-KB scan. Same verdict, cheaper order.
if (hasExplicitIdleTitle(input.record, input.rendererTitle) || input.readPositiveBodyEvidence()) {
return true
}
if (hasFreshWorkingFirstPartyStatus(input.firstPartyStatus)) {
return false
}
if (
hasQuietMuseReadyPrompt(
input.record,
input.agent,
input.readMuseReadyBodyEvidence,
input.quiescenceMs
)
) {
return true
}
🧰 Tools
🪛 GitHub Check: static analysis

[failure] 158-158: eslint(curly)
src/main/runtime/tui-idle-evidence.ts:158:5: Expected { after 'if' condition.


[failure] 136-136: eslint(curly)
src/main/runtime/tui-idle-evidence.ts:136:54: Expected { after 'if' condition.


[failure] 135-135: eslint(curly)
src/main/runtime/tui-idle-evidence.ts:135:66: Expected { after 'if' condition.

@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

Two things to settle before merge: the new Muse readiness matcher can satisfy a tui-idle wait on a pane that is actually blocked (it has no captured transcript and no blocked-signal veto, and two call sites reach it without checking blocked reasons), and the Windows launch bridge's stated mechanism contradicts how Windows hands PATH to child processes. Details inline.

Reviewed changes

Since the prior pullfrog review (949bf2a) the branch was rewritten:

  • Added a runtime Muse readiness path — isMuseReadyPromptPreview plus readMuseReadyBodyEvidence/hasQuietMuseReadyPrompt, wired through tui-idle-evidence.ts into five of six isTuiIdleSatisfied call sites, with a unit test.
  • Added a Windows launch bridge — muse now resolves to powershell.exe -NoProfile -Command muse --trust-workspace on win32 via launchCmdByPlatform, with a config test.
  • Dropped the mobile-catalog edits — the branch no longer modifies the mobile icon maps, so freebuff keeps its main entries and the earlier duplicate-key problem is gone.
  • Reverted the unrelated opencode2 regressions — the OpenCode 2 label and draftPasteReadySignal are restored with their comments.

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

Comment on lines +69 to +75
export function isMuseReadyPromptPreview(preview: string): boolean {
const normalized = preview.toLowerCase()
const index = normalized.lastIndexOf('muse code')
if (index < 0) return false
const segment = normalized.slice(index)
return segment.includes('skills:') && segment.includes('loaded') && segment.includes('❯')
}

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.

The Muse matcher never consults the blocked-signal scan that isKnownReadyPromptPreview uses, and it scans the whole tail from the last muse code with no live-window bound. Two orca-runtime-resolve-exit-waiters.ts sites (isTuiIdleSatisfiedForLeaf/ForPty) reach isTuiIdleSatisfied with this thunk without ever calling detectTerminalWaitBlockedReason, and one of them is the mailbox delivery gate that injects keystrokes — so a Muse pane parked on an actionable approval/question dialog that still shows the banner and ❯ can satisfy the wait. Please capture a real Muse dialog transcript (per docs/reference/agent-pty-transcript-capture.md) and add the blocked-signal veto and live-window bound the other readiness matchers use.

Technical details
# Muse readiness can settle a blocked pane

## Affected sites
- `src/main/runtime/terminal-wait-detection.ts:69-75` — `isMuseReadyPromptPreview` is unbounded and has no blocked veto
- `src/main/runtime/tui-idle-evidence.ts:129-138,150-158` — evaluated after the fresh-status veto, before title-idle; `agent == null` is also allowed
- `src/main/runtime/orca-runtime-resolve-exit-waiters.ts:106-123,195-211` — call `isTuiIdleSatisfied` with the Muse thunk and never scan for a blocked reason
- `src/main/runtime/orca-runtime-resolve-exit-waiters.ts:190-193` (`isAgentSettledForDelivery`) — delivery commit gate

## Required outcome
- A Muse pane owning an actionable dialog must not satisfy `tui-idle` or the delivery gate.
- The matcher is backed by a captured PTY transcript, not hand-written strings.

## Suggested approach
- Mirror `isKnownReadyPromptPreview`: return false when `findTerminalWaitBlockedSignal` appears after the ready index, and bound the scan to the live tail window.

## Open questions for the human
- Does a real Muse approval/question dialog leave `muse code` + `skills:` + `loaded` + `❯` in the tail? A transcript settles this.

@@ -59,6 +60,7 @@ export class RuntimeTerminalWait {
record: leaf,
rendererTitle: leaf.paneTitle ?? this.deps.getTabTitle(leaf.tabId),
readPositiveBodyEvidence: () => isKnownReadyPromptPreview(waitText),
readMuseReadyBodyEvidence: () => isMuseReadyPromptPreview(waitText),

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.

readMuseReadyBodyEvidence was added here but not to ptySatisfied (:47), the only one of the six isTuiIdleSatisfied sites still missing it. The comment above these helpers says every satisfaction site must rank the same way, and a live-pty terminal.wait currently won't settle on the immediate check for Muse.

Technical details
# Missing Muse evidence at the live-pty satisfaction site

## Affected sites
- `src/main/runtime/runtime-terminal-wait.ts:47-55` — `ptySatisfied` omits `readMuseReadyBodyEvidence`
- `src/main/runtime/runtime-terminal-wait.ts:58-67` — `leafSatisfied` has it

## Required outcome
- All six `isTuiIdleSatisfied` sites rank Muse evidence identically.

## Suggested approach
- Add `readMuseReadyBodyEvidence: () => isMuseReadyPromptPreview(waitText)` to `ptySatisfied`.

Comment on lines +314 to +317
// Why: the Windows installer places muse.cmd under LocalAppData, which Git Bash
// panes do not inherit from the Windows user PATH. PowerShell resolves that user
// install path and preserves the same interactive PTY stdin contract.
launchCmdByPlatform: { win32: 'powershell.exe -NoProfile -Command muse --trust-workspace' },

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.

The rationale here doesn't hold: a powershell.exe started from the pane inherits the pane's environment block, and with -NoProfile it never re-reads the user PATH from the registry — so it cannot recover a Muse install dir the pane lacked. It also adds a per-pane interpreter hop that docs/reference/windows-edr-posture.md explicitly asks callers to shorten. Please confirm what actually made muse resolve on Windows, and drop the bridge if the environment block is the real fix.

Technical details
# Windows Muse launch bridge rationale

## Affected sites
- `src/shared/tui-agent-config.ts:314-317` — bridge plus its `Why:` comment
- `src/shared/tui-agent-config.test.ts:21-25` — pins the literal string only, no runtime coverage
- `docs/reference/windows-edr-posture.md:397` — "shorten the interpreter chain"

## Required outcome
- The reason Windows needed the bridge is stated accurately, or the bridge is replaced by the actual fix (PATH augmentation / user-PATH registry read, matching existing Windows patterns).

## Open questions for the human
- What made `muse` resolve on Windows in the awin run? A child `powershell.exe` inherits the caller's environment, so if Git Bash's PATH lacked the Muse dir, so did the PowerShell child.

Comment thread src/shared/tui-agent-selection.ts Outdated
@@ -41,7 +41,8 @@ export const TUI_AGENT_AUTO_PICK_ORDER = [
'rovo',
'hermes',
'devin',
'openclaw'
'openclaw',
'muse'

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.

muse added here flows into MOBILE_AGENT_CATALOG (mobile/src/tasks/mobile-agent-catalog.ts maps over this order), but neither MOBILE_AGENT_ICON_ASSETS nor MOBILE_TUI_AGENT_FAVICON_DOMAINS has a muse entry, so mobile renders the letter fallback while desktop ships muse.png. The PR description says the mobile catalog includes the bundled Muse icon; add the mobile entries.

Technical details
# Muse has no mobile icon

## Affected sites
- `src/shared/tui-agent-selection.ts:45` — `'muse'` added to `TUI_AGENT_AUTO_PICK_ORDER`
- `mobile/src/components/mobile-agent-icon-assets.ts:12-44` — no `muse` key
- `mobile/src/tasks/mobile-tui-agents.ts:16-49` — no `muse` favicon domain

## Required outcome
- Mobile renders the bundled `muse.png` (or a favicon domain), matching desktop and the PR description.

@nwparker
nwparker force-pushed the nwparker/muse-harness-speaking-head-book branch 2 times, most recently from 5dd334a to 5abd831 Compare September 22, 2026 04:03

@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

Since the prior pullfrog review (10e289f), the branch changed only the locale catalogs (5dd334a → 5abd831):

  • Relocated the muse_label translation key into lib.agent.catalog — moved out of the JSON root and into the catalog namespace across en/es/fr/ja/ko/zh, so translate('auto.lib.agent.catalog.muse_label', 'Muse') now resolves from the catalog instead of relying on its English fallback.

Earlier threads — Muse readiness settling a blocked pane, the ptySatisfied evidence-parity gap, the Windows launch bridge, the auto-pick/catalog order sync, and the missing mobile icon — remain open and are unchanged by this delta.

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

@nwparker
nwparker force-pushed the nwparker/muse-harness-speaking-head-book branch from 5abd831 to 7cd9dcd Compare September 22, 2026 04:23

@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 critical issues — the prior auto-pick desync is fixed; one minor test gap inline.

Reviewed changes

Since the prior pullfrog review (5abd831), two files changed:

  • Restored TUI_AGENT_AUTO_PICK_ORDER to the desktop catalog order — moved opencode2 ahead of opencode and placed muse before openclaw, so the catalog-sync assertion in quick-workspace-agent-selection.test.ts passes again.
  • Hid the Muse canonical entry unless Muse is detected — SkillInstallAgentPicker now derives a visibleCanonical list that drops muse from the always-included chips, the canonical header gate, and the picker summary when detectedAgents excludes it.

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

Comment on lines +82 to +84
const visibleCanonical = canonical.filter(
(provider) => provider.id !== 'muse' || installed === null || installed.has(provider.id)
)

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 conditional is the only new behavior in the delta and no test covers it. SkillInstallAgentPicker.test.tsx renders detectedAgents={['codex']} but never asserts Muse's absence, so removing this filter would not fail any test. A case that queries for Muse with and without 'muse' in detectedAgents would pin the intended hiding.

@nwparker
nwparker force-pushed the nwparker/muse-harness-speaking-head-book branch from 7cd9dcd to 1c8fc1a Compare September 22, 2026 04:39

@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 critical issues — two minor suggestions inline.

Reviewed changes

Since the prior pullfrog review (7cd9dcd), one commit (1c8fc1ad) added a live Muse interactive-question detector:

  • Added findMuseInteractiveQuestionIndex — a new src/shared/muse-interactive-question.ts that reports the position of a live Request user input menu when at least two numbered options and enter to select follow it, and returns null when muse code appears after the question.
  • Wired it into the blocked-signal scan — terminal-wait-detection.ts now pushes an agent-interactive-prompt candidate from the Muse matcher, and TERMINAL_WAIT_BLOCKED_SENTINEL_RE gained request user input / enter to select.
  • Added coverage — a raw-pane visibility test asserts agentWait, getTerminalInteractiveWait, and permission status for a Muse question; terminal-wait-detection.test.ts adds the positive menu case plus narration and stale-ready negatives. The three touched suites pass locally (96 tests).

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

return null
}
const prompt = normalized.slice(questionIndex)
if (prompt.includes('muse code')) {

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 veto is the one load-bearing assumption in the new rule and it has no captured screen behind it — the repo's own docs/reference/agent-pty-transcript-capture.md (and AGENTS.md) require a screen-reading rule to be pinned to a recorded PTY transcript. If Muse repaints its Muse Code / Skills: … loaded banner (or the ❯ composer) below an open menu, prompt contains muse code, the matcher returns null, and isMuseReadyPromptPreview can still report the same pane ready — so the detector would go silent exactly on the live question it exists to flag. A committed muse-*.txt capture of the real question screen settles the ordering.

Technical details
# Muse live-question veto relies on unverified screen ordering

## Affected sites
- `src/shared/muse-interactive-question.ts:10` — `prompt.includes('muse code')` veto
- `src/main/runtime/terminal-wait-detection.ts:354-357` — candidate push; no agent gate
- `src/main/runtime/tui-idle-evidence.ts` — `hasQuietMuseReadyPrompt`/`isTuiIdleSatisfied` (readiness, unchanged by this delta)
- `src/main/runtime/orca-runtime-resolve-exit-waiters.ts:106-123,190-211` — sites that reach `isTuiIdleSatisfied` without a blocked scan

## Required outcome
- Evidence (a captured transcript) showing whether a live Muse question screen keeps the ready banner/composer in the tail, and the matcher / readiness veto behaving correctly for that shape.

## Suggested approach
- Record with `config/scripts/capture-agent-pty-transcript.mjs`, commit the fixture + `.meta.json`, and drive the new test through `createTranscriptPane` on the raw bytes rather than the hand-written `MUSE_USER_INPUT` array.


export const TERMINAL_WAIT_BLOCKED_SENTINEL_RE =
/update available|choose working directory to|codex just got an upgrade|hooks need review|do you trust|trust this|trusted workspace|press enter to (?:confirm|continue|view|insert)|press t to trust|permission required|requires permission|allow once|allow always|run this command\?/i
/update available|choose working directory to|codex just got an upgrade|hooks need review|do you trust|trust this|trusted workspace|request user input|enter to select|press enter to (?:confirm|continue|view|insert)|press t to trust|permission required|requires permission|allow once|allow always|run this command\?/i

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.

enter to select is redundant here: findMuseInteractiveQuestionIndex already returns null unless request user input is present, and that term alone makes the sentinel match. As a global alternation it is also very broad (any menu that prints "Enter to select" now makes the whole retained tail eligible for the full blocked-signal scan, via terminal-tail-sentinel-index.ts), so consider dropping it and keeping only request user input.

@nwparker
nwparker force-pushed the nwparker/muse-harness-speaking-head-book branch from 1c8fc1a to 9d6d728 Compare September 22, 2026 04:53
Co-authored-by: homesh-dev <[email protected]>
Co-authored-by: Jeff Huen <[email protected]>
Co-authored-by: Adrien De Oliveira <[email protected]>
Co-authored-by: John Cusack <[email protected]>
@nwparker
nwparker force-pushed the nwparker/muse-harness-speaking-head-book branch from 9d6d728 to c7acc0b Compare September 22, 2026 05:04

@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

The new inferred-status emission writes a waiting row for a Muse question, but nothing clears it once the question is answered — the pane keeps reading "Needs permission" while it works again. Details inline.

Reviewed changes

Since the prior pullfrog review (1c8fc1ad), the only net change is the Muse interactive-question status emission:

  • Emitted an inferred waiting status for a live Muse question — orca-runtime-schedule-wait-blocked-check.ts now calls emitInferredAgentStatusEvent when a Muse pane's blocked signal is the live numbered question, publishing { state: 'waiting', agentType: 'muse', toolName: 'Request user input' } into the hook-server status store so the sidebar surfaces "Needs permission".
  • Added the inference helper — orca-runtime-create-terminal-side-effect-command-code-detector.ts gains emitInferredAgentStatusEvent, a thin wrapper over emitTerminalAgentStatusEvents that synthesizes a single-payload chunk.

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

Comment on lines +82 to +92
if (
nextWaitState.signal?.reason === 'agent-interactive-prompt' &&
(pty.launchAgent === 'muse' || pty.foregroundAgent === 'muse') &&
findMuseInteractiveQuestionIndex(nextWaitState.waitText.toLowerCase()) !== null
) {
this.emitInferredAgentStatusEvent(ptyId, {
state: 'waiting',
prompt: nextWaitState.waitText,
agentType: 'muse',
toolName: 'Request user input'
})

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.

When the user answers the Muse question and the menu disappears, nothing emits a subsequent non-waiting transition for that pane, so the row this writes stays waiting (projected as permission) until the pane's process is certified ended/replaced or readers display-decay it after 30 minutes — the sidebar and getTerminalAgentStatus both keep reporting "Needs permission" on a pane that is working again. The only answer-clearing paths that exist (inferQuestionAnswered/inferInterrupt and the renderer's agent-question-answered-inference) are gated to agentType === 'claude', and Muse emits no hooks and no OSC 9999, so none of them can clear this row.

Technical details
# Muse inference row has no clearing transition

## Affected sites
- `src/main/runtime/orca-runtime-schedule-wait-blocked-check.ts:82-92` — emission is write-once; only ever sets `state: 'waiting'`
- `src/main/runtime/orca-runtime-create-terminal-side-effect-command-code-detector.ts:147-153` — `emitTerminalAgentStatusEvents` also sets `agentPromptLifecycleByPtyId` to `permission`, so `getTerminalAgentStatus` keeps returning `permission` after `detectTerminalWaitBlockedReason(waitText)` goes null (see `resolveAuthoritativeTerminalWaitPermission` at `orca-runtime-resolve-authoritative-terminal-wait-permission.ts:25-50`)
- `src/main/agent-hooks/server/server-status-inference.ts:141-148,55-62` — both clearers reject non-Claude agents
- `src/renderer/src/components/terminal-pane/agent-question-answered-inference.ts:31-39` — also `agentType === 'claude'` only
- `src/main/runtime/orca-runtime-apply-tracked-pty-title.ts:28` — title lifecycle writes pty records, never the hook-server store

## Required outcome
- A Muse pane that answers the question (or otherwise resumes) must stop reading `waiting`/`permission` in both the status store and `getTerminalAgentStatus`.
- A test drives the post-answer screen (menu gone, Muse working/idle) and asserts the row no longer reports a wait/permission, so the new emission path has coverage of its own — the current `terminal-interactive-wait-visibility.test.ts` case is satisfied by `pty.waitBlockedAt` alone and would pass without this emission.

## Open questions for the human
- Is there a Muse signal (title, output quiescence, ready screen) the runtime can key a clearing transition on? `isMuseReadyPromptPreview` already identifies the resumed ready screen.
- If the row is meant to persist by design, set `prompt` to the question text rather than the full wait screen (the `prompt` field is documented as the user's prompt, and this bypasses `parseAgentStatusPayload` normalization).

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

ℹ️ The follow-up commit drops the Muse pane-agent guard from the new status emission; one minor note inline.

Reviewed changes

Since the prior pullfrog review (9d6d7283), one line changed:

  • Removed the pty.launchAgent === 'muse' || pty.foregroundAgent === 'muse' guard — the inferred waiting emission now fires for any pane whose blocked signal matches the Muse question signature, while still stamping agentType: 'muse'.

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

this.recordAgentPromptPermissionObservation(ptyId)
if (
nextWaitState.signal?.reason === 'agent-interactive-prompt' &&
findMuseInteractiveQuestionIndex(nextWaitState.waitText.toLowerCase()) !== null

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.

With the pane-agent guard gone, the only thing asserting the pane is Muse is the screen matcher, yet the emitted row hardcodes agentType: 'muse'. The signature is specific enough that false positives are unlikely, but a non-Muse pane that briefly paints those strings now gets a row labelled Muse (and, per the still-open clearing concern, it would stick). If the guard was dropped because foregroundAgent is not populated yet when the question appears, consider deriving the type from pty.launchAgent ?? pty.foregroundAgent instead of dropping the identity check outright.

Technical details
# Emission no longer backs its `agentType` with pane identity

## Affected sites
- `src/main/runtime/orca-runtime-schedule-wait-blocked-check.ts:83-90` — condition is now `reason === 'agent-interactive-prompt' && findMuseInteractiveQuestionIndex(waitText) !== null`, then writes `agentType: 'muse'`

## Required outcome
- The row's `agentType` matches the pane's actual agent, or the condition proves the pane owns a Muse process.

## Open questions for the human
- Was the guard removed because `launchAgent`/`foregroundAgent` is unset when the question first paints? If so, deriving the emitted `agentType` from the pane (falling back to `'muse'` only when the matcher matched) keeps the label honest without reintroducing the false negative.

@homesh-dev

Copy link
Copy Markdown

Update from the latest #19188 testing: the statement that Muse hook attribution is unreliable is accurate for Muse 1.0.3, but no longer accurate for Muse 1.3.0. The new managed_hooks_env_vars setting successfully passes Orca’s pane and hook endpoint variables into managed hooks; prompt and stop events were verified end to end.

#19188 now also uses muse consistently and includes local/SSH managed hooks, real-session Agent History, resume wiring, and Source Control commit-message support.

Since #22160 appears to be the newer successor with broader launch/readiness and Windows coverage, would it make sense to consolidate the missing #19188 capabilities there rather than maintain two overlapping Muse PRs?

@nwparker

Copy link
Copy Markdown
Contributor Author

Superseded by #22216, which landed first-class Muse Code support.

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