Code Mode crashes on tool descriptions containing {{ }} — fix included #4790
Replies: 3 comments 3 replies
|
Confirmed against the source at 1. Same root cause as #3454. Reported 2026-08-19 with drawio's MCP ( 2. Era check: still live at alpha.1. Both sanitize points remain unescaped:
3. The choke-point argument holds. 4. Safety check — the escape cannot break legitimate interpolation. I grepped first-party tool descriptions for raw 5. Regression shape (matches what I'd blueprint from #3454): a fake tool whose description contains This was #25 in my PR-ready blueprint queue from the #3454 thread — if the harness ever reopens PRs, this is a natural first landing. |
|
Sorry about the earlier empty/wrong reply — this is not an MCP spawn/PATH/stdout issue. You're right: any tool description that contains a literal Until a core escape lands (sanitize at the tool-description boundary in
Your fork branch looks like the right fix shape: escape untrusted third-party description text at generation time, keep harness-authored |
Uh oh!
There was an error while loading. Please reload this page.
A tool description containing a literal
{{ }}(e.g. Composio'sCOMPOSIO_REMOTE_WORKBENCH, which documents escaping braces by doubling them) crashes Code Mode withmalformed prompt variable reference "{{ }}" in section "tools:sdk".The description reaches the model through the
tools:sdkprompt section, whichrenderPromptinterpolates for{{variable}}references — an unescaped{{throws as malformed instead of being treated as literal prose.I have a fix ready: split
{{into{ {at the existing sanitize point in both renderers (ts-types.ts'sdocLines,py-types.ts'sdescribe()), the same place that already escapes*/and quotes/backslashes for the same reason. Added regression tests for both renderers (64/64 passing), and reproduced live against the Code preset with an MCP server mounted to confirm the crash is gone.Full diff here since PRs aren't open yet: https://github.com/marcschraepler/deepseek-harness/tree/fix/code-mode-brace-escaping
Happy to open a proper PR once that's available, or paste the diff inline here if that's more useful.
All reactions