Replies: 3 comments
|
Verified against rc.8 (141eb6f) — your analysis is exact at source, and the failure class is bigger than drawio: any tool/MCP description containing 1. Source confirmation (rc.8)
2. The design tension: strict interpolation vs tool-owned proseThe strictness is deliberate (the doc comment at :193 says references are strict; a lone 3. On the three fix options — which is right
So: sanitize at the SDK generation boundary (your 4. The regression test shapeA test that registers a fake tool whose description contains 5. PR shapeOne PR: Nice find — the mermaid |
|
Published the complete operator and regression matrix derived from this report. Two details worth making explicit for future readers:
Visual trace and bounded recovery: https://sandbaseai.github.io/deepseek-harness-handbook/code-mode-unknown-prompt-variable.html |
|
同一类失败又在 DataSage MCP 的 新讨论:#4241 按这里的共识,补丁在 SDK 生成边界把每个 |
Uh oh!
There was an error while loading. Please reload this page.
Describe the bug
Assembling the system prompt fails with:
This happens only under a non-native tool presentation (
tool-presentation.mode: codeorboth) while the drawio MCP server (@drawio/mcp, bridged through@deepseek-ai/dsh-mcp-client) is registered. Native-mode presets are unaffected.To reproduce
tool-presentation.mode: code(e.g. thecodeagent preset).@drawio/mcp; tools surface asmcp__drawio__*).Root cause
dsh-toolsregisters thetools:sdkprompt section, which renders every registered tool — including MCP tools — into a generated SDK text (renderToolsSdk/renderToolsSdkPyin@deepseek-ai/dsh-tools). Each tool's rawdescriptionis embedded as doc comments (docLines(schema.description, ...)), and schema property descriptions are embedded byjsonSchemaToTs/renderTypetoo.open_drawio_mermaidtool description (shipped by@drawio/mcpasmermaid-reference.md) contains{{hexagon}}— mermaid syntax for a hexagon-shaped node (Node shapes by bracket: ... {{hexagon}} ..., also in the Mindmap section) — which is not a prompt variable.interpolate()in@deepseek-ai/dsh-system-promptstrictly scans every{{name}}in section text and throws for any name that is not a registered prompt variable. There is no escape mechanism: fenced code blocks are not skipped and there is no escape sequence like\{{.Expected behavior
Tool-owned prose (descriptions from tools / MCP servers) must not be interpreted as prompt variables. Either sanitize or escape
{{when embedding descriptions into generated SDK sections, or teach the interpolator to ignore fenced code blocks / support an escape sequence.Workaround applied locally
Patch in
@deepseek-ai/dsh-tools/lib/index.js: addedsdkSafeText()({{→{ {) applied to tool descriptions and to the output ofjsonSchemaToTs/renderTypein both SDK renderers (TypeScript and Python). It fixes the whole class of failures (any MCP description containing{{...}}), but it is lost on every dsh update.Environment
@deepseek-ai/dsh)@drawio/mcp(latest)tool-presentation.mode: codeAll reactions