Skip to content

feat(agents): add Muse Code as a first-class TUI agent - #22160

Closed
nwparker wants to merge 1 commit into
mainfrom
nwparker/muse-first-class
Closed

nwparker wants to merge 1 commit into
mainfrom
nwparker/muse-first-class

Conversation

@nwparker

@nwparker nwparker commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​211 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​211
Prod 39 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​347 $\color{#cf222e}{\Huge{\mathbf{−}}}$​31 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​316

ELI5

Orca can launch Meta's Muse Code CLI the same way it launches OpenCode, Codex, and Claude. You pick Muse, it opens in a terminal, and Orca can tell when it is working, waiting on you, or done.

What Changed

Before, Muse was not an agent Orca knew how to launch or supervise. After this, Muse is in the agent picker, the mobile catalog, skill install, and the supported-agents list.

A normal launch runs muse --trust-workspace, so project skills load and Muse still asks before it does something risky. Choosing full-auto permissions is what adds --yolo. A task is pasted into the composer after Muse is ready. If the task starts with exec, resume, or init, Muse treats it as your message instead of a command.

Orca recognizes the real process, muse or muse-bin-<version>. A muse exec one-shot is not treated as an interactive session. A live trust prompt, approval menu, or numbered "Request user input" keeps the pane waiting. A finished turn uses the same status store and attention path as the other agents.

On Windows Git Bash, muse.cmd is not a command, so that shell launches through cmd //c. PowerShell, cmd, macOS, and Linux run muse directly.

Why

Three open pull requests each added part of this, and each also did something that does not match the installed CLI:

  • feat(agents): add Muse Spark CLI agent support #18791 (jeffhuen) is where the agent id muse and the catalog registration come from. Its default muse --yolo launch is not used. --yolo skips the approval and trust questions.
  • feat(agents): add Muse Code CLI as supervised TUI agent #21494 (adriendeoliveira) is where muse-bin-* recognition, muse exec filtering, stdin prompt delivery, and --trust-workspace come from. Those match Muse 1.3.0. The agent id stays muse.
  • feat(agents): add Muse as a supported TUI agent #19188 (homesh-dev) correctly showed that Muse hooks run with a cleared environment, so they cannot be tied to a pane. Those hooks are not installed. The id musecode, argv prompt injection, and an unvalidated session importer are not used. muse -- resume still dispatches the resume subcommand, which is why prompts are pasted instead of passed as arguments.

Personal skills are installed under ~/.config/muse/skills. Project skills stay in .agents/skills, which is what Muse reads. ~/.agents/skills is import-only.

Linked Issue

Relates #14901, #19672

Visual Proof

Local screenshots of the trust question, the ready composer, and a delivered prompt are in an untracked HTML report and are not part of this diff.

Testing

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

macOS: launched Muse in a hidden Orca window. The trust dialog appeared, then the composer (Skills: 95 loaded), then an echo-provider prompt was delivered and answered.

Windows (awin, Git Bash and PowerShell): muse is muse.cmd plus muse-bin-1.3.0-R3401.1.exe. Git Bash cannot run muse directly. cmd //c muse --trust-workspace reached the composer. PowerShell runs muse --version directly.

pnpm test on the new Muse tests passed twice. pnpm tc and pnpm run check:code-quality:changed passed.

AI Disclosure

Review

Agent skill upstream boundary

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

Notes

Linux uses the native muse command, covered by the launch tests. No Linux host was available for a live screenshot.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

Muse joins the agent picker, mobile catalog, and supported-agent list. A normal
launch trusts the workspace so skills load. Full-auto permission mode is what
adds --yolo. The task is pasted after the composer is ready, so a prompt that
starts with exec, resume, or init stays the user's message.

Orca treats the versioned muse-bin process as Muse and does not treat muse exec
as an interactive session. A live trust prompt, approval menu, or numbered
request for input keeps the pane waiting. A finished turn uses the same status
store and attention path as the other agents.

On Windows Git Bash, muse.cmd is not a command, so that shell launches through
cmd //c. PowerShell, cmd, macOS, and Linux run muse directly.

Co-authored-by: homesh-dev <[email protected]>
Co-authored-by: jeffhuen <[email protected]>
Co-authored-by: adriendeoliveira <[email protected]>
@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.

📝 Walkthrough

Walkthrough

The change adds Muse as a supported TUI agent. It updates shared agent types, catalogs, process recognition, launch behavior, permissions, skills, telemetry, icons, localization, mobile metadata, and documentation. It adds Muse terminal prompt detectors and per-PTY activity status handling. It also adds tests for process recognition, launch behavior, prompt detection, and terminal status transitions.

Priority: ➖ Normal

Merge Risk: 🟡 Moderate · up to 1e3a9

Terminal activity from another agent can be shown as Muse, producing incorrect status and session updates. Gate generic menu detection on the PTY’s known agent identity before merging.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 47.83% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 23 functions across 32 files. (8 skipped:… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: adding Muse Code as a first-class TUI agent.
Description check ✅ Passed The description is mostly complete. It covers the user-facing behavior, implementation scope, rationale, linked issues, testing, platform considerations, and checklist. The Visual Proof section refere…
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.
Full details: Docstring Coverage

Explanation

Docstring coverage is 47.83% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 23 functions across 32 files. (8 skipped: 8 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 2
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🛠️ Fix failing CI checks 💡
  • Commit to this branch
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 5ab6c76d-0b4d-4638-8c2f-2056f9599afc

📥 Commits

Reviewing files that changed from the base of the PR and between 0232c03 and 1e3a9a8.

⛔ Files ignored due to path filters (1)
  • src/shared/agent-icons/muse.png is excluded by !**/*.png
📒 Files selected for processing (40)
  • README.md
  • config/scripts/locale-translation-policy.mjs
  • docs/site/content/docs/agents/supported.mdx
  • mobile/src/components/mobile-agent-icon-assets.ts
  • mobile/src/tasks/mobile-tui-agents.ts
  • src/main/runtime/muse-terminal-activity.test.ts
  • src/main/runtime/muse-terminal-activity.ts
  • src/main/runtime/orca-runtime-schedule-wait-blocked-check.ts
  • src/main/runtime/terminal-wait-detection.ts
  • src/renderer/src/components/terminal-pane/terminal-startup-command-classifier.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-packaged-process-name.ts
  • src/shared/agent-process-recognition.ts
  • src/shared/agent-title-evidence.ts
  • src/shared/agent-type-label.ts
  • src/shared/muse-harness.test.ts
  • src/shared/muse-headless-command.ts
  • src/shared/muse-interactive-question.ts
  • src/shared/muse-launch-command.ts
  • src/shared/muse-process-recognition.ts
  • src/shared/muse-ready-prompt.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-launch-command.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; 8 remain after this review.

Comment on lines +30 to +33
const museQuestion =
normalized.includes('request user input') && normalized.includes('enter to select')
const looksLikeMuse =
normalized.includes('muse code') || museTrust || museApproval || museQuestion

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,150p' src/main/runtime/muse-terminal-activity.ts
sed -n '55,110p' src/main/runtime/orca-runtime-schedule-wait-blocked-check.ts
rg -n "nextMuseTerminalStatus|emitTerminalAgentStatusEvents|agentType.*muse|ptyId.*agent|process.*agent" src/main/runtime src/shared | head -180

Repository: stablyai/orca

Length of output: 21415


🏁 Script executed:

set -e
printf '%s\n' '--- caller and imports ---'
sed -n '1,155p' src/main/runtime/orca-runtime-schedule-wait-blocked-check.ts
printf '%s\n' '--- foreground identity helper ---'
sed -n '1,220p' src/main/runtime/runtime-pty-foreground-agent.ts
printf '%s\n' '--- emission path ---'
sed -n '1,145p' src/main/runtime/orca-runtime-create-terminal-side-effect-command-code-detector.ts
printf '%s\n' '--- identity and PTY bindings ---'
rg -n -C 5 "foregroundAgent|launchAgent|recognizeAgentProcess|Pty|pty.*agent|agentType" src/main/runtime src/shared/pane-agent-identity-adapter.ts src/shared/published-pane-agent-identity.ts -g '*.ts' | head -260

Repository: stablyai/orca

Length of output: 41645


🏁 Script executed:

set -e
sed -n '1,155p' src/main/runtime/orca-runtime-schedule-wait-blocked-check.ts
sed -n '1,220p' src/main/runtime/runtime-pty-foreground-agent.ts
sed -n '1,145p' src/main/runtime/orca-runtime-create-terminal-side-effect-command-code-detector.ts
rg -n -C 5 "foregroundAgent|launchAgent|recognizeAgentProcess|pty.*agent|agentType" src/main/runtime src/shared/pane-agent-identity-adapter.ts src/shared/published-pane-agent-identity.ts -g '*.ts' | head -260

Repository: stablyai/orca

Length of output: 40974


Gate generic Muse prompts by PTY identity.

runWaitBlockedCheck passes only the PTY text to nextMuseTerminalStatus. looksLikeMuse accepts generic approval and interactive-menu text, so a non-Muse PTY can emit a payload with agentType: 'muse'. Allow these generic branches only when pty.launchAgent or a current process-recognition result identifies Muse. Otherwise, require the Muse-specific text or return null.

@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

One behavioral issue: Muse status prose is written into the prompt field, which Orca renders as the user's most recent prompt. See the inline comment.

Reviewed changes

  • Registration: muse added to TuiAgent and every registry — tui-agent-config.ts (launchCmd: 'muse --trust-workspace', stdin-after-start), agent-kind, telemetry-property-schemas, tui-agent-display-names, agent-type-label, tui-agent-selection, agent-status iconable, skill install providers, locale labels, README/docs, muse.png.
  • Permissions: YOLO_TUI_AGENT_ARGS.muse = '--yolo'; since DEFAULT_TUI_AGENT_ARGS = YOLO_TUI_AGENT_ARGS, the shipped default is muse --trust-workspace '--yolo'.
  • Process recognition: muse-bin-<version> handled by new muse-process-recognition.ts and the extracted agent-packaged-process-name.ts; muse exec filtered as headless.
  • Windows launch wrapper: muse-launch-command.ts wraps Git Bash launches through cmd //c, applied to both command and commandWithoutSessionOptions.
  • Screen-derived status: muse-terminal-activity.ts classifies ready/working/waiting from terminal text and emits status through runWaitBlockedCheck, with Muse matchers added to terminal-wait-detection.ts.
  • Tests: muse-terminal-activity.test.ts and muse-harness.test.ts; I ran both plus terminal-wait-detection.test.ts (50 tests pass).

ℹ️ The shared wait-detector change ships without a non-Muse negative test

terminal-wait-detection.ts is shared by every agent, and this PR adds generic sentinel phrases plus two Muse matchers to it. muse-terminal-activity.test.ts covers the Muse side well, but terminal-wait-detection.test.ts is unchanged, so nothing pins that a non-Muse pane quoting the Muse menu wording (or a working pane whose footer is esc to interrupt) stays null. I traced the candidates and could not build a realistic non-Muse false positive, but the surface is a shared regex and the existing file already has SILENT_STARTUP_DIALOGS / NON_CODEX_PROMPTS sections for exactly this.

Technical details
# Add non-Muse negatives for the new shared sentinel phrases

## Affected sites
- `src/main/runtime/terminal-wait-detection.ts:135` — `TERMINAL_WAIT_BLOCKED_SENTINEL_RE` gained `request user input`, `enter to select`, `reject once`.
- `src/main/runtime/terminal-wait-detection.ts:274-281` — Muse approval/question candidates added to `findBlockedSignalInLiveWindow`.
- `src/main/runtime/terminal-wait-detection.test.ts` — no new cases (existing `SILENT_STARTUP_DIALOGS` / `NON_CODEX_PROMPTS` sections are the natural home).

## Required outcome
- A non-Muse tail that contains the new sentinel words but no Muse-specific structure resolves to `null`.
- A working pane ending in `esc to interrupt` with numbered lines resolves to `null`.

## Open questions for the human
- Is `WAIT_BLOCKED_KEYWORD_PATTERN` in `src/main/runtime/orca-runtime-postlude.ts` intentionally left without the Muse phrases? It only affects whether a chunk bypasses the 50ms throttle, so the impact is latency rather than correctness.

ℹ️ Nitpicks

  • src/shared/muse-ready-prompt.ts:7 returns ready on any tail containing the literal muse code followed by ❯, with no pane/busy guard (unlike findCursorReadyPromptIndex). It is also used as a "dismissed modal" signal in findDismissedStartupModalIndex, so a coincidental ❯ could suppress a real blocked signal. Reachability looks low because ❯ is normally the pane's own ready composer, but a guard would match the Cursor precedent.
  • TERMINAL_WAIT_BLOCKED_SENTINEL_RE additions are partly redundant: reject once and enter to select are unnecessary because the Muse approval matcher requires allow once and the question matcher requires request user input, both already in the regex. request user input alone opens the gate for the only newly reachable matcher.
  • src/shared/tui-agent-permissions.ts:30 adds Muse to YOLO_TUI_AGENT_ARGS, and because DEFAULT_TUI_AGENT_ARGS = YOLO_TUI_AGENT_ARGS, a default launch is muse --trust-workspace '--yolo'. The PR body says a normal launch leaves approvals on, so the shipped default does not match the stated safety intent.
  • docs/site/content/docs/agents/supported.mdx:54 inserts the Muse row between Devin and Droid (Factory) in an otherwise alphabetical table.

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

Comment on lines +83 to +102
return { state: 'waiting', prompt: 'Muse is waiting for you', agentType: 'muse' }
}
if (next === 'working') {
return { state: 'working', prompt: 'Muse is working', agentType: 'muse' }
}
if (
next === 'ready' &&
memory.seenWorking &&
(previous === 'working' || previous === 'waiting')
) {
memory.seenWorking = false
memoryByPtyId.set(ptyId, memory)
return { state: 'done', prompt: 'Muse is ready', agentType: 'muse' }
}
if (next === 'ready' && (previous === 'waiting' || previous === null)) {
return {
state: 'done',
prompt: 'Muse is ready',
agentType: 'muse',
sessionBoundary: 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.

The status producer writes human-readable status text into prompt, which AgentStatusPayload documents as the user's most recent prompt and which Orca renders as the row's primary label (getAgentRowPrimaryText → sidebar/dashboard, mobile agent-row-display, worktree ps --json). This overwrites the real prompt seeded at launch via applyInitialAgentStatus and duplicates the state dot. No other producer puts status prose in prompt — the Droid hook explicitly keeps its Notification.message status text out of it.

Technical details
# Keep status prose out of the user-prompt field

## Affected sites
- `src/main/runtime/muse-terminal-activity.ts:83` — `prompt: 'Muse is waiting for you'`
- `src/main/runtime/muse-terminal-activity.ts:86` — `prompt: 'Muse is working'`
- `src/main/runtime/muse-terminal-activity.ts:95,100` — `prompt: 'Muse is ready'`

## Required outcome
- The Muse producer must not overwrite the row's user prompt with status text.

## Suggested approach (optional)
- Return `prompt: ''` (or otherwise leave the field unset on the wire). `ParsedAgentStatusPayload` types `prompt` as required, so `''` is the minimal change; the Muse tests assert only `state`/`agentType`/`sessionBoundary` via `toMatchObject` and are unaffected. Note the terminal/OSC ingest path (`server-ingest-terminal.ts`) does not run `resolvePrompt`, so an empty value does not inherit a cached prompt the way Droid's hook path does — this is a display-only field for Muse either way.
- `state` already carries working/waiting/done, so nothing user-visible is lost.

Comment on lines +105 to +110
commandWithoutSessionOptions: finalizeMuseLaunchCommand({
agent: args.agent,
command: commandWithoutSessionOptions,
platform: args.platform,
shell: args.shell
}),

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.

finalizeMuseLaunchCommand is also applied to commandWithoutSessionOptions, which buildSleepingAgentLaunchConfig persists as launchConfig.agentCommand. That field is expected to be a bare, re-parseable command: the OMP precedent wraps command only (tui-agent-startup.ts:76 vs :81), and sleeping-record-access.ts:168 feeds agentCommand to recognizeAgentProcessFromCommandLine, which sees the first token if and returns null. Today this is masked by launchAgent metadata and because Muse is not resumable, but the wrapper makes the persisted command stop round-tripping.

Technical details
# Keep the persisted agentCommand a bare command

## Affected sites
- `src/shared/tui-agent-launch-command.ts:105-110` — wraps `commandWithoutSessionOptions`.
- `src/renderer/src/components/terminal-pane/pty-connection/sleeping-record-access.ts:168` — parses `effectiveLaunchConfig.agentCommand` for reattach identity recovery.
- `src/main/ipc/terminal-startup-color-query-replies.ts:44` — same parse as a fallback.

## Required outcome
- `launchConfig.agentCommand` for Muse stays the bare launch command on `win32` + `posix`, matching the OMP invariant, while `command` keeps the Git Bash wrapper.

## Open questions for the human
- If Muse is intended to become resumable, note that `buildAgentResumeStartupPlan` appends resume argv to `agentCommand` (`agent-resume-launch-command.ts`), which would produce `... fi --resume` on a wrapped value.

@homesh-dev

Copy link
Copy Markdown

Important update from #19188 after testing the installed Muse Code 1.3.0: the hook-attribution statement here is now stale. Muse 1.3 supports managed_hooks_env_vars alongside managed_hooks_path. We verified that allowlisted ORCA_AGENT_HOOK_*, pane, tab, worktree, and launch-token values reach managed hooks, and that real UserPromptSubmit and Stop payloads drive Orca’s working/done status.

#19188 now also uses the muse agent id—not musecode—and includes validated real-session Agent History, muse resume <uuid>, Source Control commit-message generation, and local/SSH managed-hook installation.

I think the strongest result would combine this PR’s launch/readiness/question detection and Windows support with #19188’s hooks/history/resume/commit-message support. Could we consolidate those surfaces and update the comparison section?

@nwparker

Copy link
Copy Markdown
Contributor Author

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

@nwparker nwparker closed this Sep 23, 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