Commit Graph
18 Commits
Author SHA1 Message Date
xiechen 74348cb46f fix: harden stale-reasoning retry per review
- Only treat a retry as success on 2xx; on non-2xx/transport failure
  close the retry response and restore the original 400 body, logging
  reasoning_reference_retry_failed with the retry status.
- Always close the original network body after caching its bytes, and
  hand downstream a fresh in-memory reader (also on read errors).
- Narrow the matcher to explicit 'reasoning item/reference ... not
  found/expired' errors; add negative cases (unknown reasoning field,
  bad reasoning_effort, unrelated 400s).
- Thread a cumulative attempt offset through doUpstreamTiers and the
  anonymous path so retry attempts keep numbering [1 2] per request.
- Add HTTP-level tests via httptest upstream: retry success (with
  stripped-payload assertion), retry non-2xx restore, non-matching
  passthrough, no-op (nothing to strip), cumulative attempt numbers.
2026-09-05 09:37:56 +08:00
xiechen 462a6c8e36 feat: auto-retry upstream 400 on stale reasoning references
When Zen returns 400 such as "Referenced reasoning item 'rs_...' was
not found or has expired", replay once without the Responses reasoning
input items and previous_response_id under a fresh upstream session
instead of failing the client request. Other 400s pass through
unchanged. Adds unit tests for the classifier and payload stripping.
2026-09-04 11:21:23 +08:00
Jason Xu 3be4b393c0 feat: show upstream key suffix per request 2026-08-27 21:36:17 +08:00
Jason Xu c4c1f36d61 fix: sync OpenCode model capabilities dynamically 2026-08-23 22:06:27 +08:00
Jason Xu cc71ba8aff feat: revise free model routing fallback 2026-08-20 04:01:39 +08:00
Jason Xu 3e0a6f0b62 feat: add compatible model metadata routing 2026-08-20 00:39:06 +08:00
Jason Xu 77b794731a feat: collect token and upstream attempt metrics 2026-08-20 00:39:06 +08:00
Jason Xu 8e131dcf3b feat: add anonymous Zen support 2026-08-17 12:40:24 +08:00
Jason Xu fdae1902a0 feat: add authenticated web management console 2026-08-16 04:29:43 +08:00
Jason Xu e68a0b9d19 fix: normalize tool reasoning history across protocols 2026-08-15 03:23:16 +08:00
Jason Xu 1c149e3657 fix: normalize Anthropic tool thinking history 2026-08-15 02:52:28 +08:00
Jason Xu 52f19b7bd3 fix: preserve reasoning and add session affinity 2026-08-14 17:18:07 +08:00
Jason Xu 4d10eac974 refactor: rewrite protocol forwarding 2026-08-14 16:57:30 +08:00
Jason Xu efbdb6e7d1 fix: normalize tool history and improve health checks 2026-08-14 16:17:36 +08:00
Jason Xu adb0edb64a config: make zen/go preference configurable via prefer field
Add a top-level "prefer" config field ("zen" or "go", default "go") that
controls which upstream is used when a model is available in both pools,
including during the temporary model-discovery fallback. Previously Zen
was always preferred.
2026-08-14 10:34:08 +08:00
Jason Xu e220e7a040 fix: refine proxy health recovery 2026-08-14 10:10:26 +08:00
Jason Xu 1f603c35a6 feat: add automatic proxy failover and health checks 2026-08-14 09:37:43 +08:00
Jason Xu f32c4a0e61 feat: add OpenCode Zen API compatibility proxy 2026-08-14 08:33:22 +08:00