Skip to content

feat(dsh): add one-click handoff from assistant replies - #2655

Merged
hidb4ai merged 9 commits into
codex/dsh-handoff-claude-clifrom
codex/dsh-handoff-workflow
Nov 17, 2026
Merged

hidb4ai merged 9 commits into
codex/dsh-handoff-claude-clifrom
codex/dsh-handoff-workflow

Conversation

@knqiufan

@knqiufan knqiufan commented Nov 14, 2026 •

Copy link
Copy Markdown
Collaborator

Which issue or RFC does this PR close?

Refs #2514 and RFC #2528. This PR connects the DSH reply menu to the shared receipt and target adapters in #2651–#2654.

Rationale for this change

A user should be able to hand off a completed reply, review the prefilled instruction in the destination, and recover earlier deliveries if they change targets or restart DSH.

What changes are included in this PR?

  • Add a handoff action to the latest completed reply. Resolve the exact reply from authenticated local Host events, preflight the target, prepare a package through the existing Handoff service, and open an unsent draft. Use bounded original evidence when model generation is disabled.
  • Enable native preflight by default for the qualified macOS builds of Codex Desktop (26.1106.51428 (26605), embedded CLI 0.167.0-alpha.4.1) and Claude Code CLI (2.1.323). Recheck the target, effective Server and Scope, and package access before launch. Use the local PowerContext installer only with consent; an already configured target does not need the installer. Claude Desktop Code remains available for installation checks.
  • Preserve earlier deliveries when users change targets. Show precise receipt attribution, history, export, pin, delete, and recovery actions. A late preparation response cannot launch a cancelled target. Drafts and generated notes follow the plugin language while preserving original evidence.

Are there any user-facing changes?

Supported local targets can be selected without enabling a feature flag. When preflight passes, the selected target opens a new session with an editable draft. The user sends it. Unsupported versions or unverified environments cannot launch. See the DSH guide for supported configurations.

How was this change tested?

  • DSH plugin: pnpm test --maxWorkers=1 (752), pnpm test:e2e (11 with a real local Server), and pnpm test:package passed. make check and make docs-test passed.
  • Installed the packaged default plugin in an isolated official DSH Desktop 0.2.2-rc.3 profile. The menu offered Codex and Claude CLI, and left Claude Desktop Code disabled. Selecting Codex passed live preflight, prepared delivery 1497, and reached OS-accepted launch. The draft was not submitted in this check.
  • The native acceptance record records real receiver Continue and exact ACK for Codex Desktop (5cd2) and Claude Code CLI (d093). The CLI native acceptance was reused. The isolated Claude Desktop receive result used a preflight fixture and does not qualify it for default launch. Clean first-install and authenticated receipt flows were not requalified in this check.

AI usage statement

OpenAI Codex assisted with implementation, tests, local validation, and preparing this PR.

@knqiufan
knqiufan force-pushed the codex/dsh-handoff-claude-desktop branch from 6b2a054 to ff111fc Compare November 14, 2026 15:25
@knqiufan
knqiufan force-pushed the codex/dsh-handoff-workflow branch from 61da783 to 1e29e40 Compare November 14, 2026 15:25
@knqiufan knqiufan changed the title DSH handoff: connect the reply menu and one-click workflow feat(dsh): add one-click handoff from assistant replies Nov 14, 2026
@knqiufan
knqiufan marked this pull request as ready for review November 14, 2026 15:32
if (human) {
// Events are scanned newest first, so the oldest retained human input wins.
observe(event, label(`Human request or instruction: ${human}`, `用户请求或指令:${human}`))
objective = human

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] Require manual input when the original objective is omitted

When the original human request exceeds the 8,000-byte reader limit and a later message says "Continue", the reader retains "Continue" as the objective and automatically prepares a handoff without the original goal. Track the earliest human message even when its text cannot be retained, and require manual input when that objective is unavailable.

const pending = pendingManual ?? { requestId: id(), preflight, locale: selectedLocale,
input: workInput(objective, state, next, omissions, disposition as 'continuable' | 'blocked' | 'complete', selectedLocale) }
pendingPreparations.current.set(manualKey, pending)
acceptDelivery(await api.prepare(pending.preflight, pending.requestId, pending.input, delivery.delivery.deliveryId, signal, pending.locale))

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] Unlock manual fields after a definite validation rejection

Submitting an objective longer than 8,192 characters receives a definite validation rejection, but the pending manual payload remains cached and disables every field, preventing correction and repeatedly submitting the same invalid input. Clear the pending payload after a definitive rejection while preserving request identity for uncertain outcomes.

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

Reviewed 4842109 against ff111fc. The previous objective-loss and rejected-input issues are fixed. One recovery defect remains: an OS-opened delivery cannot be explicitly reopened from history while it is still awaiting acknowledgement.

@knqiufan
knqiufan changed the base branch from codex/dsh-handoff-claude-desktop to codex/dsh-handoff-claude-cli November 16, 2026 02:28

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

Re-reviewed 0637441 against d87c0e7. The previous recovery finding is fixed; no additional blocking regression introduced by this PR was confirmed.

Inherited validation issue: observeProject accepts only one exact Git “not a repository” stderr message. On Linux with Git 2.43.7, a non-Git workspace on a separate filesystem instead reports not a git repository (or any parent up to mount point /) followed by Stopping at filesystem boundary. The receiver then returns no environment for a valid non-Git workspace. The same two Claude receiver tests fail with both the head and the current base receiver/tests. Please handle normal non-repository variants while continuing to reject malformed Git metadata; this belongs to the base adapter change. Native macOS behavior was not revalidated in this run.

@hidb4ai
hidb4ai dismissed their stale review November 16, 2026 15:24

The recovery blocker is fixed at 0637441 and its reproduction passes. Superseded by review 5922502711; removing the outdated change request without approving the new interfaces.

@AlexStocks AlexStocks added the 1.6.0 v1.6.0 release tracking label Nov 17, 2026
@hidb4ai
hidb4ai merged commit a7d4eeb into codex/dsh-handoff-claude-cli Nov 17, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1.6.0 v1.6.0 release tracking

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants