Skip to content

fix(runtime): accept Muse's composer when the voice-input label is absent - #25695

Merged
nwparker merged 2 commits into
stablyai:mainfrom
j33pia:fix/muse-linux-readiness
Oct 28, 2026
Merged

nwparker merged 2 commits into
stablyai:mainfrom
j33pia:fix/muse-linux-readiness

Conversation

@j33pia

@j33pia j33pia commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

ELI5

Before Orca hands a task to a Muse agent, it waits until Muse's screen shows its input box. Orca only recognized that box when it carried a "Voice input" label. Muse only adds that label where voice works, so on Linux it never appears, Orca kept waiting, and every Muse worker start timed out. Orca now recognizes the input box with or without the label.

What Changed

  • Before: on Linux, orca orchestration worker-start --agent muse failed with agent_readiness · timeout even though Muse was idle at its ❯ composer. macOS/Windows (voice label shown) worked.
  • After: a Muse pane counts as ready on every platform once its composer is painted after the latest Muse Code banner.
  • Mechanism: findMuseReadyPromptIndex in src/main/runtime/terminal-wait-detection.ts required voice + input + ❯ after the last muse code. That match is kept (so narrow panes that clip the rule after the label still match), and it now also accepts the composer itself: ❯ directly after a rule of two or more ─ (/──\s*❯/). Everything around it is unchanged: the latest-banner anchor, the quiet-body gate before tui-idle settles, and blocked-dialog ordering.

Why

The voice label is a platform-dependent decoration, not a readiness signal. Accepting a bare ❯ (as one alternative proposed) would read a shell prompt left under an exited Muse's banner (~/app ❯, starship/pure ╰─❯) as ready, so the new match requires a real composer rule before the prompt. Platform-gating the voice requirement was rejected because Orca can drive a Muse running on a different OS than the client (SSH / paired hosts).

Linked Issue

Fixes #25005

Original fix by @j33pia in #25695; final version reworked during the bug bash. Also thanks to @BeamNawapat for #25047, which targeted the same bug.

Reported by @pollackscience

Visual Proof

N/A: no UI change. This only changes when the runtime considers a Muse terminal ready to receive a task.

Testing

  • Repro: on main, the new unit case (──…❯ ──… under Muse Code 1.4.2, no voice label) and the new captured-bytes transcript __fixtures__/muse-no-voice-footer-ready.txt (Muse 1.4.0 with MUSE_EXPERIMENTAL_VOICE=0, so the composer rule has no voice label, as on Linux) both fail (expected false to be true / Error: timeout).

  • With the fix: both pass, and new negative cases (~/app ❯ and ╰─❯ under a printed Muse banner) stay not-ready.

  • pnpm test src/main/runtime/terminal-wait-detection.test.ts src/main/runtime/cline-screen-readiness-transcripts.test.ts: 128 passed.

  • oxlint, oxfmt, anti-slop / code-quality / ast-grep gates, changed-code quality gate, and the flaky-test ratchet pass (the stale test-timeout-needs-reason count for the transcript test is pruned).

  • Platforms: tested on macOS; the predicate is platform-neutral text matching, so Linux/Windows and local/SSH behave the same.

  • I manually tested these changes locally

  • Automated tests added/updated, or explained why not below

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Muse-only predicate change; no new inputs, process, file or network access. Backwards compatible: every screen that was ready before is still ready. No mobile surface.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

@coderabbitai

coderabbitai Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Walkthrough

The Muse readiness predicate now accepts a composer divider followed by a prompt marker after the latest Muse Code banner. The existing voice-input pattern remains supported. Tests cover additional screen shapes and captured transcript readiness with and without the voice-input label.

Priority: Normal

Severity of issue fixed: Medium

Merge Risk: Low · up to 5527b

