Qwen3.8-27B Overthinks Coding Tasks: A Fix

Qwen3.8-27B overthinks coding tasks, and a developer says the fix lies in the code wrapped around the model, not in switching reasoning off. A local coding agent called dwim resolved 64% of 50 SWE-bench issues with the model, against 52% for OpenCode running the same model, and it finished the median issue in a third of the time.

The model can run on a laptop, yet people who try it as a coding agent run into the same wall. It reasons for ages, loops back on itself and often fills the whole context window. Hugging Face discussion threads describe the thinking eating the whole context and the model falling apart on long agent tasks. Simon Willison has suggested using low or even no reasoning.

Where the overthinking comes from

Qwen3.8-27B belongs to the reasoning family: it drafts a chain of thought first and replies afterward. The developer’s first dwim build used Bonsai, PrismML’s ternary build of the model. The agent would find a bug quickly, often work out the right fix, and then drift into a long thought without making the change. PrismML’s own known-issues note says the build tends to reason at length, which costs time and tokens even when the answer is correct.

Going through the long thoughts, the developer saw that the model seldom worked from code it had actually opened. It reconstructed behavior from memory and second-guessed itself with phrases like “I think”, “I recall” and “wait”. In one run it found the bug in a function it had just read, then read that function again and thought it all through a second time.

Researchers led by Cuadron call this the reasoning-action dilemma. They describe three patterns: analysis paralysis, rogue actions where several actions fire without waiting for results, and premature disengagement. Their work links more overthinking with lower SWE-bench success, and reasoning models overthink more than non-reasoning ones.

The three main fixes in dwim

The first fix is a hard thinking cap. dwim limits thinking to 2048 tokens, a number chosen from SWE-bench thinking traces. The cap may be too tight for harder tasks, but the developer saw no gains from longer thinking with this model, “quite the opposite”.

The second is a better closing sentence. When Qwen3’s own budget runs out, it appends a line saying it must give a solution now based on its thinking. In a coding agent, that makes it answer from memory. dwim ends the thought with a sentence in the model’s own voice. If no tool has been called that turn, it says the model is not certain from memory and will check the code with a tool. If one has, it says the answer is already in the output above and the model should go with it. For hosted models, where the thought can’t be edited, dwim stops the reply at the limit and asks again with reasoning off.

The third is a system prompt nudge. The system prompt asks the model to catch itself when it is remembering code instead of reading it, and to open or run the code at that point. If it has typed “wait” or “actually” twice about one question, it should go and check with a tool.

Smaller nudges

  • Ask for low reasoning effort on each request, since the model defaults to xhigh.
  • After 20 tool calls with no file change, remind the model to make the change or say what it still needs to learn.
  • If the model says what it will do next without calling a tool, tell it to continue.
  • Reject a tool call identical to the one before it.
  • Cut a thought short when it begins repeating itself verbatim.
  • With hosted models, return the thought along with the reply after each tool call, so the model doesn’t replan from scratch.

The benchmark results

The comparison covered SWE-bench Verified Mini, a set of 50 GitHub issues from Django and Sphinx. Each agent ran Qwen3.8-27B via Vercel’s AI Gateway and got 10 minutes per issue. Shell commands executed inside the issue’s Docker image without network access, and the official SWE-bench grader scored every patch. Each agent made a single pass: dwim at commit a8aa882, OpenCode at version 1.19.6.

dwim solved 64% of issues to OpenCode’s 52%, with roughly a quarter of the thinking. It solved nine issues OpenCode missed, and OpenCode solved three that dwim missed. With a single run, the developer calls the result a lean toward dwim, not a conclusive one.

Early exits explain most of the difference. In 8 of the 14 issues where OpenCode produced no patch, the model only said what it planned to do, such as reproducing the bug, without calling a tool, and OpenCode read that as a finished task. dwim’s “go on” nudge covers this case, and it produced a patch for 49 of 50 issues against 36.

What it means for local coding agents

The same weights did better once the thought stayed short and the agent code pushed the model to read and act. The runs can be reproduced from a dwim checkout with the SWE-bench scripts in its repository.

Source: penberg.org

Written by

Saksham Bhargava

Saksham Bhargava runs Alteroid and has been writing about consumer technology for over five years, covering iPhone, Android, Windows, AI tools and gaming. With an MCA and six years of hands-on web development experience, he tests the features he writes about on his own devices and focuses on clear, practical guides that solve real problems. Away from the screen, he enjoys travelling to places most tourists skip.