Skip to content

fix(timeout): default chat timeout → env-configurable 600s#6

Merged
VickyXAI merged 1 commit into
mainfrom
fix/chat-timeout-600
Jun 26, 2026
Merged

fix(timeout): default chat timeout → env-configurable 600s#6
VickyXAI merged 1 commit into
mainfrom
fix/chat-timeout-600

Conversation

@VickyXAI

Copy link
Copy Markdown
Contributor

What

Raise the SDK's default chat HTTP timeout from 60s to an env-configurable 600s.

The old DEFAULT_TIMEOUT = 60000 (60s) cut off long reasoning-model calls. Reasoning models (opus-4.8, deepseek-v4-pro) routinely think for 200–300s+ on non-streaming completions, hitting an AbortError before the response arrives.

Change

  • src/client.ts: replace the hard-coded 60000 with resolveDefaultTimeout(), which reads process.env.BLOCKRUN_CHAT_TIMEOUT in seconds (×1000 → ms), with a safe numeric parse (finite & positive) and a fallback to 600_000 ms (600s).
  • Per-client and per-call options.timeout overrides are preserved unchanged (this.timeout = options.timeout || DEFAULT_TIMEOUT).
  • Mirrors the already-shipped pattern in the Python blockrun-llm SDK (DEFAULT_CHAT_TIMEOUT = float(os.environ.get("BLOCKRUN_CHAT_TIMEOUT", "600"))).

Verification

  • npm run typecheck — clean
  • npm run build (tsup) — success
  • npm run lint (eslint) — clean
  • npx vitest run — 197 passed, 12 integration skipped

Reasoning models (opus-4.8/deepseek-v4-pro) think 200-300s+; old default cut them off. Override via BLOCKRUN_CHAT_TIMEOUT env. Mirrors blockrun-llm 1.4.7.
@VickyXAI VickyXAI merged commit d6cb8cf into main Jun 26, 2026
3 checks passed
VickyXAI added a commit that referenced this pull request Jun 26, 2026
…rs (#7)

Follow-up to #6, which added the env-configurable 600s DEFAULT_TIMEOUT but only
wired it into the native LLMClient path. The OpenAI/Anthropic drop-in wrappers
hardcoded 60000ms (openai-compat passed truthy 60000 into LLMClient; anthropic-compat
used it directly), so README drop-in users still timed out at 60s on reasoning calls.
Export DEFAULT_TIMEOUT from client.ts; both wrappers now fall through to it. Fix
stale default:60000 doc comments.

Co-authored-by: 1bcMax <viewitter@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant