Skip to content

feat(agents): add Muse as a supported TUI agent - #19188

Closed
homesh-dev wants to merge 14 commits into
stablyai:mainfrom
homesh-dev:feat/musecode-agent
Closed

homesh-dev wants to merge 14 commits into
stablyai:mainfrom
homesh-dev:feat/musecode-agent

Conversation

@homesh-dev

@homesh-dev homesh-dev commented Sep 7, 2026 •

Copy link
Copy Markdown

Adds Meta's Muse (muse CLI) as a first-class Orca agent, validated against Muse Code 1.3.0.

What changed

  • Uses Muse consistently across Orca (muse internal agent id and CLI command); removes the previous MuseCode naming.
  • Adds launch, detection, permissions, icons, desktop/mobile catalogs, telemetry, i18n, skills, and headless-command recognition.
  • Adds Source Control commit-message generation through muse exec with write, shell, web-tool, and approval restrictions.
  • Adds Agent History discovery for Muse JSONL sessions on local, WSL, and SSH hosts, including titles, cwd, model, tokens, timestamps, previews, and muse resume <uuid>.
  • Adds complete local and SSH managed-hook install/status/remove support using Muse's managed_hooks_path and managed_hooks_env_vars settings.
  • Passes Orca's pane/session attribution variables through Muse's managed environment allowlist, including hook endpoint/token, pane, tab, worktree, and launch-token values.

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 UserPromptSubmit and Stop events. 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.
  • 12 focused suites / 260 tests — passed.
  • Pre-commit oxlint, React Doctor lint, and formatting — passed.
  • Real Muse Code 1.3.0 launch in hidden/background Electron — passed.
  • Muse appears in Settings and the new-tab agent launcher — passed.
  • A real Muse session is discovered and rendered in Agent History — passed.
  • Installed Muse hook script delivered real-shape prompt/stop payloads through Orca's hook endpoint and produced working/done events — passed.
  • Orca emitted the correct 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.
  • Source Control's Muse command contract and the real muse exec path 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 agent settings

Muse in the new-tab launcher

Muse in the new-tab launcher

Muse Code 1.3.0 running in Orca

Muse 1.3 Electron smoke

Real Muse session in Agent History

Muse session history

Deliberately not included

  • Live quota/account tracking: Muse 1.3 exposes usage/read and usage/changed over 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.
  • Session deletion: a Muse session spans its JSONL data and index metadata, so this PR keeps it non-deletable rather than risking partial deletion.

@coderabbitai

coderabbitai Bot commented Sep 7, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Team

Run ID: 1a5f86f4-c7a9-4c4f-972f-bed1a83baa93

📥 Commits

Reviewing files that changed from the base of the PR and between 045e1be and f111c32.

📒 Files selected for processing (1)
  • src/main/musecode/hook-service.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/main/musecode/hook-service.ts

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


📝 Walkthrough

Walkthrough

Adds MuseCode as a supported TUI agent. The change defines its muse command, startup behavior, selection priority, permissions, process recognition, headless detection, telemetry, session scanning, hook management, resume behavior, skill discovery, and display labels. It also adds desktop and mobile catalog entries, localized labels, favicon mappings, and documentation. Tests cover startup, process recognition, hooks, event normalization, session parsing, remote scanning, and resume commands.

Merge Risk: 🔵 Low · up to f111c

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)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 23.08% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 52 functions across 53 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 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 identifies the primary change: adding Muse as a supported TUI agent. It is concise and relevant, although it does not cover the broader session-history and hook integration work.
Description check ✅ Passed The description is detailed and covers the user-facing changes, rationale, linked issue, screenshots, testing, verification results, and out-of-scope items. It omits several template headings and chec…

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


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Team

Run ID: 7df9c366-9a1f-4956-9de0-a7fe7091d133

📥 Commits

Reviewing files that changed from the base of the PR and between 6c8ce54 and 3342e8f.

📒 Files selected for processing (24)
  • README.md
  • 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-status.ts
  • src/renderer/src/lib/tui-agent-startup.test.ts
  • src/shared/agent-headless-command.ts
  • src/shared/agent-kind.ts
  • src/shared/agent-process-recognition.test.ts
  • src/shared/agent-status-types.ts
  • src/shared/agent-type-label.ts
  • src/shared/musecode-headless-command.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/renderer/src/i18n/locales/en.json Resolved
Comment thread src/renderer/src/i18n/locales/ja.json Resolved
Comment thread src/shared/musecode-headless-command.ts Resolved
Comment thread src/shared/tui-agent-config.ts Resolved

@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 -- 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 musecode member wired through tui-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 isMusecodeHeadlessOneShotCommand matcher treats muse exec … as a one-shot while muse resume and bare muse stay live.
  • Tests — startup argv injection and process-recognition coverage for the new agent.

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

