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.
#169 called anonymousNodes.CursorForOffset, warp.Pool.ReportWithRetryAfter and
warp.Pool.HasUntriedActive without defining them, so main did not compile.
Add the three methods: an attempt offset shifts the anonymous start node, a
longer Retry-After extends the egress cooldown, and HasUntriedActive matches
the pool's egress keys.
Also:
- rewrite title.go in house style: named limits, a prompt table, no issue
numbers in comments, and a titleFallback helper shared by both lanes
- document the held-back tool-call helpers in protocol/stream.go
- gofmt internal/admin/server.go
- drop the _test.go files from #169, #170 and #171
- 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.
The hourly free-model probe presented one pinned identity: project
"opencode2api:default-project" together with a session derived from the
model name. The free tier meters per project id and egress, so every
deployment running the same probe shared one bucket; once a popular exit
had charged that bucket, every probe answered 429 FreeUsageLimitError and
the model was cached as unavailable for an hour while live traffic on the
same process and egress succeeded.
The Playground bench pinned a session indirectly: it sent no session
signal, so DeriveRequestIDs fell back to conversationSeed — the system
prompt plus the first user turn — and every click replaying the same
prompt produced the same session.
Neither path is a conversation, so neither should present one. Each now
mints fresh identity per attempt: a canonical session and a random project
id for the probe, a canonical session per Playground click. Canonical ids
are forwarded verbatim, so the scope mixin does not apply and the shape the
free tier accepts is what goes out.
Verified end to end with the admin UI enabled on a temporary instance.
Three Playground clicks before the change logged the same upstream session
three times (ses_ea4eb1680ffe0B8cZBh0nKJ03A); two clicks after logged
ses_eb2c888f1ffe4Y0DodMQdwvu6c and ses_ed8748efdffe2ez6IH352OdMpV, both
200. Probes on this build measured 8/8 probe_succeeded with a fresh
availability cache — they already succeeded on this exit before the change,
so this is hardening for the charged-bucket case in the report, not a
reproduction of it.
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.
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>
- 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.
Usage was only broken down by model and tier, so a gateway shared by
several callers could not tell how much each server key consumed.
authenticate now records the fingerprint of the key that matched, and the
monitor keeps requests and tokens per key in usage.server_keys for both
the lifetime and the last hour; the entries sum to the aggregate totals.
/api/api-keys attaches each key's usage and the WebUI shows it in the key
list. Playground traffic borrows the first enabled key, so it is counted
under "playground" instead. Like the rest of the monitor, the figures
survive hot reloads and reset on restart.
Closes#58.
Keep manually restored free models enabled until automatic control is selected.
Persist the control mode and expose an authenticated per-model toggle in the WebUI and admin API.
Preserve disable evidence, renew expired 24-hour retries after inconclusive probes, and keep mode changes idempotent.
Validation: local regression checks, go vet/build, formatting and WebUI syntax passed; all five GitHub Checks passed. Test files were removed after validation.
Closes#56
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.