Free · Daily brief + weekly playbookDaily 60-sec AI Voice Brief + Weekly Production AI Agent PlaybookGet the brief →
ReleaseInsight · On RadarHabr AI→ original

DeepSeek Harness Plugin Teaches Local Models Not to Break File Edits

Local models in the DeepSeek Harness agent often break file edits: they replace a string that isn't in the file, or edit a file they never read. The author, who runs an RTX 4060 Ti with 8 GB of VRAM, wrote a plugin that rewrites the descriptions of the edit, write, and pwsh commands and fixes misaligned arguments. Errors have become less frequent, but there are no measurements. The takeaway: a careful tooling wrapper helps a weak model.

AI-processed from Habr AI; edited by Hamidun News
DeepSeek Harness Plugin Teaches Local Models Not to Break File Edits
Source: Habr AI. Collage: Hamidun News.
Listen to article
Article Fact Sheet & Key Figures
ParameterDetails
Primary sourceHabr AI ↗
Editor-in-Chief
Key metric #1Execution, the sandbox, and action confirmations remain unchanged
Key metric #2Fixes line numbers leaking into old_string and an empty description in pwsh
Key metric #3On a failed edit, shows which lines of the file did not match

Picture this: you've launched a coding agent on your own GPU and asked it to fix one function. The model tries to replace a block of code, but it remembers the block inaccurately, and the shell returns an error. The agent tries again, misses again, and gets stuck in a loop. That is exactly what the author of a recent post on Habr ran into. He uses DeepSeek Harness, a shell program that gives the model tools for working with a project: edit (replacing a fragment of a file), write (writing a whole file), and pwsh (running commands in PowerShell). To make failures less frequent, he wrote a plugin that corrects calls to these tools.

Hardware and finding a suitable shell

The author's setup is an ordinary desktop, not a server: an Intel Core i5-13400F, 32 GB of DDR5 (two 16 GB sticks), and an NVIDIA GeForce RTX 4060 Ti with 8 GB of memory. For local models this is a lower bound, so the question of how to get the most out of small models is a practical one here.

He tried several shells and clients: Continue, Cline, OpenCode (including the CLI version), Open Interpreter, Cherry Studio, and DeepSeek Harness. He liked the last one best, although, according to the author, it has its shortcomings.

What errors kept appearing

When working with local models in DeepSeek Harness, these messages came up regularly:

  • old_string not found in file: the model wants to replace a fragment that isn't in the file or that it remembered inaccurately;
  • file changed after reading: the shell requires rereading it and retrying;
  • file not read before editing: the system asks for it to be read first;
  • old and new strings are identical, so the edit changes nothing;
  • writing to a file that no longer exists;
  • the required description field (a short note on what the command does) is missing from a pwsh command;
  • justification is passed without sandbox_permissions (requested sandbox rights), and the shell accepts them only together.

In every case the model violates the call format or the order of actions. Strong models do this rarely, weak ones often. The author notes that most failures come from the weakness of local models, but occasionally such errors slip through even with DeepSeek v4 Flash.

What the plugin does

The author built the plugin with DeepSeek Harness itself. It does two things. First, it rewrites the descriptions of the edit, write, and pwsh tools so that small models find it easier to understand how to call them. Second, it fixes arguments that have "shifted": line numbers that ended up inside old_string, a missing description in pwsh, a lone justification, and Python output encoding. In addition, when an edit fails, the plugin shows the exact differences against the file's lines, so the model can see how its old_string differs from the actual text.

Execution, the sandbox, and action confirmations stay as they were. The plugin only adjusts what the model passes to the tools and how those tools are described to it, so the security boundary is not blurred. The repository is called biomotor/dsh-tool-fix.

What this means in practice

The idea is useful beyond this one shell. If you run an agent on a small local model, some problems are solved by the surrounding tooling rather than by replacing the model:

  • clear tool descriptions;
  • gentle correction of obvious typos in arguments;
  • detailed error messages that let the model fix itself.

A message like "reread the file and retry" already suggests the next step, and showing the real line mismatch saves the model from blind attempts.

Limitations

This is the author's first publication and a personal project, not a release from a large team. There are no quantitative measurements: he writes only that errors have "really become fewer." It is unclear which models and how many tasks he tested the plugin on, so you will have to judge the effect yourself. The plugin is built for this specific shell and, judging by the mention of pwsh, for Windows. The author is open to feedback and advice, so if you run local models in agent scenarios, the plugin is worth trying and sharing your results.

Story

Key Questions Answered

What are the key details on Hardware and finding a suitable shell?

The author's setup is an ordinary desktop, not a server: an Intel Core i5-13400F, 32 GB of DDR5 (two 16 GB sticks), and an NVIDIA GeForce RTX 4060 Ti with 8 GB of memory. For local models this is a lower bound, so the question of how to get the most out of small models is a practical one here. He tried several shells and clients: Continue, Cline, OpenCode (including the CLI version), Open Interpreter, Cherry Studio, and DeepSeek Harness.

What errors kept appearing?

When working with local models in DeepSeek Harness, these messages came up regularly: old_string not found in file: the model wants to replace a fragment that isn't in the file or that it remembered inaccurately; file changed after reading: the shell requires rereading it and retrying; file not read before editing: the system asks for it to be read first; old and new strings are identical, so the edit changes nothing; writing to a file that no longer exists; the required description field (a…

What the plugin does?

The author built the plugin with DeepSeek Harness itself. It does two things. First, it rewrites the descriptions of the edit, write, and pwsh tools so that small models find it easier to understand how to call them. Second, it fixes arguments that have "shifted": line numbers that ended up inside old_string, a missing description in pwsh, a lone justification, and Python output encoding.

ZK
Zhemal Khamidun — Head of AI at Alpina Digital · MIPT (academic supervisor of the Tech Entrepreneurship department). Building AI products since 2019. Hamidun News is a pet project that grew into a production aggregator with 6,000+ readers.
✦ Unified AI Workspace · Nomad

Test Frontier LLMs & Autonomous Agents in One Workspace

Run Claude Opus 5.5, GPT-6, Gemini 3.1, and DeepSeek side-by-side in Nomad AI (nomadnet.ai) — unified model routing, deep research, and multimodal workflows under one subscription.

Try Nomad AI →Launch Nomad Agent
Jemal Hamidun

Editor-in-chief · Cite this analysis

Jemal Hamidun

Head of AI at Alpina Digital · Academic Supervisor of the Tech Entrepreneurship Department at MIPT

Head of AI & CPO of AlpinaGPT at Alpina Digital, Academic Lead of Tech Entrepreneurship at MIPT. Founder of Hamidun News and Vibe Academy.

Ready-to-paste citation for journalists, blogs and Telegram channels

Source: Hamidun News — DeepSeek Harness Plugin Teaches Local Models Not to Break File Edits https://news.hamidun.com/en/news/18816/deepseek-harness-plugin-teaches-local-models-not-to-break-fi

What do you think?
Loading comments…