fix: computeFirstByteTimeout now respects CLAUDE_FIRST_BYTE_TIMEOUT env var

The adaptive timeout calculation ignored BASE_FIRST_BYTE_TIMEOUT (set via
CLAUDE_FIRST_BYTE_TIMEOUT env), always using the tier base (120s for Sonnet).
Now uses whichever is larger: adaptive or env override. Bump to v3.2.2.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-04 09:26:01 +10:00
co-authored by Claude Opus 4.6
parent a6007393a3
commit afe0c6e1be
4 changed files with 6 additions and 4 deletions
+1 -1
View File
@@ -2,7 +2,7 @@
"id": "ocp", "id": "ocp",
"name": "OCP Commands", "name": "OCP Commands",
"description": "Slash commands for the OpenClaw Proxy — /ocp usage, /ocp settings, /ocp health, etc.", "description": "Slash commands for the OpenClaw Proxy — /ocp usage, /ocp settings, /ocp health, etc.",
"version": "3.2.1", "version": "3.2.2",
"configSchema": { "configSchema": {
"type": "object", "type": "object",
"additionalProperties": false, "additionalProperties": false,
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "ocp", "name": "ocp",
"version": "3.2.1", "version": "3.2.2",
"description": "Slash commands for the OpenClaw Proxy", "description": "Slash commands for the OpenClaw Proxy",
"main": "index.js", "main": "index.js",
"type": "module", "type": "module",
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "openclaw-claude-proxy", "name": "openclaw-claude-proxy",
"version": "3.2.1", "version": "3.2.2",
"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.", "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", "type": "module",
"bin": { "bin": {
+3 -1
View File
@@ -374,7 +374,9 @@ function getModelTier(cliModel) {
function computeFirstByteTimeout(cliModel, promptLength) { function computeFirstByteTimeout(cliModel, promptLength) {
const tier = MODEL_TIMEOUT_TIERS[getModelTier(cliModel)]; const tier = MODEL_TIMEOUT_TIERS[getModelTier(cliModel)];
const timeout = tier.base + Math.floor(promptLength * tier.perPromptChar); const adaptive = tier.base + Math.floor(promptLength * tier.perPromptChar);
// Use whichever is larger: adaptive calculation or BASE_FIRST_BYTE_TIMEOUT (env override)
const timeout = Math.max(adaptive, BASE_FIRST_BYTE_TIMEOUT);
return Math.min(timeout, Math.max(TIMEOUT - 5000, 10000)); return Math.min(timeout, Math.max(TIMEOUT - 5000, 10000));
} }