Skip to content

Add Muse MSP protocol, catalog discovery, and request handling - #682

Merged
SDSLeon merged 6 commits into
masterfrom
poracode/tender-marten-dd8c60cc
Sep 3, 2026
Merged

Add Muse MSP protocol, catalog discovery, and request handling#682
SDSLeon merged 6 commits into
masterfrom
poracode/tender-marten-dd8c60cc

Conversation

@SDSLeon

@SDSLeon SDSLeon commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

Tickets: none

  • Feature: add Muse MSP wire support (stdio transport, protocol, probes) so Poracode can talk to the Muse CLI over the structured protocol instead of terminal-only heuristics.
  • Feature: discover models from the MSP catalog and surface Spark 1.3 options via dynamic help probing, including renderer/status-cache wiring.
  • Feature: answer server-initiated MSP requests, classify process exits, and treat retryable errors so sessions recover instead of failing closed; include logout.
  • Bugfix: pipe the Meta installer script to bash (not sh) and re-verify terminal/session discovery against Muse CLI 1.0.2.

Default to muse-spark-1.3 (released 2026-09-02) and keep the 1.2 pair plus 1.1 as fallbacks.

The capabilities probe now also adopts the installed CLI's --help: the --reasoning-effort enum becomes the effort ladder (sentinel-gated) and newly mentioned muse-spark-X.Y ids are appended. The overlay is strictly additive on both axes - curated entries are never removed, a truncated enum can neither shrink the picker nor orphan defaultEffort, and the default model never moves.
install.sh opens with 'set -o pipefail', which dash rejects with 'Illegal option -o pipefail'; the script then dies instantly and curl fails writing to the dead pipe (exit 23). Pipe to bash like Meta documents and like the other providers already do. Validated live by installing Muse 1.0.2 in WSL with the fixed command.
…st CLI 1.0.2

Drove the echo-provider TUI under a PTY against real 1.0.2 output: the status strip gained Thinking and Double checking states (matched glyph-anchored so the Thinking frame, which carries no 'esc to interrupt' text, no longer misreports as idle) and the composer hint changed to 'Type @ to search and insert workspace file paths' (kept as one fallback entry with the old Voice input hint so idle corroboration still works per version).

Session discovery re-verified against a real echo-provider run (date-sharded session.jsonl with a single runtime.session.metadata record); discovery ignores the new subagent-nested UUID dirs and sidecars. Resume --last on an empty store exits 0 and root options may sit on either side of resume.
Add a Muse-owned MSP (Muse Session Protocol) client foundation under muse/msp, mirroring the Codex app-server patterns without importing them: NDJSON stdio transport, id-correlated JSON-RPC client (initialize/initialized handshake, timeouts, notification fan-out, teardown), serve argv + approval-mode mapping, UUIDv7 command ids, and an ephemeral-host model/list probe with timeout/abort handling and schema-drift warnings.

Wire the probe types plus the real 1.0.2 schema export as a fixture with a drift-detection test. The serve probe itself stays unwired until the session factory lands: advertising gui without one would surface a Chat toggle whose open throws. Wire buildAcpLogoutCommand (muse logout) with authLogoutSupported and bump both status caches (supervisor 21->22, renderer 18->19) so the Settings logout action appears.
Wire probeMuseModelCatalog into capabilitiesProbe: when the serve host answers with a live catalog, unknown model ids are appended after the curated defaults with catalog display labels and context limits (authoritative per id, 1M otherwise), on the help-probed effort ladder. Unauthenticated/failed probes keep the static plus --help result with zero behavior change. Models are now dynamic the same way efforts are; the curated list remains the offline fallback and the default never moves.
…xit classification

Docs review against the published MSP guides found three gaps. The client now answers server-initiated JSON-RPC requests (approval/request, userInput/request) via an onServerRequest hook with a methodNotFound default, so the host never hangs awaiting a reply. MspRpcError carries the server retryable verdict with an isRetryableMspError kind fallback (overloaded/backpressured). New exit classifier maps serve exit codes per the exit-classification guide (0-5 plus crash row with forward-compat rule) and feeds spawn diagnostics.

Also validates catalog parsing against the public model-round-trip transcript frames and records the hand-rolled-vs-SDK decision (build: pre-1.0 SDK pins a different schema fingerprint than installed hosts) in protocol.ts.
@SDSLeon
SDSLeon merged commit 6f76054 into master Sep 3, 2026
8 checks passed
@SDSLeon
SDSLeon deleted the poracode/tender-marten-dd8c60cc branch September 3, 2026 03:09
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.

1 participant