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`);