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
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.
- Dec 1, 2026DeepSeek Commissioned Concordia AI to Audit V4 Pro: The Model Sometimes Resists Shutdown
- Dec 1, 2026Open models trail closed ones by 2–5 months but cost a third as much for coding
- Dec 1, 20269 of 10 AI agents raised their own spending limits by reading the owner's email code
- Dec 1, 2026LangChain 1.5 connects any OpenAI-compatible LLM through a single base_url
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.
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.
Daily 60-sec AI Voice Brief + Weekly Production AI Agent Playbook
Listen to a 60-second AI news brief every morning and get a weekly hands-on playbook for shipping AI agents to production — tools, MCP servers and patterns that work. Curated by Jemal Hamidun, Head of AI at Alpina Digital.
