Repository navigation
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (6)
🚧 Files skipped from review as they are similar to previous changes (6)
📝 WalkthroughWalkthroughAdds a 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
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.
🧹 Nitpick comments (1)
src/main/runtime/orca-runtime.ts (1)
17924-17953: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick winReused paste-quiet timeout may be too short for full TUI mount readiness.
waitForStartupDraftReady(invoked here for the followup gate) hard-times-out viaDRAFT_PASTE_READY_TIMEOUT_MS(8000ms), a constant originally scoped to the "paste then wait for render to go quiet" flow. It's now reused to gate on an agent fully mounting its TUI and printing a banner (e.g., Kimi's "Welcome to Kimi"), which is a materially slower/more variable operation than post-paste render settling. If this signal doesn't fire within 8s on a slow machine/SSH session, the code silently skips the follow-up prompt entirely (only a console warning), which regresses back to the original bug's user-visible symptom — the agent starts autonomously without its prompt — just via a different failure path.Consider a dedicated (and possibly longer or per-agent-configurable) timeout constant for this readiness gate instead of coupling it to the bracketed-paste-quiet semantics.
♻️ Proposed fix: separate timeout constant
+const STARTUP_FOLLOWUP_DRAFT_READY_TIMEOUT_MS = 15000 const DRAFT_PASTE_READY_TIMEOUT_MS = 8000And thread a timeout override through
waitForStartupDraftReady(or a small wrapper) so the follow-up gate uses the longer bound while the original paste-quiet flow keeps its existing 8s.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 04d62d3e-e6f0-4f4b-90a3-d9a61922c2c6
📒 Files selected for processing (5)
src/main/runtime/orca-runtime.tssrc/shared/draft-paste-ready-scanner.test.tssrc/shared/draft-paste-ready-scanner.tssrc/shared/tui-agent-config.tssrc/shared/tui-agent-startup.test.ts
2ba7549 to
c462212
Compare
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
|
Follow-up after field report on #10336:
Evidence: draft-paste-ready + tui-agent-startup (83) and new/updated |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/main/runtime/orca-runtime.ts (1)
36461-36480: 🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy liftScope the Kimi welcome-banner matcher to startup readiness.
findKimiReadyPromptIndexreports readiness from anywelcome to kimimatch without a later busy/idle guard, while Cursor’s variant falls back to the absence of a spinner after its active prompt. SinceisKnownReadyPromptPreviewis used bywaitForTerminal, this can make a laterwait --for tui-idleresolve after the welcome banner remains in the tail buffer, even while Kimi is generating. Gate this match on a working/idle signal if Kimi has one, or limit the banner check to the initial startup/draft-paste-ready flow and use a separate mechanism for later turns.
🧹 Nitpick comments (1)
src/main/runtime/orca-runtime.ts (1)
21155-21186: 🧹 Nitpick | 🔵 Trivial | 💤 Low valueConfirm silent follow-up drop on draft-ready timeout is acceptable.
When
waitForStartupDraftReadytimes out (20 seconds), the function logs a warning and returns without ever sendingfollowup.prompt. The prompt is dropped with no signal back to theworktree.createcaller or to orchestration. This matches the PR's stated intent ("skips delivery when readiness fails"), and the fire-and-forget pattern already existed before this change, so this is a design confirmation rather than a new defect.[reliability_and_resilience]
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: a0eba0d9-0e78-42e3-8d7d-aa8e165db6ed
📥 Commits
Reviewing files that changed from the base of the PR and between f713739 and c4622129e374135cb78d236ff2d1ff59b0e22be7.
📒 Files selected for processing (6)
src/main/runtime/orca-runtime.test.tssrc/main/runtime/orca-runtime.tssrc/shared/draft-paste-ready-scanner.test.tssrc/shared/draft-paste-ready-scanner.tssrc/shared/tui-agent-config.tssrc/shared/tui-agent-startup.test.ts
🚧 Files skipped from review as they are similar to previous changes (4)
- src/shared/tui-agent-startup.test.ts
- src/shared/draft-paste-ready-scanner.ts
- src/shared/draft-paste-ready-scanner.test.ts
- src/shared/tui-agent-config.ts
c462212 to
c690571
Compare
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
|
Addressed CodeRabbit major: Instead:
Regression: banner+quiet resolves; banner with continuous output does not; quiet before banner does not. |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
src/main/runtime/orca-runtime.ts (1)
21353-21357: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick winStamp
kimiWelcomeBannerSeenwhenwaitForStartupDraftReadyobserves Kimi readiness.
createDraftPasteReadyScanner('kimi-welcome-banner')returns{ ready: true }onWelcome to Kimi, butfinish(ptyId)never writesptysById.get(ptyId).kimiWelcomeBannerSeen. Set it only when the ready signal is Kimi, so later idle fallback does not remain gated on a later tail rescan that can miss the banner due to theMAX_TAIL_*bounds.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 50e5df43-bc4d-4580-bd45-7ebf751f4fb4
📥 Commits
Reviewing files that changed from the base of the PR and between 01d3bc5 and c690571a0402b3255dce76b78c7feaa14ca59353.
📒 Files selected for processing (6)
src/main/runtime/orca-runtime.test.tssrc/main/runtime/orca-runtime.tssrc/shared/draft-paste-ready-scanner.test.tssrc/shared/draft-paste-ready-scanner.tssrc/shared/tui-agent-config.tssrc/shared/tui-agent-startup.test.ts
🚧 Files skipped from review as they are similar to previous changes (4)
- src/shared/tui-agent-startup.test.ts
- src/shared/draft-paste-ready-scanner.ts
- src/shared/tui-agent-config.ts
- src/shared/draft-paste-ready-scanner.test.ts
stdin-after-start only waited for the kimi process to own the PTY, so worktree-create --prompt always wrote the brief before the TUI composer existed and the text echoed above "Welcome to Kimi". Add a kimi-welcome-banner ready signal and gate follow-up prompt delivery on it after process liveness, matching the draft-paste readiness pattern. Closes stablyai#10336
Field report on stablyai#10336 (orchestration worker-start on remote headless): tui-idle could false-positive on Kimi process quiet before the TUI mounts, and the follow-up draft-ready gate reused the 8s paste-quiet timeout. Wait longer for the banner marker on stdin-after-start follow-up, treat "Welcome to Kimi" as a tui-idle ready preview, and skip quiet-only idle while the kimi process is still mounting. Refs: stablyai#10336 issuecomment-5204525896
CodeRabbit: matching "Welcome to Kimi" in isKnownReadyPromptPreview made every subsequent tui-idle wait succeed while the banner remained in the tail, even during generation. Gate Kimi quiet-idle on a once-seen banner flag instead, and keep the draft-paste ready scanner for stdin follow-up.
When draft-ready sees the Kimi banner, set kimiWelcomeBannerSeen so later tui-idle quiet fallback does not depend on a scrolled-away tail. Clear the flag on PTY process-generation reset, and assert quiet has not elapsed before the banner+quiet settle window.
c690571 to
0563058
Compare
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
|
Addressed latest CodeRabbit notes:
tip: |
|
Thanks @innocarpe — your diagnosis that Kimi's stdin-after-start delivery only waited for process liveness is what #33581 builds on. #33581 (merged, with you credited as co-author) delivers Kimi's first prompt once its composer is ready, including on Windows. Closing as superseded. |
Description
Kimi Code
stdin-after-startprompt injection now waits for the Welcome to Kimi banner (and a longer readiness budget) before writing the follow-up prompt. Orchestrationtui-idlealso treats that banner as ready and no longer false-positives on a quietkimiprocess alone.Focused fix
tui-idlereadiness for the same markerdispatch_input: acceptedto mean “agent consumed bytes” rather than “write accepted”Preserves
worker-start/sendTerminalAgentPromptwrite contract (acceptedstill means the write path completed)Evidence
pnpm exec vitest run --config config/vitest.config.ts src/shared/draft-paste-ready-scanner.test.ts src/shared/tui-agent-startup.test.ts(83)pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/orca-runtime.test.ts -t 'tui-idle|Kimi|#10336'(including banner ready + quiet-kimi not idle)User-regression-tradeoffs
tui-idlewaits for the banner instead of process quiet — slower ready on hosts where Kimi is quiet mid-boot, but avoids silent empty dispatchFixes #10336