Does anybody also encounter "Output token limit reached" error while using dsh? #1166
Replies: 16 comments 12 replies
|
I met same issue. |
|
I checked the current dsh flow, and this looks different from a context-window overflow.
For the built-in DeepSeek adapter, the current default conversation If you're seeing this regularly, could you share:
That would help distinguish an intentionally configured output cap from the model actually exhausting its available generation budget. If the expectation is that dsh should automatically resume after a |
|
I have the same issue |
|
Thanks, that helps narrow it down. With Before increasing it, could you check whether the Ollama response reports If it does, the next thing I'd check is whether If you can paste the relevant Ollama/dsh debug output for one occurrence (with any API keys removed), we can determine whether the limit is coming from dsh, the Pi adapter, or Ollama itself. |
|
Same problem running Qwen 3.8 27b This is after a 1hour 30minute run, I end up with only 320 tokens headroom, but the prompt should be nowhere close to 65K tokens 2026-08-19 22:33:18 [DEBUG] |
|
This is an output-generation ceiling, not necessarily an input context-overflow error. Harness maps the provider stop reason For the llama.cpp trace here, I wrote a source-linked diagnostic and bounded recovery checklist here: https://sandbaseai.github.io/deepseek-harness-handbook/output-token-limit.html The safest recovery is to preserve the partial artifact, start a bounded continuation (for example, only the missing sections), and measure prompt/output usage plus the final stop reason before raising any cap. |
|
This error makes long runs - supposedly a Deepseek Harness strong point - impossible to execute. SIgnificantly I was unable to 'continue' without slamming right back into the same error. Problem: I am getting the same error on long runs: 'Output token limit reachedThe reply was cut off; earlier output is preserved in the conversation. Send "continue" to let the model resume.' There appear to be two bugs here:
oh-my-pi (issue #3310, closed by PR #3311) probes once at discovery and caches it in SQLite. Restarting the server with a different n_ctx would ignore it for a day. Apparently there is a fix that does the following:
Openclaw (issue #73664 openclaw/openclaw#73664) has the same problem as DSH. It reads the wrong field n_ctx_train rather than n_ctx. OpenHarness (issue #199 HKUDS/OpenHarness#199) has the same problem as DSH. Their fix is to widen the error matcher to catch exceed_context, exceeds the available context size, and exceed_context_size_error, plus a documented env override. I am not proposing a specific fix for DSH because I am still not up to speed on the design philosophy behind the architecture. It seems bug 1 can be addressed simply using the n_ctx setting during model selection. Bug 1 is essential to fix immediately - it is critical. Bug 2 perhaps needs both the cache fingerprinting and error recovery approaches to be robust during long runs. In particular, the longer the agentic run, the more likely the LLM server will restart with a different n_ctx limit. As agentic harnesses extend into days and weeks long runs, Bug 2 becomes increasingly important to fix. |
|
I ran into the same issue when running LM Studio with Ornith 1.5 35b A3B. Also setting 65535 for context length. Setting the contextWindow seems to have fixed the issue on new sessions. Old sessions are still broken though. Cannot compact and cannot continue. To be clear I initially set max context length because I was hoping the MoE model would handle it. Unfortunately LMStudio has a 5 minute timeout that closes the sessions while its churning prefill. I had to drop to 65535 context to make sure LMStudio received a token before the 5 minute timeout. I have not tried changing the model in an older session to see if I can fix it. It might be possible to fix using a different back end. Something that does not suffer the 5 minute timeout might let me up the context to the maximum allowed and then successfully compact. |
|
Datapoint from a reproducible harness, since this thread keeps collecting cases where the declared limits and the runtime's real limits disagree (Ollama/LM Studio context mismatches above): We ran stock
Evidence: case Practical consequence for the local-runtime cases here: this error family is usually the declaration disagreeing with the runtime (e.g. catalog says 256K context while Ollama is configured at 64K, as @luisecastro found). If you route through a provider declaration you control, set Scope note: our run is against api.deepseek.com, not Ollama/LM Studio — it demonstrates the declaration→wire→surfaced-stop chain, not your specific local runtime's behavior. |
|
TL;DR: this is the output ceiling, not input-context overflow - and the fix is the configured context window, applied to a new session.
If this resolves it for you, marking it as the answer helps future readers find the fix. |
|
Ok, I hit the same issue in the first use of this harness, but I recognise the symptoms:
So, somehow we need to tell dsh to run only a single inference at the time My case is solved by using dsh-concurrency-guard plugin. It is in Chinese, though. In gui it adds "并发监控" tab next to "Trajectory", in that tab use "上限−"/"上限+" buttons (top right) to set number of concurrent agents to 1. Edit: dsh-concurrency-guard just throttles concurrent requests, not stops them. There is a timeout need to be changed in ~/.dsh/profiles/web/cordis.patch.yml: |
|
i'm running into this now since the latest update. i could let it run for hours on end but now on the same config it just fails on that:
that "continue" is also a lie, the message is never handed to the llm and it just starts over again. |
|
I hit a similar problem with qwen3.8-27b, not sure if it's exactly the same tho. For me the problem was a combination of auto-compaction firing too late and the token limit for compaction being too small for how much thinking the model wanted to do (see https://github.com/Yunado/dsh-compaction-fix). I fixed the max-output setting and applied a modified version of the compaction fix, but even that wasn't enough because I was using the model via the stock Add Custom Provider setup and it doesn't discover reasoning effort settings for local models at all. my reaction to that was to go overboard and create a plugin to manage local model config with proper capability discovery: modelspoke but I think it could also be accomplished by manually editing ~/.dsh/settings.yaml. As a side-effect of creating the plugin tho I also had the chance to fix read_image functionality to make use of qwen's image input capability so it wasn't a complete waste of time. My minimal version of the compaction patch is in minimal-compaction-patch.sh. |
|
In my ~.dsh/setings.yaml I ended up setting the following:
contextLength may not be required, but was part of trying to fix it previously. In LMStudio > Local Server > Inference (Tab) So far that seems to be working for me. Have gone a whole day at least without the error. Hopefully this information helps. |






Uh oh!
There was an error while loading. Please reload this page.
All reactions