---
id: 18816
lang: en
title: "DeepSeek Harness Plugin Teaches Local Models Not to Break File Edits"
published_at: "2026-12-01 10:33:45"
source_name: "Habr AI"
source_url: "https://habr.com/ru/articles/1114444/?utm_campaign=1114444&utm_source=habrahabr&utm_medium=rss"
canonical_url: "https://news.hamidun.com/en/news/18816"
categories: ["research", "autonomous"]
publisher: "AI News by Jemal Hamidun (news.hamidun.com)"
---

# DeepSeek Harness Plugin Teaches Local Models Not to Break File Edits

> **Краткая суть (BLUF):** 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.  • Execution, the sandbox, and action confirmations remain unchanged • Fixes line numbers leaking into old_string and an empty description in pwsh • On 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.

---
- **Первоисточник:** [Habr AI](https://habr.com/ru/articles/1114444/?utm_campaign=1114444&utm_source=habrahabr&utm_medium=rss)
- **Каноническая ссылка:** https://news.hamidun.com/en/news/18816
- **Экосистема автора:** [Бесплатный интенсив по вайбкодингу — предзапись в Нике](https://t.me/vibecodeguidebot?start=agent_intensive_news_md) · [Nomad AI](https://nomadnet.ai) · [Telegram @jemal_hamidun](https://t.me/jemal_hamidun)
