From a6007393a364b9ccb7e4560c52b859a487eaa54f Mon Sep 17 00:00:00 2001 From: dtzp555 Date: Fri, 3 Apr 2026 08:50:19 +1000 Subject: [PATCH] fix: auto-configure idleTimeoutSeconds=0 to prevent tool-call timeouts setup.mjs now sets agents.defaults.llm.idleTimeoutSeconds=0 in openclaw.json during installation. Without this, OpenClaw's default 60s idle timeout kills Claude connections during tool use (Bash, Read, etc.), causing exit 143 errors and stuck sessions. Also adds troubleshooting section to README. Bump to v3.2.1. Co-Authored-By: Claude Opus 4.6 --- README.md | 46 ++++++++++++++++++++++++++++++++- ocp-plugin/openclaw.plugin.json | 2 +- ocp-plugin/package.json | 2 +- package.json | 2 +- setup.mjs | 13 ++++++++++ 5 files changed, 61 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 0ec970f..ba15424 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # OCP — Open Claude Proxy -> **Status: Stable (v3.2.0)** — Feature-complete. Bug fixes only. +> **Status: Stable (v3.2.1)** — Feature-complete. Bug fixes only. > **Already paying for Claude Pro/Max? Use your subscription as an OpenAI-compatible API — $0 extra cost.** @@ -188,6 +188,50 @@ Add to `~/.openclaw/openclaw.json`: Restart: `openclaw gateway restart` +## Troubleshooting + +### Requests fail with exit 143 / SIGTERM after ~60 seconds + +**Symptom:** Claude returns errors or stops responding after about 60 seconds, especially during tool use (Bash, Read, etc.). + +**Cause:** OpenClaw's gateway has a default `idleTimeoutSeconds` of 60 seconds. When Claude calls tools, the token stream pauses while the tool executes — if that takes longer than 60s, the gateway kills the connection. + +**Fix:** `setup.mjs` (v3.2.1+) sets this automatically. If you installed an older version, add this to `~/.openclaw/openclaw.json`: + +```json +{ + "agents": { + "defaults": { + "llm": { + "idleTimeoutSeconds": 0 + } + } + } +} +``` + +Then restart: `openclaw gateway restart` + +### Agents stuck in "typing" but never respond + +Usually caused by stuck sessions from previous timeout errors. Fix: + +```bash +# Clear all sessions +ocp clear + +# Restart both services +ocp restart +openclaw gateway restart +``` + +If that doesn't help, manually clear the session store: +```bash +# Find and reset stuck Telegram sessions +cat ~/.openclaw/agents/main/sessions/sessions.json +# Remove entries with "telegram" channel, then restart gateway +``` + ## Upgrading from v3.0.x If you installed OCP before v3.1.0, the auto-start service used names that OpenClaw's gateway detected as conflicting (`ai.openclaw.proxy` on macOS, `openclaw-proxy` on Linux). Running `node setup.mjs` or `ocp update` will automatically migrate to the new neutral names. diff --git a/ocp-plugin/openclaw.plugin.json b/ocp-plugin/openclaw.plugin.json index dfa6a2c..d4d4b95 100644 --- a/ocp-plugin/openclaw.plugin.json +++ b/ocp-plugin/openclaw.plugin.json @@ -2,7 +2,7 @@ "id": "ocp", "name": "OCP Commands", "description": "Slash commands for the OpenClaw Proxy — /ocp usage, /ocp settings, /ocp health, etc.", - "version": "3.2.0", + "version": "3.2.1", "configSchema": { "type": "object", "additionalProperties": false, diff --git a/ocp-plugin/package.json b/ocp-plugin/package.json index 18f6a92..b8ecbbd 100644 --- a/ocp-plugin/package.json +++ b/ocp-plugin/package.json @@ -1,6 +1,6 @@ { "name": "ocp", - "version": "3.2.0", + "version": "3.2.1", "description": "Slash commands for the OpenClaw Proxy", "main": "index.js", "type": "module", diff --git a/package.json b/package.json index c72d81e..7856013 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "openclaw-claude-proxy", - "version": "3.2.0", + "version": "3.2.1", "description": "OCP (Open Claude Proxy) — use your Claude Pro/Max subscription as an OpenAI-compatible API for any IDE. Works with Cline, OpenCode, Aider, Continue.dev, OpenClaw, and more.", "type": "module", "bin": { diff --git a/setup.mjs b/setup.mjs index defdb72..f4655f8 100755 --- a/setup.mjs +++ b/setup.mjs @@ -169,6 +169,19 @@ for (const [key, val] of Object.entries(MODEL_ALIASES)) { } log(`Model aliases added to agents.defaults.models`); +// Set idleTimeoutSeconds to 0 — critical for Claude tool-use. +// When Claude calls tools (Bash, Read, etc.), the token stream pauses for 30-120s. +// OpenClaw's default idleTimeoutSeconds (60s) kills the connection mid-tool-call, +// causing exit 143 (SIGTERM) and stuck sessions. Setting to 0 disables the idle timer. +if (!config.agents.defaults.llm) config.agents.defaults.llm = {}; +if (config.agents.defaults.llm.idleTimeoutSeconds === undefined || + config.agents.defaults.llm.idleTimeoutSeconds > 0) { + config.agents.defaults.llm.idleTimeoutSeconds = 0; + log(`Set agents.defaults.llm.idleTimeoutSeconds = 0 (prevents tool-call timeouts)`); +} else { + log(`idleTimeoutSeconds already configured: ${config.agents.defaults.llm.idleTimeoutSeconds}`); +} + writeJSON(CONFIG_PATH, config); log(`Config saved`);