SIGN IN SIGN UP

fix: TUI-safe logging via OpenCode's log API + configurable request timeout (#26)

* fix: route plugin logging through OpenCode's log API

console.* writes straight into the same terminal the OpenCode TUI
renders in, so a background cache refresh corrupts the interface
mid-session (issue #15). Send all plugin logs through
client.app.log instead — they land in OpenCode's log files, and
the TUI stays intact. Falls back to the console only when no
client is wired up (unit tests, unusual embedders).

* feat: make discovery request timeout configurable via LITELLM_REQUEST_TIMEOUT_MS

Some proxies (many database-defined models, or a gateway in front of
LiteLLM) legitimately take longer than the 15 s per-request default
to answer /v1/model/info (issue #20). The env var raises the budget
for the discovery fetches, and the overall discovery cap scales with
it (max of 20 s and request timeout + 5 s) so the requests aren't
cut off mid-flight. Invalid values fall back to the default.

* test: cover LITELLM_REQUEST_TIMEOUT_MS parsing

Suite from #24 is on main now, so the timeout parsing promised in
the #26 write-up gets its unit tests: default fallback, valid
override, and invalid values (non-numeric, zero, negative, float,
empty).

* fix: parse LITELLM_REQUEST_TIMEOUT_MS strictly

parseInt('12.5') silently truncates to 12, so a float like 12.5
would set a bogus 12 ms timeout. Use Number() + an integer check so
only whole positive numbers are accepted; anything else falls back
to the 15 s default. Caught by the new unit tests.
Y
Yusef Mohamadi committed
e294071fae0f4fc604be1ac76db205aab1ae96de
Parent: 821e9f6
Committed by GitHub <noreply@github.com> on 9/11/2026, 7:34:17 PM