GeezerVison is showing github.com — Build the acpx 'muse' agent — ACP adapter for the Muse CLI over muse serve (implements #1721) · Issue #2012 · developing-today/code
Build the acpx 'muse' agent — ACP adapter for the Muse CLI over muse serve (implements #1721) #2012DescriptionImplements the design in #1721 (design note: #1721 (comment)). Owner decision 2026-10-28: GO — build it with the design note's rulings.
What this builds
A first-class acpx muse agent for OpenClaw: an ACP adapter whose harness runs the Muse CLI as the agent, backed by muse serve (MSP) on the laptop. This is a harness door into the one Meta pool (the Muse API High Usage plan) via the CLI's sanctioned OAuth login — it is NOT a model route, and the OpenCode muse provider closure of 2026-10-25 stands untouched.
Rulings folded in (from the design note)
- Q1: first-class door. The adapter sits alongside the existing acpx agents with per-agent command overrides pointing at laptop paths.
- Q2 (build-blocking): metering and capping are acceptance criteria, not follow-ups — plan-only by construction, a per-session usage ledger, a pre-dispatch pool check, and a per-session turn budget (below).
- Q3:
muse serve is the transport (owner's smoke test: warm turns 7.2–7.8s vs exec 13.3–18.0s). muse exec exists only as the degraded fallback when serve fails before a response is committed.
- Q4: the adapter owns no credentials and no login lifecycle. Auth is solely the CLI's laptop OAuth login (
~/.config/muse/auth.json).
Acceptance criteria
- acpx
muse agent registered and selectable in OpenClaw; an ACP session on it completes a real coding turn end-to-end on the laptop.
- Plan-only by construction: the child process is spawned with
META_API_KEY deleted from its environment; no API-key route exists anywhere in the adapter.
- Per-session usage ledger: the adapter records turns/usage per session in a durable, readable store.
- Pre-dispatch pool check: dispatch refuses to start when the freshest Meta pool reading (≤60 minutes old) shows 100%; burns over an hour re-check at least hourly.
- Per-session turn budget enforced from adapter config.
- Auth failures (expired/revoked login) surface as a terminal session error — "muse login required on laptop" — never a silent retry, route switch, or interactive login attempt by the adapter.
- CLI drift handled by probing
serve --help / exec --help at startup (the bin/muse-proxy.mjs pattern), never by version-string checks.
- The OpenCode
muse provider remains disabled and untouched by this work.
- Lands as a worktree branch + PR per fleet discipline (never the primary checkout).
Activitydeveloping-today commented on Oct 29, 2026 dezren39 commented on Oct 31, 2026 Status — owner order 2026-10-28, stalled, re-queued 2026-10-31.
Drew's GO on this build was given 2026-10-28, but the enqueue recorded that night landed in repo-health-code-shadow (task 2936) by helper default — never claimable by the pilot lanes, and this issue carried no queue labels, so nothing ever picked it up.
Remediation (2026-10-31, Oct-28 left-on-the-ground audit):
- Shadow row cancelled; the task was re-enqueued into repo-health-code-pilot — task 2936 is now
queued there (small_fix, priority 50, attempts 0/3, no not_before), verified by direct queue read after the move.
queue/queued label added to this issue.
- Queue signal refreshed.
The build is now live work for the next code lane shift. dezren39 commented on Nov 1, 2026 dezren39 commented on Nov 1, 2026 dezren39 commented on Nov 16, 2026
agent-note:v1
state: in-progress (PR #9026 rebased + verified; live meta turn waits on the pool gate it implements)
Done this shift:
- Dependency gate re-verified cleared: PR Wire OpenClaw ACP adapters to Nix runtime plugin #3275 MERGED 2026-11-16T08:22:39Z, codex-only (files: codex-acp-wrapper.mjs, default.nix) — it does not build the muse agent.
- Resumed the prior implementation (branch queue/2936-2012-acpx-muse-agent) instead of restarting: rebased onto current main (8818c6d), resolving the default.nix conflict against the code#1711 managed-wrapper layout. PR feat(openclaw): acpx muse agent — ACP<->MSP adapter over muse serve (#2012) #9026 is OPEN and MERGEABLE at that head.
- Unit tests: node --test muse-agent-acp-wrapper.test.mjs — 6/6 pass (happy path + env hygiene + ledger, fresh-100% refusal, stale reading not refusing, turn budget, terminal auth error, exec fallback). nix-instantiate --parse home/openclaw/default.nix OK.
- Live protocol smoke against the REAL muse serve binary (echo provider, stale pool fixture so no pool is drawn): ACP initialize -> session/new (real MSP session) -> session/prompt -> stopReason end_turn, agent text streamed as session/update chunks, ledger lines written with usage figures.
- Live pool-gate check against the REAL current reading (~/atlas/meta-quota-export/latest.json, measured 2026-11-16T09:30:37Z): the 5h window is at 102.47%, so session/new was REFUSED with "meta pool at capacity" and the refusal was ledgered — the gate working as designed, not a failure.
Remaining before merge: one real meta-provider coding turn through the adapter, which the gate correctly blocks until the 5h window resets (2026-11-16T11:04:30Z) or the rolling reading drops below 100%. This lane's shift budget covers that window; the turn, then merge, then task completion follow in this shift. dezren39 commented on Nov 16, 2026 Done — the acpx muse agent is built, verified live, and merged.
Merged: PR #9026, merge sha 28d566f261bbd36acccf3c6fbe223b741bc9a42d (2026-11-16T11:07:32Z).
What shipped
home/openclaw/acpx/muse-agent-acp-wrapper.mjs — ACP adapter for the Muse CLI: translates ACP <-> MSP against muse serve (design Consider: an acpx 'muse' agent — ACP adapter for the Muse CLI (plan-quota coding harness for OpenClaw) #1721). META_API_KEY is stripped from the child env; per-session JSONL ledger at ~/.local/state/muse-acp/ledger.jsonl; pre-dispatch meta-pool gate; per-session turn budget (MUSE_ACP_TURN_BUDGET, default 20); terminal auth error surfaces as "muse login required on laptop"; --help capability probing; muse exec fallback only before first output is committed.
- Registration wired in
home/openclaw/default.nix in all three places: managed wrapper file ~/.openclaw/acpx/managed-muse-agent-acp-wrapper.mjs, ~/.acpx/config.json agents, and acp.allowedAgents + the embedded acpx plugin agents.muse.
- Tests:
node --test home/openclaw/acpx/muse-agent-acp-wrapper.test.mjs — 9/9 pass. nix-instantiate --parse home/openclaw/default.nix OK.
Review: all 5 Codex findings on the original head fixed in 671e07e3a3 and dispositioned in their PR threads (cancel propagation to MSP turn/cancel / exec SIGTERM, pool snapshot refresh split, failed-turn budget counting at dispatch, failed-initialize host disposal with stale-callback guards, stdin EPIPE routing). Codex re-review of the final head failed on Codex usage limits with zero findings; disposition recorded on PR #9026.
Live verification (this shift)
- Protocol smoke against the real
muse serve (echo provider): initialize -> session/new -> prompt -> end_turn, agent text streamed, ledger lines with usage.
- Pool gate verified in the refusing direction on a fresh exporter reading (5h window 102.47% used):
session/new refused "meta pool at capacity" and the refusal was ledgered.
- Live meta-provider coding turn after the window reset (fresh export 2026-11-16T11:05:39Z: 5h window 0% used, weekly 50.22%): MSP session
01a1e409-3eda-7583-aae6-91ab74cd316e, stopReason end_turn, agent replied DONE and created the requested file with the exact requested contents; ledger recorded the turn (inputTokens 26792, outputTokens 41, cacheReadTokens 26484).
Closing as completed. Queue task 2936 completes as fixed_merged with this note as evidence.
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|