Skip to content

feat(agents): launch DeepSeek Build from the agent menu - #22886

Closed
innocarpe wants to merge 3 commits into
stablyai:mainfrom
innocarpe:fix/dsb-agent-launch
Closed

innocarpe wants to merge 3 commits into
stablyai:mainfrom
innocarpe:fix/dsb-agent-launch

Conversation

@innocarpe

Copy link
Copy Markdown
Contributor

Summary

Add DeepSeek Build (dsb 6, @innocarpe/deepseek-build) as a launchable agent.

  • The agent menu runs dsb. The first prompt is pasted into the ❯ composer after the alt-screen switch. dsb run stays a one-shot and is not hosted as a session.
  • Orca recognizes the dsb / deepseek-build binaries, the deepseek-build-agent child, and the npm shim under @innocarpe/deepseek-build.
  • A resting title is DeepSeek Build. A turn retitles to spinner - Waiting for response… - DeepSeek Build and must not count as tui-idle. OSC 9999 {"state":"done","agentType":"deepseek-build"} settles a finished turn even if that spinner title lags.
  • Resume is dsb --resume <id>, gated by agent-session.dsb-resume.v1.

Captured from a local dsb 6.0.0 TUI. Hooks and Source Control AI are not in this change.

Preserves

Other agents keep their launch, title, and idle rules. A shell prompt that is only ❯ is not treated as DeepSeek Build. YOLO mode adds --dogfood, which is that CLI's trusted local profile.

Tests

  • pnpm exec vitest run src/main/runtime/terminal-wait-detection.test.ts src/main/runtime/terminal-wait-name-only-idle.test.ts src/shared/agent-process-recognition.test.ts src/shared/dsb-headless-command.test.ts src/renderer/src/runtime/agent-resume-host-authority-capability.test.ts src/shared/agent-kind.test.ts
  • Targeted oxlint and oxfmt checks

@coderabbitai

coderabbitai Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

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

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: b28c41de-0cdb-470b-b330-f11df1d3b2c0

📥 Commits

Reviewing files that changed from the base of the PR and between 7932dbd4d5ee3bb7ce2c35558f9374539277ad75 and a0ef6bf32ae6ed3b52908b3543521513e3a39e69.

📒 Files selected for processing (13)
  • src/main/runtime/orca-runtime-resolve-exit-waiters.ts
  • src/main/runtime/orca-runtime-start-tui-idle-visible-read-probe.ts
  • src/main/runtime/runtime-terminal-idle-polls.ts
  • src/main/runtime/runtime-terminal-wait.ts
  • src/main/runtime/terminal-wait-detection.test.ts
  • src/main/runtime/terminal-wait-detection.ts
  • src/main/runtime/tui-idle-evidence.test.ts
  • src/main/runtime/tui-idle-evidence.ts
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/fr.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/ko.json
  • src/renderer/src/i18n/locales/zh.json
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/renderer/src/i18n/locales/zh.json

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


📝 Walkthrough

Walkthrough

The change adds DeepSeek Build as a TUI agent. It adds agent and process recognition, launch configuration, one-shot command detection, and terminal title classification. It also adds composer readiness detection and DSB-specific idle evaluation. The renderer catalog, locale labels, iconable-agent mapping, and supported-agent documentation now include DeepSeek Build.

Priority: ⬇️ Low

Merge Risk: 🟡 Moderate · up to a0ef6

DeepSeek Build can remain in a waiting state after completing a turn. Preserve the event order for same-chunk title and status updates before merging.

Security Architecture Review

Security architecture risk: 🟡 Moderate · up to a0ef6

Two completion paths may report a turn finished while it is still running, allowing subsequent automated actions to proceed out of order. The identified paths are scoped to a terminal; no cross-user access path was established.

Retained concerns

  • Medium · security · inferred: The newly enabled DSB visible-screen probe can resolve a terminal idle waiter from ready text without applying the working-status and working-title vetoes used by the normal idle predicate. The probe is conditional on an empty initial wait text and an eligible pane state, so premature resolution is a plausible path rather than a verified occurrence.
  • Medium · security · inferred: A done status is timestamped when received, without a turn identifier or stale-frame rejection. If an old or repeated done frame arrives after a new working title, its receipt time can make that title appear stale and permit retained ready-body evidence to settle the current turn. Whether such frames occur or can be induced in production is unverified.
