Repository navigation
feat(agents): add Muse Code CLI as supervised TUI agent - #21494
adriendeoliveira wants to merge 2 commits into
Conversation
- registry/config/detection/launch/selection/permissions/telemetry/labels - muse-bin-* process recognition, muse exec headless filtering - tui-idle readiness via quiet ready-screen body lane
- launchCmd trusts the workspace so the trust menu cannot eat pastes - narrow process recognition to the muse-bin- prefix - headless matcher covers exec past any position, case-sensitive - bundled icon, README badges, supported-agents docs
📝 WalkthroughWalkthroughThe change adds Muse as a supported agent across shared configuration, process recognition, launch behavior, telemetry, skills, renderer and mobile surfaces, localization, and documentation. It recognizes versioned Muse binaries and Priority: ➖ Normal Severity of issue fixed: Medium Merge Risk: 🟠 High · up to Launching Muse in an untrusted workspace can enable project-local behavior without explicit consent, while dismissed trust prompts may leave sessions blocked. These issues should be fixed before merge. 🚥 Pre-merge checks | ✅ 1 | ❌ 4❌ Failed checks (3 warnings, 1 inconclusive)
✅ Passed checks (1 passed)
Full details: Linked Issues checkExplanation The PR implements the coding objectives in Full details: Out of Scope Changes checkExplanation Most changes support Muse integration, including catalog, documentation, mobile mappings, skills support, runtime detection, and tests. Full details: Docstring CoverageExplanation Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 18 functions across 32 files. (14 skipped: 14 unsupported.) Full details: Description checkExplanation The description covers the change, rationale, linked issue, testing, AI disclosure, scope, security, compatibility, and checklist items. However, the required Visual Proof section is incomplete because it says attachments are still TODO for this UI and behavior change.
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to GitHub limitations.
🟡 Minor · Clear a Muse trust block after the Muse prompt appears. · terminal-wait-detection.ts:94-100
src/main/runtime/terminal-wait-detection.ts:94-100
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winClear a Muse trust block after the Muse prompt appears.
findDismissedStartupModalIndexomitsfindMuseReadyPromptIndex, whileisMuseReadyPromptPreviewtreats a Muse ready prompt after the trust signal as ready.detectTerminalWaitBlockedReasonuses the actionable signal, so stale Muse trust text can remain actionable. Add the Muse ready index and a regression for a trust dialog followed byMUSE_READY_TAIL.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: 396e539f-0cfc-4802-9cbc-5d3911996c2e
⛔ Files ignored due to path filters (1)
src/shared/agent-icons/muse.pngis excluded by!**/*.png
📒 Files selected for processing (46)
README.mddocs/readme/README.es.mddocs/readme/README.fr.mddocs/readme/README.ja.mddocs/readme/README.ko.mddocs/readme/README.pt.mddocs/readme/README.zh-CN.mddocs/site/content/docs/agents/supported.mdxmobile/src/components/mobile-agent-icon-assets.tsmobile/src/tasks/mobile-tui-agents.tssrc/main/runtime/orca-runtime-resolve-exit-waiters.tssrc/main/runtime/runtime-terminal-idle-polls.tssrc/main/runtime/runtime-terminal-wait.tssrc/main/runtime/terminal-wait-detection.test.tssrc/main/runtime/terminal-wait-detection.tssrc/main/runtime/terminal-wait-name-only-idle.test.tssrc/main/runtime/tui-idle-evidence.test.tssrc/main/runtime/tui-idle-evidence.tssrc/renderer/src/components/terminal-pane/terminal-startup-command-classifier.test.tssrc/renderer/src/components/terminal-pane/terminal-startup-command-classifier.tssrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/i18n/locales/es.jsonsrc/renderer/src/i18n/locales/fr.jsonsrc/renderer/src/i18n/locales/ja.jsonsrc/renderer/src/i18n/locales/ko.jsonsrc/renderer/src/i18n/locales/zh.jsonsrc/renderer/src/lib/agent-catalog.tsxsrc/renderer/src/lib/agent-favicon-assets.tssrc/renderer/src/lib/agent-status.tssrc/shared/agent-headless-command.tssrc/shared/agent-kind.tssrc/shared/agent-process-recognition.test.tssrc/shared/agent-process-recognition.tssrc/shared/agent-type-label.tssrc/shared/constants.test.tssrc/shared/muse-headless-command.tssrc/shared/skill-install-providers.tssrc/shared/skills-cli-agent-keys.tssrc/shared/telemetry-property-schemas.tssrc/shared/tui-agent-config.test.tssrc/shared/tui-agent-config.tssrc/shared/tui-agent-display-names.tssrc/shared/tui-agent-permissions.tssrc/shared/tui-agent-selection.tssrc/shared/tui-agent-startup.test.tssrc/shared/tui-agent.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.
| // 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', |
There was a problem hiding this comment.
🔒 Security & Privacy | 🛡️ Analyzed with Security Review | 🟠 Major | 🏗️ Heavy lift
🧩 Analysis chain
🏁 Script executed:
rg -n "trust-workspace|workspace trust|workspaceTrust|trusted workspace|Manual|manual" src mobile docs/site/content/docs/agents
sed -n '270,310p' src/shared/tui-agent-config.ts
sed -n '700,770p' src/shared/tui-agent-startup.test.tsRepository: stablyai/orca
Length of output: 50370
🌐 Web query:
Meta Muse Code CLI --trust-workspace skills rules hooks security
💡 Result:
<search_synthesis>
Muse Code is a terminal-based coding agent released by Meta in August 2026, designed for complex, repository-wide tasks [1][2][3]. The --trust-workspace flag is a critical security control in the Muse Code CLI [4][5]. The --trust-workspace flag enables the agent to load and execute project-specific configurations, including skills, rules, and hooks defined within the repository [4]. When this flag is not used, the agent operates with a restricted set of capabilities to prevent unauthorized actions from malicious or untrusted code in a repository [4]. Key security and configuration concepts for Muse Code include: Skills, Rules, and Hooks: Muse Code can utilize repository-local configurations (such as.muse/hooks.json) to automate workflows, enforce coding standards, or trigger custom scripts [4]. These project-level features are only active after the user explicitly grants trust to the workspace [4]. Security and Isolation: Muse Code runs in a sandbox environment by default [4][5]. Using flags like --yolo or --trust-workspace effectively lowers these security boundaries by granting the agent elevated access to project-defined logic [4]. Using --trust-workspace on an untrusted or external repository can allow an attacker to control the agent's behavior through malicious configurations [4]. Command Usage: The CLI includes several built-in commands for managing these features, such as muse skills to list, inspect, or manage skills, and muse sandbox to verify the environment's configuration [6][5]. In summary, --trust-workspace acts as a consent mechanism, signaling to the CLI that the user trusts the local configuration files to perform automated tasks [4]. Users are advised to inspect files like AGENTS.md, skill definitions, and hook configurations before enabling trust on unfamiliar repositories to avoid potential security risks [4].
</search_synthesis>
<source_evidence>
Citations:
- 1: https://developer.meta.com/ai/resources/blog/build-with-muse-code/
- 2: https://www.layer3labs.io/guides/how-to-use-muse-code
- 3: https://techcrunch.com/2026/08/05/meta-launches-muse-code-an-ai-agent-for-large-code-bases/
- 4: https://www.vibecoding.cz/cheat-sheet/muse-code/
- 5: https://github.com/superbasedapp/observer/blob/9081edd2/cmd/observer/muse.go
- 6: https://codersera.com/blog/how-to-install-muse-code-cli-2026/
🏁 Script executed:
#!/bin/bash
set -e
printf '%s\n' '--- Muse references in focused files ---'
rg -n --glob '*.ts' --glob '*.tsx' --glob '*.mdx' "muse|launchCmd|stdin-after-start|trust-workspace|AgentPermissionMode|permission mode" src/shared src/main docs/site/content/docs/agents | head -n 500
printf '%s\n' '--- Config shape and Muse entry ---'
sed -n '1,140p' src/shared/tui-agent-config.ts
sed -n '250,320p' src/shared/tui-agent-config.ts
printf '%s\n' '--- Permission resolution ---'
sed -n '1,180p' src/shared/tui-agent-permissions.ts
printf '%s\n' '--- Startup test coverage ---'
sed -n '680,780p' src/shared/tui-agent-startup.test.ts
printf '%s\n' '--- Config tests ---'
sed -n '1,80p' src/shared/tui-agent-config.test.tsRepository: stablyai/orca
Length of output: 39887
🏁 Script executed:
#!/bin/bash
set -e
printf '%s\n' '--- Startup-plan definitions and launch-command resolution ---'
rg -n -C 4 "buildAgentStartupPlan|resolveTuiAgentLaunchArgs|getTuiAgentLaunchCommand|launchCommand|agentCommand" src/shared src/main | head -n 600
printf '%s\n' '--- Trust preflight definitions and callers ---'
rg -n -C 5 "preflightTrust|agent-trust-presets|trust preset|TrustPreset" src/shared src/main src/renderer | head -n 500
printf '%s\n' '--- Launch entrypoint call sites ---'
rg -n -C 4 "buildAgentStartupPlan|buildAgentDraftLaunchPlan|launchAgent|start.*agent|TUI_AGENT_CONFIG" src/main src/shared src/renderer | head -n 700Repository: stablyai/orca
Length of output: 50370
🏁 Script executed:
#!/bin/bash
set -e
printf '%s\n' '--- New-session startup implementation ---'
sed -n '1,190p' src/shared/tui-agent-startup.ts
printf '%s\n' '--- Resume startup implementation ---'
sed -n '1,100p' src/shared/tui-agent-resume-startup.ts
printf '%s\n' '--- Exact preflight-trust references ---'
rg -n -C 8 "preflightTrust" src
printf '%s\n' '--- Exact startup builder callers ---'
rg -n -C 6 "buildAgentStartupPlan\(" src --glob '*.ts' --glob '*.tsx'
printf '%s\n' '--- Exact resume builder callers ---'
rg -n -C 6 "buildAgentResumeStartupPlan\(" src --glob '*.ts' --glob '*.tsx'Repository: stablyai/orca
Length of output: 50370
Security Misconfiguration
Reachability: External
Exploitability: Moderate
CWE: CWE-693
Do not auto-trust a workspace in Manual mode. The normal and resume launch paths use muse --trust-workspace without a Muse-specific consent gate. Manual mode only removes Muse’s --yolo permission argument. It does not restore workspace-trust consent. Add an explicit Orca confirmation before passing --trust-workspace, and update the Manual-mode expectations in src/shared/tui-agent-startup.test.ts.
There was a problem hiding this comment.
ℹ️ No critical issues — one coverage question and one minor matcher-scope note.
Reviewed changes
- Adds
museas a supervised TUI agent across the registration surfaces:TuiAgent+TUI_AGENT_CONFIG(detectCmd: 'muse',launchCmd: 'muse --trust-workspace',stdin-after-start), auto-pick order, display name, UI catalog entry + bundled 64px icon, all 6 i18n locales, mobile icon/domain maps, telemetry kind, skills-CLI mapping (null), skill-install provider, and--yolopermissions. - Recognizes the versioned
muse-bin-<version>binary the launcher execs — inagentForNormalizedProcess, a Muse-scoped branch inisExpectedAgentProcess, and the startup-command classifier — plus anexecheadless-one-shot filter. - Adds a tier-1b
tui-idlelane (isMuseReadyPromptPreview+hasQuietMuseReadyPrompt) for the captured ready screen, believed only after quiescence and vetoed by a first-party working status; wired through all sixisTuiIdleSatisfiedcall sites, including the mailbox-pointer delivery path. - Tests cover the config/startup matrix, process recognition (comm truncation +
execnegatives), the readiness body (ANSI + trust-dialog veto), evidence ranking, and a live-PTY-pipeline E2E. I ran the touched suites locally: 201 tests green, with the Muse E2E exercising the new lane (~4s).
ℹ️ Muse readiness has no fallback once the startup banner leaves the retained tail
findMuseReadyPromptIndex requires the muse code banner to still be in the retained tail (2000 lines / 256 KiB). Because Muse emits no title signal and its bare-cwd OSC title classifies as null (not idle), no other lane can settle a tui-idle wait once that banner scrolls out — tier 1 is false, the first-party veto has nothing to veto, and tier 3 needs lastAgentStatus === 'idle'. This is fine for a fresh worker-start (the tested case), but I could not verify the long-lived case. If Muse keeps the banner pinned on screen this is a non-issue; otherwise a re-used Muse pane would time out on tui-idle.
Technical details
# Muse readiness has no fallback after the banner scrolls off
## Affected sites
- `src/main/runtime/terminal-wait-detection.ts:134` — `findMuseReadyPromptIndex` anchors on `lastIndexOf('muse code')` in the tail.
- `src/main/runtime/tui-idle-evidence.ts:141` — `hasQuietMuseReadyPrompt` is the only lane that can settle a Muse pane; it delegates entirely to that body check.
- `src/main/runtime/terminal-tail-limits.ts:1` — retained tail is `MAX_TAIL_LINES = 2000` / `MAX_TAIL_CHARS = 256 KiB`.
## Required outcome
- Confirm whether the Muse TUI keeps its banner in the retained tail for the life of a session.
- If it does not, decide whether a re-used Muse pane needs a body signal that survives scrollback (e.g. the persistent composer/status line) or whether timing out on long-lived panes is an accepted limitation.
## Open questions for the human
- Does `muse` repaint the banner on every turn, or only at startup?
- Is `worker-start`/`tui-idle` on an already-running Muse pane in scope for this PR?DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
| // subcommand dispatch is (`muse 'EXEC'` is a TUI prompt), and a quoted TUI prompt | ||
| // never splits into an `exec` token on its own. | ||
| export function isMuseHeadlessOneShotCommand(tokens: readonly string[]): boolean { | ||
| return tokens.slice(1).some((token) => token === 'exec') |
There was a problem hiding this comment.
exec is matched at any position, but the captured evidence only establishes it as the first positional (muse exec … dispatches headless, muse <flags> exec … errors). If Muse treats a non-subcommand first positional as the prompt, then a manually launched muse refactor the exec path (unquoted) is classified headless and the pane is not recognized as Muse. Does Muse scan every positional for a subcommand, or only the first? If only the first, matching just the first non-flag positional would keep the documented cases and drop the false positive.
|
Thank you for this! First-class Muse Code support has now landed in #22216, which builds on its readiness detection, versioned |

ELI5
Orca can now launch and supervise Meta's Muse Code CLI (
muse) like any othersupported agent: it appears in the agent picker, auto-detects from PATH,
receives orchestration tasks, and reports readiness — using your existing Muse
login, no API key involved.
What Changed
Agent registration (same shape as the most recent minimal agents):
TuiAgent+TUI_AGENT_CONFIG:detectCmd: 'muse',launchCmd: 'muse --trust-workspace',promptInjectionMode: 'stdin-after-start'telemetry kind, skills-CLI mapping (
null→ universal target), skill-installprovider (canonical
.agents/skillsat both scopes), mobile icon/domain maps--yolodefault (Manual supported), settings test coveragesupported.mdxrow + permissions list, README badges (EN + 6 locales)Muse-specific behavior, all measured against Muse 1.3.0 (no guessing):
muselauncher execs a versionedmuse-bin-<version>binary, so theforeground process never equals
muse. Recognition accepts themuse-bin-prefix (also covers comm-truncated rows) and the expected-process check does
the same scoped to muse only — no global rule was relaxed
(ante-obsidian test still guards the generic path).
muse exec …(headless one-shot) never classifies as the interactive TUI.every existing
tui-idletier stayed null andworker-starttimed out atagent_readinesson a fully booted TUI. New tier-1b lane: the stable readyscreen (banner +
Skills: … loaded+❯composer, captured from the realTUI) counts only after the standard 3s quiescence. No sleep added, no timeout
raised. A later trust/approval dialog below the banner vetoes the match, and
the trust dialog itself already maps to
agent-trust-workspace.Why
Alternative 1 —
argvprompt injection (with or without--): rejected withproof.
muse -- resumestill dispatches theresumesubcommand, so any specstarting with
resume/exec/init/… would misfire.stdin-after-start(Bare TUI + paste after readiness) avoids argv parsing entirely; bracketed
paste + single Enter verified to submit, including multi-line prompts.
Alternative 2 — agent id
musecode(see #19188):musematches the binaryname like every other agent and matches #18791, so the ecosystem converges on
one id.
Relation to open PRs: supersedes #18791 (same id; this PR adds
muse-bin-*process recognition,execfiltering, the readiness lane, and aproven
worker-startE2E). Alternative to #19188 (idmusecode, argvinjection, hooks/resume/vault — intentionally out of scope here; this PR is
the minimal safe core those can build on).
Out of scope (documented, not invented): session resume, agent hooks,
mailbox-pointer push to hookless panes (workers pull via
check, as withother hookless agents), usage/account tracking (#19224).
Linked Issue
Fixes #19672
Relates #14901, #18791, #19188
Visual Proof
TODO (attach when opening): picker screenshot showing Muse +
worker-startE2E transcript below. No committed attachments per repo rule.
Testing
Manual (macOS arm64, Muse Code 1.3.0, Meta subscription login):
worker-start --agent muse→ready/input_accepted; task injected intothe Muse TUI; no API key configured anywhere.
agent-trust-workspace;--trust-workspacelaunch skips it in both modes.(zero model calls);
muse exec/muse -- resume/muse --yolo execdispatch behaviors verified via
--help/error paths only.Automated: 29 new test cases (config, cross-shell yolo/manual startup matrix,
process recognition incl. comm-truncated + unrelated
muse-*negatives,headless matcher, ready-screen body incl. ANSI + trust veto, evidence ranking,
wait-level fake-timer + live-pipeline regression — the live test fails with a
15s timeout on the pre-fix tree).
pnpm typecheck✓,pnpm lint✓ (full gate), targeted suites green(201 tests), full
src/main/runtimesuite: only pre-existing unrelatedfailure (
orchestration-cli-subprocesskeepalives, fails on pristine treetoo).
AI Disclosure
Implemented with Muse Code (Meta Muse Spark) under human direction; every
Muse behavior claim above was verified against the installed CLI 1.3.0, and
the E2E was run by the author.
Agent skill upstream boundary
skill-install-providersentry is a 6-line data row pointing at thecanonical
.agents/skillsroot Muse demonstrably reads.Notes
Security: no auth/credential handling added or changed — Orca only spawns the
musebinary, which uses the user's existing session.--trust-workspaceinthe base launch line skips the trust menu (it would otherwise eat the pasted
task); approval/sandbox bypass stays behind the Yolo/Manual switch.
Cross-platform: macOS/Linux per the launcher's own platform gate (no native
Windows binary; WSL follows the Linux path); startup matrix covers
linux/darwin/win32 × posix/powershell/cmd quoting.
Backwards compat: additive only; the one shared-semantics touch
(
isExpectedAgentProcess) is gated onexpected === 'muse'.Performance: the new body thunk runs only after the agent gate passes, so
non-Muse panes pay nothing.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)