Repository navigation
fix(agents): accept Muse idle composer without the voice footer - #25047
BeamNawapat wants to merge 2 commits into
Conversation
Muse Code on Linux paints its idle composer without the voice-input footer, so the readiness predicate never matched and worker start timed out at agent_readiness. Keep the footer match, and also accept a prompt marker framed by a box-drawing rule on both sides, ignoring the escapes Muse paints between them. A shell prompt next to a single rule under an old banner still does not count. Fixes stablyai#25005
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (1)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughThe Muse readiness detector now accepts a composer with either the voice-input footer or a rule-framed Fixed issue severity: <fixed_issue_severity>Medium</fixed_issue_severity> Priority: ➖ Normal Merge Risk: 🔵 Low · up to If Muse exits back to a still-running shell during launch, stale composer text can make readiness succeed and route the task to the shell. This is a bounded launch failure, but it can submit unintended shell input and merits owner follow-up. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The change preserves permission checks and rejects several ordinary shell-prompt cases. However, an old input box could still be mistaken for readiness after Muse exits. If a shell remains open, pending task text could be submitted there instead. That production transition remains unverified, and the potential exposure is limited to the selected terminal’s existing authority. Retained concerns
Security review detailsSecurity Blast Radius
Security Findings and Attack Paths
Trust Boundaries and Controls
Resilience and Maintainability Implications
Hardening Proposals
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Linked Issues checkExplanation Issue
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. Comment |
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:
2af43b5f-6fe5-47bf-89a2-c8ee714ae219
📒 Files selected for processing (2)
src/main/runtime/terminal-wait-detection.test.tssrc/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; 8 remain after this review.
There was a problem hiding this comment.
Important
The new footer-free Muse rule is tuned to the issue's synthetic illustration rather than a captured Linux PTY transcript. docs/reference/agent-pty-transcript-capture.md requires terminal-painted readiness rules to be pinned to a recorded transcript, and docs/reference/antigravity-readiness-evidence.md is the cautionary tale for remembered screens (three of four past attempts were worse than the bug they replaced). Please attach a Linux muse capture, or have the reporter provide one, before merging — or say explicitly why this shape is trustworthy without one.
Reviewed changes
- Footer-free Muse composer recognized —
findMuseReadyPromptIndexnow also accepts a❯framed by───rules above and below, in addition to the existingvoice+inputfooter match. - Bounded, escape-tolerant scan —
hasRuleFramedMusePromptchecks only the last 8❯after the last banner, each in a 96-char window with terminal escapes stripped. - Tests — no-footer composer (positive), exited-Muse shell screens (negative), an escape-painted composer (positive), and a footer-free composer with a trust dialog below it (negative).
⚠️ New readiness rule is pinned to a synthetic screen, not a capture
The predicate this PR relaxes is exactly the kind of rule the repo says must be written against a recorded agent transcript. The committed macOS fixture (muse-empty-folder-ready.txt) is a real capture, but the Linux footer-free shape that motivates this change comes from the issue's synthetic illustration — the same evidence class the Antigravity history shows is unreliable (wrapping, cursor moves, and column alignment are not handed back by a described screen). If the real Linux screen differs in any detail the heuristic keys on (rule adjacency to ❯, glyph, spacing), #25005 still times out. The change is conservative and fails safe, so this is about whether the fix is actually demonstrated, not about regression risk.
Technical details
# New Linux Muse rule lacks transcript evidence
## Affected sites
- `src/main/runtime/terminal-wait-detection.ts:173` — `hasRuleFramedMusePrompt`, the new heuristic.
- PR body "Testing" — author states: "Not run: a live Linux Muse session. The footer-free screen is built from the issue's description."
## Required outcome
- At least one committed capture of the real Linux `muse` idle screen (with the sidecar `platform: linux`), replayed through the runtime, so the heuristic is pinned to bytes rather than to a rendering of the issue text.
## Suggested approach (optional)
- Record with `node config/scripts/capture-agent-pty-transcript.mjs --name muse-linux-no-voice-footer -- muse ...` per `docs/reference/agent-pty-transcript-capture.md`, scrub it, and drive the readiness assertion through `onPtyData` (`agent-transcript-pane-test-harness.ts`) instead of `waitTextFor`. If the reporter can supply the screen, a capture from them also settles it.
## Open questions for the human (optional)
- Is a Linux Muse session reachable from CI or a maintainer machine at all, or should this ship as a documented best-effort against the reported shape?ℹ️ Nitpicks
terminal-wait-detection.ts:190-191still says "The voice-input composer is present even without loaded skills"; the function now also accepts a composer that carries no voice input, so the comment no longer describes the accepted shape.
deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏
A footer-free composer left in scrollback matched even after Muse exited and a shell prompt appeared below it, because the scan fell back to older prompt markers. Only the newest prompt marker is checked now. The escape stripping in that scan was unreachable: the tail parser consumes escapes before the detector sees text. Drop it and the test that fed it hand-built escapes, and cover the footer-free screen with the real captured Muse bytes instead.
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
Reviewed the delta from 646b391 to c242d6b — the newest-❯ composer judgement, the escape-strip removal, and the new tests. The full PR remains three files.
- Removed the terminal-escape stripping (
TERMINAL_ESCAPE_RE/ESC/BEL) and the hand-built "escape-painted composer" test from the Muse composer matcher, since productionwaitTextis parsed tail text that never carries escapes. - Narrowed
hasRuleFramedMusePromptto the newest❯only, so a shell prompt below an exited Muse's stale footer-free composer no longer reads as ready; the predicate stays strictly additive relative tomainbecause thevoice+inputbranch is unchanged. - Added a discriminating negative test for the stale-composer case and a
createTranscriptPanereplay of the captured Muse bytes with the voice-input footer swapped for a plain rule.
I ran pnpm test src/main/runtime/terminal-wait-detection.test.ts src/main/runtime/muse-readiness-transcript.test.ts (56 passed) and confirmed the new negative case fails when the scan is reverted to the earlier multi-candidate form, so it is real coverage.
deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏
|
Thanks a lot for digging into this, @BeamNawapat! We landed the fix for #25005 through #25695 (reworked during our bug bash, with your rule-framed composer idea and shell-prompt cases informing the final version, and you credited as co-author). Closing this one in favor of #25695. |

ELI5
On Linux, Muse's idle input box has no "Voice input" line under it. Orca was waiting for that line before sending a task to a Muse worker, so the worker start timed out. Orca now also recognizes the input box without that line.
What Changed
findMuseReadyPromptIndex(src/main/runtime/terminal-wait-detection.ts) used to needvoice+input+❯after the lastMuse Codebanner. That match is kept, so every screen that was ready before still is.❯with a───rule directly above and directly below it counts as Muse's composer. That frame is there with or without the footer. Between the rule and❯the check skips whitespace and line breaks. Terminal escapes never reach the detector: the tail parser consumes them first, so the captured Muse bytes in__fixtures__/muse-empty-folder-ready.txtarrive as───❯───with no escape characters.❯after the banner is checked, in a 96-char window on each side. If a shell prompt sits below an exited Muse's old composer, the newest❯is the shell's, so the screen is not ready.Why
Two rules and not
❯alone: starship / pure shell prompts also draw❯, and shell output can draw a rule. With one rule, a crashed Muse with a shell prompt under its old banner would read as ready.Linked Issue
Fixes #25005
Visual Proof
N/A: no UI change. The fix changes when the orchestration worker start sees Muse as ready.
Testing
terminal-wait-detection.test.ts: the footer-free composer from the issue, a footer-free composer with a trust dialog below it (blocked), and exited-Muse shell screens (~/app ❯; rule + path line +❯; rule directly above❯ ls; a shell❯below a stale footer-free composer) that must stay not-ready.muse-readiness-transcript.test.ts: the real captured Muse bytes with the voice-input footer swapped for a plain rule, replayed through the runtime, reads astui-idle.expected true to be false) and passes now. 8 test files touching Muse readiness and terminal wait: 189 passed.tsc -p config/tsconfig.node.jsonclean, oxlint/oxfmt clean,check-changed-code-quality0 findings.Known limits, found by an independent verifier probing the detector:
Text typed into the composer (
❯ hellobetween the rules) is not ready. Same asmainfor the footer-free case, and it fails safe.A shell prompt painted exactly inside two rules under an old Muse banner would read as ready. I could not build that from a real shell; it needs the exact Muse frame.
A stale composer with the voice-input footer left in scrollback after
/exitstill matches below the banner. Same asmainbefore this change. The footer-free match no longer has this problem, because only the newest❯counts.Only the newest
❯is checked, so a shell prompt that has no❯(plain$or%) painted below a stale footer-free composer still reads as ready.I manually tested these changes locally
Automated tests added/updated, or explained why not below
AI Disclosure
This PR was written by an AI agent (Claude Code, Claude Opus) on behalf of @BeamNawapat. Separate AI verifier passes reviewed the change against the issue; their findings were addressed or listed above before opening.