Add WebUI device authorization, organization selection, persisted token refresh, and fail-closed official Go subscription routing. Preserve manual keys without PAYG fallback and keep OAuth quota unknown.
Validation: offline regression checks, go vet, JavaScript syntax, and Windows/Linux amd64 compilation passed. Live subscription authorization and inference are not yet verified.
Refs #168
Resolved against #170 so a relay pin clears the per-attempt WARP choice
(attemptUseWARP). The relay list is now credential-redacted, and a pin may
name a relay by its redacted URL.
- Allow operators to associate Zen and Go credentials with configured proxy
routes via optional proxy_bindings in config.
- Keys are mapped to their 16-hex fingerprint during normalization so
secrets are never stored twice or exposed in diagnostics.
- Bound credentials fail closed: when their assigned proxy becomes unavailable,
they do not silently migrate to other proxies or fall back to direct egress.
- When an assigned proxy recovers, traffic resumes immediately without
changing bindings.
- Removed or invalid proxy references fail config validation, leaving the
previous running runtime untouched on failed reloads.
- Unbound configurations, anonymous routing, and session affinity continue
to behave exactly as before.
- Note in config documentation that binding to a #pool proxy endpoint pins the
transport route and does not guarantee a static public egress IP.
- Add unit and acceptance tests covering binding resolution, fail-closed isolation,
persistence, and secret masking.
Co-authored-by: NekomyaDev <neko@nekomya.dev>
- Dark theme: an auto/light/dark cycle in the topbar, persisted per
browser and applied before first paint by an inline head script; the
dark palette moves behind data-theme so the runtime choice wins over
the media query (#122).
- Request routing and upstream attempts tables are paged (50/100/200/500
rows per page) instead of a hard last-100 cap, with translated pager
controls (#122).
- Free-model refresh status now calls POST /api/models/probe, which
marks every automatic model due and wakes the probe loop, then reloads
the snapshot; the button re-probes instead of only rereading the cache
(#122).
- The config page renders long key/proxy lists collapsed behind a
100-chip cap with an expand toggle, so a large proxy pool no longer
freezes the page (#146).
- New strings translated for en/vi/it; READMEs document the new
admin endpoint.
Startup registers the first exit synchronously and failed closed on any
error, including Cloudflare's rate limit — which a fresh process can still
receive because the limit follows the source address. Wait out the pause
inside the initialization deadline instead, and give WARP initialization
one full rate-limit window so a deploy does not fail on a limit that is
about to expire.
The WARP pool could never rotate: its lifetime context was derived from the
startup deadline, so every standby registration and replacement died with
"context canceled" and requests stayed on the first egress forever. Give the
first registration the caller's deadline and the pool a context that only
Close cancels.
- warp.pool_size is an upper bound. The active ring follows concurrency (one
exit per lease, one per queued request, plus a spare) and trims idle surplus
after 60 seconds, so a burst expands it and quiet periods shrink it.
- An IPv6 exit is deduplicated and cooled by its /64 for 30 minutes (IPv4 by
its /32), since the free quota is scoped to that block.
- 429/403 retires an exit immediately and re-registers right away; a free
model request keeps switching exits and only returns the last 429 after
retry.max_attempts, on both the anonymous and the Zen-key lane. 429s no
longer trip the anonymous breaker or cool the key.
- Pin HTTP/1.1 ALPN and TLSNextProto on the WARP transport: a clone of
DefaultTransport made after its first dial negotiated h2 and fed SETTINGS
frames to the HTTP/1.x reader, breaking catalog refresh.
- Default to the IPv6 stack and, with warp.source_ipv6, let each exit bind its
own outer source from a routed prefix via IPV6_FREEBIND. Endpoints try IPv6
first and fall back to IPv4, so IPv4-only hosts keep working.
- WebUI, config example and all READMEs describe the new pool and rotation
behaviour.
Free-tier requests now optionally leave through a Cloudflare WARP tunnel that runs inside the gateway process: WireGuard over UDP plus a gVisor netstack, so no TUN device, root, NET_ADMIN, or route changes are needed. Adapted from github.com/sudogeeker/ai-route (MIT).
- warp.enabled/pool_size/stack in config, the WebUI, config.example.json and all READMEs; startup and hot reload fail closed when WARP cannot initialize.
- Anonymous lane, free-model Zen-key fallback, free-model probes and the anonymous catalog refresh send no proxy traffic while enabled; Go keys and paid models keep their proxies.
- Per-attempt leases feed 403/429 rotation and broken-tunnel failures back into the pool; /healthz and /api/monitor expose the pool state and readiness requires an active exit.
- errWARPUnavailable maps to a 503 warp_unavailable response.
- 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.
Move the command to cmd/opencode2api and group production code into
configuration, gateway, protocol, model, admin, telemetry and helper packages.
Keep shared state private behind context, metrics and runtime interfaces.
Remove the requested test files and replace test-only CI jobs with vet/build
checks. Update Docker and release build paths, preserve version injection and
make the WebUI an explicit embedded asset package.
Add directory trees and source reading guides to both READMEs. Anchor binary
ignore rules so the command package is tracked.