Repository navigation
feat(agents): add Muse as a supported TUI agent - #19188
homesh-dev wants to merge 14 commits into
Conversation
|
Note Reviews pausedIt 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 Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review. 📝 WalkthroughWalkthroughAdds MuseCode as a supported TUI agent. The change defines its Merge Risk: 🔵 Low · up to MuseCode support adds launch, session, and interface integration, but reserved prompts may execute CLI commands rather than enter the intended task, and localization entries remain inconsistent. These are bounded issues that should be addressed or explicitly accepted before relying on the integration broadly. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
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: 4
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Team
Run ID: 7df9c366-9a1f-4956-9de0-a7fe7091d133
📒 Files selected for processing (24)
README.mdmobile/src/tasks/mobile-tui-agents.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-status.tssrc/renderer/src/lib/tui-agent-startup.test.tssrc/shared/agent-headless-command.tssrc/shared/agent-kind.tssrc/shared/agent-process-recognition.test.tssrc/shared/agent-status-types.tssrc/shared/agent-type-label.tssrc/shared/musecode-headless-command.tssrc/shared/skills-cli-agent-keys.tssrc/shared/telemetry-property-schemas.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.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.
There was a problem hiding this comment.
Important
The -- semantics for MuseCode are self-contradictory in this PR, and the "no -- separator" claim that the config relies on is unverifiable — please reconcile before merging (details inline).
Reviewed changes
Adds Meta's MuseCode (muse CLI) as a launchable TUI agent, mirroring the Trae registration pattern.
- Agent registries — new
musecodemember wired throughtui-agent, config (detectCmd: 'muse', argv injection), kind, telemetry, status types/labels, permissions (--yolo), selection, display names, skills keys (null), renderer + mobile catalogs, i18n, and the README badge. - Headless detection — new
isMusecodeHeadlessOneShotCommandmatcher treatsmuse exec …as a one-shot whilemuse resumeand baremusestay live. - Tests — startup argv injection and process-recognition coverage for the new agent.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
Important
Adding 'musecode' to AGENT_HOOK_TARGETS makes MuseCode a live detection/telemetry target with no installer to act on it — reconcile before merging (details inline).
Reviewed changes
Reviewed the two commits landed since the prior Pullfrog review: the hook listener normalization + provider-session resume + parked hook installer, and the bundled icon + skill-install provider.
- Hook listener normalization —
musecode-events.tsplusprovider-dispatch/provider-event-routing/source-routing/agent-hook-relay/agent-hook-typescases normalize MuseCode's Claude-compatible payloads and route/hook/musecode. - Resume wiring —
RESUMABLE_TUI_AGENTS,extractAgentProviderSession, andgetAgentResumeArgv(muse resume <uuid>), plus an ungated host-authority capability. - Parked installer — a complete, tested
src/main/musecode/hook installer service that is not registered anywhere. - Assets — a bundled 64x64 icon wired into renderer + mobile favicons; a skill-install provider entry.
ℹ️ Parked installer ships ~600 lines of unreachable code
src/main/musecode/{hook-service,hook-settings,hook-config-json}.ts (~460 LOC) plus their tests have no production import path — only the tests construct MusecodeHookService. Everything downstream (listener normalization, /hook/musecode, resume) stays dormant until a hook actually fires, which it cannot while the installer is unregistered. Consider deferring this subsystem to a follow-up PR so the dead code isn't merged and left to rot while the upstream env-allowlist issue resolves.
Technical details
# Parked installer, dormant wiring
## Affected sites
- src/main/musecode/hook-service.ts — `MusecodeHookService` / `musecodeHookService` are exported but never imported outside `hook-service.test.ts`
- src/shared/agent-hook-listener/* — normalization + `/hook/musecode` routing are live but inert until a muse hook fires
- src/shared/agent-session-resume.ts — `muse resume <uuid>` is live but can never be invoked without a captured `providerSession`
## Open questions for the human
- Split the installer + normalization + resume into a follow-up PR, or merge them now as dormant wiring?DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
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 platform limitations.
⚠️ Outside diff range comments (2)
src/shared/tui-agent-config.ts (1)
125-134: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winSet MuseCode to
stdin-after-start. With'argv', the startup planner buildsmuse exec, which selects the headlessexecsubcommand. Thestdin-after-startmode launchesmusefirst and deliversexecas prompt input.src/shared/musecode-headless-command.ts (1)
1-14: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winContinue MuseCode subcommand matching after
--MuseCode 1.0.3 dispatches command words after
--, butisMusecodeHeadlessOneShotCommandreturnsfalseat that token. ThusrecognizeAgentProcessFromCommandLine('muse -- exec …')retains the process as an interactivemusecodeagent, and foreground recognition can select the completed one-shot session. Update only the MuseCode matcher. Keep the startup prompt handling unchanged because MuseCode intentionally has noargvPromptSeparatorand receives the prompt as one quoted argument.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Team
Run ID: 9c3a9651-7502-4950-9def-e73f7c4b6eb9
⛔ Files ignored due to path filters (1)
src/shared/agent-icons/musecode.pngis excluded by!**/*.png
📒 Files selected for processing (18)
mobile/src/components/mobile-agent-icon-assets.tssrc/main/agent-hooks/server-retired-pane-new-turn.test.tssrc/main/musecode/hook-config-json.test.tssrc/main/musecode/hook-config-json.tssrc/main/musecode/hook-service.test.tssrc/main/musecode/hook-service.tssrc/main/musecode/hook-settings.tssrc/renderer/src/lib/agent-favicon-assets.tssrc/renderer/src/runtime/agent-resume-host-authority-capability.tssrc/shared/agent-hook-listener-claude-compatible-vendors.test.tssrc/shared/agent-hook-listener/provider-dispatch.tssrc/shared/agent-hook-listener/provider-event-routing.tssrc/shared/agent-hook-listener/providers/musecode-events.tssrc/shared/agent-hook-listener/source-routing.tssrc/shared/agent-hook-relay.tssrc/shared/agent-hook-types.tssrc/shared/agent-session-resume.tssrc/shared/skill-install-providers.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review.
There was a problem hiding this comment.
ℹ️ No critical issues — the AI Vault session-history wiring is clean and follows the existing scanner patterns; one minor coverage suggestion inline.
Reviewed changes
Adds MuseCode AI Vault session history so muse transcripts are discovered, parsed, and resumable alongside the other supported CLIs.
- Session parser — new
session-scanner-musecode-parser.tsfolds the append-onlysession.jsonlenvelope log (bare +retained_framerecords, µs timestamps, per-turn intent/run dedup) into the shared accumulator. - Discovery + sources — new
session-scanner-musecode-paths.ts(~/.local/share/muse/sessions) wired into localAI_VAULT_AGENT_SOURCESand remoteremoteSessionSources, plus themusecodeparser/source cases. - Resume —
muse resume <uuid>added tobuildAgentResumeInvocation. - Catalog + docs —
AI_VAULT_AGENTS/ label entries (single source of truth driving the RPC schema, renderer filter, and mobile), ahome-musecodeskill-discovery source, and the session-history docs.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
ℹ️ One minor documentation inconsistency inline — the code changes are correct and the two prior review concerns (
--semantics, dedup coverage) are cleanly resolved.
Reviewed changes
Re-reviewed commit 045e1be (feat(agents): address review feedback on MuseCode hooks, matcher, and parser), which landed in response to the prior Pullfrog review.
- Matcher reconciled —
isMusecodeHeadlessOneShotCommandnow matches a bareexectoken anywhere (dropping the--early-return), consistent with the verifiedmuse -- resume/muse -- execbinary behavior and the "no--separator" config claim. - Dedup coverage added — the musecode fixture now emits a
run.startedrecord carrying the same prompt as the intent record, so the< 60sfoldUserTurndedup window is actually exercised (messageCountstays 2). - Status hardening —
readManagedMusecodeHookEventsnow treats null definitions, non-array hook lists, null entries, and non-string commands as absent viamanagedHookEntries/hookEntryCommand, with a regression test assertinggetStatus()degrades topartialinstead of throwing. - Parking rationale documented — comments on
AGENT_HOOK_TARGETSand the parked service clarify why the'musecode'membership is retained without a registered installer.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
Re-reviewed commit 731174c (feat(agents): recognize MuseCode's versioned muse-bin foreground process), the only commit landed since the prior Pullfrog review.
- Versioned binary recognition —
agentForNormalizedProcessnow maps amuse-bin-prefix to'musecode', mirroring the existingcodex-/grok-precedent, so themuselauncher'smuse-bin-<version>sibling (truncated tomuse-bin-1.0.3-Rin macOS comm output) is recognized as MuseCode in foreground detection. - Tests — exact
toEqualcoverage for the full versioned name, the comm-truncated name, and a full path.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
# Conflicts: # src/main/ai-vault/session-scanner-agent-parser.ts # src/main/ai-vault/session-scanner.test.ts # src/shared/agent-session-resume.ts
Electron smoke test✅ Basic hidden-renderer Electron smoke passed against this branch ( Validated:
The screenshots below contain disposable E2E data only—no real credentials or session content. New-tab launcherAgents settingsAgent Session HistoryAdditional checks: focused unit suites ( |
There was a problem hiding this comment.
Important
The main merge restored the branch's older isRecognizedAgentType shape, reverting the early-return version now on main. Behavior is unchanged, but the reverted lines count as added, so the changed-code quality gate flags the as TuiAgent cast on line 336.
Reviewed changes
Re-reviewed the four commits landed since the prior Pullfrog review (731174c): the Source Control AI commit-message spec, two main merges, and smoke screenshots.
- MuseCode commit messages — a
musecodespec added tocommit-message-agent-specs-secondary.ts(muse exec --disable-write --disable-shell --disable-web-tools --approval-mode never [--model] [--reasoning-effort] <prompt>,promptDelivery: 'argv', staticdefaultmodel), with an exact-argv test and the agent added to the capability list. mainmerges — conflict resolutions kept the musecode AI Vault parser/resume wiring and relocated the musecode scanner fixture into the shared every-agent vault builder; the parser moved toRemoteSessionContent/remoteSessionContentLines.- Screenshots — three smoke images under
docs/assets/pr-19188/.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
Important
Registering Muse in the managed-hook installer registries is not accompanied by the roster/invariant updates it needs, and Muse's refresh path now does synchronous work on the Electron main thread. Four existing tests fail on this head.
Reviewed changes
Re-reviewed f6f40cc (feat: complete Muse integration), the only commit landed since the prior pullfrog review (543a72df). It is a rename plus a behavior change.
- Renamed
musecode→museend to end — agent id,TuiAgent/kind/telemetry/status enums, source routing (/hook/muse), files (src/main/muse/*,session-scanner-muse-*), icon, i18n, and catalogs. Nomusecodereference remains in the tree. - Registered the Muse hook installer — added
musetoMANAGED_AGENT_HOOK_INSTALLERS,..._SCRIPT_REFRESHERS,..._REMOVERS,..._STATUS_READERS, and the remote installer list (previously parked and unregistered). - Added a
managed_hooks_env_varsallowlist —serializeMuseSettingsnow writes/merges the ORCA_* env names into~/.config/muse/settings.json, andgetStatusreportspartialwhen any are missing. - Fixed the session-file parser call —
parseMuseSessionFilenow passes{}for options and the sink asmessages(previously the sink landed in the options slot). - Version references bumped to 1.3.0 in several comments; a
sessionSegmentshelper replaced the two per-agent segment builders in the remote scanner.
ℹ️ PR description no longer matches the code
The description still states the installer is "parked" and "Auto-install is therefore NOT wired (registry entries omitted)", citing Muse's cleared hook environment as the blocker, and reports that the changed-code quality gate passed. This delta does the opposite: it registers the installer on both the local and remote paths and relies on managed_hooks_env_vars to pass ORCA_PANE_KEY (and the hook token) through to hooks. That rationale reads as superseded — if the env allowlist is what unblocks pane attribution, please update the description so a reviewer is not told hooks are inert when they will now install; if it is not, the registration reintroduces the per-event overhead the description warns against.
Technical details
# Stale PR description vs registered installer
## Affected sites
- PR description "Known limitation — live status pending, installer parked" / "Auto-install is therefore NOT wired (registry entries omitted)"
- `src/main/agent-hooks/managed-agent-hook-registry.ts:55,77,95,117` — `muse` now registered
- `src/main/agent-hooks/remote-managed-hook-installers.ts:77` — remote `muse` installer registered
- `src/main/muse/hook-config-json.ts:14-25` — `MUSE_MANAGED_HOOK_ENV_VARS` (the env-allowlist mechanism)
## Open questions for the human
- Is `managed_hooks_env_vars` the shipped Muse 1.3.0 env-allowlist, and does it deliver `ORCA_PANE_KEY` to the managed script?
- The description also cites `muse 1.0.3` while the code now says `1.3.0`, and claims the changed-code quality gate passed (it reports 15 findings on this head).ℹ️ Nitpicks
remove()intentionally keeps Orca's env-var names (includingORCA_AGENT_HOOK_TOKEN) in the user's globalmanaged_hooks_env_vars(asserted inhook-service.test.ts:97-98). Consider dropping only the Orca-owned names on remove while preserving user entries, symmetric with how the pointer is removed.- Version references in comments are inconsistent after the bump: several still say
muse 1.0.3(muse-events.ts:15,provider-event-routing.ts:36,137,hook-service.ts:39,hook-settings.ts:17,agent-session-resume.ts:230,session-scanner-test-fixtures.ts:197) while others say1.3.0.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
|
@nwparker @brennanb2025 — could you please review the latest Muse 1.3 updates in this PR and approve/run the workflows currently awaiting approval? The managed-hook allowlist, local/SSH hook registration, Agent History, resume wiring, Source Control support, tests, and screenshots are now included. The actionable review threads have also been addressed and resolved. Thank you! |
There was a problem hiding this comment.
ℹ️ No new issues in this commit — it cleanly addresses the prior inline feedback and the focus suites pass. One merge-readiness note carried from the prior review is below.
Reviewed changes
Re-reviewed the single commit landed since the prior pullfrog review (f6f40cc): 139ff83 (fix: address Muse hook review feedback). Also re-read the full PR diff end to end for context.
- Roster tests updated —
managed-hook-local-filesystem.test.tsnow expects 15 install results and excludes Muse'smuse-hooks.jsondescriptor from the executable-script assertion;remote-hook-service-installers.test.tsregistersmuseHookServicein the invariant map. - Muse refresh no longer touches HOME synchronously —
MuseHookService.refreshManagedScripts()dropped theexistsSync/writeTextFileAtomicrewrite of the managed-hooks JSON (written byinstall(), and its command depends only on the stable~/.orca/agent-hooks/muse-hook.shpath), matching every other service. isRecognizedAgentTyperestored tomain's shape — early-return form, clearing the changed-lineas TuiAgentfinding.- PR description corrected — no longer claims the installer is parked; now documents the
managed_hooks_env_varsunblock.
Verification: managed-hook-local-filesystem.test.ts, remote-hook-service-installers.test.ts, and managed-hook-script-refresh-main-thread.test.ts — 3 files, 28 tests pass.
ℹ️ Changed-code quality gate remains red on the PR's Muse files
pnpm run check:code-quality:changed reports 14 typescript/consistent-type-assertions findings in PR-authored files (src/main/muse/hook-config-json.ts:42,74,81,92, hook-settings.ts:117,125, hook-service.ts:111, hook-config-json.test.ts:32, hook-service.test.ts:55,60,95,122, and src/main/ai-vault/session-scanner-muse-parser.ts:215). pr.yml's "Enforce changed-code quality" step runs exactly this command, so the step fails once CI runs on this head. These are unchanged by this commit and were raised on the prior review; I'm re-flagging only because the description's quality-gate claim — the sole prior acknowledgement — has now been removed, so this can read as resolved when it is not. AGENTS.md permits these casts only with a line-specific SAFETY: rationale.
Technical details
# Changed-code quality gate red on Muse files
## Affected sites
- `src/main/muse/hook-config-json.ts:42,74,81,92` — `parseJsonc(...) as Record<string, unknown>`
- `src/main/muse/hook-settings.ts:117,125` — `as { hooks?: unknown }` / `as { command?: unknown }`
- `src/main/muse/hook-service.ts:111` — `JSON.parse(managedText) as HooksConfig`
- `src/main/muse/hook-config-json.test.ts:32`, `src/main/muse/hook-service.test.ts:55,60,95,122`
- `src/main/ai-vault/session-scanner-muse-parser.ts:215`
## Required outcome
- `pnpm run check:code-quality:changed` reports 0 findings for the PR's changed lines, or each remaining cast carries a line-specific `SAFETY:` rationale per AGENTS.md.
## Verification
- `pnpm run check:code-quality:changed`DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
|
@pullfrog Addressed the remaining changed-code quality finding from this review in |
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
Re-reviewed the single commit landed since the prior pullfrog review (139ff83): e163a0f (fix: satisfy Muse type assertion gate). Both open threads from the prior review are already resolved.
- Muse settings parsing narrows instead of casting —
parseMuseSettingsTextreturnsRecord<string, unknown> | nullthroughisPlainObject, andserializeMuseSettingsroutes every parse through it (src/main/muse/hook-config-json.ts). - Hook parsing accepts
unknownand narrows —MuseHookService.getStatusholds the parsed managed-hooks JSON asunknown, andreadManagedMuseHookEvents/managedHookEntries/hookEntryCommandnarrow withisPlainObjectinstead ofas { hooks?: unknown }/as { command?: unknown }(src/main/muse/hook-settings.ts,src/main/muse/hook-service.ts). - Parser dedupe accumulator annotated — the fold state in
session-scanner-muse-parser.tsis now typed explicitly, droppingnull as string | null. - Tests migrated to the narrowing parser —
hook-config-json.test.tsandhook-service.test.tsparse fixtures throughparseMuseSettingsText, including the malformed-input rejection case.
Verification: pnpm run check:code-quality:changed now reports 0 findings across 60 changed files (the gate was red on 139ff83), and the five focused Muse/hook suites pass (37 tests).
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
Re-reviewed the single commit landed since the prior pullfrog review (139ff83): e163a0f (fix: satisfy Muse type assertion gate). The claim in the mention holds — all 14 previously flagged typescript/consistent-type-assertions findings are gone.
- Muse hook config parses through the runtime parser —
serializeMuseSettingsnow usesparseMuseSettingsTextinstead ofparseJsonc(...) as Record<string, unknown>, so malformed JSON is reported through the same diagnostic path as the reader. - Hook status narrows instead of asserting —
MuseHookService.buildStatusparses the managed file intounknown, andreadManagedMuseHookEventsacceptsunknownand narrows viaisPlainObject;managedHookEntries/hookEntryCommandread the narrowed record directly. - Tests use the parser or explicit annotations —
hook-config-json.test.tsandhook-service.test.tsread settings withparseMuseSettingsText, and the managed-file reads carry explicit record types instead of casts. - Parser dedupe typed explicitly —
session-scanner-muse-parser.tsreplacesnull as string | nullwith an explicit{ text: string | null; ms: number | null }annotation.
Verification: pnpm run check:code-quality:changed reports 0 findings across all seven lanes; focused Muse and agent-hook suites pass (6 files).
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
|
Thank you for this! First-class Muse Code support has now landed in #22216, which builds on its overall harness structure: managed hooks, session history/resume and Source Control patterns from this PR (credited in the PR description). Closing as superseded. |




Adds Meta's Muse (
museCLI) as a first-class Orca agent, validated against Muse Code 1.3.0.What changed
museinternal agent id and CLI command); removes the previous MuseCode naming.muse execwith write, shell, web-tool, and approval restrictions.muse resume <uuid>.managed_hooks_pathandmanaged_hooks_env_varssettings.Muse 1.3 finding
The earlier blocker described in this PR no longer applies to Muse 1.3. Muse now supports managed hook environment-variable delivery, so Orca can install the hook and receive attributable
UserPromptSubmitandStopevents. The implementation therefore includes the hook registry and remote installer instead of leaving status support parked. This addresses the behavior discussed in meta-models/muse-code-sdk#4.Verification
pnpm tc— passed.muse resume <uuid>command for the real session. A completed-session smoke reached Muse's workspace-trust prompt; the automated run did not accept that interactive prompt.muse execpath were verified; the final Electron smoke did not reach the screenshot step after stopping at the resume trust prompt.Screenshots
Muse in agent settings
Muse in the new-tab launcher
Muse Code 1.3.0 running in Orca
Real Muse session in Agent History
Deliberately not included
usage/readandusage/changedover MSP, but the snapshot is host-local state observed from model responses handled by that same long-lived MSP host. It is not persisted or shared with the standalone Muse TUI processes Orca currently launches. Supporting it therefore requires Orca-managed MSP sessions (or a future standalone/persisted Muse usage surface), not substituting Agent History token totals for account quota. Session token totals remain available as historical session metadata.