Commit Graph
175 Commits
Author SHA1 Message Date
Quheng DengandWengeLiu101 57b906b23f fix(proxy): treat any failed probe as a proxy failure, not just timeouts (#111)
checkClaimedProxy() only marked a proxy unhealthy when the probe error was a
timeout or ECONNREFUSED (isProxyFailure). A proxy that answers the CONNECT with
its own error -- e.g. a provider refusing because the plan's bandwidth is
exhausted -- produced an error matching none of those cases, so the probe was
reported as inconclusive and the proxy stayed healthy forever: never taken out
of rotation and never re-bound for key traffic.

A probe is a plain HTTP GET issued through the proxy; if it returns no response,
that proxy cannot serve traffic, whatever the reason. Count every
non-cancellation error as a failure. context.Canceled stays exempt because it
says the caller gave up, not that the proxy is down.

Scope: the probe path only. syncProxyResult() (real traffic) and the anonymous
attempt loop keep using isProxyFailure deliberately -- there an error may come
from the upstream rather than the proxy, so staying conservative is correct.

Co-authored-by: WengeLiu101 <233876084+WengeLiu101@users.noreply.github.com>
2026-10-23 09:25:00 +08:00
Quheng DengandWengeLiu101 05874a5bf0 fix(webui): stop browsers serving a stale embedded UI after upgrade (#112)
The management UI is embedded in the binary (//go:embed) and served through
http.FileServerFS. Those responses carry no Cache-Control, and the embed FS
reports a zero modification time, so there is no Last-Modified or ETag either.
Browsers are therefore free to apply heuristic caching and keep an old
index.html/app.js/styles.css for hours.

That is invisible until the operator upgrades the binary: the new backend then
serves requests that the cached old frontend does not know about, so newly
added pages never appear (or the UI breaks) until the cache expires or the user
hard-refreshes.

Set Cache-Control: no-cache on the embedded assets so the browser always
revalidates. Revalidation is cheap against a local server, and it makes the UI
version follow the binary version, which is the invariant the embed implies.

Co-authored-by: WengeLiu101 <233876084+WengeLiu101@users.noreply.github.com>
2026-10-23 09:24:48 +08:00
FLYFandAiFLYF 4e2edbf1e6 fix(upstream): let the runtime own Accept and Content-Length placement (#143)
A captured 2.1.1 request carries neither an Accept header nor a trailing
Content-Length: fetch fills Accept with */* and computes Content-Length as
part of the common-header block. The gateway set both itself, so the v2 lane
sent an Accept value the client never produces and put Content-Length last,
where no fetch request has it.

Header order and presence are part of what a fingerprint sees, so the v2 lane
now sets no Accept and the Bun head emits Content-Length among the common
headers instead of trailing the request.

The v1 lane keeps its own Accept, which is what that client sends.

Co-authored-by: AiFLYF <AiFLYF@users.noreply.github.com>
2026-10-23 09:24:37 +08:00
FLYFandAiFLYF 5c5100c470 feat(upstream): match the 2.x client's chat body byte for byte (#142)
The v2 gate fingerprints the body as well as the headers, and five details
still differed from a captured 2.1.1 request:

- The client sends max_completion_tokens: 32000 on every chat body. The
  gateway now adds it when the caller asked for no ceiling; an explicit
  max_tokens or max_completion_tokens still wins.
- Every client tool carries "strict": false, so a tool that omits the field
  is byte-different from the client's on every request that carries tools.
- The shell tool description names the shell the client actually has, so a
  Windows host advertises a different one than the captured Unix wording.
- Chat bodies keep the client's key order, model first. Go writes map keys
  alphabetically, which puts max_completion_tokens at the front where a real
  client starts with model.
- Bodies are encoded without HTML escaping. encoding/json writes \u003c,
  \u003e and \u0026 by default where JSON.stringify writes the characters,
  and tool descriptions are full of both.

The ordered encoder falls back to plain encoding/json for every lane except
the v2 chat one, and both re-encode points in the request path use it.

Co-authored-by: AiFLYF <AiFLYF@users.noreply.github.com>
2026-10-23 09:24:20 +08:00
FLYFandAiFLYF f9ef5693ab feat(upstream): follow the OpenCode 2.1 client's version and /inference routes (#141)
Captured a 2.1.1 CLI request with the plugin hook that produced the 2.0.32
capture. The body is byte-identical; what moved is the version string and the
route.

The 2.1 client groups /inference routes by provider family, so a chat request
goes to /inference/openai/v1/chat/completions, responses to
/inference/openai/v1/responses and messages to /inference/anthropic/v1/messages.
A 2.0.32 client posted the protocol path directly and that route still answers,
so this is fidelity rather than a fix.

The family segment is only inserted for the /inference origin: a custom base
URL and the /zen/go lane keep the flat route, because the grouping belongs to
/inference alone.

Co-authored-by: AiFLYF <AiFLYF@users.noreply.github.com>
2026-10-23 09:23:58 +08:00
Jason Xu ab55803cdc docs: document explicit reasoning disable in translations (#151) 2026-10-23 08:46:03 +08:00
Jason Xu 394acb5de3 fix(protocol): preserve explicit reasoning disable (#150) 2026-10-23 08:38:15 +08:00
Jason Xu 56a789d560 feat: add Italian WebUI localization
Repairs the Italian README documentation and includes all four README translations in release archives.
2026-10-23 07:02:00 +08:00
Jason Xu 189ef7e433 docs: repair Italian README and include it in releases 2026-10-23 07:01:21 +08:00
croccio fee095680f fix(webui): address PR #144 review — auto-detect Italian, wire API-key card, polish Italian copy 2026-10-22 13:57:48 +02:00
croccio 22d584f34c feat: add Italian localization for the WebUI
Extend the WebUI internationalization module with Italian (it) support,
including locale metadata (flag, label, date formats) and comprehensive
translation strings covering the operator manual, dashboard, configuration
center, diagnostics, quotas, and logs.
2026-10-21 10:23:41 +02:00
Jason Xu 0bb23c7a7f fix(upstream): stop retrying request-level rejections and cap anonymous exits
The anonymous walk now ends on a deterministic 4xx instead of replaying the same context-length rejection through every exit and tier. Static exits are capped by performance.max_anonymous_exits, and an IP-level abuse block marks only its exit; the lane breaker opens only when every exit is blocked, so a single 403 no longer pauses the lane. The Zen key tier is skipped after an IP block while the authenticated Go tier remains available. Add performance.free_tier_block_seconds, make the breaker half-open probe single-flight, and coordinate refreshes and availability probes with the breaker. Update the shipped example to start on the anonymous lane.
2026-10-21 02:52:52 +08:00
Jason Xu ddb5c14b3f Merge pull request #140 from tubimasky/pr-anon-breaker
Add an opt-in circuit breaker for the anonymous free-tier lane.
2026-10-21 02:28:20 +08:00
Jason Xu 07ba89af9f Merge pull request #127 from cuipengcx90/fix/anonymous-exit-cap
Cap the number of static anonymous exits walked per request.
2026-10-21 02:28:00 +08:00
Jason Xu 07aa4534b9 Merge pull request #132 from cheerc/fix/free-tier-ip-abuse
Handle free-tier IP blocks and stop retrying request-level rejections.

Test files from the PR are omitted: this repository does not keep _test.go
files, so they are removed in the merge commit.
2026-10-21 02:27:11 +08:00
rock 8cc5e96489 feat(gateway): pause the anonymous lane after repeated failures
A flagged free-tier exit keeps answering 403 (IP-level abuse detection)
and retrying only extends the penalty. Add an optional lane-level circuit
breaker, configured with models.anonymous_backoff:

- threshold consecutive failed anonymous attempts, or one 403/429, pause
  the whole lane for base_hours, doubling on every further trip up to
  max_hours;
- while paused, no proxy is drawn and no upstream request is made, so
  routing falls straight through to the authenticated tiers;
- a successful attempt closes the breaker and restores the free lane;
- absent config leaves behavior unchanged;
- availability probes honour the breaker instead of refreshing the block.
2026-10-20 23:02:10 +08:00
CheerCandClaude Code fa9a25577e fix(upstream): stop retrying request-level rejections and ignore placeholder keys
A free-tier 400 (context_length_exceeded, invalid_request_error) was
treated as retryable: the gateway walked the second anonymous lane, then
the keyed tier, and the client received whatever the last tier answered.
With the documented placeholder in zen_keys, a 941 KB request that only
needed compaction came back as "401 Invalid credential".

- classify request-level rejections (400/422 with invalid_request_error,
  context_length_exceeded, maximum context length, string_above_max_length
  or prompt is too long) and end the request after the first attempt on
  both the anonymous and keyed lanes, forwarding the original status and
  body; 401/403/429 stay retryable because they can be key-specific;
- read the body once with peekResponseBody so classification does not
  consume what the client eventually receives;
- drop documented placeholder keys (sk-your-zen-key, change-this-local-key)
  during config normalization: they never authenticate, and keeping them
  turns every free-tier fallback into a 401 that hides the real error.

Verified end to end by replaying the recorded request against the built
binary with the original configuration: 400 with the upstream message,
one upstream attempt, an anonymous key_id, and zen/go pools of 0.

Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-10-20 21:22:25 +08:00
CheerCandClaude Code 3e8318578d fix(upstream): treat the free-tier IP block as terminal for the exit
The free tier answers an egress IP it flagged with 403 "abusive traffic".
The gateway read that as an ordinary rejection: it tried the second
anonymous lane on the same IP, then the keyed tiers from the same IP, and
remembered nothing, so every later request and every probe repeated the
walk. A single client request produced four upstream 403s on an instance
with one exit.

- classify the three known IP-block wordings (abuse.go) without consuming
  the body, so the upstream response stays intact for the caller;
- cool only that exit (proxyTransport.blockedUntil) and leave the lane:
  another lane on the same IP cannot help, and neither can a keyed tier;
- keep blocked exits out of anonymousCursor.Next, including its cooldown
  fallback, and bring them back after a 15 minute TTL;
- skip the keyed tiers once the anonymous phase reports the block;
- answer clients with 503 free_tier_ip_blocked instead of forwarding the
  upstream "turn off your VPN" text;
- record probes as network_abuse_blocked instead of http_403;
- count anonymous attempts, which stayed at zero and broke the telemetry
  attempt numbers and the request budget.

Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-10-20 21:22:09 +08:00
Jason Xu f0f064f31d fix: align the v2 free-tier shape with OpenCode 2.0.32
- Use the genuine patchText description and keep the Linux/bash shell sentence.
- Preserve the client's child session id separately from the affinity.
- Scope the anonymous parent session id like every other derived identity.
- Append beta=true only on v2 Anthropic lanes and parse the query safely.
- Remove the redundant v1 project renderer and duplicate anthropic-version.
- Revert the formatting-only churn in opencode_tools.json and update lane docs.
v1.4.3
2026-10-20 18:13:56 +08:00
Jason Xu 8899749008 Merge pull request #130 from byi4/feat/v2-genuine-free-tier-client
feat(upstream): mimic the genuine free-tier client on the v2 lane
2026-10-20 18:13:41 +08:00
byi4 c780e68a4c feat(upstream): mimic the genuine free-tier client on the v2 lane
The v2 lane (/inference) was reached in a shape the real 2.x CLI never
sends: the /zen host was offered first, session affinity was pinned to
the child session, Anthropic requests carried no beta query, and the
tool list still described a Linux shell.

- Prefer the /inference anonymous lane and keep the v1 lane as fallback.
- Append ?beta=true to Anthropic endpoints so the request matches the
  real client.
- Derive session affinity from the canonical parent session id and
  expose it as x-opencode-parent-session-id, while
  x-opencode-session-id keeps the child id.
- Send anthropic-version 2023-06-01 and drop the unused fine-grained
  streaming beta.
- Pass "global" and commit-shaped project ids through v2ProjectID
  untouched.
- Drop the Linux/bash wording from the shell tool description and add
  the patch tool.
2026-10-20 17:00:37 +08:00
cuipengcx90 ea947bc5dc fix(upstream): cap the number of anonymous exits tried per request
doAnonymousUpstream used limit = len(pool), so a request that every exit
rejects (403/429) walked the whole proxyfile, up to two legs per exit,
before failing. With a ~24 exit proxyfile this showed up as requests with
19-77 attempts and 200-660s of wall time, all ending in a 403/429 or a
client cancel.

Cap the static exit walk at 8. The #pool rule is unchanged: when a pool
entry is present the limit still rises to retry.max_attempts, so a single
rotating #pool entry keeps its per-attempt fresh IP.
2026-10-19 11:59:39 +08:00
Jason Xu d04ff337d7 feat(upstream): disguise free-model traffic as the Bun runtime
Both official OpenCode clients (1.x and 2.x) run on Bun, but the gateway
reached /zen and /inference through net/http, whose Go ClientHello, HTTP/2
and header layout no Bun client produces.

- Add httpx.BunTransport: Bun 1.4.3's BoringSSL ClientHello via uTLS
  (JA4 t13d1713h1, X25519MLKEM768, http/1.1-only ALPN), HTTP/1.1 with
  Bun fetch's header order and spelling, and gzip/deflate/br/zstd
  decoding that streams SSE incrementally.
- Support direct, HTTP/HTTPS CONNECT and SOCKS5 proxies with auth;
  proxy failures keep the net/http proxyconnect / socks connect shape so
  proxy health classification is unchanged.
- Pool idle connections per host, drop ones the server closes while
  idle, and retry once when a reused connection is dropped before the
  first response byte.
- Route only free-model traffic on the /zen and /inference lanes
  (anonymous, Zen key and availability probes) through it; /zen/go,
  paid models and metadata requests keep the regular client.
v1.4.2
2026-10-19 08:33:12 +08:00
Jason Xu a70e77fe62 Fix audited gateway issues 2026-10-19 05:27:50 +08:00
Jason Xu 81ad2842c7 refactor: drop new prefixes, unify v1/v2 lane naming, audit comments
- Remove the new/New prefix from constructors; rename the colliding
  types semantically (ModelCatalog, RuntimeController, Metrics,
  LogBroker, Redactor, proxyTransports, upstreamNodes, ...).
- Unify upstream lane naming on v1 (/zen, OpenCode 1.x shape) and v2
  (/inference and /zen/go, 2.x CLI shape); add models.IsV1Upstream and
  drop the duplicated lane detection.
- Fix inaccurate, truncated and stale comments across all packages and
  document exported symbols plus non-obvious internals.
- Fix anthropicThinking passing "enabled"/"adaptive" through as an
  effort; derive the level from the budget instead.
- Delete dead code (identity.StableID, unused protocol decoders and
  stream parser wrappers).
- Export EffectiveListeners, rename modelsDev* metadata constants, and
  describe the metadata source as the OpenCode endpoint.
- Rename the forced-collapse log event to stream_collapse_failed and
  add an anonymous field.
- Correct the README upstream.zen default and add upstream.anonymous.
2026-10-19 03:46:09 +08:00
Jason Xu 9aa2133f84 fix(identity): scope derived upstream sessions to the calling server key
Two callers whose conversations began identically were mapped onto the
same upstream session. Without a client session signal the session was
hashed from the first user turn alone, ignoring the server key and the
system prompt, so two users opening with "你好", or two Codex users in the
same working directory (whose first user turn is the boilerplate
<environment_context> block), shared one x-opencode-session, one sticky
upstream provider, one preferred key and one anonymous proxy exit. Every
caller without a client project also shared one constant project id.

- Mix the authenticated caller (server key fingerprint; Playground gets
  its own bucket) into every session and default project the gateway
  derives. Official OpenCode ses_ sessions sent by the client are kept
  verbatim because the client minted them uniquely.
- Read the session signals mainstream agents already send before falling
  back to a content seed: Codex's session_id / conversation_id headers
  and the session UUID inside Claude Code's metadata.user_id (underscore
  or JSON form). The per-user remainder of user_id is never used as a
  session.
- Seed from the system prompt (Anthropic system, Responses instructions,
  leading system/developer messages) plus the first user turn instead of
  the first user turn alone.
- Correct stale comments: x-opencode-request and the project header do
  reach upstream, rendered per lane.

Upgrading re-derives every gateway-made session once, so in-flight
conversations may move to another key or proxy and start with a cold
upstream cache. Conversations under one key that share both the system
prompt and the opening turn can still share affinity; the READMEs now
recommend separate server keys for users who must stay isolated.
2026-10-18 22:04:54 +08:00
Jason Xu cece86bb22 Merge pull request #126 from TiaraBasori/chore/opencode-2.0.32-shape
chore(upstream): sync the /inference lane shape with OpenCode 2.0.32
2026-10-18 21:53:16 +08:00
TiaraBasori b0a6584825 chore(upstream): sync the /inference lane shape with OpenCode 2.0.32
Report the current CLI release in the User-Agent and use the Linux shell tool description the client ships, so the anonymous fingerprint matches the release the free tier actually sees.
2026-10-18 21:21:40 +08:00
Jason Xu 83d623d541 fix(webui): prevent duplicate v prefix in version and link to GitHub repo 2026-10-17 19:45:45 +08:00
Jason Xu a9470df4fc fix(upstream): alias the client read tool to "read" on the legacy /zen/v1 lane
The legacy /zen/v1 free-tier gate needs only a single tool named "read":
probing showed [read] alone passes while bash/shell/edit/glob/grep alone
(or any combination without read) return 403 FreeTierError, and neither
the description nor the parameter schema is validated. The v1.3.7-style
pre-injection of the other core tools was therefore unnecessary traffic
and repeated client schemas on the wire.

Legacy lane:
- Drop the bash/edit/glob/grep pre-injection entirely.
- If the client already declares an exact "read" tool, the body is left
  untouched.
- Otherwise, a read-related client tool (case-insensitive match such as
  "reAd", "read_file", "ReadFile", "file_read", "view_file") is renamed
  in place to "read" with its client description and schema preserved,
  and the matching tool_choice plus any historical tool call in the
  request are rewritten so the outbound body stays self-consistent.
- If no read-related tool exists, a single "read" stub is injected whose
  description marks it deprecated, disabled, and not to be called.

Round trip:
- Add protocol.RenameResponseTool for chat tool_calls, Responses
  function_call items, and Anthropic tool_use blocks.
- Add protocol.RenameStreamReader, a pull-based SSE rewriter (no goroutine
  or io.Pipe, so a disconnected client cannot strand a writer) that
  restores the client's original name in streaming replies. Chat deltas
  may split or repeat a name fragment, so "read" prefixes are held until
  the name resolves, and a continuation past "read" is passed through
  verbatim.
- Carry the alias through the new telemetry.RequestMeta.ToolAlias field
  and shapeKeyBody's new return value; the /inference lane and non-legacy
  upstreams are untouched.
v1.4.1
2026-10-17 07:13:19 +08:00
Jason Xu 2319941a6a fix(upstream): restore v1.3.7 request shape and stub tools on legacy /zen/v1 lane
Commit 076451f preferred the legacy /zen/v1 origin ahead of /inference,
but still applied the 2026-10-14 /inference gate rules to /zen/v1
requests:

- ensureAnonymousTools rewrote any client-declared tool sharing a
  recognised OpenCode 2.x name ("read", "edit", "write", "glob", "grep",
  "shell", etc.) with the embedded CLI 2.x schema from
  opencode_tools.json, clobbering downstream function-calling schemas,
  and anonymousTool injected full 2.x tool schemas for edit/glob/grep/read
  alongside a stub bash tool.
- newUpstreamRequest and FetchModels sent the 2.x CLI User-Agent and
  header set instead of the v1.3.7 OpenCode 1.18.x headers.

Restore the v1.3.7 request shape when targeting the legacy /zen/v1 origin
(LegacyUserAgent, x-opencode-request, prj_* project id, lightweight tool
stubs, and untouched client tool definitions) while keeping the 2.x CLI
fingerprint and genuine tool definitions for the /inference fallback lane.
2026-10-17 06:17:54 +08:00
Jason Xu 8b61b66235 Delete internal/gateway/pool_test.go 2026-10-17 04:11:27 +08:00
Jason Xu ee0fb53e5d fix(proxy): force fresh tunnels for #pool and stop failing over cooling exits
Three defects kept the anonymous lane returning 502 "all upstream attempts
failed" and kept rotating endpoints pinned to one exit IP:

- Cloning http.DefaultTransport after its first dial inherits the configured
  HTTP/2 ALPN and TLSNextProto map, which ignore DisableKeepAlives and
  Request.Close and multiplex every request over a single CONNECT tunnel. A
  pool transport now installs an explicit empty TLSNextProto map and pins
  ALPN to http/1.1, so each attempt opens a new tunnel and draws a new exit.

- anonymousCursor.Next returned nil as soon as every static proxy was cooling
  or unhealthy, which turned a transient 429 into an immediate "no healthy
  anonymous proxies available" and a 502 for the client. It now tracks the
  nodes this cursor already tried and falls back to the earliest-expiring
  remaining node, mirroring the key pool's earliest-expiry behavior.

- An upstream HTTP response proves the proxy route is reachable, so a 4xx/5xx
  (or a 2xx) now clears an unhealthy flag left by an earlier transient
  timeout instead of leaving the route evicted for up to 15 minutes.

The tier-outer loop also keeps the last upstream response when a later key
tier dies on transport: the previous code dropped it, so a real 429 from the
anonymous lane was replaced by a generic 502.
2026-10-17 04:04:07 +08:00
Jason Xu 260211cd9e feat(proxy): support rotating proxy pools via #pool marker
An endpoint that already rotates exit IPs (Resin and similar gateways) was
handled like a static proxy, which defeated the rotation in three ways:

- the cloned transport kept HTTP/2 and keep-alive enabled, so every request
  reused one CONNECT tunnel and therefore one exit IP, drawing 429s;
- a single slow exit marked the whole entry unhealthy and keys were rebound,
  with scheduled recovery only every 15 minutes;
- any 429/5xx put the anonymous node into a 15s-120s cooldown, and that lane
  has no earliest-expiry fallback, so the request failed with
  "no healthy anonymous proxies available" (HTTP 502).

Mark an entry with a "#pool" fragment (or a "pool+" scheme prefix) to declare
it a rotating pool. Pool entries then open a fresh connection per attempt
(DisableKeepAlives, no HTTP/2, plus Connection: close on the request), are
excluded from cooldown, health eviction, and proxy rebinding, and may be
retried up to retry.max_attempts on the anonymous lane instead of once.

Config validation and redaction work on the clean URL, the marker stays
visible in the operator UI, and deduplication keeps a pool entry next to a
static proxy that dials the same endpoint since they are different routes.
2026-10-17 03:30:25 +08:00
Jason Xu 6d83806939 fix(protocol): skip non-function Responses tools during cross-protocol bridging
Closes #95
2026-10-17 02:09:55 +08:00
Jason Xu a46de6fe29 Merge branch 'pr-89'
# Conflicts:
#	.github/workflows/checks.yml
#	README.md
#	README.zh-CN.md
#	docs/management.zh-CN.md
#	webui/app.js
#	webui/embed.go
#	webui/index.html
#	webui/styles.css
2026-10-17 01:54:21 +08:00
Jason Xu d4f1e136ed Merge branch 'pr-98'
# Conflicts:
#	webui/styles.css
2026-10-17 01:11:21 +08:00
Jason Xu 7bd517efb5 Merge branch 'pr-100' 2026-10-17 01:08:23 +08:00
Jason Xu 076451fa31 feat: prefer legacy /zen/v1 anonymous lane with fallback to /inference 2026-10-17 01:02:59 +08:00
WengeLiu101 6c9be9037f fix(webui): make sidebar nav reachable on short viewports and stop overflow on narrow screens 2026-10-16 19:35:31 +08:00
michaelliunsky e6797dab22 fix(webui): drop the zero timestamp from the quota catalog line
An unset catalog timestamp is the Go zero time; format it as a "not
ready" placeholder instead of rendering 0001-01-01.
2026-10-16 18:34:03 +08:00
michaelliunsky a0da31ed08 feat(webui): rebuild console with tabbed pages
Replace the single-file frontend (app.js, styles.css) with a multi-file
ES module structure served from go:embed, and reorganize the 13 pages
into 8 tabbed pages under 4 navigation groups: runtime (overview,
diagnostics), integrations (access guide, API keys), models (quotas,
rotation), and system (configuration, account).

The redesign adopts a monochrome light/dark design system driven by
prefers-color-scheme, replaces prompt()/confirm() flows with in-page
dialogs, and keeps every management API call and deep link (old hashes
alias to the new pages).

Behavior changes: the log SSE connection now spans the whole console
session and buffers while the stream tab is hidden; quota polling runs
only while its tab is active; the first-run checklist appears on the
overview page and hides once ready.

Also fixes a crash on the rotation page: the persisted state serializes
empty orders and maps as JSON null, which is now normalized before
rendering, with the same defensive handling in the quota and API key
pages.

CI now syntax-checks the ES modules via node --input-type=module, and
the README structure notes are updated.
2026-10-16 18:09:42 +08:00
hanlap0503 6648db99ee Merge pull request #1 from hanlap0503/fix/rotation-anonymous-2026-10-16
Fix/rotation anonymous 2026 10 16
2026-10-16 13:43:29 +07:00
hanlap0503 2626f49fbb fix: update check-models script to save working models and handle empty responses 2026-10-16 06:41:31 +00:00
hanlap0503 f99600e7b9 fix: simplify rotation manager configuration and add test for model exclusion 2026-10-16 06:41:19 +00:00
hanlap0503andCopilot b7be5ed7d0 fix: route rotation aliases through anonymous lane
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-16 06:35:01 +00:00
hanlap0503 d15aec3d2e Merge branch 'jasonxu114514:main' into main 2026-10-16 08:08:41 +07:00
Jason Xu a6601da673 fix: report a proxy error when every proxy is down
When every attempt died on the proxy route itself, the gateway answered
with a generic 502 "all upstream attempts failed", pointing operators at
the upstream instead of their proxies.

Attempt errors that fail before a connection to the upstream exists
(proxy dial, CONNECT/SOCKS handshake, tunnelled TLS) are now tagged as
proxy failures on real proxies; direct transports are left untouched.
The anonymous lane also reports a proxy failure when no proxy is healthy.
When the final error is such a failure, the inference and System One
handlers return 503 with type "proxy_error". Any upstream HTTP response
is still forwarded as before, so genuine upstream errors are not
mislabelled.
2026-10-15 20:40:50 +08:00
hanlap0503 6150f7da28 fix(webui): align language flag in toolbar and auto-detect browser language 2026-10-15 10:06:22 +00:00
hanlap0503 1e81532be8 fix(webui): pin login language selector to top-right 2026-10-15 09:55:58 +00:00