mirror of
https://github.com/jasonxu114514/opencode2api.git
synced 2026-12-05 08:02:53 +00:00
attempt_timeout_seconds only reached the transport's ResponseHeaderTimeout, which starts after the request body is written, so an exit wedged in dial or request write could consume the whole request budget. When the option is set, each attempt now also carries a context deadline covering dial, write, headers and, when enabled, the first SSE event; a committed stream is never cut. Legs record the phase an attempt died in. A timeout after the upstream already answered is slow generation, not a broken proxy, so it does not evict the exit. Co-authored-by: mcheiyue <2267610721@qq.com>