fix: LM transport ceiling per provider (read_timeout_s + num_retries) #25

Merged
onibot merged 1 commits from fix/lm-transport-ceiling into main 2026-10-26 12:27:58 +01:00
Owner

Body: local EXTRACT died at 2407.3s = 4 attempts x 600s + backoff — retries ran but every attempt hit the same 600s read wall (lm15 default, and the silent-ollama proxy cuts at 600 too). The fix: the ceiling becomes per-provider config — local read_timeout_s=1800 + num_retries=1 (one honest 30-min attempt, one re-try); cloud read_timeout_s=300 + num_retries=2. run.log reports the ceiling on the first line. Wire-verified: timeout=3 kills a hang-server call at 3.1s (not 600); num_retries=1 = exactly 2 attempts. Unset -> dspy defaults, nothing invented. Suite 21 green.

Body: local EXTRACT died at 2407.3s = 4 attempts x 600s + backoff — retries ran but every attempt hit the same 600s read wall (lm15 default, and the silent-ollama proxy cuts at 600 too). The fix: the ceiling becomes per-provider config — local read_timeout_s=1800 + num_retries=1 (one honest 30-min attempt, one re-try); cloud read_timeout_s=300 + num_retries=2. run.log reports the ceiling on the first line. Wire-verified: timeout=3 kills a hang-server call at 3.1s (not 600); num_retries=1 = exactly 2 attempts. Unset -> dspy defaults, nothing invented. Suite 21 green.
onibot added 1 commit 2026-10-26 12:27:55 +01:00
The bug his log pinned: local EXTRACT died at 2407.3s = 4 attempts x
600s + 7s backoff — dspy's retry loop (default num_retries=3) ran
honestly but every attempt hit the SAME wall: lm15's default read
timeout of 600s (and the silent-ollama proxy in front cuts at its own
READ_TIMEOUT=600 too). Retries can't help when each attempt dies at
the same ceiling — the 27b on a single 3090 legitimately needs
minutes for a long EXTRACT output (his nvidia-smi: 21GB resident,
64k context, ~52% util).

The fix: the ceiling is CONFIG, not code.
- config.yaml: local read_timeout_s=1800 (one honest 30-min attempt),
  num_retries=1 (one re-try after a genuine cut, not 3x30min);
  ollama-cloud read_timeout_s=300 (glm answers EXTRACT in ~3s),
  num_retries=2 (cloud retries are cheap).
- configure_lm forwards read_timeout_s as dspy.LM(timeout=...) —
  dspy 3.4.1 routes it to lm15 Timeouts(read/write/pool) — and
  num_retries to the retry loop (LMTransportError is retryable).
- run.log first line now reports the ceiling (no more silent 600s
  walls — you SEE what will kill a slow call).
- Unset keys -> dspy defaults (600s / retries 3), nothing invented.

Verified on the wire (tests/lm_transport_wire.py): a hang server +
timeout=3 kills the call at 3.1s (not 600s); num_retries=1 gives
exactly 2 attempts (3.2s = 2x1s + backoff). Suite: 21 files green.
onibot merged commit 31c7e02e22 into main 2026-10-26 12:27:58 +01:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: onibot/floop#25