@bman654/clodex 2.8.5 → 2.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -339,22 +339,65 @@ clodex --version # version
339
339
  SDK reports that it omitted the tier for a model, clodex warns once and the
340
340
  backend default remains in use.
341
341
  - **Outbound proxy:** when `HTTP_PROXY`/`HTTPS_PROXY` (and optionally `NO_PROXY`) are set in clodex's environment, all clodex-originated network calls honor them — OAuth sign-in and token refresh, model-list and models.dev refreshes, upstream OpenAI API calls, and the ChatGPT/Codex OAuth WebSocket transport (tunneled via HTTP CONNECT).
342
- - **Upstream retries:** set `CLODEX_UPSTREAM_MAX_RETRIES` to an integer from
343
- `0` through `5` to override the SDK's default of two retries for retryable
344
- provider failures. `0` disables retries. The SDK honors valid
345
- `retry-after`/`retry-after-ms` headers and otherwise uses exponential
346
- backoff. Larger integers clamp to `5` with a one-time warning because a sixth
347
- retry cannot complete before the translated streaming paths' 120-second
348
- no-data timeout. Unset, empty, or malformed values preserve the default. A
349
- stream that fails after output begins cannot be replayed safely and still
350
- terminates the request. The same setting covers requests passed straight
351
- through to Anthropic, which replay once by default. Only a request that went
352
- out on a pooled connection the far end had already closed, and that received
353
- no part of a response, is replayed there; anything else is reported as it
354
- happens. Setting Claude Code's own `CLAUDE_CODE_MAX_RETRIES=0` also disables
355
- the passthrough replay, so telling the client never to resend a request is
356
- not quietly undone one layer down. Recovered requests appear in the inference
357
- log as `response_retried`.
342
+ - **Provider timeouts:** `CLODEX_UPSTREAM_IDLE_TIMEOUT_MS` controls how long an
343
+ SDK-backed translated stream may produce no event (default `120000`; range
344
+ `10000`–`3600000` ms). `CLODEX_UPSTREAM_TOTAL_TIMEOUT_MS` limits each call
345
+ clodex makes to a configured provider, including non-streaming calls (default
346
+ `600000`; range `60000`–`21600000` ms). An authentication refresh can start a
347
+ new call with a fresh timer, so this is not an end-to-end route deadline. Set
348
+ both variables on the process serving the request: the embedded server
349
+ started by `clodex claude`, or a standalone `clodex server`. `clodex-claude`
350
+ only connects to an existing server, so setting them on that wrapper does not
351
+ reconfigure the server. Empty values use the defaults, malformed values are
352
+ ignored, and integers outside the supported ranges clamp to the nearest
353
+ bound. Clodex warns once for each malformed, clamped, or inconsistent setting
354
+ when a request first resolves it; `clodex claude` displays that parent notice
355
+ after Claude Code exits. The total timeout can never be shorter than the idle
356
+ timeout: increasing only the idle timeout raises the default total to match,
357
+ while an explicit shorter total lowers the idle timeout. The 10s/1m floors
358
+ avoid near-immediate termination; the 1h/6h ceilings allow deliberately long
359
+ calls without leaving stalls attached indefinitely. At either deadline,
360
+ clodex aborts the SDK call; cancellation is cooperative, so a provider
361
+ transport that ignores the abort signal can settle later. These are
362
+ server-side limits, and callers may stop sooner. Claude Code currently
363
+ defaults to about 180s of downstream byte silence in proxy mode and 300s in
364
+ endpoint mode, with
365
+ a 30m byte-watchdog ceiling. In Claude Code's environment, `API_TIMEOUT_MS`
366
+ controls the pre-header deadline; `CLAUDE_STREAM_IDLE_TIMEOUT_MS` and
367
+ `CLAUDE_BYTE_STREAM_IDLE_TIMEOUT_MS` control stream silence. Waits beyond 30m
368
+ also require `CLAUDE_ENABLE_BYTE_WATCHDOG=false`. With a standalone server,
369
+ set those client variables on the Claude Code process, not the server.
370
+ - **Upstream retries:** clodex retries retryable failures on SDK-backed
371
+ provider calls up to `5` times by default. Set
372
+ `CLODEX_UPSTREAM_MAX_RETRIES` to a non-negative integer to override it; `0`
373
+ disables retries. The default and configuration ceiling
374
+ are derived from the resolved idle timeout and the SDK's fallback 2s, 4s, 8s,
375
+ … backoff, so a shorter idle timeout automatically lowers both. The ceiling
376
+ is `5` at the default timeout and can rise to `10` at the maximum. Larger
377
+ integers clamp with a one-time warning that names the active idle timeout.
378
+ On a genuinely unavailable provider, five retries can add roughly 62s of
379
+ fallback backoff instead of the SDK default's roughly 6s; the longer wait is
380
+ deliberate so transient failures have more time to recover. Provider
381
+ `retry-after` hints and time spent in failed attempts can mean fewer retries
382
+ start before a streaming idle deadline; the shared abort signal still
383
+ interrupts backoff when that deadline fires. If a deadline interrupts a
384
+ retry delay, clodex preserves the provider failure that prompted the retry;
385
+ if a currently active call is silent, clodex reports the timeout instead.
386
+ Unset, empty, or malformed values preserve the clodex default. The SDK only
387
+ retries before model output is exposed downstream; a stream that fails after
388
+ partial output cannot be
389
+ replayed safely and still terminates the request. The same
390
+ retry setting also controls proxy mode's raw HTTP MITM path, which replays
391
+ once by default and retains an independent ceiling of `5`. Only a request
392
+ sent on a pooled connection the far end had already closed, with no response
393
+ received, is replayed there; other direct raw relays add no transport-failure
394
+ replay (an OAuth 401 refresh can still start a new authenticated call). The
395
+ timeout settings add no timers to any raw relay. A valid
396
+ `CLODEX_UPSTREAM_MAX_RETRIES` value takes precedence on the HTTP MITM path;
397
+ otherwise, Claude Code's own `CLAUDE_CODE_MAX_RETRIES=0` disables that replay
398
+ so telling the client never to resend a request is not quietly undone one
399
+ layer down.
400
+ Recovered requests appear in the inference log as `response_retried`.
358
401
 
359
402
  ## Known limitations
360
403