Repository navigation
Conversation
b4d0f5b to
949bf2a
Compare
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. 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:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📥 CommitsReviewing files that changed from the base of the PR and between 5abd8316efe618d96db68581b75efa09789cfd30 and 7cd9dcd. ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (2)
Included review availability: Your plan provides up to 10 included reviews per hour; 6 remain after this review. 📝 WalkthroughWalkthroughThe pull request adds Muse as a supported agent. It defines Muse configuration, selection, permissions, process and headless-command recognition, skills handling, telemetry mapping, and client presentation data. It adds localized labels and favicon assets. Runtime terminal logic detects the Muse ready prompt and uses quiet prompt evidence for idle satisfaction. Tests cover Muse readiness detection and the Windows launch command. Priority: ➖ Normal Merge Risk: 🟡 Moderate · up to The integration launches Muse with workspace trust already granted and adds Muse prompt detection to terminal completion handling. This can bypass consent or misclassify a later blocked dialog, while changed code still has static-analysis violations; resolve these issues before merging. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Full details: Description checkExplanation The description provides a clear change summary, rationale, validation details, and visual proof. However, it omits the required linked issue and does not complete several template sections and checklist items. Resolution Add a valid issue reference under “Linked Issue” using “Fixes #…”. Complete or explicitly mark the ELI5, Why, Testing, AI Disclosure, Review, Notes, Agent skill upstream boundary, and Checklist sections. Mark the testing and checklist items that the validation evidence supports, or explain why they remain unchecked.
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
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: 2
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: 75e65420-645d-424b-8b21-8e6be606f631
📥 Commits
Reviewing files that changed from the base of the PR and between 197550c and 949bf2ab891d7b9f2ff0f04976e29e03f540e40e.
⛔ Files ignored due to path filters (1)
src/shared/agent-icons/muse.pngis excluded by!**/*.png
📒 Files selected for processing (24)
mobile/src/components/mobile-agent-icon-assets.tsmobile/src/tasks/mobile-tui-agents.tssrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/i18n/locales/es.jsonsrc/renderer/src/i18n/locales/fr.jsonsrc/renderer/src/i18n/locales/ja.jsonsrc/renderer/src/i18n/locales/ko.jsonsrc/renderer/src/i18n/locales/zh.jsonsrc/renderer/src/lib/agent-catalog.tsxsrc/renderer/src/lib/agent-favicon-assets.tssrc/renderer/src/lib/agent-status.tssrc/shared/agent-headless-command.tssrc/shared/agent-kind.tssrc/shared/agent-process-recognition.tssrc/shared/agent-type-label.tssrc/shared/muse-headless-command.tssrc/shared/skill-install-providers.tssrc/shared/skills-cli-agent-keys.tssrc/shared/telemetry-property-schemas.tssrc/shared/tui-agent-config.tssrc/shared/tui-agent-display-names.tssrc/shared/tui-agent-permissions.tssrc/shared/tui-agent-selection.tssrc/shared/tui-agent.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.
| opencode2: { detectCmd: 'opencode2', launchCmd: 'opencode2 --standalone', expectedProcess: 'opencode2', promptInjectionMode: 'flag-prompt' }, | ||
| opencode: { | ||
| detectCmd: 'opencode', | ||
| promptInjectionMode: 'flag-prompt', | ||
| // Why: opencode enables bracketed paste before its composer mounts; wait for the post-\x1b[?2004h show-cursor so paste lands. | ||
| draftPasteReadySignal: 'render-cursor-after-bracketed-paste' | ||
| }, |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
sed -n '1,230p' src/shared/tui-agent-config.ts
rg -n "draftPasteReadySignal|render-cursor-after-bracketed-paste|opencode2|quiet-render" src test* . --glob '!node_modules' --glob '!dist'Repository: stablyai/orca
Length of output: 41962
🏁 Script executed:
#!/bin/bash
set -e
printf '%s\n' '--- agent-paste-draft.ts ---'
sed -n '1,240p' src/renderer/src/lib/agent-paste-draft.ts
printf '%s\n' '--- draft-paste-ready-scanner.ts ---'
sed -n '1,220p' src/shared/draft-paste-ready-scanner.ts
printf '%s\n' '--- startup readiness ---'
sed -n '1,180p' src/main/runtime/runtime-worktree-startup-readiness.ts
printf '%s\n' '--- readiness tests ---'
sed -n '1,180p' src/renderer/src/lib/agent-paste-draft-readiness-budget.test.ts
printf '%s\n' '--- startup tests around config ---'
sed -n '520,620p' src/shared/tui-agent-startup.test.ts
printf '%s\n' '--- focused diff ---'
git diff -- src/shared/tui-agent-config.ts
printf '%s\n' '--- focused history ---'
git log --oneline -12 -- src/shared/tui-agent-config.ts src/renderer/src/lib/agent-paste-draft.ts src/shared/draft-paste-ready-scanner.tsRepository: stablyai/orca
Length of output: 30798
🏁 Script executed:
#!/bin/bash
set -e
printf '%s\n' '--- prompt injection and draft launch references ---'
rg -n -C 5 "buildAgentDraftLaunchPlan|promptInjectionMode|pasteDraftWhenAgentReady|pasteWorktreeStartupDraftWhenReady|startupDraft" src/shared src/renderer/src src/main --glob '*.ts' --glob '*.tsx'
printf '%s\n' '--- OpenCode 2 introduction commit summary ---'
git show --stat --oneline ee354a35d72
printf '%s\n' '--- OpenCode 2 introduction config/history ---'
git show ee354a35d72^:src/shared/tui-agent-config.ts | sed -n '105,150p'
git show ee354a35d72:src/shared/tui-agent-config.ts | sed -n '105,150p'
printf '%s\n' '--- history touching OpenCode 2 config lines ---'
git log --all -p -G "opencode2:|draftPasteReadySignal" -- src/shared/tui-agent-config.ts | sed -n '1,260p'Repository: stablyai/orca
Length of output: 42429
🏁 Script executed:
#!/bin/bash
set -e
printf '%s\n' '--- tui-agent-startup implementation ---'
rg -n "export function buildAgentStartupPlan|export function buildAgentDraftLaunchPlan|function buildAgentStartupPlan|function buildAgentDraftLaunchPlan|promptInjectionMode|draftPromptFlag|draftPromptEnvVar" src/renderer/src/lib/tui-agent-startup.ts
sed -n '1,260p' src/renderer/src/lib/tui-agent-startup.ts
printf '%s\n' '--- startup draft dispatch ---'
rg -n -C 8 "startupDraftPaste|pasteWorktreeStartupDraftWhenReady|buildStartupForDraft|draftPrompt|startupDraft" src/main/runtime src/renderer/src/hooks/composer-state src/shared --glob '*.ts' --glob '*.tsx'Repository: stablyai/orca
Length of output: 192
🏁 Script executed:
#!/bin/bash
set +e
printf '%s\n' '--- candidate files ---'
fd -i 'tui-agent-startup' .
printf '%s\n' '--- definitions ---'
rg -n -C 6 "buildAgentStartupPlan|buildAgentDraftLaunchPlan|promptInjectionMode|draftPromptFlag|draftPromptEnvVar" src/renderer/src/lib src/shared --glob '*.ts' --glob '*.tsx'
printf '%s\n' '--- startup draft dispatch ---'
rg -n -C 8 "startupDraftPaste|pasteWorktreeStartupDraftWhenReady|buildStartupForDraft|draftPrompt|startupDraft" src/main/runtime src/renderer/src/hooks/composer-state src/shared --glob '*.ts' --glob '*.tsx'Repository: stablyai/orca
Length of output: 45539
🏁 Script executed:
#!/bin/bash
set -e
printf '%s\n' '--- draft launch plan ---'
sed -n '180,310p' src/shared/tui-agent-startup.ts
printf '%s\n' '--- worktree draft construction ---'
sed -n '105,190p' src/main/runtime/orca-runtime-activate-managed-worktree.ts
printf '%s\n' '--- startup draft readiness test ---'
sed -n '455,495p' src/main/runtime/orca-runtime-tests/worktree-setup-and-startup-part-03.spec.ts
printf '%s\n' '--- config current lines ---'
sed -n '120,142p' src/shared/tui-agent-config.tsRepository: stablyai/orca
Length of output: 9883
Restore the cursor-gated readiness signal for OpenCode 2. OpenCode 2 startup drafts use the paste-after-ready path because it has no native draft flag or environment variable. Without this signal, the default 1500 ms quiet window can send the bracketed paste before the @opentui composer mounts. The draft can be lost or fail to appear as one editable prompt, especially for multiline input. Add draftPasteReadySignal: 'render-cursor-after-bracketed-paste' to the opencode2 configuration.
| // Why: skip the workspace trust menu so it cannot consume the drafted task — the TUI | ||
| // would otherwise sit on the dialog while Orca pastes into it. Permission bypass | ||
| // stays configurable via the yolo default args. | ||
| launchCmd: 'muse --trust-workspace', |
There was a problem hiding this comment.
🔒 Security & Privacy | 🛡️ Detected with Advanced Tier | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -e
printf '%s\n' '--- relevant config ---'
cat -n src/shared/tui-agent-config.ts | sed -n '260,325p'
printf '%s\n' '--- launchCmd references ---'
rg -n -C 4 'launchCmd|trust-workspace|tui-agent-config' src/sharedRepository: stablyai/orca
Length of output: 41461
🏁 Script executed:
#!/bin/bash
set -e
cat -n src/shared/tui-agent-config.ts | sed -n '260,325p'
rg -n -C 4 'launchCmd|trust-workspace|tui-agent-config' src/sharedRepository: stablyai/orca
Length of output: 41644
🏁 Script executed:
#!/bin/bash
set -e
printf '%s\n' '--- launch command assembly ---'
cat -n src/shared/tui-agent-launch-command.ts | sed -n '1,180p'
printf '%s\n' '--- startup launch use ---'
rg -n -C 8 'resolveAgentLaunchCommand|getTuiAgentLaunchCommand|launchCmd|YOLO_TUI_AGENT_ARGS|permission' src/shared/tui-agent-startup.ts src/shared/tui-agent-launch-defaults.ts src/shared/tui-agent-startup-shell.tsRepository: stablyai/orca
Length of output: 15785
🌐 Web query:
Muse Code official documentation --trust-workspace workspace trust project-local rules skills hooks
💡 Result:
Inspection citation: inspection_cd23f4e6b4f2b5d615e8bdf848e76713
<source_evidence>
Citations:
- 1: https://dev.meta.ai/docs/muse-code
- 2: https://ai.developer.meta.com/docs/muse-code/
- 3: https://dev.meta.ai/docs/muse-code/configuration
- 4: https://dev.meta.ai/docs/muse-code/permissions
- 5: https://dev.meta.ai/docs/muse-code/permissions.md
- 6: https://dev.meta.ai/docs/muse-code/extending/
- 7: https://qainsights.com/getting-started-with-muse-code-cli-commands-syntax-and-purpose/
Security Misconfiguration
Reachability: External
Exploitability: Moderate
CWE: CWE-16
Do not trust every workspace by default.
muse --trust-workspace skips Muse's workspace trust prompt and loads project-local skills, rules, and hooks. An attacker can place these files in a repository and influence a Muse session when a user opens that repository through Orca. This trust boundary is separate from --yolo.
Remove this flag from the default launch command. Preserve the prompt flow, or add it only after explicit user consent.
There was a problem hiding this comment.
Caution
This PR breaks quick-workspace-agent-selection.test.ts and silently reverts three unrelated behaviors that exist on main — opencode2's paste-readiness signal and display label, and freebuff's mobile icon. They look like stale-branch rebase casualties; please rebase on current main and restore them before merging.
Reviewed changes
- Muse added to the agent registry —
museis threaded throughtui-agent.ts,agent-kind.ts,AGENT_KIND_VALUES,tui-agent-display-names.ts,agent-type-label.ts,agent-status.ts, andtui-agent-permissions.ts(--yolo), and configured intui-agent-config.tsasmuse --trust-workspacewithstdin-after-startinjection. - Muse process and headless recognition —
agent-process-recognition.tsrecognizes amuse-bin-*foreground binary, and the newmuse-headless-command.tstreats anexectoken after the binary as a headless one-shot. - Catalog, skills, and mobile surfaces —
agent-catalog.tsx,agent-favicon-assets.ts, both mobile maps, andagent-icons/muse.png;skill-install-providers.tsplaces Muse on the canonical.agents/skillsroot;skills-cli-agent-keys.tsmaps it tonull. - Unrelated edits folded in — the
opencode2/freebuffremovals and the auto-pick reordering described inline.
ℹ️ No test coverage for the new Muse behavior
Muse introduces a versioned-binary prefix, a headless exec matcher, and a --trust-workspace launch, but the PR adds no tests and no existing suite exercises muse (agent-process-recognition.test.ts and tui-agent-startup.test.ts have no Muse case). A case pinning muse --trust-workspace → recognized and muse exec → headless would guard the two new matchers; without it the muse-bin- spelling and the exec scan are asserted, not demonstrated.
ℹ️ Nitpicks
isMuseHeadlessOneShotCommand(muse-headless-command.ts:8) matchesexecat any position after the binary, so a value-taking flag whose value isexec(e.g.muse --model exec) would classify a live TUI as headless. Low risk unless Muse has such a flag — restricting the match to the subcommand position would remove the ambiguity.- The
submitLineSettleMsPerLinedoc comment and antigravity's "Why" rationale (tui-agent-config.ts) were dropped while the45value stayed; comment-only, but the reasoning is no longer recoverable.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
c96d4b9 to
10e289f
Compare
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: b57b8207-2ab2-49fc-808f-be51f3cbca1c
📥 Commits
Reviewing files that changed from the base of the PR and between 949bf2ab891d7b9f2ff0f04976e29e03f540e40e and 10e289feea70ea5f82f5ec22d769ec70b9886b4c.
⛔ Files ignored due to path filters (1)
src/shared/agent-icons/muse.pngis excluded by!**/*.png
📒 Files selected for processing (8)
src/main/runtime/orca-runtime-resolve-exit-waiters.tssrc/main/runtime/runtime-terminal-idle-polls.tssrc/main/runtime/runtime-terminal-wait.tssrc/main/runtime/terminal-wait-detection.test.tssrc/main/runtime/terminal-wait-detection.tssrc/main/runtime/tui-idle-evidence.tssrc/shared/tui-agent-config.test.tssrc/shared/tui-agent-config.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review.
| export function isMuseReadyPromptPreview(preview: string): boolean { | ||
| const normalized = preview.toLowerCase() | ||
| const index = normalized.lastIndexOf('muse code') | ||
| if (index < 0) return false | ||
| const segment = normalized.slice(index) | ||
| return segment.includes('skills:') && segment.includes('loaded') && segment.includes('❯') |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
sed -n '1,130p' src/main/runtime/terminal-wait-detection.ts
sed -n '80,135p' src/main/runtime/orca-runtime-resolve-exit-waiters.ts
sed -n '180,220p' src/main/runtime/orca-runtime-resolve-exit-waiters.ts
rg -n "findTerminalWaitBlockedSignal|detectTerminalWaitBlockedReason|isKnownReadyPromptPreview|isMuseReadyPromptPreview" src/main/runtimeRepository: stablyai/orca
Length of output: 18985
🏁 Script executed:
sed -n '230,390p' src/main/runtime/terminal-wait-detection.ts
rg -n "function isTuiIdleSatisfied|isTuiIdleSatisfied\\(|resolvePtyTuiIdleWaiters|resolveLeafTuiIdleWaiters|resolveWaiter|tui-idle|isAgentSettledForDelivery|deliver" src/main/runtime --glob '*.ts'
sed -n '1,250p' src/main/runtime/orca-runtime-resolve-exit-waiters.ts
sed -n '1,260p' src/main/runtime/runtime-terminal-idle-polls.tsRepository: stablyai/orca
Length of output: 45507
🏁 Script executed:
sed -n '1,240p' src/main/runtime/orca-runtime-resolve-exit-waiters.ts; rg -n "export function isTuiIdleSatisfied|function isTuiIdleSatisfied|isAgentSettledForDelivery|readMuseReadyBodyEvidence|readPositiveBodyEvidence" src/main/runtime --glob '*.ts'; sed -n '235,330p' src/main/runtime/terminal-wait-detection.tsRepository: stablyai/orca
Length of output: 17434
🏁 Script executed:
sed -n '100,175p' src/main/runtime/tui-idle-evidence.ts
sed -n '55,95p' src/main/runtime/orchestration/mailbox-pointer-delivery.ts
sed -n '1,90p' src/main/runtime/orchestration/mailbox-pointer-delivery-contract.ts
sed -n '1,35p' src/main/runtime/terminal-wait-detection.ts
sed -n '245,340p' src/main/runtime/terminal-wait-detection.tsRepository: stablyai/orca
Length of output: 12276
Reject Muse readiness when a later blocked signal exists.
isTuiIdleSatisfied accepts quiet Muse body evidence without checking blocked state. The event-driven waiter and mailbox delivery paths call it directly. A retained Muse banner followed by a trust or permission signal can therefore settle tui-idle and allow mailbox delivery into the dialog.
Match isKnownReadyPromptPreview:
const blockedSignal = findTerminalWaitBlockedSignal(normalized)
if (blockedSignal !== null && blockedSignal.index > index) {
return false
}
return segment.includes('skills:') && segment.includes('loaded') && segment.includes('❯')
| @@ -134,5 +147,14 @@ export function isTuiIdleSatisfied(input: TuiIdleSatisfactionInput): boolean { | |||
| if (hasFreshWorkingFirstPartyStatus(input.firstPartyStatus)) { | |||
| return false | |||
| } | |||
| if ( | |||
| hasQuietMuseReadyPrompt( | |||
| input.record, | |||
| input.agent, | |||
| input.readMuseReadyBodyEvidence, | |||
| input.quiescenceMs | |||
| ) | |||
| ) | |||
| return true | |||
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
rg -n '"lint"|eslint|curly' package.json pnpm-workspace.yaml eslint.config.* .eslintrc* config src --glob '!node_modules'
sed -n '120,165p' src/main/runtime/tui-idle-evidence.tsRepository: stablyai/orca
Length of output: 45546
🏁 Script executed:
#!/bin/bash
set -eu
printf '%s\n' '--- candidate config and package files ---'
git ls-files | rg '(^|/)(package\.json|pnpm-workspace\.yaml|eslint\.config\..*|\.eslintrc.*|oxlint\.json.*|\.oxlintrc.*|lint-staged.*|\.lintstagedrc.*|biome\.json.*)$' | sort
printf '%s\n' '--- package scripts and lint-related config references ---'
python3 - <<'PY'
import json
from pathlib import Path
p = Path('package.json')
data = json.loads(p.read_text())
print('package.json scripts:')
for k, v in data.get('scripts', {}).items():
if 'lint' in k.lower() or 'eslint' in str(v).lower() or 'oxlint' in str(v).lower():
print(f'{k}: {v}')
print('package.json devDependencies lint tools:')
for section in ('dependencies', 'devDependencies', 'optionalDependencies'):
for k, v in data.get(section, {}).items():
if 'lint' in k.lower() or 'eslint' in k.lower():
print(f'{section}.{k}: {v}')
PY
for f in $(git ls-files | rg '(^|/)(eslint\.config\..*|\.eslintrc.*|oxlint\.json.*|\.oxlintrc.*|package\.json)$' | sort); do
case "$f" in
package.json) ;;
*) printf '%s\n' "--- $f ---"; sed -n '1,240p' "$f" ;;
esac
done
printf '%s\n' '--- target file directives and cited lines ---'
rg -n -C 3 'eslint|oxlint|if \(' src/main/runtime/tui-idle-evidence.tsRepository: stablyai/orca
Length of output: 30745
🏁 Script executed:
#!/bin/bash
set -eu
git ls-files | rg '(^|/)(package\.json|pnpm-workspace\.yaml|eslint\.config\..*|\.eslintrc.*|oxlint\.json.*|\.oxlintrc.*|lint-staged.*|\.lintstagedrc.*|biome\.json.*)$' | sort
printf '%s\n' '--- package lint scripts ---'
python3 - <<'PY'
import json
from pathlib import Path
data=json.loads(Path('package.json').read_text())
for k,v in data.get('scripts',{}).items():
if 'lint' in k.lower() or 'eslint' in str(v).lower() or 'oxlint' in str(v).lower():
print(f'{k}: {v}')
PY
printf '%s\n' '--- config contents ---'
while IFS= read -r f; do
case "$f" in package.json|pnpm-workspace.yaml) continue;; esac
printf '%s\n' "--- $f ---"
sed -n '1,260p' "$f"
done < <(git ls-files | rg '(^|/)(eslint\.config\..*|\.eslintrc.*|oxlint\.json.*|\.oxlintrc.*|lint-staged.*|\.lintstagedrc.*|biome\.json.*)$' | sort)
printf '%s\n' '--- target directives and conditionals ---'
rg -n -C 3 'eslint|oxlint|if \(' src/main/runtime/tui-idle-evidence.tsRepository: stablyai/orca
Length of output: 2503
🏁 Script executed:
printf '%s\n' '--- files ---'
git ls-files | rg '(^|/)(package\.json|eslint\.config\..*|\.eslintrc.*|oxlint\.json.*|\.oxlintrc.*)$' | sort
printf '%s\n' '--- scripts ---'
node -e "const p=require('./package.json'); for (const [k,v] of Object.entries(p.scripts||{})) if (/lint|eslint|oxlint/i.test(k+' '+v)) console.log(k+': '+v)"
printf '%s\n' '--- config rule references ---'
rg -n -C 4 'curly|eslint|oxlint|src/main|main/runtime' eslint.config.* .eslintrc* oxlint.json* .oxlintrc* package.json 2>/dev/null || true
printf '%s\n' '--- target ---'
sed -n '125,165p' src/main/runtime/tui-idle-evidence.tsRepository: stablyai/orca
Length of output: 13311
Add braces to satisfy the enforced Oxlint curly rule.
The repository runs Oxlint, not ESLint. The root configuration enables curly as an error, and no exception excludes this file. These three changed if statements can fail the lint workflow until their bodies use braces.
Proposed fix
- if (agent !== null && agent !== undefined && agent !== 'muse') return false
- if (!readBody?.() || record.lastOutputAt === null) return false
+ if (agent !== null && agent !== undefined && agent !== 'muse') {
+ return false
+ }
+ if (!readBody?.() || record.lastOutputAt === null) {
+ return false
+ }
...
- )
- return true
+ ) {
+ return true
+ }📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| if (agent !== null && agent !== undefined && agent !== 'muse') { | |
| return false | |
| } | |
| if (!readBody?.() || record.lastOutputAt === null) { | |
| return false | |
| } | |
| return Date.now() - record.lastOutputAt >= quiescenceMs | |
| } | |
| /** The one place the three tiers are combined; every satisfaction site routes here. */ | |
| export function isTuiIdleSatisfied(input: TuiIdleSatisfactionInput): boolean { | |
| // Why the title before the body: both are tier 1, so either settles, but the title is a | |
| // memoized lookup and the body is a fresh multi-KB scan. Same verdict, cheaper order. | |
| if (hasExplicitIdleTitle(input.record, input.rendererTitle) || input.readPositiveBodyEvidence()) { | |
| return true | |
| } | |
| if (hasFreshWorkingFirstPartyStatus(input.firstPartyStatus)) { | |
| return false | |
| } | |
| if ( | |
| hasQuietMuseReadyPrompt( | |
| input.record, | |
| input.agent, | |
| input.readMuseReadyBodyEvidence, | |
| input.quiescenceMs | |
| ) | |
| ) { | |
| return true | |
| } |
🧰 Tools
🪛 GitHub Check: static analysis
[failure] 158-158: eslint(curly)
src/main/runtime/tui-idle-evidence.ts:158:5: Expected { after 'if' condition.
[failure] 136-136: eslint(curly)
src/main/runtime/tui-idle-evidence.ts:136:54: Expected { after 'if' condition.
[failure] 135-135: eslint(curly)
src/main/runtime/tui-idle-evidence.ts:135:66: Expected { after 'if' condition.
There was a problem hiding this comment.
Important
Two things to settle before merge: the new Muse readiness matcher can satisfy a tui-idle wait on a pane that is actually blocked (it has no captured transcript and no blocked-signal veto, and two call sites reach it without checking blocked reasons), and the Windows launch bridge's stated mechanism contradicts how Windows hands PATH to child processes. Details inline.
Reviewed changes
Since the prior pullfrog review (949bf2a) the branch was rewritten:
- Added a runtime Muse readiness path —
isMuseReadyPromptPreviewplusreadMuseReadyBodyEvidence/hasQuietMuseReadyPrompt, wired throughtui-idle-evidence.tsinto five of sixisTuiIdleSatisfiedcall sites, with a unit test. - Added a Windows launch bridge —
musenow resolves topowershell.exe -NoProfile -Command muse --trust-workspaceonwin32vialaunchCmdByPlatform, with a config test. - Dropped the mobile-catalog edits — the branch no longer modifies the mobile icon maps, so
freebuffkeeps itsmainentries and the earlier duplicate-key problem is gone. - Reverted the unrelated
opencode2regressions — theOpenCode 2label anddraftPasteReadySignalare restored with their comments.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
| export function isMuseReadyPromptPreview(preview: string): boolean { | ||
| const normalized = preview.toLowerCase() | ||
| const index = normalized.lastIndexOf('muse code') | ||
| if (index < 0) return false | ||
| const segment = normalized.slice(index) | ||
| return segment.includes('skills:') && segment.includes('loaded') && segment.includes('❯') | ||
| } |
There was a problem hiding this comment.
The Muse matcher never consults the blocked-signal scan that isKnownReadyPromptPreview uses, and it scans the whole tail from the last muse code with no live-window bound. Two orca-runtime-resolve-exit-waiters.ts sites (isTuiIdleSatisfiedForLeaf/ForPty) reach isTuiIdleSatisfied with this thunk without ever calling detectTerminalWaitBlockedReason, and one of them is the mailbox delivery gate that injects keystrokes — so a Muse pane parked on an actionable approval/question dialog that still shows the banner and ❯ can satisfy the wait. Please capture a real Muse dialog transcript (per docs/reference/agent-pty-transcript-capture.md) and add the blocked-signal veto and live-window bound the other readiness matchers use.
Technical details
# Muse readiness can settle a blocked pane
## Affected sites
- `src/main/runtime/terminal-wait-detection.ts:69-75` — `isMuseReadyPromptPreview` is unbounded and has no blocked veto
- `src/main/runtime/tui-idle-evidence.ts:129-138,150-158` — evaluated after the fresh-status veto, before title-idle; `agent == null` is also allowed
- `src/main/runtime/orca-runtime-resolve-exit-waiters.ts:106-123,195-211` — call `isTuiIdleSatisfied` with the Muse thunk and never scan for a blocked reason
- `src/main/runtime/orca-runtime-resolve-exit-waiters.ts:190-193` (`isAgentSettledForDelivery`) — delivery commit gate
## Required outcome
- A Muse pane owning an actionable dialog must not satisfy `tui-idle` or the delivery gate.
- The matcher is backed by a captured PTY transcript, not hand-written strings.
## Suggested approach
- Mirror `isKnownReadyPromptPreview`: return false when `findTerminalWaitBlockedSignal` appears after the ready index, and bound the scan to the live tail window.
## Open questions for the human
- Does a real Muse approval/question dialog leave `muse code` + `skills:` + `loaded` + `❯` in the tail? A transcript settles this.| @@ -59,6 +60,7 @@ export class RuntimeTerminalWait { | |||
| record: leaf, | |||
| rendererTitle: leaf.paneTitle ?? this.deps.getTabTitle(leaf.tabId), | |||
| readPositiveBodyEvidence: () => isKnownReadyPromptPreview(waitText), | |||
| readMuseReadyBodyEvidence: () => isMuseReadyPromptPreview(waitText), | |||
There was a problem hiding this comment.
readMuseReadyBodyEvidence was added here but not to ptySatisfied (:47), the only one of the six isTuiIdleSatisfied sites still missing it. The comment above these helpers says every satisfaction site must rank the same way, and a live-pty terminal.wait currently won't settle on the immediate check for Muse.
Technical details
# Missing Muse evidence at the live-pty satisfaction site
## Affected sites
- `src/main/runtime/runtime-terminal-wait.ts:47-55` — `ptySatisfied` omits `readMuseReadyBodyEvidence`
- `src/main/runtime/runtime-terminal-wait.ts:58-67` — `leafSatisfied` has it
## Required outcome
- All six `isTuiIdleSatisfied` sites rank Muse evidence identically.
## Suggested approach
- Add `readMuseReadyBodyEvidence: () => isMuseReadyPromptPreview(waitText)` to `ptySatisfied`.| // Why: the Windows installer places muse.cmd under LocalAppData, which Git Bash | ||
| // panes do not inherit from the Windows user PATH. PowerShell resolves that user | ||
| // install path and preserves the same interactive PTY stdin contract. | ||
| launchCmdByPlatform: { win32: 'powershell.exe -NoProfile -Command muse --trust-workspace' }, |
There was a problem hiding this comment.
The rationale here doesn't hold: a powershell.exe started from the pane inherits the pane's environment block, and with -NoProfile it never re-reads the user PATH from the registry — so it cannot recover a Muse install dir the pane lacked. It also adds a per-pane interpreter hop that docs/reference/windows-edr-posture.md explicitly asks callers to shorten. Please confirm what actually made muse resolve on Windows, and drop the bridge if the environment block is the real fix.
Technical details
# Windows Muse launch bridge rationale
## Affected sites
- `src/shared/tui-agent-config.ts:314-317` — bridge plus its `Why:` comment
- `src/shared/tui-agent-config.test.ts:21-25` — pins the literal string only, no runtime coverage
- `docs/reference/windows-edr-posture.md:397` — "shorten the interpreter chain"
## Required outcome
- The reason Windows needed the bridge is stated accurately, or the bridge is replaced by the actual fix (PATH augmentation / user-PATH registry read, matching existing Windows patterns).
## Open questions for the human
- What made `muse` resolve on Windows in the awin run? A child `powershell.exe` inherits the caller's environment, so if Git Bash's PATH lacked the Muse dir, so did the PowerShell child.| @@ -41,7 +41,8 @@ export const TUI_AGENT_AUTO_PICK_ORDER = [ | |||
| 'rovo', | |||
| 'hermes', | |||
| 'devin', | |||
| 'openclaw' | |||
| 'openclaw', | |||
| 'muse' | |||
There was a problem hiding this comment.
muse added here flows into MOBILE_AGENT_CATALOG (mobile/src/tasks/mobile-agent-catalog.ts maps over this order), but neither MOBILE_AGENT_ICON_ASSETS nor MOBILE_TUI_AGENT_FAVICON_DOMAINS has a muse entry, so mobile renders the letter fallback while desktop ships muse.png. The PR description says the mobile catalog includes the bundled Muse icon; add the mobile entries.
Technical details
# Muse has no mobile icon
## Affected sites
- `src/shared/tui-agent-selection.ts:45` — `'muse'` added to `TUI_AGENT_AUTO_PICK_ORDER`
- `mobile/src/components/mobile-agent-icon-assets.ts:12-44` — no `muse` key
- `mobile/src/tasks/mobile-tui-agents.ts:16-49` — no `muse` favicon domain
## Required outcome
- Mobile renders the bundled `muse.png` (or a favicon domain), matching desktop and the PR description.5dd334a to
5abd831
Compare
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
Since the prior pullfrog review (10e289f), the branch changed only the locale catalogs (5dd334a → 5abd831):
- Relocated the
muse_labeltranslation key intolib.agent.catalog— moved out of the JSON root and into the catalog namespace across en/es/fr/ja/ko/zh, sotranslate('auto.lib.agent.catalog.muse_label', 'Muse')now resolves from the catalog instead of relying on its English fallback.
Earlier threads — Muse readiness settling a blocked pane, the ptySatisfied evidence-parity gap, the Windows launch bridge, the auto-pick/catalog order sync, and the missing mobile icon — remain open and are unchanged by this delta.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
5abd831 to
7cd9dcd
Compare
There was a problem hiding this comment.
ℹ️ No critical issues — the prior auto-pick desync is fixed; one minor test gap inline.
Reviewed changes
Since the prior pullfrog review (5abd831), two files changed:
- Restored
TUI_AGENT_AUTO_PICK_ORDERto the desktop catalog order — movedopencode2ahead ofopencodeand placedmusebeforeopenclaw, so the catalog-sync assertion inquick-workspace-agent-selection.test.tspasses again. - Hid the Muse canonical entry unless Muse is detected —
SkillInstallAgentPickernow derives avisibleCanonicallist that dropsmusefrom the always-included chips, the canonical header gate, and the picker summary whendetectedAgentsexcludes it.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
| const visibleCanonical = canonical.filter( | ||
| (provider) => provider.id !== 'muse' || installed === null || installed.has(provider.id) | ||
| ) |
There was a problem hiding this comment.
This conditional is the only new behavior in the delta and no test covers it. SkillInstallAgentPicker.test.tsx renders detectedAgents={['codex']} but never asserts Muse's absence, so removing this filter would not fail any test. A case that queries for Muse with and without 'muse' in detectedAgents would pin the intended hiding.
7cd9dcd to
1c8fc1a
Compare
There was a problem hiding this comment.
ℹ️ No critical issues — two minor suggestions inline.
Reviewed changes
Since the prior pullfrog review (7cd9dcd), one commit (1c8fc1ad) added a live Muse interactive-question detector:
- Added
findMuseInteractiveQuestionIndex— a newsrc/shared/muse-interactive-question.tsthat reports the position of a liveRequest user inputmenu when at least two numbered options andenter to selectfollow it, and returnsnullwhenmuse codeappears after the question. - Wired it into the blocked-signal scan —
terminal-wait-detection.tsnow pushes anagent-interactive-promptcandidate from the Muse matcher, andTERMINAL_WAIT_BLOCKED_SENTINEL_REgainedrequest user input/enter to select. - Added coverage — a raw-pane visibility test asserts
agentWait,getTerminalInteractiveWait, andpermissionstatus for a Muse question;terminal-wait-detection.test.tsadds the positive menu case plus narration and stale-ready negatives. The three touched suites pass locally (96 tests).
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
| return null | ||
| } | ||
| const prompt = normalized.slice(questionIndex) | ||
| if (prompt.includes('muse code')) { |
There was a problem hiding this comment.
This veto is the one load-bearing assumption in the new rule and it has no captured screen behind it — the repo's own docs/reference/agent-pty-transcript-capture.md (and AGENTS.md) require a screen-reading rule to be pinned to a recorded PTY transcript. If Muse repaints its Muse Code / Skills: … loaded banner (or the ❯ composer) below an open menu, prompt contains muse code, the matcher returns null, and isMuseReadyPromptPreview can still report the same pane ready — so the detector would go silent exactly on the live question it exists to flag. A committed muse-*.txt capture of the real question screen settles the ordering.
Technical details
# Muse live-question veto relies on unverified screen ordering
## Affected sites
- `src/shared/muse-interactive-question.ts:10` — `prompt.includes('muse code')` veto
- `src/main/runtime/terminal-wait-detection.ts:354-357` — candidate push; no agent gate
- `src/main/runtime/tui-idle-evidence.ts` — `hasQuietMuseReadyPrompt`/`isTuiIdleSatisfied` (readiness, unchanged by this delta)
- `src/main/runtime/orca-runtime-resolve-exit-waiters.ts:106-123,190-211` — sites that reach `isTuiIdleSatisfied` without a blocked scan
## Required outcome
- Evidence (a captured transcript) showing whether a live Muse question screen keeps the ready banner/composer in the tail, and the matcher / readiness veto behaving correctly for that shape.
## Suggested approach
- Record with `config/scripts/capture-agent-pty-transcript.mjs`, commit the fixture + `.meta.json`, and drive the new test through `createTranscriptPane` on the raw bytes rather than the hand-written `MUSE_USER_INPUT` array.|
|
||
| export const TERMINAL_WAIT_BLOCKED_SENTINEL_RE = | ||
| /update available|choose working directory to|codex just got an upgrade|hooks need review|do you trust|trust this|trusted workspace|press enter to (?:confirm|continue|view|insert)|press t to trust|permission required|requires permission|allow once|allow always|run this command\?/i | ||
| /update available|choose working directory to|codex just got an upgrade|hooks need review|do you trust|trust this|trusted workspace|request user input|enter to select|press enter to (?:confirm|continue|view|insert)|press t to trust|permission required|requires permission|allow once|allow always|run this command\?/i |
There was a problem hiding this comment.
enter to select is redundant here: findMuseInteractiveQuestionIndex already returns null unless request user input is present, and that term alone makes the sentinel match. As a global alternation it is also very broad (any menu that prints "Enter to select" now makes the whole retained tail eligible for the full blocked-signal scan, via terminal-tail-sentinel-index.ts), so consider dropping it and keeping only request user input.
1c8fc1a to
9d6d728
Compare
Co-authored-by: homesh-dev <[email protected]> Co-authored-by: Jeff Huen <[email protected]> Co-authored-by: Adrien De Oliveira <[email protected]> Co-authored-by: John Cusack <[email protected]>
9d6d728 to
c7acc0b
Compare
There was a problem hiding this comment.
Important
The new inferred-status emission writes a waiting row for a Muse question, but nothing clears it once the question is answered — the pane keeps reading "Needs permission" while it works again. Details inline.
Reviewed changes
Since the prior pullfrog review (1c8fc1ad), the only net change is the Muse interactive-question status emission:
- Emitted an inferred
waitingstatus for a live Muse question —orca-runtime-schedule-wait-blocked-check.tsnow callsemitInferredAgentStatusEventwhen a Muse pane's blocked signal is the live numbered question, publishing{ state: 'waiting', agentType: 'muse', toolName: 'Request user input' }into the hook-server status store so the sidebar surfaces "Needs permission". - Added the inference helper —
orca-runtime-create-terminal-side-effect-command-code-detector.tsgainsemitInferredAgentStatusEvent, a thin wrapper overemitTerminalAgentStatusEventsthat synthesizes a single-payload chunk.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
| if ( | ||
| nextWaitState.signal?.reason === 'agent-interactive-prompt' && | ||
| (pty.launchAgent === 'muse' || pty.foregroundAgent === 'muse') && | ||
| findMuseInteractiveQuestionIndex(nextWaitState.waitText.toLowerCase()) !== null | ||
| ) { | ||
| this.emitInferredAgentStatusEvent(ptyId, { | ||
| state: 'waiting', | ||
| prompt: nextWaitState.waitText, | ||
| agentType: 'muse', | ||
| toolName: 'Request user input' | ||
| }) |
There was a problem hiding this comment.
When the user answers the Muse question and the menu disappears, nothing emits a subsequent non-waiting transition for that pane, so the row this writes stays waiting (projected as permission) until the pane's process is certified ended/replaced or readers display-decay it after 30 minutes — the sidebar and getTerminalAgentStatus both keep reporting "Needs permission" on a pane that is working again. The only answer-clearing paths that exist (inferQuestionAnswered/inferInterrupt and the renderer's agent-question-answered-inference) are gated to agentType === 'claude', and Muse emits no hooks and no OSC 9999, so none of them can clear this row.
Technical details
# Muse inference row has no clearing transition
## Affected sites
- `src/main/runtime/orca-runtime-schedule-wait-blocked-check.ts:82-92` — emission is write-once; only ever sets `state: 'waiting'`
- `src/main/runtime/orca-runtime-create-terminal-side-effect-command-code-detector.ts:147-153` — `emitTerminalAgentStatusEvents` also sets `agentPromptLifecycleByPtyId` to `permission`, so `getTerminalAgentStatus` keeps returning `permission` after `detectTerminalWaitBlockedReason(waitText)` goes null (see `resolveAuthoritativeTerminalWaitPermission` at `orca-runtime-resolve-authoritative-terminal-wait-permission.ts:25-50`)
- `src/main/agent-hooks/server/server-status-inference.ts:141-148,55-62` — both clearers reject non-Claude agents
- `src/renderer/src/components/terminal-pane/agent-question-answered-inference.ts:31-39` — also `agentType === 'claude'` only
- `src/main/runtime/orca-runtime-apply-tracked-pty-title.ts:28` — title lifecycle writes pty records, never the hook-server store
## Required outcome
- A Muse pane that answers the question (or otherwise resumes) must stop reading `waiting`/`permission` in both the status store and `getTerminalAgentStatus`.
- A test drives the post-answer screen (menu gone, Muse working/idle) and asserts the row no longer reports a wait/permission, so the new emission path has coverage of its own — the current `terminal-interactive-wait-visibility.test.ts` case is satisfied by `pty.waitBlockedAt` alone and would pass without this emission.
## Open questions for the human
- Is there a Muse signal (title, output quiescence, ready screen) the runtime can key a clearing transition on? `isMuseReadyPromptPreview` already identifies the resumed ready screen.
- If the row is meant to persist by design, set `prompt` to the question text rather than the full wait screen (the `prompt` field is documented as the user's prompt, and this bypasses `parseAgentStatusPayload` normalization).There was a problem hiding this comment.
ℹ️ The follow-up commit drops the Muse pane-agent guard from the new status emission; one minor note inline.
Reviewed changes
Since the prior pullfrog review (9d6d7283), one line changed:
- Removed the
pty.launchAgent === 'muse' || pty.foregroundAgent === 'muse'guard — the inferredwaitingemission now fires for any pane whose blocked signal matches the Muse question signature, while still stampingagentType: 'muse'.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
| this.recordAgentPromptPermissionObservation(ptyId) | ||
| if ( | ||
| nextWaitState.signal?.reason === 'agent-interactive-prompt' && | ||
| findMuseInteractiveQuestionIndex(nextWaitState.waitText.toLowerCase()) !== null |
There was a problem hiding this comment.
With the pane-agent guard gone, the only thing asserting the pane is Muse is the screen matcher, yet the emitted row hardcodes agentType: 'muse'. The signature is specific enough that false positives are unlikely, but a non-Muse pane that briefly paints those strings now gets a row labelled Muse (and, per the still-open clearing concern, it would stick). If the guard was dropped because foregroundAgent is not populated yet when the question appears, consider deriving the type from pty.launchAgent ?? pty.foregroundAgent instead of dropping the identity check outright.
Technical details
# Emission no longer backs its `agentType` with pane identity
## Affected sites
- `src/main/runtime/orca-runtime-schedule-wait-blocked-check.ts:83-90` — condition is now `reason === 'agent-interactive-prompt' && findMuseInteractiveQuestionIndex(waitText) !== null`, then writes `agentType: 'muse'`
## Required outcome
- The row's `agentType` matches the pane's actual agent, or the condition proves the pane owns a Muse process.
## Open questions for the human
- Was the guard removed because `launchAgent`/`foregroundAgent` is unset when the question first paints? If so, deriving the emitted `agentType` from the pane (falling back to `'muse'` only when the matcher matched) keeps the label honest without reintroducing the false negative.|
Update from the latest #19188 testing: the statement that Muse hook attribution is unreliable is accurate for Muse 1.0.3, but no longer accurate for Muse 1.3.0. The new #19188 now also uses Since #22160 appears to be the newer successor with broader launch/readiness and Windows coverage, would it make sense to consolidate the missing #19188 capabilities there rather than maintain two overlapping Muse PRs? |
|
Superseded by #22216, which landed first-class Muse Code support. |

What changed
Muse Code is now a first-class Orca TUI agent. Orca can detect the installed
museCLI, launch it safely, inject orchestration prompts, recognize Muse's versioned foreground process, and keepmuse execheadless runs out of interactive-agent detection.Muse launches with
muse --trust-workspaceand uses stdin-after-start prompt delivery. This avoids Muse interpreting task text such asexec,resume, orinitas CLI subcommands. Muse readiness is recognized from its stable body screen (Muse Code,Skills: … loaded, and the❯composer) only after output quiesces, and approval/question screens remain actionable; the real Orca PTY evidence includes Muse's workspace trust question with Trust/Quit choices.Desktop and mobile catalogs include the bundled Muse icon, permissions, telemetry, labels, skills discovery mapping, and localized picker entries. The implementation is cross-platform at the shared agent/config layer, including paired Windows runtimes. The awin check found Git Bash did not inherit the user-local Muse install, so the Windows launch config now bridges through PowerShell; the real remote TUI then reached Muse Code 1.3.0 successfully.
Validation
pnpm tcecho: Say MUSE_ORCA_LOCAL_OKawin: PowerShell bridge resolvedmuse.cmdand reached the interactive Muse 1.3.0 TUImuse --helpandmuse exec --provider echo --jsonevidencerequest user inputscreen: Orca now detects the live numbered-choice menu as an interactive wait and reports it through the terminal status path; narration and stale screens are rejectedCommunity work reviewed
ORCA_*, so live hook attribution is not treated as reliableVisual proof
Co-authored-by: homesh-dev [email protected]
Co-authored-by: Jeff Huen [email protected]
Co-authored-by: Adrien De Oliveira [email protected]
Co-authored-by: John Cusack [email protected]
The final screenshot shows the live worktree changing to Needs permission while the terminal remains open, proving the numbered Muse question is surfaced through Orca's visible status path.
Live CDP verification after a fresh Electron launch: a real PTY emitted the numbered Muse question transcript, and Orca rendered Needs permission, Needs attention, and an Agents → Waiting for input → Muse row.