Replies: 1 comment
|
A usable alternate path is to let a transport-owning Pi provider parse the proxy's SSE instead of routing it through the affected dsh plugin --profile web add pi2dsh
dsh plugin --profile web add pi-provider-litellm
export LITELLM_BASE_URL="<your LiteLLM/OneAPI/OpenAI-compatible gateway root>"
export LITELLM_API_KEY="<your key>"
# restart dsh and select that routeI checked the implementation before posting: the package owns a I do not have the gateway deployment used in this report, so this is a source-audited compatibility route rather than a live claim for that account. If it still fails on your endpoint, please send the redacted error/stream shape to https://github.com/weijiafu14/pi2dsh/issues and I will trace and fix the concrete incompatibility. |
Uh oh!
There was an error while loading. Please reload this page.
Problem
When connecting to OpenAI-compatible gateways and proxies (such as OpenCode, LiteLLM, OneAPI, etc.), tool call streaming deltas conform to the standard OpenAI SSE shape where the first chunk specifies
{ name: "tool_name", arguments: "" }, and subsequent argument chunks send{ name: null, arguments: "..." }.In
packages/llm/llm-deepseek/src/translate.ts:Because
null !== undefinedistruein JavaScript, the valid tool name captured from chunk 1 was being overwritten bynullin chunk 2, causing the assembled tool call to havename: ""(empty string), leading to runtimeError: unknown tool "".Solution & Commit
A patch with unit tests has been pushed to the fork:
👉 Commit: kolawong@1aa1af2571
👉 Branch: https://github.com/kolawong/deepseek-harness/tree/fix/llm-deepseek-null-tool-delta
typeof call.function?.name === 'string' && call.function.name.length > 0before updatingblock.name.typeof call.id === 'string' && call.id.length > 0before updatingblock.callId.packages/llm/llm-deepseek/tests/translate.spec.tscovering SSE chunks with{ name: null, id: null }(31/31 Vitest tests passed).Please consider cherry-picking this fix into master. Thank you!
All reactions