Skip to content

fix: stop named-importing CallId/ToolCallId from dsh-llm - #17

Closed
yyh-001 wants to merge 1 commit into
Mars-Sea:mainfrom
yyh-001:fix/callid-toolcallid-host-compat
Closed

fix: stop named-importing CallId/ToolCallId from dsh-llm#17
yyh-001 wants to merge 1 commit into
Mars-Sea:mainfrom
yyh-001:fix/callid-toolcallid-host-compat

Conversation

@yyh-001

@yyh-001 yyh-001 commented Sep 2, 2026

Copy link
Copy Markdown

Summary

Desktop / dsh 0.1.2-alpha.1 fails to load @mars-sea/dsh-commandcode-provider@latest (0.9.1) with:

The requested module '@deepseek-ai/dsh-llm' does not provide an export named 'CallId'

@deepseek-ai/dsh-llm renamed the branded CallId constructor to ToolCallId in 0.1.2-alpha.1. A named ESM import of the missing name fails at instantiation and the whole plugin tree dies (deepseek-ai/deepseek-harness#4827).

A previous attempt (#9) switched the named import to ToolCallId, which would then break rc hosts that still export CallId. Copilot's review asked for a namespace fallback instead of a hard named import.

This PR brands tool-call ids through the host StreamChunk vocabulary (Extract<StreamChunk, { type: 'tool-call-delta' }>['id']) and does not import either constructor name. Same pattern as ai/adapt-dsh-0.1.2.

Changes

  • src/adapter.ts — local toolCallId() helper; drop ToolCallId from the @deepseek-ai/dsh-llm value import
  • tests/adapter.test.ts — regression that the adapter must not named-import CallId or ToolCallId
  • CHANGELOG.md — Unreleased note

Test plan

  • node --import tsx --test tests/adapter.test.ts (71 pass)
  • Confirm a cold boot on dsh 0.1.2-alpha.1 / alpha.2 no longer throws the named-export SyntaxError
  • Send a tool-calling turn and confirm tool-call / tool-call-delta ids still round-trip

Note for 0.9.x / @latest

Current main is the 0.10.0-alpha line (@alpha, dsh ≥ 0.1.2-alpha.2). Desktop users on 0.1.2-alpha.1 still install @latest 0.9.1, which is the line that still import { CallId }.

The same adapter change is on yyh-001:fix/0.9.2-callid-compat (based on v0.9.1, version bumped to 0.9.2, peers include 0.1.2-alpha.1). Please cut a 0.9.x branch from v0.9.1 and publish 0.9.2 to the latest tag so Desktop alpha.1 users stop hitting this on install. That branch should not be merged into main.

rc and alpha.1 export different brand constructors. A missing named ESM import crashes plugin-tree load. Brand tool-call ids through StreamChunk instead.

Co-authored-by: Cursor <cursoragent@cursor.com>
@yyh-001

yyh-001 commented Sep 2, 2026

Copy link
Copy Markdown
Author

Closing this PR. The supported path is now dsh 0.1.2-alpha.2+ with @mars-sea/dsh-commandcode-provider@alpha (0.10.0-alpha).

@yyh-001 yyh-001 closed this Sep 2, 2026
@yyh-001
yyh-001 deleted the fix/callid-toolcallid-host-compat branch September 2, 2026 09:09
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