Fix LM Studio "Client disconnected" with OpenClaw: Increase the Stalled Embedded-Run Watchdog
If you're running OpenClaw with local models via LM Studio and seeing Client disconnected. Stopping generation..., the model probably isn't broken — OpenClaw's internal watchdog is killing the request before the first token arrives. Here's the exact fix.
The root cause
OpenClaw has a diagnostic watchdog that aborts "stalled" embedded runs. The threshold lives in a compiled JS file (diagnostic-DhwkYT4X.js) under .openclaw\npm\projects\openclaw-diagnostics-prometheus-5bcae34c2e\node_modules\@openclaw\diagnostics-prometheus\node_modules\openclaw\dist. Two constants control it:
const MIN_STALLED_EMBEDDED_RUN_ABORT_MS = 5000000; // ~83 minutes const STALLED_EMBEDDED_RUN_ABORT_WARN_MULTIPLIER = 15;
Changing these values and restarting the gateway stopped the disconnects for a user running Qwen, Gemma, and DeepSeek models on a 32 GB RAM HP All-in-One (Windows 10, OpenClaw 2026.7.1-2, LM Studio 1.0.7 build 2).
Why standard timeouts don't help
The usual suspects — agents.defaults.timeoutSeconds, models.providers.lmstudio.timeoutSeconds, etc. — had no effect. The watchdog fires before the provider timeout. Also note that openclaw doctor can reset your config, so manual config changes may get reverted.
Applying the fix
Edit the constants in that dist file (or the source if you have it), then restart the gateway:
openclaw gateway restart
Restarting Windows may also be required for a clean test.
The author observed disconnects at ~6.5 minutes on heavy first requests, consistent with the watchdog's logic (5000000 ms × 15 = 75,000 ms = 75 s? — actually the math in the post is a bit off, but the point stands: the threshold was too low for long local prompt processing).
This is a niche but deeply annoying issue for anyone running OpenClaw with local models. If you've hit it, this is the fix.
📖 Read the full source: r/openclaw
👀 See Also

12 OpenClaw SOUL.md and STYLE.md Templates with Practical Lessons
A developer created 12 OpenClaw agent templates for common use cases, each following the official 4-section spec, and identified key lessons including the necessity of STYLE.md for defining communication patterns and the importance of specific boundaries over vague personality traits.

Claude Code Workflow Visual: Memory Hierarchy, Skills, Hooks, and Loop
A Reddit post shares a workflow visual for Claude Code covering CLAUDE.md memory layering (global → repo → scoped), skills as reusable patterns in .claude/skills/, and a suggested workflow loop (plan → describe → accept → commit).

12GB VRAM Benchmarks: Running Qwen 3.6 and Gemma 4 Models on a RTX 4070 Super
A Reddit user shares detailed speed benchmarks for Qwen3.6-35B-A3B, Qwen3.6-27B, Gemma 4 26B, and Gemma 4 31B on a 12GB RTX 4070 Super using llama.cpp with optimized settings.

Getting Started with OpenCode for Local AI Coding Agent Setup
A beginner's guide walks through setting up OpenCode as a fully local AI coding agent using ByteShape's optimized models with LM Studio, llama.cpp, or Ollama across Mac, Linux, and Windows (WSL2).