Deepseek Tool Mangling

Open
#13,442 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 8 days

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
typescript

Research direction

The payload names no source files or tests. Begin at the DeepSeek provider integration and the shared tool-call streaming/argument parser, then reproduce with a turn that emits at least two tool calls while comparing the raw streamed arguments against the parsed arguments. Done means multi-call turns preserve each call's fields and either apply edits correctly or fail cleanly.

Written by the indexing model from the issue text.

Description

Before submitting your bug report
Relevant environment info
- OS: Windows: 11
- Continue version: 2.0.0
- IDE version: {
Version: 1.131.0 (system setup)
Commit: e4c7e7b1d6d060162f4aa7f8225271b67ce1df75
Date: 2026-07-28T10:51:25Z
Electron: 42.7.0
ElectronBuildId: 14710161
Chromium: 148.0.7778.280
Node.js: 24.18.0
V8: 14.8.178.38-electron.0
OS: Windows_NT x64 10.0.26200
}
- Model: Deepseek
- config:
  
name: Main Config
version: 1.0.0
schema: v1
disableAutocomplete: true
models:

  - name: DeepSeek Coder
    provider: deepseek
    model: deepseek-coder
    apiKey: 
    contextLength: 128000
    shell: powershell.exe

  
  OR link to agent in Continue hub:
Description

Intermittently, when the agent emits tool calls, the arguments arrive corrupted in transit with no user input at all (no typing, no editor interaction). Required fields arrive empty (filepath, old_string, new_string), field values from sibling calls get interleaved/swapped, and the JSON is truncated mid-value. In the worst case an edit reports success but writes garbled or truncated content to disk (e.g. #pragma once → #pragma o sha; a header truncated mid-line), silently breaking source files. Failures surface inconsistently as ... argument is required or Cannot read properties of undefined (reading 'trim'). Markedly worse when multiple tool calls are batched in a single turn, pointing to a stream/serialization problem in argument generation or parsing.

To reproduce

Tool-call argument corruption
Conditions that make it reliable:

Agent is asked to perform a task that produces multiple tool calls in a single turn (e.g., "read these 3 files", or a multi-part edit touching several files).
Target files exist and the IDE editor panel is open (typing is not required).
Steps:

Give the agent a task that naturally emits ≥2 tool calls in one turn (e.g., "open A.cpp, B.cpp, and C.cpp and summarize each", or "add this same change to these 3 files").
Do not type or click in the editor while the turn streams.
Observe the tools: one or more calls fail with a missing/invalid argument — e.g. filepath argument is required, string old_string is required, string new_string is required, or Cannot read properties of undefined (reading 'trim').
In some runs, observe sibling-field contamination: an old_string/new_string containing text belonging to the other call, or filepath appearing inside changes.
In the worst case, an edit tool reports success but the file on disk is corrupted — truncated mid-line or with characters swapped (e.g. #pragma once → #pragma o sha, or a header ending abruptly at // Latest detected regions (image pixel).
Expected: each tool call receives exactly the arguments the agent emitted; edits either fully succeed with correct content or fail cleanly. Actual: arguments are empty/swapped/truncated and/or files are silently written corrupt.
Confirm it is not user-input related: keep hands completely off the keyboard/mouse for the whole turn; the corruption still occurs.

Log output

Dominant language
TypeScript
Stars
36.5k
Forks
5.6k
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from continuedev/continue

All issues in continuedev/continue

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.