Security review details

Security Blast Radius

  • inferred — The identified completion paths affect waiting automation for the selected pane. Status and titles are recorded by PTY, and the inspected waiter lookup does not show evidence crossing into a different PTY.

Security Findings and Attack Paths

  • inferred — When the visible-read probe is eligible, retained DSB composer text could produce an idle result during a working turn because this resolution path does not recheck the turn status or title.
  • inferred — A delayed or repeated done frame could outrank a newer OSC working title on the normal PTY path. This requires a frame to arrive after that title and ready-body evidence to remain available; no production replay or attacker-controlled injection was established.

Trust Boundaries and Controls

  • observed — Ready-body text does not itself identify a DSB pane: the normal idle predicate and visible-read probe select DSB matching from the pane agent. The generic matcher does not include the DSB banner rule.

Resilience and Maintainability Implications

  • observed — Unit tests exercise newer and older done-versus-title timestamps, but provide the epoch directly; they do not establish that a leaf receives it or that a repeated frame belongs to the current turn.

Hardening Proposals

  • proposed — Apply the same live status and title vetoes before the visible-screen probe resolves a DSB waiter, including after its asynchronous read completes.
  • proposed — Correlate completion evidence with the current turn rather than relying solely on receipt time, and make the title epoch available to every record evaluated by the completion predicate.
🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description gives useful implementation and testing details, but it does not follow the required template. It omits the required ELI5, What Changed, Why, Linked Issue, Visual Proof, Review, Agent … Rewrite the description using all required template sections. Add the linked issue, provide visual proof or state N/A with a reason, complete the testing and checklist sections, and update the resume-support statement to match the final cha…
Docstring Coverage ⚠️ Warning Docstring coverage is 32.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 25 functions across 36 files. (5 skipped:… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: adding DeepSeek Build as a launchable agent from the agent menu.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description gives useful implementation and testing details, but it does not follow the required template. It omits the required ELI5, What Changed, Why, Linked Issue, Visual Proof, Review, Agent skill upstream boundary, Notes, and Checklist sections. It also states that resume support exists, while the PR objectives say resume support was later removed.

Resolution

Rewrite the description using all required template sections. Add the linked issue, provide visual proof or state N/A with a reason, complete the testing and checklist sections, and update the resume-support statement to match the final changeset.

Full details: Docstring Coverage

Explanation

Docstring coverage is 32.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 25 functions across 36 files. (5 skipped: 5 unsupported.)

  • Fix all pre-merge checks with AI

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.

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

Actionable comments posted: 4


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 9a2d5008-1931-4c99-99a8-4c3820a7954d

📥 Commits

Reviewing files that changed from the base of the PR and between 646e9a5 and f00dd63f9c02148b6ed025fb7972e7488630a698.

📒 Files selected for processing (33)
  • docs/site/content/docs/agents/supported.mdx
  • src/main/runtime/dsb-terminal-readiness.ts
  • src/main/runtime/terminal-wait-detection.test.ts
  • src/main/runtime/terminal-wait-detection.ts
  • src/main/runtime/terminal-wait-name-only-idle.test.ts
  • src/main/runtime/tui-idle-evidence.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/fr.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/ko.json
  • src/renderer/src/i18n/locales/zh.json
  • src/renderer/src/lib/agent-catalog.tsx
  • src/renderer/src/lib/agent-status.ts
  • src/renderer/src/runtime/agent-resume-host-authority-capability.test.ts
  • src/renderer/src/runtime/agent-resume-host-authority-capability.ts
  • src/shared/agent-headless-command.ts
  • src/shared/agent-kind.ts
  • src/shared/agent-process-recognition.test.ts
  • src/shared/agent-process-recognition.ts
  • src/shared/agent-session-resume.ts
  • src/shared/agent-type-label.ts
  • src/shared/dsb-headless-command.test.ts
  • src/shared/dsb-headless-command.ts
  • src/shared/protocol-version.ts
  • src/shared/skills-cli-agent-keys.ts
  • src/shared/telemetry-property-schemas.ts
  • src/shared/terminal-title-agent-type.ts
  • src/shared/tui-agent-config.ts
  • src/shared/tui-agent-display-names.ts
  • src/shared/tui-agent-permissions.ts
  • src/shared/tui-agent-selection.ts
  • src/shared/tui-agent.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 3 remain after this review.

Comment thread src/main/runtime/tui-idle-evidence.ts Resolved
Comment thread src/shared/agent-session-resume.ts Resolved
Comment thread src/shared/dsb-headless-command.ts Resolved
Comment thread src/shared/terminal-title-agent-type.ts Resolved

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

Important

Two integration gaps worth addressing before merge: a working DeepSeek Build title is still classified as Claude Code by the renderer's title classifier, and the new tui-idle lane trusts a first-party done with no age bound, which can settle a later turn's wait mid-turn.

Reviewed changes

  • New agent plumbing — dsb added to the TuiAgent union and every exhaustive map (config, display names, kind, resume, headless matcher, skills keys, process recognition, telemetry, i18n). All compile-time-checked maps are complete.
  • Readiness detection — new dsb-terminal-readiness.ts finds the DeepSeek Build banner plus a lone ❯ composer and the "Waiting for response…"/braille working title; wired into terminal-wait-detection.ts and a dedicated dsb branch in isTuiIdleSatisfied.
  • Launch/resume — launch config uses stdin-after-start with the reused grok composer-paste signal; dsb --resume <id> is gated by agent-session.dsb-resume.v1.

ℹ️ The readiness rules have no captured transcript in the repo

docs/reference/agent-pty-transcript-capture.md asks that terminal-painting readiness rules be written against a captured transcript, and grok/muse/zcode/antigravity each ship a trace-replay test for theirs. The dsb rules here, and the reuse of grok-composer-prompt for its ❯-after-alt-screen signal, are asserted only against hand-written strings, so a dsb release that changes the composer frame or spinner shape would fail silently. Committing the dsb 6.0.0 capture and adding a replay test would let those assumptions break loudly.

Technical details
# Commit the dsb readiness capture

## Affected sites
- `src/main/runtime/dsb-terminal-readiness.ts` — banner/`❯`/braille assumptions.
- `src/shared/tui-agent-config.ts:351` — `draftPasteReadySignal: 'grok-composer-prompt'` reuses grok's alt-screen anchor.
- Comparable precedent: `src/shared/draft-paste-ready-scanner-grok-trace-replay.test.ts`, `src/main/runtime/muse-readiness-transcript.test.ts`, `src/main/runtime/zcode-readiness-transcript.test.ts`, `src/main/runtime/antigravity-readiness-transcripts.test.ts`.

## Required outcome
- A committed dsb capture (scrubbed per the capture doc) plus a replay test that fails if the composer glyph stops appearing after `\x1b[?1049h` or the working title shape changes.

ℹ️ dsb resume is wired but has no provider-session producer

dsb was added to RESUMABLE_TUI_AGENTS and getAgentResumeArgv, but providerSession is populated only from hooks (extractAgentProviderSession switches over AgentHookSource, and dsb is not in AGENT_HOOK_SOURCES); OSC 9999 carries no session id. With hooks explicitly out of scope in this PR, dsb --resume is currently unreachable. Is that intended groundwork, or should the capability land with the hook? The enum widening itself is safely gated by agent-session.dsb-resume.v1.

Technical details
# Resume path reachability

## Affected sites
- `src/shared/agent-session-resume.ts:23,320` — `dsb` in `RESUMABLE_TUI_AGENTS` and `getAgentResumeArgv`.
- `src/shared/agent-hook-relay.ts:37-59` — `AGENT_HOOK_SOURCES` has no `dsb`.
- `src/shared/agent-session-resume.ts:185-259` — `extractAgentProviderSession` is the only producer of `providerSession`.

## Open questions for the human
- Is `dsb` resume intended to ship ahead of its hook, or should the capability + enum entry wait?

ℹ️ Nitpicks

  • isDsbRestingTitle (src/main/runtime/dsb-terminal-readiness.ts:6) is exported but has no callers anywhere, including tests — dead code.
  • isDsbWorkingTitle re-implements the braille code-point scan; containsBrailleSpinner is already exported from terminal-title-agent-type.ts:26 (and containsAgentSpinnerGlyph from agent-title-core).

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

Comment thread src/shared/terminal-title-agent-type.ts Resolved
Comment thread src/main/runtime/tui-idle-evidence.ts Resolved
Comment thread src/main/runtime/tui-idle-evidence.ts Resolved
@innocarpe

Copy link
Copy Markdown
Contributor Author

Addressed the review on 7932dbd4d5. The description's resume bullet is withdrawn by that commit.

Title identity. DeepSeek Build matches only when the product name is the whole title or its own final - segment. ⠋ Review DeepSeek Build integration stays Claude on both classifiers (terminal-title-agent-type and agent-title-identity). isClaudeAgent is false for a real DeepSeek Build title, so Claude-only cache and completion paths do not run. The sidebar label map sends DeepSeek Build to dsb.

tui-idle. The working-title veto reads both rendererTitle and lastOscTitle, including an empty renderer title. A done status no longer overrides a working title. The composer stays on screen during a turn, and the previous done remains until the next OSC 9999 frame, so trusting it settled the next wait too early. A resting title plus the composer still settles.

dsb run. node …/dsb.js run skips the script path and is treated as the one-shot, same as dsb run. A node-wrapped TUI with no run subcommand stays interactive.

Resume. Removed dsb from RESUMABLE_TUI_AGENTS and dropped agent-session.dsb-resume.v1. The OSC 9999 frame carries state, agentType, model, and prompt only. Hooks are still out of scope, so there is no session-id producer. The supported-agents row no longer advertises dsb --resume. That can return with a producer.

Left as-is:

  • --dogfood is the YOLO launch arg, the same gate other agents use for --yolo. Manual mode launches bare dsb.
  • Docstring coverage and the long description template are outside this behavior fix.
  • A scrubbed transcript replay is a useful follow-up. The readiness rules are pinned against the captured title and composer strings for now.

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

Actionable comments posted: 2


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 287f585c-de80-42f0-9edc-d6bda772381d

📥 Commits

Reviewing files that changed from the base of the PR and between f00dd63f9c02148b6ed025fb7972e7488630a698 and 7932dbd4d5ee3bb7ce2c35558f9374539277ad75.

📒 Files selected for processing (15)
  • docs/site/content/docs/agents/supported.mdx
  • src/main/runtime/dsb-terminal-readiness.ts
  • src/main/runtime/terminal-wait-name-only-idle.test.ts
  • src/main/runtime/tui-idle-evidence.test.ts
  • src/main/runtime/tui-idle-evidence.ts
  • src/renderer/src/components/sidebar/worktree-title-derived-agent-rows.test.ts
  • src/renderer/src/components/sidebar/worktree-title-derived-agent-rows.ts
  • src/renderer/src/i18n/locales/en.json
  • src/shared/agent-process-recognition.test.ts
  • src/shared/agent-title-identity.ts
  • src/shared/dsb-headless-command.test.ts
  • src/shared/dsb-headless-command.ts
  • src/shared/dsb-terminal-title.test.ts
  • src/shared/dsb-terminal-title.ts
  • src/shared/terminal-title-agent-type.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • docs/site/content/docs/agents/supported.mdx

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

Comment thread src/main/runtime/tui-idle-evidence.ts Resolved

@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 new issues found.

Reviewed changes

Delta since the prior pullfrog review (f00dd63 → 7932dbd):

  • Shared title classifier — isDsbWorkingTitle moved to src/shared/dsb-terminal-title.ts and now requires the product name as the final - segment; both terminal-title-agent-type.ts and agent-title-identity.ts guard isClaudeAgent/getAgentLabel, so a working ⠼ - Waiting for response… - DeepSeek Build resolves to dsb instead of Claude Code.
  • Idle detection hardened — the tui-idle dsb lane now vetoes when either the renderer or OSC title reads as working, and no longer lets a first-party done override a working title.
  • Sidebar mapping — TITLE_AGENT_LABEL_TO_TYPE maps DeepSeek Build → dsb, so the corrected label produces a typed row.
  • Resume removed — dsb dropped from RESUMABLE_TUI_AGENTS/getAgentResumeArgv and the agent-session.dsb-resume.v1 capability, consistent with hooks being out of scope.
  • Headless matcher — isDsbHeadlessOneShotCommand skips the npm shim script path (…/dsb.js), so node …/dsb.js run is still recognized as a one-shot.

Pullfrog  | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

@innocarpe

Copy link
Copy Markdown
Contributor Author

Closed the two remaining review points on a0ef6bf32a.

Retained banner. isKnownReadyPromptPreview no longer treats a DeepSeek Build banner plus ❯ as ready. isDsbReadyPromptPreview runs only while the pane agent is still dsb, including the visible-screen probe. After the agent id is cleared, a leftover banner and a later shell ❯ do not settle another agent or the shell.

Lagging title. No follow-up issue. A done newer than lastOscTitleEpochMs settles a lagging OSC working title, because that clock is the epoch of the PTY title and shares a timeline with the status frame. A working renderer title, a title with no epoch, or a title written after done still vetoes. A retained done therefore cannot settle the next turn.

Tests: pnpm exec vitest run --config config/vitest.config.ts on tui-idle-evidence.test.ts, terminal-wait-detection.test.ts, and terminal-wait-name-only-idle.test.ts (85 passed) after the rebase onto current upstream/main.

@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 new issues found.

Reviewed changes

Delta since the prior pullfrog review (7932dbd → a0ef6bf):

  • Dedicated dsb body readiness — isDsbReadyPromptPreview now backs the dsb lane and findDsbReadyPromptIndex is no longer part of the shared ready/dismissed-modal indexes, so a DeepSeek Build banner retained in scrollback can no longer settle another agent's shell.
  • Bounded working-title veto — dsbWorkingTitleBlocksSettle reads both the renderer and OSC titles and excuses a lagging OSC working title only when a first-party done is newer than lastOscTitleEpochMs; renderer titles carry no clock and always veto.
  • Title identity hardened — isDsbWorkingTitle matches a braille-only segment or an activity word, and both title classifiers plus the sidebar label→type map now resolve a working dsb title to dsb instead of falling through to Claude.
  • Coverage — added unit and live-pipeline tests for the dsb lane, the shared-vs-dsb ready split, the lagging-title bounds, and process/headless/title recognition.

Pullfrog  | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

Recognize dsb 6, including the npm shim and deepseek-build-agent child.
Paste the first prompt after the ❯ composer, and do not treat a turn titled
"Waiting for response…" as idle. Resume with `dsb --resume <id>`.

`dsb run` stays a one-shot and is not hosted as a session. Hooks and Source
Control AI are left for a follow-up.
A working title on either channel vetoes tui-idle, including a stale done
status, because the composer stays visible during a turn. Title identity
matches DeepSeek Build's own final segment, so a Claude task that mentions
it stays Claude. Node-wrapped `dsb run` is headless.

Resume is not advertised yet. OSC 9999 carries state, agent type, model,
and prompt, and no session id is captured. This supersedes the resume
sentence in the previous commit.
The shared ready-prompt check no longer treats a DeepSeek Build banner
plus ❯ as ready. That match runs only while the pane agent is still dsb.
A done newer than the PTY OSC title epoch can settle a lagging working
title. A later working title, or one without that clock, still vetoes.
@innocarpe

Copy link
Copy Markdown
Contributor Author

Sync update (0017fe54de)

Withdrawing this broader launcher proposal. The intended scope is recognition of already-running DeepSeek Build sessions in tabs and agent rows, now covered by #23485 (issue #23484). The replacement keeps DSB out of the launch catalog, automatic selection, and new-tab shortcuts; launch support can be considered separately. Replacement validation: 278 focused tests, node/web/CLI typecheck, and changed-file quality 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.

1 participant