An unusual screen containing a divider and a later prompt could be mistaken for an idle Muse composer. Constrain the match to the composer box before merging, or accept this bounded risk.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: Muse readiness detection now accepts the composer when the voice-input label is absent.
Description check Passed The description is complete and matches the required template. It explains the problem, user-visible behavior, implementation, rationale, linked issue, testing, platform scope, and checklist status. I…
Linked Issues check Passed Issue #25005 requires Orca to treat an idle Muse composer as ready when the voice-input footer is absent. It also requires that blocked-prompt and active-work checks remain, and that regression covera…
Out of Scope Changes check Passed The changed files are terminal-wait-detection.ts (Muse readiness predicate and comment), its unit test, the Muse transcript test, the two new Muse footer-free fixtures (`muse-no-voice-footer-ready.t…
Full details: Description check

Explanation

The description is complete and matches the required template. It explains the problem, user-visible behavior, implementation, rationale, linked issue, testing, platform scope, and checklist status. It also documents that no visual proof is needed because the change has no UI impact.

Full details: Linked Issues check

Explanation

Issue #25005 requires Orca to treat an idle Muse composer as ready when the voice-input footer is absent. It also requires that blocked-prompt and active-work checks remain, and that regression coverage exists for footer-bearing and footer-free composers, blocked dialogs, active output, and stale scrollback.

At the reviewed head, findMuseReadyPromptIndex in src/main/runtime/terminal-wait-detection.ts keeps the original voice/input/❯ match. It adds MUSE_COMPOSER_RE = /\u2500\u2500\s*\u276F/, which matches ❯ after two ─ with optional whitespace (including a newline). The issue's footer-free example (──…, newline, ❯) therefore matches. The match is still anchored at the last muse code index. The quiet-body gate (isQuietReadyScreenBody, holdsReadyTextToQuiet) and isUnblockedAfter / findActionableTerminalWaitBlockedSignal are not changed in the source. Stale scrollback is handled by the latest-banner anchor. Shell prompts such as ~/app ❯ (no ─) and ╰─❯ (one ─) do not match.

Tests: the change summary reports a footer-free positive unit case, footer-free negative cases, and a captured-bytes footer-free transcript test (cline-screen-readiness-transcripts.test.ts). The previous assessment reported existing coverage for blocked, loading, active, and newer-banner cases. The test-file text diff could not be read in this run, so test coverage rests on the summary and the previous assessment. The source behavior is confirmed from the reviewed head file.

Full details: Out of Scope Changes check

Explanation

The changed files are terminal-wait-detection.ts (Muse readiness predicate and comment), its unit test, the Muse transcript test, the two new Muse footer-free fixtures (muse-no-voice-footer-ready.txt and .meta.json), and a one-line flaky-test baseline count update for the edited transcript test. Each directly supports the Muse footer-free readiness objective of #25005. The source change does not alter other agents, the blocked-text layer, the quiet gate, or unrelated product behavior. The PR description does not add unrelated work. The source diff at the reviewed head was read; the test and fixture diffs were not directly readable in this run, so their scope relies on the summary.

Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 1 functions across 3 files.

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@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 change is correct and the behavior delta is exactly the intended Linux screen. One process note inline.

Reviewed changes

  • Linux Muse readiness now accepted: findMuseReadyPromptIndex returns the latest muse code banner index whenever a ❯ follows it, dropping the voice/input requirement that only macOS/Windows paint. Both the old and new predicates return the banner index, so the only delta is which screens qualify.
  • Tests: a Linux ready-screen unit fixture, a live-PTY tui-idle test for the same screen, a Windows voice-label regression, and two negative tests (banner without a composer, composer above a newer banner).
  • Ordering preserved: isUnblockedAfter still vetoes a blocked dialog painted after the banner, and findDismissedStartupModalIndex still dismisses a trust dialog only when a later banner (plus composer) repainted below it.

ℹ️ Nitpicks

  • terminal-wait-detection.test.ts:559 — the test is named for the Windows voice-input shortcut label, but the predicate no longer reads that label; it passes with or without the line, so it does not actually pin the label behavior. Rename to describe the Windows ready screen, or assert the fixture still contains the label if that is the intent.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

Comment on lines +530 to +537
// Linux ready screen (Muse Code 1.4.3): same `❯` composer and status line, but Linux builds
// never paint the "Voice input" ruler above the composer.
const MUSE_READY_SCREEN_LINUX = [
' Muse Code 1.4.3',
'─────────────────────────────────────────────────────────────────────────',
'❯ ───────────────────────────────────────────────────────────────────────',
' muse-spark-1.3 · high · ~/projects/demo · YOLO'
]

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.

The Linux screen here is transcribed by hand, so the rule is pinned to a remembered screen rather than captured bytes. AGENTS.md and docs/reference/agent-pty-transcript-capture.md require readiness rules be written against a recorder capture, and this predicate already has such a lane (muse-readiness-transcript.test.ts + __fixtures__/muse-empty-folder-ready.txt). Consider recording a Linux ready screen and extending that suite; the line array can stay as the fast unit test.

Technical details
# Capture the Linux Muse ready screen as a transcript

## Affected sites
- `src/main/runtime/terminal-wait-detection.test.ts:532-537` — `MUSE_READY_SCREEN_LINUX`, hand-transcribed fixture.
- `src/main/runtime/terminal-wait-name-only-idle.test.ts:38-43` — `MUSE_READY_TAIL_LINUX`, the same lines duplicated.

## Required outcome
- The `❯`-only predicate is pinned to bytes a real Linux Muse CLI emitted, fed through `onPtyData`, matching the existing Muse readiness suite.

## Suggested approach (optional)
- Record with `node config/scripts/capture-agent-pty-transcript.mjs --name muse-linux-ready -- muse --provider echo --trust-workspace`, scrub per the doc, and add a case to `muse-readiness-transcript.test.ts` (advance the version in the sidecar note).

## Open questions for the human (optional)
- Is a hand-transcribed fixture acceptable for this rule, or is a committed Linux capture expected?

…sent

Muse labels its composer's top rule "Voice input" only where voice is
available, so on Linux the readiness predicate never matched and
worker-start timed out at agent_readiness. Keep the voice-label match and
also accept the composer itself: a rule (two or more rule chars) directly
before the prompt glyph after the latest Muse banner, so a shell prompt like
'~/app ❯' or '╰─❯' under a printed banner is still not ready.

Fixes stablyai#25005

Co-authored-by: j33pia <[email protected]>
Co-authored-by: Nawapat Buakoet <[email protected]>
@nwparker
nwparker force-pushed the fix/muse-linux-readiness branch from fe4a8ea to 17a3474 Compare October 28, 2026 00:20
@nwparker nwparker changed the title fix(runtime): accept Muse's ready composer without the voice-input ruler fix(runtime): accept Muse's composer when the voice-input label is absent Oct 28, 2026

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

Caution

Some comments are outside the diff and can’t be posted inline due to GitHub limitations.

⚠️ Outside diff range comments (1)

Minor · Constrain the Muse composer match to its rendered box. · terminal-wait-detection.ts:132-143

src/main/runtime/terminal-wait-detection.ts:132-143
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Constrain the Muse composer match to its rendered box.

MUSE_COMPOSER_RE uses \s*, which can consume line breaks. After the latest Muse Code banner, a divider followed by a later non-composer ❯ can therefore satisfy the regex. isUnblockedAfter does not reject this case, and a quiet Muse screen can become ready-strong. This violates the existing contract that shell prompts are not ready.

Preserve the valid same-line form and the fixture's three-line composer form, but reject arbitrary intervening lines.

Suggested fix
-const MUSE_COMPOSER_RE = /\u2500\u2500\s*\u276F/
+const MUSE_COMPOSER_RE =
+  /\u2500\u2500(?:[ \t]*\u276F|[ \t]*\r?\n[ \t]*\u276F[ \t]*\r?\n[ \t]*\u2500\u2500)/

Review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 1d021568-7981-4fbf-9d88-3b40d6877cf7
Commits

Reviewing files that changed from the base of the PR and between 17a3474 and 5527b2b.

Files selected for processing: 1
  • src/main/runtime/terminal-wait-detection.ts
Files skipped from review as they are similar to previous changes: 1
  • src/main/runtime/terminal-wait-detection.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review.

@nwparker
nwparker merged commit ef6e661 into stablyai:main Oct 28, 2026
40 checks passed
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.

[Bug]: Muse Linux idle composer is rejected by the readiness detector when the voice-input footer is absent

2 participants