Repository navigation
Conversation
DSH-TUI rests on a title of "✦ 🐋". That star is Gemini's working glyph, so terminal wait --for tui-idle ran until timeout while the composer was already ready. A running turn uses a braille spinner and "esc to interrupt", and those must not settle. The ready screen is also recognized from the dsh-tui banner plus an idle ❯ composer, so a pane that has not published an OSC title can settle the same way.
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. 📝 WalkthroughWalkthroughThe change adds DeepSeek Harness title and composer-prompt readiness checks. Terminal wait detection uses resting titles as explicit idle signals and includes ready-prompt indexes in startup-modal and known-prompt detection. Tests cover resting and working titles, ready composers, and screens that should not indicate readiness. Priority: ⬇️ Low Merge Risk: 🟡 Moderate · up to
Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to A pane can now be reported idle from its title or visible text even when other status evidence indicates work is ongoing. That could release an automation wait early. The reviewed privileged launch path checks session identity separately before focusing a terminal; no direct privilege escalation was established. Retained concerns
Security review detailsSecurity Blast Radius
Security Findings and Attack Paths
Trust Boundaries and Controls
Hardening Proposals
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Full details: Description checkExplanation The description explains the problem, behavior changes, preserved cases, and targeted tests. It does not follow the required template and omits the ELI5, What Changed, Why, Linked Issue, Visual Proof, Review, boundary, Notes, and Checklist sections. Resolution Rewrite the description using the repository template. Add the required issue reference, visual proof or
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: 3
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: fa464273-60ac-46b1-abc0-2a9c9b12e373
📒 Files selected for processing (4)
src/main/runtime/dsh-terminal-readiness.tssrc/main/runtime/terminal-wait-detection.test.tssrc/main/runtime/terminal-wait-detection.tssrc/main/runtime/terminal-wait-name-only-idle.test.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 4 remain after this review.
| /** A finished DSH pane titles itself `✦ 🐋 …`. A running turn uses `⠂`/`⠐` instead. */ | ||
| export function isDshRestingTitle(title: string): boolean { | ||
| const trimmed = title.trim() | ||
| return trimmed.startsWith(DSH_REST_PREFIX) && trimmed.includes(DSH_WHALE) |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Require the whale next to the resting glyph.
A Gemini working title such as ✦ Write about 🐋 starts with ✦ and contains a whale. This predicate reports it as DSH idle, so tui-idle can settle during a Gemini turn. Match the DSH ✦ 🐋 prefix rather than a whale anywhere in the title.
| const headerIndex = normalized.lastIndexOf('dsh-tui') | ||
| if (headerIndex === -1) { | ||
| return null | ||
| } | ||
| const segment = normalized.slice(headerIndex) | ||
| if (!segment.includes('deepseek-flash') && !segment.includes('max effort')) { |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Require a DSH banner and model row, not just matching text.
If a shell echoes dsh-tui deepseek-flash and later displays a lone ❯ prompt, this function reports a ready DSH pane. The checks accept both identifiers on a shell command line; they do not establish the banner or model row. Match those identifiers in their respective screen lines before accepting the composer.
| if (!segment.includes('deepseek-flash') && !segment.includes('max effort')) { | ||
| return null | ||
| } | ||
| const composerIndex = findLastLoneComposerIndex(segment) |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Do not accept a composer above a later question row.
If the preview retains an earlier ⌸ ❯ line and then shows ❯● Tea, findLastLoneComposerIndex returns the earlier composer. The later question row does not trigger either active-turn check, so isKnownReadyPromptPreview reports idle while the question needs input. Check the current input area after the candidate composer, and add a fixture with both rows present.
There was a problem hiding this comment.
Important
The DSH screen rule is pinned only to a hand-typed five-line fixture, and its model-row guard is loose enough to match a non-DSH pane. Details and one inline comment below.
Reviewed changes
- New
src/main/runtime/dsh-terminal-readiness.ts—isDshRestingTitlereads a✦ …🐋…OSC title as idle;findDshReadyPromptIndexaccepts adsh-tuibanner plus adeepseek-flash/max effortrow and a lone❯composer, vetoing when the last 12 lines showesc to interruptor a braille frame[\u2802\u2810]. - Wiring in
terminal-wait-detection.ts— the title check short-circuitscomputeExplicitIdleStatusFromTitlebefore the generic classifier, and the body matcher joinsfindKnownReadyPromptIndex(tier-1 body evidence) andfindDismissedStartupModalIndex. - Tests — resting/working title cases plus five body-preview cases (lone composer, live-turn veto, echoed launcher, question row).
⚠️ The screen rule has no captured transcript behind it
findDshReadyPromptIndex is a rule over what DSH paints on the terminal, but every string it keys on was typed by hand into a five-line fixture. AGENTS.md ("Agent Terminal Screens") requires such rules to be written against a captured transcript, and docs/reference/antigravity-readiness-evidence.md documents that three of four Antigravity rules written from typed-from-memory screens were "found worse than the bug they replaced." A real dsh-tui capture would also settle the questions the inline comment and the isDshRestingTitle/wrapper caveats below cannot answer.
Technical details
# DSH readiness needs a committed PTY transcript
## Affected sites
- `src/main/runtime/dsh-terminal-readiness.ts:26-45` — the body rule; every token it keys on (`dsh-tui`, `deepseek-flash`, `max effort`, `❯`, `esc to interrupt`, `⠂`/`⠐`) comes from the hand-typed screen at `terminal-wait-detection.test.ts:591-597`.
- `src/main/runtime/terminal-wait-detection.test.ts:590-637` — asserts against `buildTerminalWaitText` output, not raw bytes through the runtime.
- `src/main/runtime/terminal-wait-detection.ts:102,112` — the wiring inherits any false positive/negative of that rule.
## Required outcome
- A committed `src/main/runtime/__fixtures__/dsh-*.txt` + `.meta.json`, captured from a live `dsh-tui` with `config/scripts/capture-agent-pty-transcript.mjs` (resting, mid-turn, and if reachable a startup dialog), replayed through `createTranscriptPane` in a `dsh-readiness-transcript.test.ts`, per `docs/reference/agent-pty-transcript-capture.md`.
## Suggested approach (optional)
- Mirror `antigravity-readiness-transcripts.test.ts` / `muse-readiness-transcript.test.ts`.
- The capture would settle three currently-unverifiable points: whether the idle composer is truly a lone `❯` (decorations/placeholder text), whether a running turn always carries `esc to interrupt` or a `⠂`/`⠐` frame inside the bottom 12 lines, and whether DSH paints its composer beneath a startup/trust dialog (which `findDismissedStartupModalIndex` would then read as "modal dismissed").
## Open questions for the human (optional)
- Was the cited v0.11.0 capture on `dsh 0.1.7-rc.1` saved anywhere that can be committed?ℹ️ Nitpicks
isDshRestingTitleaccepts any✦ …🐋…title, so a Gemini CLI working title whose free-form task text contains a whale (✦ Explain the 🐋 marker) now reads as idle; the whale is the only discriminator because there is nodshagent identity.isDshRestingTitleusesstartsWith('✦')while the generic glyph classifier usesincludes, so a wrapper-prefixed title (tmux: ✦ 🐋 …) will not settle via the title path and falls through to the body rule.terminal-wait-name-only-idle.test.ts:240("does not treat a working DeepSeek Harness title as idle") setslastAgentStatus: null, so it cannot reach the DSH path and passes with or without the change; the assertion that actually pins the behavior isterminal-wait-detection.test.ts:603.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
| const segment = normalized.slice(headerIndex) | ||
| if (!segment.includes('deepseek-flash') && !segment.includes('max effort')) { | ||
| return null |
There was a problem hiding this comment.
max effort is a generic phrase, and this matcher is unscoped tier-1 body evidence — unlike Muse's hasQuietMuseReadyPrompt, it gets no agent gate and no quiescence. Combined with a bare ❯ prompt (the default glyph of starship/pure shells), a non-DSH pane whose retained tail contains dsh-tui + max effort — e.g. an Orca agent that cats or greps this PR's own test file — can settle tui-idle immediately. Requiring the deepseek-flash model token (or an actual DSH banner shape) instead of the max effort alternative would tighten this, and a scrollback-quoting regression test would pin it.
Technical details
# Unscoped, loosely-guarded DSH body matcher
## Affected sites
- `src/main/runtime/dsh-terminal-readiness.ts:32` — `segment.includes('deepseek-flash') || segment.includes('max effort')`; `max effort` also appears in prose in `docs/site/content/docs/agents/glm-agent.mdx:46`.
- `src/main/runtime/dsh-terminal-readiness.ts:39-44` — the 12-line veto only excludes `esc to interrupt` and the two braille frames, so a shell prompt tail passes.
- `src/main/runtime/terminal-wait-detection.ts:112` — joins `findKnownReadyPromptIndex`, whose result is consumed as tier-1 evidence in `tui-idle-evidence.ts:165`.
## Required outcome
- A non-DSH pane must not satisfy `tui-idle` from scrollback that merely quotes DSH identifiers.
## Suggested approach (optional)
- Drop the generic `max effort` alternative, or require the banner/model-row shape together with a version token.
- Add a regression test mirroring `terminal-wait-name-only-idle.test.ts:252` ("never settles another agent quoting Muse in its scrollback").|
Closing this in favor of the first-party
#22468 treats a fresh hook The review notes on this PR (whale-anywhere title, shell echo, question row, unscoped |

Summary
terminal wait --for tui-idletimed out on a ready DeepSeek Harness (dsh-tui0.11.0) pane. The composer was already showing❯, and the OSC title was✦ 🐋.That star is Gemini CLI's working glyph, so the wait classifier never treated the resting title as idle. A running turn uses
⠂/⠐plusesc to interruptand still does not settle.✦ 🐋title is explicit idle fortui-idleonly. Sidebar status classification is unchanged.dsh-tuibanner, the model row, and a lone❯composer, unless the bottom of the screen is still a live turn.Preserves
Gemini titles that start with
✦and do not include the whale stay unchanged. A shell that only echoeddsh-tuiis not ready. A question row such as❯● Teais not the idle composer.Tests
pnpm exec vitest run src/main/runtime/terminal-wait-detection.test.ts src/main/runtime/terminal-wait-name-only-idle.test.ts