Repository navigation
Conversation
Add muse to the native chat transcript agents so Muse sessions open in the chat view instead of staying a raw terminal, like claude, codex, grok and omp already do. - New decodeMuseTranscriptLine over session.jsonl: user turns from runtime.user_intent.accepted, assistant text, tool calls/results, question cards, and the shared interrupted row for cancelled runs. - Id-based resolver matching the parent-dir session id, reusing the XDG-aware muse sessions dir; subagent logs never cross-match. - Wire through the full reader, live tailer, and journal legacy import. - Muse joins the local-transcript gate: its hook reports no path. Fixes stablyai#22990, contributes to stablyai#29162.
|
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:
📝 Walkthrough
Priority: ➖ Normal Merge Risk: 🔵 Low · up to
|
There was a problem hiding this comment.
Actionable comments posted: 2
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
537ff6ca-5a71-4825-985e-d6428b7c2d78
📒 Files selected for processing: 12
mobile/src/session/mobile-native-chat-eligibility.test.tssrc/main/ai-vault/session-scanner-muse-parser.tssrc/main/native-chat/agent-session-journal/journal-legacy-import.tssrc/main/native-chat/session-file-resolver.test.tssrc/main/native-chat/session-file-resolver.tssrc/main/native-chat/transcript-line-decoders-muse.tssrc/main/native-chat/transcript-line-decoders.muse.test.tssrc/main/native-chat/transcript-line-decoders.tssrc/main/native-chat/transcript-reader.tssrc/main/native-chat/transcript-tail-reader.tssrc/shared/native-chat-agent-support.test.tssrc/shared/native-chat-agent-support.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
Carry tool_call_id onto Muse tool-result blocks. Without the call id the chat treats the output as unattributed and hides it behind the bare call row, so tool output never rendered.
Headless Electron spec following the zcode transcript precedent: seed an isolated Muse session.jsonl covering every row kind, toggle a terminal tab to chat view, assert each kind plus ordering and bookkeeping absence, then verify a live append lands. XDG_DATA_HOME is pinned to the isolated home so the run never reads live Muse logs.
Mirror the claude live-session options for Muse: scrape model/effort from the TUI status line, switch effort mid-session through /effort, and render the reported model id on the pill. No model picker: model ids are account-scoped and Muse has no listing command, so the pill names the running model without offering choices. Unlisted-but-tracked model rows now receive the catalog unknown-model options so their pills keep working.
Strict callers must distinguish an unreadable tree from a missing session; the Muse branch now threads the flag into the walk like the tiered agents do.
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
8a711995-1e8a-4ae7-a3c1-9aecfddf53ac
📒 Files selected for processing: 8
src/renderer/src/components/native-chat/muse-terminal-session-options.test.tssrc/renderer/src/components/native-chat/muse-terminal-session-options.tssrc/renderer/src/components/native-chat/use-native-chat-session-options.test.tssrc/renderer/src/components/native-chat/use-native-chat-session-options.tssrc/shared/agent-session-option-catalog-muse.test.tssrc/shared/agent-session-option-catalog-muse.tssrc/shared/native-chat-session-option-snapshot.test.tssrc/shared/native-chat-session-option-snapshot.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
|
drove this end to end on a real desktop (xvfb + openbox, this branch, real what i walked through: enabled chat ui in settings, ran muse in a workspace terminal (orca detects it as a muse session), toggled to chat from the terminal context menu, expanded the turn + tool runs + a tool output box, opened the model/effort pill, switched max -> med and watched the live tui status line follow, sent a follow-up from the chat composer, toggled back to the terminal with full history intact. one thing worth knowing: muse has no chat providers settings row, same as zcode. that list is structured (acp) agents + the claude/codex builtins; muse renders through the terminal-transcript path so the toggle lives on the terminal tab instead. noted that in the body too. |
Model/list names four meta-provider models with wonder 1.0 the default; /model takes the id inline mid-session. Effort gains the documented none tier. Permissions offers the four permissionProfile/list built-ins through the TUI's own /permissions picker, with no launch flag so a picked model never silently changes the session's security posture.
Transcribed from the TUI's own help list; entries without name bytes stay out. Shared by desktop and mobile, so both menus and send classification cover /model, /effort, /permissions, and the rest.
The mobile controller only built catalogs for claude, codex, and omp; Muse renders its snapshot from the same shared catalog now.
Muse has no structured adapter so no host ever registers it; the settings list now unions the chat-capable transcript agents this computer detected (or the user already chose) with the host-registered structured agents.
Mirrors the Grok section: the main process reads only the display metadata from the CLI's auth file and the section guides signed-out users through muse login, which stays CLI-owned.
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to GitHub limitations.
🟡 Minor · Keep the tracked model when opening the… · use-mobile-native-chat-session-options.ts:275-290
mobile/src/session/use-mobile-native-chat-session-options.ts:275-290
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winKeep the tracked model when opening the permissions picker.
Muse maps
permissionProfileto the/permissionsagent picker. This branch clears the tracked model and all values scoped to that model for every agent picker. The subsequent snapshot rebuild can therefore lose the selected model and its model-scoped options.Keep the existing clearing behavior for
/modelpickers, but do not apply it to/permissions.Suggested fix
- clearNativeChatSessionModel(record) + if (midSession.command === '/model') { + clearNativeChatSessionModel(record) + }
🔇 Additional comments: 2
mobile/src/session/use-mobile-native-chat-session-options.ts: 1
283-283: 🎯 Functional CorrectnessThe exact effect of
clearNativeChatSessionModel(record)is not available in the inspected output. The available source shows that the call runs for everyagent-pickeraction, but it does not establish whether the function removes the tracked model or model-scoped option values. The claim cannot be decided from the available evidence.src/shared/agent-session-option-catalog-muse.ts-69-70: 1
69-70: 🔒 Security & Privacy | 🟠 Major | 🏗️ Heavy lift
⚠️ Unverified finding
Verification ran but could not confirm this finding. It is shown for review, not as a verified issue.Apply explicitly selected permission profiles at launch.
If a worker selects
:read-only,resolveAgentSessionOptionLaunch('muse', { model: 'muse-spark-1.3', permissionProfile: ':read-only' })drops that selection because this option has nolaunchArgs. Muse then starts with its configured profile, which can be less restrictive than the selected profile. Preserve the configured default when the user makes no selection, but pass an explicit selection to Muse or remove this option from worker launch preferences. Muse supports a launch-time permission-profile selection. (dev.meta.ai)
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
d1bd18b1-e9d7-48d8-9459-91e5da1e50c5
📒 Files selected for processing: 30
mobile/src/session/use-mobile-native-chat-session-options.test.tsmobile/src/session/use-mobile-native-chat-session-options.tssrc/main/ipc/muse-accounts.tssrc/main/ipc/register-core-handlers/register-core-handlers.test.tssrc/main/ipc/register-core-handlers/register-core-handlers.tssrc/main/muse-accounts/auth.tssrc/main/muse-accounts/status.test.tssrc/main/muse-accounts/status.tssrc/preload/api-types.tssrc/preload/api/agent-account-api.tssrc/preload/api/muse-accounts-bridge.tssrc/preload/index.tssrc/renderer/src/components/native-chat/muse-terminal-session-options.tssrc/renderer/src/components/native-chat/use-native-chat-session-options.test.tssrc/renderer/src/components/settings/AccountsPane.tsxsrc/renderer/src/components/settings/ChatSettingsSection.test.tsxsrc/renderer/src/components/settings/MuseAccountsSection.test.tsxsrc/renderer/src/components/settings/MuseAccountsSection.tsxsrc/renderer/src/components/settings/NativeChatProvidersSetting.tsxsrc/renderer/src/components/settings/accounts-search.tssrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/web/preload-api/web-agent-accounts-api.tssrc/renderer/src/web/web-preload-api-composition.test.tssrc/renderer/src/web/web-preload-api.tssrc/shared/agent-session-option-catalog-muse.test.tssrc/shared/agent-session-option-catalog-muse.tssrc/shared/native-chat-session-option-snapshot.test.tssrc/shared/native-chat-slash-commands.test.tssrc/shared/native-chat-slash-commands.tssrc/shared/rate-limit-types.ts
🚧 Files skipped from review as they are similar to previous changes: 1
- src/renderer/src/components/native-chat/muse-terminal-session-options.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
|
round 2 is up: muse chat now has the full model picker (all four meta models from model/list, wonder 1.0 default), mid-session /model switching, the documented none effort tier, and a permissions row with muse's own four profiles (read only / ask me / auto-review / unrestricted) that opens the tui's /permissions picker. also added: muse row in chat providers (transcript-only agents now list from the install inventory), a provider accounts section reading the cli session (mirrors grok, sign-in stays cli-owned), the 31-command / menu on desktop and mobile, and mobile picker parity. no launch flag for profiles by design, so a picked model never silently changes security posture. all suites green (desktop 205 + mobile 22 + 46 in the touched files), typecheck/lint/localization clean. |
The Muse TUI attaches pasted or dropped images as [Image #N] labels and advertises that file paths work for image paste, so Muse joins the raw path-paste attachment set instead of falling back to @file text mentions the model cannot see. Verified end to end that spark and wonder answer from an attached image.
|
round 3: dropped/pasted images now attach in muse chats exactly like codex. muse joins the raw path-paste attachment set (the tui turns a pasted image path into an [image #n] label per the musecode docs), instead of falling back to @file text the model can't see. verified live that spark 1.3 and wonder 1.0 both answer from an attached image, and that chat history renders the [image #n] turn. desktop + mobile + web client covered by the same shared table. |
A file dropped onto a remote terminal chat was refused with 'Local attachments are not available for remote sessions', even though the agent runs on a paired server that could receive the bytes. Route image drops through the same runtime temp pipeline a remote clipboard paste uses: the main process reads the authorized client-local file and saves it into the target runtime's temp dir, and the chips settle to the server-side paths the agent reads. Non-images and owners without an upload environment keep the unsupported refusal, and the local file check still starts in the same tick as the drop.
|
round 4: dropping an image onto a remote terminal chat (muse or codex on a paired server) no longer says local attachments are unavailable. the bytes now upload into the target runtime's temp dir through the same pipeline a remote clipboard paste uses, and the chips settle to the server-side paths the agent reads. non-images and owners without an upload environment keep the refusal. also kept the local file check starting in the same tick as the drop, since an awaited helper before it deferred the first stat and broke two existing tests. |
…t project files A photo dropped onto a remote terminal chat was refused with 'Access denied: path resolves outside allowed directories' whenever it lived outside the project roots, e.g. a picture from the Photos library. The drop names its file by an explicit user gesture, like an image shown in a transcript, so resolve it with the chat-image rule (any absolute local image) instead of the desktop roots check.
|
round 5: fixed the photo case — a drop onto a remote terminal chat no longer needs the file to live inside the project roots. dropped images now resolve with the chat-image rule (any absolute local image, same as transcript images), since the drop itself is the user naming the file. this was never agent-specific: a local codex chat never hits that gate, a remote muse chat does. |
|
e2e verified in the real app (chat view, local Muse session): drop onto the Orca composer attaches the image chip with no refusal, send delivers it, and the agent describes the image back. Model picker shows the live Muse catalog (Wonder 1.0, Wonder Full 1.0, Spark 1.3 selected, Spark 1.2) with effort None through Ultra, and turn timing plus session timestamps render. No code change needed: plus button and drop share one intake, and the drop handling is agent-agnostic (local vs remote target only, no per-agent or per-OS branch), so the remote-upload fix covers Muse the same as Codex. |
|
follow-up: exercised the real plus-button path too in the same Muse chat view (Attach file, native picker, picked the same png). chip attached with no refusal, send delivered, agent described the image back. plus and drop share one intake and both are agent-agnostic (local vs remote target only), so parity holds with no divergence and no code change needed. |
|
note on the menu row: Muse chat says 'No chat on this host' on every machine because no host registers a Muse structured adapter (catalog is pi/codex/claude/acp only, built-ins are claude/codex). terminal Muse (CLI) chat is unaffected. verified the fix path though: muse 1.4.10 serve speaks MSP v1 over stdio and a full session plus image turn round-trips. filed as #31997, adapter build is the follow-up. |
Register muse as a structured agent so hosts offer chat instead of 'No chat on this host'. A new MSP stdio client spawns 'muse serve', speaks initialize/session/turn/media/approval over NDJSON JSON-RPC with UUIDv7 command ids, and journals turns, messages, tool calls, approvals, and questions through the host sink. Steering injects into the running turn; Stop ends the child and the next send resumes the MSP session. Includes the host metadata, launch resolution, model catalog probe, location support, session history, and journal identity plus key round-trips.
…ct is wired The registry demands an adapter compact method for the capability. MSP compaction stays a follow-up, so declare compact false and keep the chat row live instead of failing registration.
|
fix pushed: the structured registry rejected muse at startup because the definition declared compact without an adapter compact method. msp session/compact stays a follow-up, so compact is false for now. verified live: the capability error is gone, the new-tab menu lists muse as a chat row, and a fresh turn round-trips (text in, five-word reply out, timings and history intact). |
ELI5
Muse sessions now open in Orca's chat view (desktop toggle and mobile) instead of staying a raw terminal, like Claude, Codex, Grok and OMP already do. Live Muse tabs also get the model/effort pill with a working effort switcher.
What Changed
musetoNATIVE_CHAT_SUPPORTED_AGENT_LISTand the transcript-agent resolution. Muse joins grok/omp/opencode in requiring a locally readable transcript: its hook reportstranscript_path: null, so under Model-A SSH there is no owning-host file to read.decodeMuseTranscriptLineover~/.local/share/muse/sessions/YYYY/MM/DD/<uuid>/session.jsonl:runtime.user_intent.accepted(refill blocks,model_messagesfallback) -> user turnassistant_message_committed-> assistant textassistant_tool_calls_committed/tool_result_batch_committed-> tool turns (args JSON parsed, output kept raw)user_input_prompt_requested/settled-> question card / user replyterminal-> the shared interrupted rowretained_frameretention envelopes) skips, never throws.resolveMuseSessionsDir(XDG-aware). A subagent log nests one level deeper, so its parent dir is the child id — a parent id can never match a child log. No WSL tier: the XDG-derived root has no fixed per-home segments for the WSL table.museTimestampMs(now exported) for the microsecond-to-millisecond conversion.<model> \u00b7 <effort> \u00b7 <cwd> \u00b7 <mode>), effort switches mid-session through/effort <level>, and the pill names the running model id. No model picker: ids are account-scoped andmusehas no listing command (model-profile showtakes an id, it does not list). Unlisted-but-tracked model rows now receive the catalog'sunknownModelOptionsso their pills keep their options.Why
#22216 made Muse a first-class agent but left its conversation as a terminal: native chat renders each agent's own JSONL transcript and Muse had no decoder.
#22998 implements this same scope but is conflicting against current main and untouched since Sep 26 (the tiered resolver refactor, opencode dispatch, and settings refactor all landed since). This PR carries that approach forward onto current main with the same decoder contract. If the author of #22998 prefers to rebase instead, happy to close mine in favor of theirs.
Alternatives considered:
run :: started.promptas a user-turn fallback — rejected; every parent log with assistant turns carriesuser_intent(verified: 18/18 across 3,602 local sessions), whilestartedfires ~318k times for tasks and runs, so folding it would flood the chat with bogus user turns.Linked Issue
Fixes #22990. Contributes to the umbrella #29162.
Visual Proof
No new UI components or strings: rendering reuses the existing message/turn UI. Verified end to end in headless Electron with the new
tests/e2e/native-chat-muse-transcript.spec.ts, which drives a seeded Musesession.jsonlthrough the real chat view in one pass and captures four frames (also uploaded by CI asplaywright-traces-*artifacts fromtest-results/):bashtool call with args JSON, paired output), question card with options, answer bubble, interrupted rowtoggle-to-chat-visible=78ms live-append-visible=868ms)Run it locally with
./node_modules/.bin/playwright test --config tests/playwright.config.ts --project=electron-headless --workers=1 tests/e2e/native-chat-muse-transcript.spec.ts(headless Linux needs the usual Electron system libs plusxvfb-run).Live desktop run (this branch on Xvfb + real
muse1.4.10, real credentials, scratch repo)Beyond the headless spec, I drove the app visually end to end: enabled Chat UI, ran
musein a workspace terminal, toggled to chat, switched effort from the pill, sent a follow-up from the composer, and toggled back. Everything below is a real frame from that session (full size in the visual-proof assets):Verified visually: user/assistant/tool turns render from the live log, tool outputs pair under their calls (
read_fileoutput box), the pill namesmuse-spark-1.3+ effort, picking an effort runs/efforton the live TUI (status line wentmax→medium, frame 9), composer sends land in the same session, and toggling back preserves the full TUI history. Note Muse intentionally has no Chat Providers settings row: that list covers structured (ACP) agents plus the Claude/Codex builtins, while Muse renders through the terminal-transcript path like zcode — the toggle appears on the terminal tab instead (frame 4).Testing
Decoder (10 tests), resolver (3), shared agent-support, mobile eligibility, status-line reader (7), catalog (3), snapshot/hook options, and one headless Electron spec cases. Also swept 3,602 real local Muse logs (4.8M lines): 308,830 decoded (user 162 / assistant 168,235 / tool 140,339 / system 94), zero thrown, zero empty turns. The e2e run caught one real bug fixed in this PR: Muse tool results initially omitted
callId, so the chat hid every tool output as unattributed. A follow-up live run with real credentials (temporary probe spec, deleted afterwards — real spend must never run in CI) drove an actual repo task through the chat in an isolated profile: live hook recognized the session, pills showedmuse-spark-1.3+ effort,/effortswitches took on the TUI status line (Low -> High -> Minimal; Ultra is gate-closed on this account and the TUI falls back to xhigh), the model read an orca source file and completed the task, tool runs rendered, and chat<time>nodes matched the session logrecorded_atexactly.pnpm tcclean,oxlintandoxfmtclean on all touched files, e2e typecheck ratchet clean; neighboring suites pass (transcript reader, tail reader, read cache, turn lifecycle, journal legacy import, muse vault scanner, mobile eligibility). Tested on Linux only; fullpnpm testandpnpm buildleft for CI.AI Disclosure
Written with AI assistance (Muse Code, Meta Muse Spark); verified with the repo's own test suites plus the real-log decode runs above.
Review
AI self-review summary (per CONTRIBUTING):
museSessionIdFromFilePath(basename/dirname) andresolveMuseSessionsDir(join/homedir/XDG_DATA_HOME), already used cross-platform by the AI Vault scanner and the usage provider. No new platform assumptions. Tested on Linux only; the date-sharded log layout is what Muse writes on all three platforms.transcript_path: null, so under Model-A SSH the chat view refuses instead of reading a wrong disk — same as grok/omp. Local and runtime-owned SSH paths are unchanged.satisfies neverexhaustiveness gate still holds. Renderer needs no code changes (generic predicates). No changes to hook, usage, or account systems.argsgo throughJSON.parsein try/catch (raw string fallback) — no eval.Agent skill upstream boundary
Notes
Ensure no issues in: Security, Cross-platoform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance
Covered in Review above. Mobile needs no code changes beyond this PR: the next companion build picks up the shared gate automatically (covered by the mobile eligibility test).
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)Live verification (structured-chat MSP host, build 1.4.238-musechat)
declares a capability its adapter has no compact for): compact declared false until MSP session/compact is wired. Fleet payloads0.1.0+dcd5179287f3(x64) and0.1.0+14f16f703db6(arm64) carry the fix; Mac asar v6 relaunched clean.