Skip to content

fix(orchestration): re-press Enter when dsh's launchpad refuses a worker's first dispatch - #33499

Merged
nwparker merged 2 commits into
mainfrom
nwparker/agint-dsh-cold-start-readiness
Oct 25, 2026
Merged

nwparker merged 2 commits into
mainfrom
nwparker/agint-dsh-cold-start-readiness

Conversation

@nwparker

@nwparker nwparker commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​23 $\color{#cf222e}{\Huge{\mathbf{−}}}$​8 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​15
Prod 3 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​6 $\color{#cf222e}{\Huge{\mathbf{−}}}$​8 $\color{#cf222e}{\Huge{\mathbf{−}}}$​2

ELI5

When an Orca orchestration starts a DeepSeek Harness (dsh) worker, Orca waits for dsh to look ready, pastes the task, and presses Enter once. dsh draws its input box (the "launchpad") before its session has opened. Until the session opens it ignores Enter, shows "still starting — press Enter to send once it is ready", and leaves the text in the box. Orca still reported the dispatch as accepted, so the worker just sat there holding its task.

#33316 fixed this for agent.launch prompts: Orca presses Enter again while the launchpad still shows this prompt. Worker dispatches didn't get that retry. This PR gives it to them too.

Root cause (upstream refs)

@deepseek-harness-tui/dsh-tui 0.17.0 (and 0.16.1, npm tarballs):

  • lib/types/ink/hooks/use-program-status.js:67: dsh reports OSC 7501 state=idle when it mounts, before any session is bound. It reports it again when a session is adopted (:52). Orca's tui-idle settles on the first report.
  • lib/types/screens/Chat.js:2510 refusedAtStartup (0.16.1: :2419): while channel.ready === false, a plain-text submit gets the startup-not-ready notice and is refused. The draft stays in the launchpad.
  • 0.14–0.16 send no OSC 7501. There, a fresh worker settles on the dsh-composer-prompt marker, which is also drawn before the session opens.

Orca side: getAgentPromptHeldSubmitBudgetMs gave dsh's submitRetryBudgetMs only to sends with composerReady (the launch path). dispatchPreambleSendOptions (inputKind: 'orchestration') doesn't set composerReady, so a dispatch got one Enter and no retry.

What changed

How verified

Live, real dsh through OrcaRuntimeService: waitForWorkerAgentReady (fresh worker), then sendTerminalAgentPrompt(…, dispatchPreambleSendOptions(…)). The PTY ran real dsh-tui . on @deepseek-ai/dsh 0.2.1-rc.2, macOS arm64, with an isolated HOME and a fake API key, so no model spend.

dsh-tui main this PR
0.17.0 ready at 2.8 s on the boot OSC 7501 idle, 1 Enter, still starting, accepted:true, no turn (no state=working in 8 s) 2nd Enter about 1 s later → OSC 7501 state=working → turn ran (auth error from the fake key)
0.16.1 1 Enter, still starting; the final screen is the launchpad still holding ❯ say hi in one word 2nd Enter → chat screen showing ❯ say hi in one word and the turn's auth error
  • dsh-launch-prompt-resubmit.test.ts: the new case fails on main (enters: 1) and passes here (enters: 3, pastes: 1). The first-run-guide and empty-launchpad cases still press no extra Enter.
  • pnpm tc, check:code-quality:changed, the prompt/input test files (19 files, 285 tests), and every test that references 'dsh' (12 files, 396 tests) pass.

Risk

  • Any dsh prompt send, not only launch and dispatch (for example, a follow-up into an idle chat), can now take the gated retry. It presses Enter only while the boxed launchpad still holds the same prompt. dsh's chat composer queues input during a turn and clears the draft (Chat.js launchpad submit path), so the retry ends on its first check. The worst case is about 1 s of extra wait before the receipt.
  • The first Enter can still land on the 0.17 first-run guide when it covers the launchpad, because the boot OSC 7501 idle settles readiness under the guide. That is [Bug]: dsh-tui 0.15 onboarding receives supervised task input before chat readiness; same-terminal reuse times out #29131's remaining half; this PR adds no Enter there.
  • A terminal wait --for tui-idle on a dsh 0.14–0.16 pane that has never had a turn still doesn't settle: no OSC 7501, and the whale keeps repainting. 0.17 settles via OSC 7501. Not addressed here (see fix(runtime): settle a cold-started DSH pane on its idle composer #26691 note below).
  • Windows/SSH not run. It is the same PTY write and draft reader, both transport-independent. The fix runs on the host that owns the PTY, so mixed client/server versions behave the same as the host's version.

Related

Fixes #30778. Related: #33316, #29131, #26691.

#26691 (@Jinwoo-H) adds screen rules so tui-idle settles on a cold dsh pane. On current main, dsh 0.17 already settles from its own OSC 7501 idle. Those rules match only the 0.12/0.13 layouts: replayed against a timed dsh-tui 0.16.1 cold-start capture with them applied, tui-idle still never settled, because the 0.16/0.17 model row has four fields and a space. Its cold-start readiness analysis led to this fix, hence the co-author credit.

Co-authored-by: Jinwoo-H [email protected]

…ker's first dispatch

A fresh dsh worker's readiness settles on dsh-tui 0.17's boot `OSC 7501 idle`
(0.14-0.16: its composer glyph), which dsh paints before its session opens.
The dispatch preamble's one Enter then got "still starting" and the task sat
in the launchpad while worker-start reported it accepted. Apply dsh's
screen-gated held-prompt resubmit budget (#33316) to every send, not only a
launch with `composerReady`.

Fixes #30778

Co-authored-by: Jinwoo-H <[email protected]>
@coderabbitai

coderabbitai Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 485dda8c-0f53-43ca-bc59-3d56e234a420
Commits

Reviewing files that changed from the base of the PR and between 651f1af and 1b9c34a.

Files selected for processing: 1
  • src/shared/tui-agent-config-types.ts
Files skipped from review as they are similar to previous changes: 1
  • src/shared/tui-agent-config-types.ts

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

Walkthrough

The held-submit budget for TUI agents now uses the startup retry budget regardless of composer readiness. The non-TUI zero budget and the existing paste-burst and timeout cap remain. The DSH dispatch test helper can select dispatch options, and a new test checks retries after the launchpad refuses the first Enter.

Priority: Normal

Severity of issue fixed: Medium

Merge Risk: Minimal · up to 1b9c3

No merge-blocking issue is established for this incremental change; normal checks remain appropriate.

Pre-merge checks: Passed 3 · Failed 2

Failed Failed checks: 2 warnings

Check name Status Explanation Resolution
Linked Issues check Warning #30778 requires consistent DSH readiness recognition and successful task dispatch through worker-start. This PR removes the composerReady gate from getAgentPromptHeldSubmitBudgetMs and adds a di… Address the remaining #30778 readiness and startup paths, with automated coverage for the supported dsh versions and relevant startup states, or change the linked issue scope to the single premature-Enter dispatch case.
Docstring Coverage Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 4 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 3 passed
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: retrying Enter when dsh refuses a worker dispatch during startup.
Description check Passed The description is detailed and covers the problem, root cause, implementation, linked issue, testing, risks, and known limitations. It omits several template sections and checklist confirmations, inc…
Out of Scope Changes check Passed The production change extends the existing dsh held-submit retry to orchestration dispatches. The regression test uses dispatchPreambleSendOptions and verifies the retry. The comment change document…
Full details: Description check

Explanation

The description is detailed and covers the problem, root cause, implementation, linked issue, testing, risks, and known limitations. It omits several template sections and checklist confirmations, including Visual Proof, Review, Agent skill upstream boundary, Notes, and the final checklist, but the core required information is present.

Full details: Out of Scope Changes check

Explanation

The production change extends the existing dsh held-submit retry to orchestration dispatches. The regression test uses dispatchPreambleSendOptions and verifies the retry. The comment change documents the same prompt-send behavior. No unrelated change is demonstrated.

Full details: Linked Issues check

Explanation

#30778 requires consistent DSH readiness recognition and successful task dispatch through worker-start. This PR removes the composerReady gate from getAgentPromptHeldSubmitBudgetMs and adds a dispatch retry test for the startup launchpad case. The PR evidence also states that dsh 0.14–0.16 panes can still fail to settle on tui-idle, and that the first-run guide can still consume the first Enter. The linked issue therefore has documented readiness and startup paths that this PR does not cover.

Resolution

Address the remaining #30778 readiness and startup paths, with automated coverage for the supported dsh versions and relevant startup states, or change the linked issue scope to the single premature-Enter dispatch case.

Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

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.

[Bug]: DeepSeek Harness Worker Fails to Start or Times Out During Readiness Check

1 participant