Comment thread src/shared/tui-agent-config.ts Resolved

@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

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.ts plus provider-dispatch / provider-event-routing / source-routing / agent-hook-relay / agent-hook-types cases normalize MuseCode's Claude-compatible payloads and route /hook/musecode.
  • Resume wiring — RESUMABLE_TUI_AGENTS, extractAgentProviderSession, and getAgentResumeArgv (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?

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

Comment thread src/shared/agent-hook-types.ts Resolved

@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

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 win

Set MuseCode to stdin-after-start. With 'argv', the startup planner builds muse exec, which selects the headless exec subcommand. The stdin-after-start mode launches muse first and delivers exec as prompt input.

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

1-14: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Continue MuseCode subcommand matching after --

MuseCode 1.0.3 dispatches command words after --, but isMusecodeHeadlessOneShotCommand returns false at that token. Thus recognizeAgentProcessFromCommandLine('muse -- exec …') retains the process as an interactive musecode agent, 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 no argvPromptSeparator and 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

📥 Commits

Reviewing files that changed from the base of the PR and between 3342e8f and 76650f8.

⛔ Files ignored due to path filters (1)
  • src/shared/agent-icons/musecode.png is excluded by !**/*.png
📒 Files selected for processing (18)
  • mobile/src/components/mobile-agent-icon-assets.ts
  • src/main/agent-hooks/server-retired-pane-new-turn.test.ts
  • src/main/musecode/hook-config-json.test.ts
  • src/main/musecode/hook-config-json.ts
  • src/main/musecode/hook-service.test.ts
  • src/main/musecode/hook-service.ts
  • src/main/musecode/hook-settings.ts
  • src/renderer/src/lib/agent-favicon-assets.ts
  • src/renderer/src/runtime/agent-resume-host-authority-capability.ts
  • src/shared/agent-hook-listener-claude-compatible-vendors.test.ts
  • src/shared/agent-hook-listener/provider-dispatch.ts
  • src/shared/agent-hook-listener/provider-event-routing.ts
  • src/shared/agent-hook-listener/providers/musecode-events.ts
  • src/shared/agent-hook-listener/source-routing.ts
  • src/shared/agent-hook-relay.ts
  • src/shared/agent-hook-types.ts
  • src/shared/agent-session-resume.ts
  • src/shared/skill-install-providers.ts

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

Comment thread src/main/musecode/hook-settings.ts Resolved

@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 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.ts folds the append-only session.jsonl envelope log (bare + retained_frame records, µ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 local AI_VAULT_AGENT_SOURCES and remote remoteSessionSources, plus the musecode parser/source cases.
  • Resume — muse resume <uuid> added to buildAgentResumeInvocation.
  • Catalog + docs — AI_VAULT_AGENTS / label entries (single source of truth driving the RPC schema, renderer filter, and mobile), a home-musecode skill-discovery source, and the session-history docs.

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

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

ℹ️ 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 — isMusecodeHeadlessOneShotCommand now matches a bare exec token anywhere (dropping the -- early-return), consistent with the verified muse -- resume / muse -- exec binary behavior and the "no -- separator" config claim.
  • Dedup coverage added — the musecode fixture now emits a run.started record carrying the same prompt as the intent record, so the < 60s foldUserTurn dedup window is actually exercised (messageCount stays 2).
  • Status hardening — readManagedMusecodeHookEvents now treats null definitions, non-array hook lists, null entries, and non-string commands as absent via managedHookEntries / hookEntryCommand, with a regression test asserting getStatus() degrades to partial instead of throwing.
  • Parking rationale documented — comments on AGENT_HOOK_TARGETS and the parked service clarify why the 'musecode' membership is retained without a registered installer.

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

Comment thread src/main/musecode/hook-service.ts Resolved

@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

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 — agentForNormalizedProcess now maps a muse-bin- prefix to 'musecode', mirroring the existing codex- / grok- precedent, so the muse launcher's muse-bin-<version> sibling (truncated to muse-bin-1.0.3-R in macOS comm output) is recognized as MuseCode in foreground detection.
  • Tests — exact toEqual coverage for the full versioned name, the comm-truncated name, and a full path.

Pullfrog  | View workflow run | Using 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
@homesh-dev

Copy link
Copy Markdown
Author

Electron smoke test

✅ Basic hidden-renderer Electron smoke passed against this branch (1 passed, Playwright/CDP, ORCA_BACKGROUND_LAUNCH=1).

Validated:

  • MuseCode is detected and listed in the + launcher.
  • MuseCode appears in Settings → Agents.
  • MuseCode sessions render in Agent Session History alongside existing Codex history.
  • Existing New Terminal behavior still creates and focuses a terminal tab.
  • Source Control AI commit-message generation uses muse exec with write, shell, and web tools disabled while retaining session logging, so generated sessions remain visible in history.

The screenshots below contain disposable E2E data only—no real credentials or session content.

New-tab launcher

MuseCode in the new-tab launcher

Agents settings

MuseCode in Agents settings

Agent Session History

MuseCode and Codex sessions in Agent Session History

Additional checks: focused unit suites (54 passed), pnpm tc:node, oxlint, and oxfmt.

@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 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 musecode spec added to commit-message-agent-specs-secondary.ts (muse exec --disable-write --disable-shell --disable-web-tools --approval-mode never [--model] [--reasoning-effort] <prompt>, promptDelivery: 'argv', static default model), with an exact-argv test and the agent added to the capability list.
  • main merges — 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 to RemoteSessionContent / remoteSessionContentLines.
  • Screenshots — three smoke images under docs/assets/pr-19188/.

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

Comment thread src/shared/agent-process-recognition.ts Resolved
@homesh-dev homesh-dev changed the title feat(agents): add MuseCode as a supported TUI agent feat(agents): add Muse as a supported TUI agent Sep 22, 2026

@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

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 → muse end to end — agent id, TuiAgent/kind/telemetry/status enums, source routing (/hook/muse), files (src/main/muse/*, session-scanner-muse-*), icon, i18n, and catalogs. No musecode reference remains in the tree.
  • Registered the Muse hook installer — added muse to MANAGED_AGENT_HOOK_INSTALLERS, ..._SCRIPT_REFRESHERS, ..._REMOVERS, ..._STATUS_READERS, and the remote installer list (previously parked and unregistered).
  • Added a managed_hooks_env_vars allowlist — serializeMuseSettings now writes/merges the ORCA_* env names into ~/.config/muse/settings.json, and getStatus reports partial when any are missing.
  • Fixed the session-file parser call — parseMuseSessionFile now passes {} for options and the sink as messages (previously the sink landed in the options slot).
  • Version references bumped to 1.3.0 in several comments; a sessionSegments helper 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 (including ORCA_AGENT_HOOK_TOKEN) in the user's global managed_hooks_env_vars (asserted in hook-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 say 1.3.0.

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

Comment thread src/main/muse/hook-service.ts Resolved
@homesh-dev

Copy link
Copy Markdown
Author

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

@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 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.ts now expects 15 install results and excludes Muse's muse-hooks.json descriptor from the executable-script assertion; remote-hook-service-installers.test.ts registers museHookService in the invariant map.
  • Muse refresh no longer touches HOME synchronously — MuseHookService.refreshManagedScripts() dropped the existsSync/writeTextFileAtomic rewrite of the managed-hooks JSON (written by install(), and its command depends only on the stable ~/.orca/agent-hooks/muse-hook.sh path), matching every other service.
  • isRecognizedAgentType restored to main's shape — early-return form, clearing the changed-line as TuiAgent finding.
  • PR description corrected — no longer claims the installer is parked; now documents the managed_hooks_env_vars unblock.

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`

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

@homesh-dev

homesh-dev commented Sep 22, 2026 •

Copy link
Copy Markdown
Author

@pullfrog Addressed the remaining changed-code quality finding from this review in e163a0f6aa: removed all 14 flagged Muse type assertions using existing runtime narrowing or explicit annotations. Verified against refreshed upstream/main: check:code-quality:changed passes all seven lanes with 0 findings; pnpm tc passes; 6 focused suites / 39 tests pass.

@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

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 — parseMuseSettingsText returns Record<string, unknown> | null through isPlainObject, and serializeMuseSettings routes every parse through it (src/main/muse/hook-config-json.ts).
  • Hook parsing accepts unknown and narrows — MuseHookService.getStatus holds the parsed managed-hooks JSON as unknown, and readManagedMuseHookEvents / managedHookEntries / hookEntryCommand narrow with isPlainObject instead of as { 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.ts is now typed explicitly, dropping null as string | null.
  • Tests migrated to the narrowing parser — hook-config-json.test.ts and hook-service.test.ts parse fixtures through parseMuseSettingsText, 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).

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

@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

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 — serializeMuseSettings now uses parseMuseSettingsText instead of parseJsonc(...) as Record<string, unknown>, so malformed JSON is reported through the same diagnostic path as the reader.
  • Hook status narrows instead of asserting — MuseHookService.buildStatus parses the managed file into unknown, and readManagedMuseHookEvents accepts unknown and narrows via isPlainObject; managedHookEntries / hookEntryCommand read the narrowed record directly.
  • Tests use the parser or explicit annotations — hook-config-json.test.ts and hook-service.test.ts read settings with parseMuseSettingsText, and the managed-file reads carry explicit record types instead of casts.
  • Parser dedupe typed explicitly — session-scanner-muse-parser.ts replaces null as string | null with 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).

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

@nwparker

Copy link
Copy Markdown
Contributor

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.

@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