Skip to content

v1.5.74

Latest

Choose a tag to compare

@github-actions github-actions released this 02 Dec 20:29
· 29 commits to main since this release

Fixed

  • W-1: WorkBuddy's Sync Models no longer dead-ends. The sync path reused the generic handler, which built <BaseURL>/models out of the chat completions URL and got a 404, so the dashboard button returned nothing. WorkBuddy now serves its catalogue from the authenticated GET /v3/config upstream uses, with the full client header profile (User-Agent, X-Product, X-IDE-Type/Name/Version, X-Requested-With, X-Domain). The response is parsed in both shapes — array and object keyed by id — and media-only entries are filtered, so the offered rows are exactly what a chat request can reach. A missing credential or a rejecting upstream now surfaces as an error instead of an empty list.
  • W-3: the chat lane sends the same full client profile on every request. Previously only X-Product: SaaS was set, while the refresh path already carried User-Agent/X-Product/X-Domain; the executor's provider config now carries the same seven headers the sync uses, so the two lanes authenticate identically.

Verification

  • TestIsWorkbuddyFamily, TestParseWorkbuddyConfig_ArrayForm, TestParseWorkbuddyConfig_ObjectMapForm, TestParseWorkbuddyConfig_FiltersMediaOnly, TestFetchWorkbuddyModels_SendsClientHeaders, TestFetchWorkbuddyModels_NoTokenIsAnError, TestFetchWorkbuddyModels_UpstreamErrorSurfaces, TestFetchWorkbuddyModels_UsesLiveConfigEndpoint, TestWorkbuddyStaticHeaders_Complete were written first and failed against the unmodified tree, then passed after the fix.
  • Mutation proofs: disabling the object-map branch made TestParseWorkbuddyConfig_ObjectMapForm fail with "object-map form parsed 0 models"; changing the chat lane's X-IDE-Version made TestWorkbuddyStaticHeaders_Complete fail with the exact header diff. Restoring both returned green.
  • No static list was seeded into providers.ProviderModels: the ids come from the live authenticated catalogue, matching the provider's PassthroughModels semantics.
  • Local gates: go build ./..., go vet ./..., full go test ./... -count=1, bun test src, bun run build all PASS.

Fixed

  • W-5a: WorkBuddy Sync Models now populates Available Models. The sync path only called RetainLiveModels (which clears deprecation marks) and never created rows, so a successful sync returned synced=1 with the panel still empty — a silent dead end, because WorkBuddy is a PassthroughModels provider with no built-in list. The live roster is now upserted as custom-model rows in the exact shape the dashboard's bulk save writes, and the response reports how many were added. Providers with a curated catalog are unchanged: RetainLiveModels only, so a sync never widens a curated list.
  • W-5b: the dashboard refetches the custom-model list after a successful sync and shows "Synced N models" / the deprecation-revival message, instead of leaving the panel stale with no feedback.

Verification

  • Red-first: TestSyncWorkbuddyCreatesCustomRows failed before the upsert (added=0); TestSyncWorkbuddySecondSyncRemovesRows failed before it (rows never created). Both pass after.
  • The second test pins that a model dropping off the live roster is deprecated, not deleted.
  • Full local gates: go vet ./..., go test ./... -count=1, bun test src (926 pass), bun run build, bun run lint (0/0).

Fixed

  • WB-1/WB-2/WB-3: WorkBuddy requests now carry the Tencent gateway's full chat compliance layer, ported from OmniRoute release/v3.8.55 (pin b3a95db, open-sse/utils/workbuddyGateway.ts + providerHeaderProfiles.ts + registry/workbuddy/index.ts).
    • The chat header profile gains the required X-Agent-Intent: craft / X-Agent-Purpose: conversation / X-Agent-Type: main trio that the gateway gates every chat route on (error 11128).
    • Conversation/turn tracking headers are set: X-Conversation-Message-ID = X-Request-ID per request (32 hex), X-Conversation-Request-ID stable per unanswered turn, X-Conversation-ID stable per conversation, both salted-sha256 and never overwriting a caller-provided value.
    • The body is normalized before it leaves the gateway: max_completion_tokens folded to max_tokens, developer role folded to system, x-anthropic-billing-header: stripped, system-first injection, Gemini turn alignment (11153), tool-name/parameters fitting and tool_choice sanitization (11133), and the anti-ban string replacements that rewrite competitor client names (11128).

Verification

  • New fixture tests in internal/proxy/executor/workbuddy_gateway_test.go, red first then green: required trio + client headers, conversation headers shape/stability, probe body system-first + stream forced, turn alignment (11153), invalid tool name fitting (11133), tool_choice=none dropping tools, anti-ban replacements, billing-header strip.
  • Existing TestWorkbuddyUpstreamStreamPreservesDownstreamMode still passes (force stream unchanged).
  • Local gates: go build ./..., go vet ./..., go test ./..., bun test src (928 pass), bun run lint (0/0) all PASS.

Fixed

  • T-1: an enabled tunnel now resumes at boot. The port shipped the tunnel package, every route and a fully tested watchdog, but nothing outside the dashboard handlers ever called into internal/tunnel, so a tunnel died on every restart and the watchdog never ran. internal/app wires both into the lifecycle hook, gated on the persisted tunnelEnabled setting and carrying the stored connector/API tokens.
  • T-2: the dashboard's tunnelWatchdogEnabled and tailscaleWatchdogEnabled switches are live instead of inert. The watchdog gates read the settings row on every tick, so a toggle takes effect without a restart. Both gates fail closed: an unreadable settings row supervises neither lane rather than mutating the operator's tailnet.

Verification

  • TestStartTunnelResume_HonoursTheSetting covers all three cases: restart with the tunnel enabled resumes it, restart with it disabled leaves it down, and the resumed tunnel carries the persisted token. TestTunnelGates_ReadTheLiveSettingsRow pins the two gates' independence and their live reads; TestTunnelGates_FailClosed pins the unreadable-settings case.
  • Mutation proof: forcing the tunnelEnabled gate open made the disabled case fail with "resume ran while tunnelEnabled was false"; restoring the gate returned green.
  • Local gates: go build ./..., go vet ./..., full go test ./... -count=1, bun test src (926 pass), bun run build all PASS.

Fixed

  • T-4: the Tailscale lane now works on a machine with no system daemon. The port only drove an externally installed daemon, so a bare server or container answered "Tailscale CLI is not installed" and Funnel could never be enabled. internal/tunnel can spawn its own userspace tailscaled on a socket inside the gateway data dir, waits for it to finish starting, and passes --socket on every subsequent invocation. A healthy system daemon still short-circuits the spawn.
  • T-5: added POST /api/tunnel/tailscale-install (registered in both route tables) which installs the Tailscale CLI in place — brew on macOS, install.sh on Linux, the MSI link on Windows — streaming newline-delimited JSON progress. The dashboard's Tailscale tab replaces the raw curl | sh hint with an Install button that shows that progress and re-checks installation when it finishes.
  • T-6: a freshly started daemon is no longer probed before its BackendState is ready. The wait runs only while the state reports no answer or Starting; a logged-out daemon still reaches the interactive login instead of being mistaken for a slow one.
  • T-7: tunnelSafetyGate now covers tailscale-enable, tailscale-install and repair-origin, matching the local-only rule upstream applies to tunnel mutations. The Cloudflare enable path is unchanged.

Verification

  • TestEnsureUserspaceDaemon_UsesSocketAndUserspaceNetworking, TestUserspaceDaemonSkipsWhenSystemDaemonRuns, TestUserspaceSocketPath, TestExecWithSocket_PinsTheSocketFlagForEveryCall pin the spawn contract, the system-daemon short-circuit and the per-call --socket flag. TestWaitForDaemonState_SurvivesWarmup / TestWaitForDaemonState_FailsWhenNeverReady pin the bounded wait.
  • TestTunnelMutationsRequireSafetyGate asserts tailscale-enable and repair-origin refuse with the gate closed and never exec; TestTailscaleInstallRoute_PinsContract asserts the install route is registered and answers with a contract-fulfilling status.
  • Mutation proof: removing the tailscale-enable gate made TestTunnelMutationsRequireSafetyGate/tailscale_enable fail with "mutation executed ... while the safety gate was closed"; restoring it returned green.
  • The pre-existing TailscaleEnable_NeedsLoginIsNotAnError case now opens the gate first, since the gate is part of the contract being tested.
  • Local gates: go build ./..., go vet ./..., full go test ./... -count=1, bun run lint (0 warnings, 0 errors), bun test src (926 pass), bun run build, bun run ratchet:svelte (0 new, 63 baseline) all PASS.

Fixed

  • Round-Robin / combo fallback strategy now honors the sticky-round-robin value instead of silently ignoring it. Previously selecting "Sticky Round-Robin" left the strategy unset in the rotation switch, so connections kept DB priority order while the UI reported the strategy active. connRotationStrategy now maps sticky-round-robin onto the sticky rotation path, failover keeps priority order, and the sticky limit defaults to 3 when the operator never set one (upstream auth.js default), with an explicit saved value still winning.
  • Combo account parking removed. When a combo member hit a non-model-scoped retryable error the loop also wrote an account-wide rateLimitedUntil cooldown; with several combo members sharing one provider that parked the recovered account across subsequent requests until TTL expired, so the account never got traffic again. The combo lanes now record the failure scoped to the connection and exclude it only for the current pass; the per-model lock is kept so backoff stays honest for that model. The single-provider failover lane keeps its account-wide cooldown.
  • Session affinity eviction regression-pinned: a binding pointing at a cooling account is dropped and rotation advances, asserted at the getBestConnectionWithContext seam.

Verification

  • go vet ./..., go test ./..., bun test src, bun run build, bun run lint all pass locally.
  • Red-first: sticky-round-robin rotation test failed before the mapping (kept priority order), the account-parking test failed before the combo change (rateLimitedUntil was written), and the affinity test failed before revision.

Fixed

Issue #82: a provider that retires a model but answers HTTP 200 with a
well-formed completion (whose content is only the retirement notice) was relayed
as a successful turn — no combo fallback, quota/cost accounted for a response the
user cannot use.

EmptyUpstreamError now checks the top-level soft-retirement markers
(retired, deprecated, discontinued) on a 200 body and, when present and
not false, reports the response as a 502 UpstreamFailure. That is the same
retryable shape the fallback layer already acts on
(providers.RetryableStatusCodes), so combo routing moves to the next candidate
instead of sticking to the retired model.

Verification

  • TestEmptyUpstreamError table gained the issue #82 cases: OpenAI-shape
    retired envelope, Claude-shape deprecated envelope, and discontinued all
    fail (red before the fix), while retired: null and an unrelated
    retirement_policy_url key still pass (no false positive).
  • TestEmptyUpstreamError_LenientAboutProviderBodies still passes: a 200
    carrying a genuine answer is never converted into the 502 that ends combo
    fallback. A plain prose answer that merely mentions retirement is deliberately
    not matched — only the machine-readable envelope is.
  • go build ./..., go vet, full internal/proxy suite pass.

Fixed

  • readme-cli

Verification

  • Local full Go and web gates passed for this branch.

Fixed

  • BP-2 (antigravity caches not purged on connection delete): HandleDeleteConnection now calls ClearAntigravityQuotaCacheFor(id), which drops the target connection's cached quota map, roster, last-refresh timestamp, weekly timestamp, in-flight barrier, and all strike/strike-block entries keyed by that id. A recreated connection with the same id can no longer inherit a stale quota reading or 15m strike block. Other connections are untouched.
  • BP-3 (projectNoCache never evicted): expired entries are now deleted on load, and deleting a connection evicts its cached "no project" verdict via EvictProjectNoCache. The map no longer grows slowly across connection churn.
  • BP-4 (lifetime quota SUM per request): quotaCheck now serves a very short-TTL cached total keyed by apiKeyID plus the key's reset mark, so repeated checks inside the TTL cost one cached read instead of a history SUM. The ledger invalidates the cache after every usage insert, and a reset produces a new mark, so a fresh spend or a window reset is always observed.
  • BP-1 (stall regime not wired): call sites now resolve the provider's free regime and use the 120s free-tier stall budget instead of holding a slot for the 6-minute default.

Not changed

  • BP-4 intentionally keeps the existing covering indexes and plan-pinned tests; no covering index or plan test was altered.
  • The "running counter on ledger insert" option was not taken (owner note: hot write path).

Verification

  • Red-first: TestClearAntigravityQuotaCacheFor_PurgesOnlyTarget, TestProjectProbeCached_EvictsExpired, TestEvictProjectNoCache, TestTokenUsageCache_HitWithinTTLCountsOneQuery, TestTokenUsageCache_InvalidateAfterSpend, TestQuotaCheck_RejectsAfterSpendInvalidation, TestResolveStallTimeoutForProviderModel_FreeWiring all failed before the fix and pass after.
  • Regression the tests caught: the first cache version served a stale pre-spend total (fullstack 403 test went 200). Fixed with the ledger-insert invalidation hook.
  • Full local gates: go build ./..., go vet ./..., go test ./... -count=1, bun test src, bun run lint, bun run build all PASS.

Fixed

  • provider-contracts

Verification

  • Local full Go and web gates passed for this branch.

Fixed

  • L-1a: A passing "Test model" probe now clears the model lock and account cooldown it just proved stale. Previously the probe's success path returned early BEFORE the unlock block, so a green badge cleared nothing — the dashboard showed the model healthy while every real request was still rejected on the locked account.
  • L-1b: The verdict now surfaces lock state. locked + lockedUntil are set when another account serving the same model is still cooling; the SPA badge reads OK (another account cooling until ...). A plain green badge without that signal hid a parked account.
  • The probe fix does not regress #280 — probe writes are still gated and no usage row is recorded.

Verification

  • Red-first: TestPingConnection_ClearsLocksOnSuccess failed before the fix (probe left model locked and account cooling), then passed after the unlock block was extracted to clearLocksOnSuccess and called before the probe return.
  • Red-first: TestProbeModelForHealth_FlagsOtherParkedAccount failed before the frontend fix (verdict did not set locked), then passed after earliestModelLock was added.
  • Mutation proof: commenting out the earliestModelLock call made TestProbeModelForHealth_FlagsOtherParkedAccount fail again.
  • Full local gates: go vet ./..., go test ./... -count=1, bun test src (928 pass), bun run build, bun run lint (0/0).

Fixed

  • P-1: A model-test probe now bypasses both cache layers. A probe sends a byte-identical body every run, so with the semantic cache enabled the SECOND probe of the same model was served from cache in ~0-1ms and reported ok from the cached body; "Test all" then looked superhuman because every repeat was a hit. Two probes now reach the upstream twice, and the measured latency is real.
  • P-2: A probe that was refused before any upstream call is now reported as a note ("not tested: ..."), not painted red. A probe pinned to a disabled account, or a provider with no active connections, produced an instant error with latencyMs ~0 that read as "model dead". The pin is not redirected on purpose, so the honest answer is that nothing was asked of the model.

Verification

  • Red-first: TestProbe_SkipsExactPromptCache failed before the cache-gate change (first probe reached upstream 0 times, second would have been a HIT); TestNonProbe_StillUsesExactPromptCache pins the feature is not regressed.
  • Red-first: TestProbeModelForHealth_DisabledPinIsNotAttempted failed before the note classification (a not-attempted refusal had an empty note and a non-empty error); passed after.
  • Full local gates: go vet ./..., go test ./... -count=1, bun test src (926 pass), bun run build, bun run lint (0/0).

Fixed

  • S1 (security, MEDIUM-HIGH): tightened the OAuth redirect_uri validation. validRedirectURI previously accepted any absolute http(s) URL, so an attacker-crafted ?redirect_uri= could point the authorization code at a foreign domain. It now only honors the host the dashboard is served on or a loopback address; foreign hosts fall back to the gateway's own callback, and javascript:/data: schemes are refused outright.
  • S1: getAntigravityRedirectURI keeps its fixed loopback fallback. Deriving it from the request host would reintroduce the redirect via a spoofable Host header (the CI test TestGetAntigravityRedirectURI caught exactly this), so the fallback is a loopback constant and only an allowlisted ?redirect_uri= overrides it.
  • S1 (documented hazard): all 25 OAuth routes sit OUTSIDE the RequireDashboardSessionAuth group (router.go:537, after the authed group closes at :528). Closing the redirect_uri gap is the primary fix; the auth-boundary decision on those routes is recorded for the owner.

Verification

  • Red-first: TestAntigravityAuthorize_RejectsForeignRedirectURI failed before the fix (attacker.example honored), passes after. TestAntigravityAuthorize_RejectsDangerousSchemes (javascript:/data:), TestAntigravityAuthorize_AcceptsOwnLoopback (legitimate loopback still accepted), TestAntigravityExchange_RejectsForeignRedirectURI all pass.
  • Existing TestHandleAntigravityAuthorize (localhost:20130 loopback) unchanged and green.
  • Local gates: go build ./..., go vet ./..., go test ./internal/handlers/oauth/ + ./internal/handlers/chat/, bun test src (928 pass), bun run lint (0/0).

Fixed

  • nous-resilience

Verification

  • Local full Go and web gates passed for this branch.

Added

  • Keenable web search and web fetch provider (keenable). /v1/search with model: keenable/search calls POST https://api.keenable.ai/v1/search (max_results capped at the API's limit of 50), and /v1/web/fetch with model: keenable/fetch calls POST https://api.keenable.ai/v1/fetch and returns the page as Markdown. Requests and answers are adapted in internal/handlers/media/keenable_search.go, the same way as the AI/ML API Toolbox lane.

    Both ids are listed by /v1/models/web from the registry entry. No key is needed: with no connection the lanes use Keenable's keyless paths (/v1/search/public, /v1/fetch/public, 1,000 requests per hour per IP). A connection with an API key moves the calls to the keyed paths, which only lift the rate limit. Every request names the app with X-Keenable-Title: 9RouterX; the key is attached only when the target is exactly https://api.keenable.ai, redirects are not followed, and the caller's own headers are not relayed upstream.

    Nothing changes for existing connections: no default, combo or fallback was touched.

Verification

  • go test -count=1 -run Keenable ./internal/providers/ ./internal/handlers/media/: registry entry, keyless and keyed paths, request/response mapping for search and fetch, per-page fetch errors, exact-host check, no redirect follow, no caller-header relay, keyless 429 status, HandleSearch and HandleWebFetch dispatch with no connection, bare keenable with a stored key.
  • cd web && bun test src/lib/providers.test.ts: catalog wiring.

Changed

  • One Keenable implementation. This replaces the keenable entry from the providers batch (#39): the URL builders in internal/providers/keenable.go are removed, KnownProviders["keenable"] points at the keyed POST paths (the handler switches to /public when there is no key) and keeps X-Keenable-Title: 9RouterX in StaticHeaders, which the handler sends on every request. Fetch uses POST /v1/fetch/public with {"urls": [...]}: GET /v1/fetch and GET /v1/fetch/public are deprecated and stop working on 1 March 2027 (docs.keenable.ai/api-reference). The registry entry lists the lanes as webSearch and webFetch, so they show up under Web providers.

Fixed

  • freepi-oauth

Verification

  • Local full Go and web gates passed for this branch.

Fixed

  • F-1: FreePI device login no longer aborts at "token poll returned no access_token" while the operator is still completing GitHub login. Upstream signals PENDING with HTTP 200 and body {"status":"pending"}, which fell through to the token decoder, produced an empty AccessToken, and returned a message the retry loop in internal/handlers/oauth/device.go does not match on — so it surfaced as a hard error. The poll now decodes the status envelope (matched case-insensitively, covering pending, authorization_pending and slow_down) before the token shape and returns the authorization_pending sentinel the handler retries on. The former 202/404/429 handling is unchanged, and a 200 carrying a real access_token is never treated as pending.
  • F-2: fixture tests pin all four poll outcomes — 200 {"status":"pending"} retries, 200 with a real access_token authorises, 403 consent_required surfaces as a real error, and 400 {"code":"bad_request"} surfaces as a real error (confirmed against the live upstream probe).

Verification

  • TestFreepiPollPendingIsRetried, TestFreepiPollCaseInsensitivePending, TestFreepiPollConsentRequiredIsHardError and TestFreepiPollBadRequestIsHardError were written first and failed against the unmodified tree with exactly the reported symptom, then passed after the fix. Existing TestFreepiDeviceFlowConsentBeforePoll and TestFreepiDeviceFlowConsentFailedStops remain green.
  • Mutation proof: dropping "pending" from the envelope switch made the two pending tests fail with "want the authorization_pending sentinel"; restoring it returned green.
  • Local gates: go build ./..., go vet ./..., full go test ./... -count=1, bun test src, bun run build all PASS.

Fixed

  • FP-1: device consent is recorded ONCE in Start() immediately after the device-code request (2 attempts, ~300ms delay, 6s timeout, 4xx stops). Removed the per-poll consent POST that could 4xx into a non-pending error and surface a silent "error" state. Revised the two tests that pinned the old order.
  • FP-2: the token poll body is now {session_id, timezone, locale} (machine timezone/locale), not the consent shape.
  • FP-3: success decode accepts token || access_token so a live body carrying token is authorized instead of failing "no access_token".
  • FP-4: the pending envelope carries retry_after via a typed FreepiPendingError so the handler's poll loop can honour the upstream backoff.
  • FP-5: added internal/proxy/executor/freepi_handshake.go (launchSessionHandshake): GET /ads/next?slot=banner with the full client header set, fire the imp_url, report the impression, all bounded and fail-open, state keyed by hashed token with TTL housekeeping.
  • FP-6: non-pending/non-success poll bodies are logged for live diagnosis.

Verification

  • Red-first: TestFreepiDeviceFlowConsentFailedStops failed before the fix (Start returned a device code despite a 403 consent), then passed.
  • Revised: TestFreepiDeviceFlowConsentInStart (was ConsentBeforePoll) now pins Start=device->consent and Poll=token only.
  • Handshake unit tests: banner+imp+impression counts, header set, grace-window suppression, fail-open, TTL eviction.
  • Local gates: go build ./..., go vet ./..., go test ./... -count=1, bun test src, bun run build, bun run lint all PASS.

Fixed

  • X-1: the freepi "suggested models" lane works. The registry ships a ModelsFetcher of Type "freepi" pointing at /client-version, but HandleSuggestedModels had no case for it, so the dashboard silently got an empty list. Added a freepi filter that reads the {models:[{id,free}]} shape and keeps only free==true rows, failing soft to an empty list on a payload with no models array.
  • X-2: a freepi connection no longer stores a refresh_token it cannot use. FreePI device tokens last ~15 minutes and no refresher is registered, so a stored refresh_token made the background loop select the connection every tick and fail "no OAuth refresher for: freepi". The connection is now access-only and carries a re-login hint, so the honest state is visible instead of a per-tick error.
  • X-3 is covered by X-1: the free lane now reads the live client-version roster, so a model the service stopped serving (deepseek-v4-flash) simply stops appearing.

Verification

  • Red-first: TestSuggestedModelsFreepiFree and TestSuggestedModelsFreepiNoModelsFailsSoft failed before the filter arm ("Unknown filter type"); pass after.
  • X-2: TestFreepiDeviceFlowHandler now asserts the persisted connection has no refreshToken and carries accessTokenOnly + reloginRequired.
  • Local gates: go build ./..., go vet ./..., go test ./... -count=1, bun test src, bun run build, bun run lint all PASS.

Fixed

  • free-catalog

Verification

  • Local full Go and web gates passed for this branch.

Fixed

  • internal/handlers/chat/fallback.go: the request trace used a bare type
    assertion fwdErr.(*upstreamError), which misses a wrapped error and records
    the generic "error" instead of the provider's HTTP status. Extracted into
    chatTraceStatus using errors.As, so a wrapped *upstreamError now
    surfaces the real status on /debug/traces.
  • internal/mcpserver/mcpserver.go: the stdio stop check used err != context.Canceled, which misses a wrapped context.Canceled and logs a
    spurious warning. Extracted into isStdioCleanStop using errors.Is, and
    treats nil (clean EOF) as a clean stop.

Verification

  • TestChatTraceStatus_WrappedUpstreamError / _DirectUpstreamError /
    _ZeroStatusFallsThrough prove wrapped and unwrapped upstream errors surface
    the provider status, and a zero-status error falls back to the generic token.
  • TestIsStdioCleanStop_WrappedCanceled proves a wrapped context.Canceled is
    treated as a clean stop; _ variant covers nil / direct / real failure.
  • go build ./..., go vet, full internal/handlers/chat (114s) and
    internal/mcpserver suites pass.

Fixed

  • BP-5: documented the three undocumented operator env knobs plus four secondary ones in README ("Optional runtime environment") and wiki/operations.md ("Optional runtime environment"): SEMANTIC_CACHE_MAX_BYTES (64MiB), SEMANTIC_CACHE_MAX_ENTRY_BYTES (512KiB), STREAM_STALL_TIMEOUT_MS (360000 = 6m, with the 9ROUTERX_/NINEROUTER_ legacy spellings and the 120s free-tier budget), SEAT_ATTEMPT_BUDGET_MS (0 = policy default), plus ROUTE_HEADERS, URL, SERVICE_BACKEND.
  • BP-6: five conditional-only components in App.svelte (AddProviderFromLinkModal, ImportProviderModal, OAuthCallbackView, WebhookTargetsView, PlansView) and the two analytics sub-views (CacheAnalyticsView, CompressionAnalyticsView) are now dynamically imported, so they no longer inflate the first-load bundle.

Verification

  • No Go tests (docs only for BP-5); gate = the env table is present in both files.
  • bun run lint 0/0; bun test src 928 pass; bun run build PASS; svelte-check back at the 63-error baseline (was 67 after the first conversion pass because the analytics await blocks were missing their markup).

Fixed

  • devin-withdrawn

Verification

  • Local full Go and web gates passed for this branch.

Removed

Dead functions/types with zero callers, zero string-literal references, and no
reflection/interface reach (verified per symbol before deleting):

  • validateJSONSchema (internal/guardrails/json_schema.go) — duplicate of the
    live schemaValidate.
  • bypassResponse (internal/handlers/chat/bypass.go) — its shape was never
    used; handleBypassRequest builds its own anonymous structs.
  • visionProviders, pdfProviders, modelHasCapability
    (internal/handlers/chat/combo.go) — a hand-maintained provider list that
    drifted from the real capability source (capabilityFlag).
  • modelLockoutSkipped (internal/handlers/chat/strategy_omniroute.go) — the
    callers sweep the db lock directly; only modelLockoutRecord{Failure,Success}
    stayed in use.
  • removeEnvVar (internal/handlers/media/hermes_yaml.go).

Verification

  • go build ./..., go vet on the touched packages, and full
    internal/handlers/chat (115s), internal/guardrails,
    internal/handlers/media suites pass.
  • Deletion is behavior-neutral: all seven were unexported and unreferenced, so
    no exported surface changed.

Changed

  • A-5: TestOVHModelPacingAndOptionalAuth slept through two real 30s
    ovhModelInterval waits (60s wall clock) to assert same-model pacing. The
    pacer now reads an injectable clock (ovhNow) and sleep (ovhWait), and the
    test drives a fake clock that asserts the same-model call waits exactly one
    interval while a different model stays immediate. The internal/proxy/executor
    package dropped from 82s to 19s; the assertion is now exact (previously it
    only checked elapsed >= interval).

Verified (no code change)

  • A-4 arena: arena-ai is registered and wired (executor/init.go:299, with
    lmarena/arena resolving to it) and exported surface is intact. One gap to
    flag, not silently gloss over: the executor itself has no unit test — the only
    arena tests cover the dashboard playground (arena_test.go). Closing as wired;
    executor-level coverage remains available follow-up.
  • A-2 trae: the executor authenticates with a static JWT (Cloud-IDE-JWT, see
    traeHeaders); there is no refresh-token path in the tree at all, so the
    "drop the stored refresh_token" premise is inapplicable on this version.
    Nothing to remove.

Verification

  • Mutation-checked: reverting the pacing formula makes the new test fail.
  • go vet clean; full internal/proxy/executor suite passes in ~19s.

Audit and analytics reads now fail loudly on truncation

Fixed

  • VerifyAuditChain (internal/db/auditlog_chain.go) checks rows.Err() after the
    scan loop. A read that fails partway (cancelled context, dropped connection,
    locked page) previously ended the loop early and returned an "intact" verdict
    over only the rows seen — a truncated audit log reported as clean, defeating
    the tamper-evident chain.
  • The two BackfillCompressionAnalytics scan loops (requestDetails and
    usageHistory passes) check rows.Err(). A partial read would silently skip
    compressed rows and undercount savings. Logged, not fatal: this is a
    best-effort startup migration and must not abort schema init.
  • HandleGetBurnRate budget projection checks rows.Err() and returns a 500
    instead of under-reporting armed budgets from a partial read.
  • PersistentLRUStore.Hydrate checks rows.Err(). A truncated hydrate used to
    report success while the cache was missing entries that exist on disk,
    causing silent misses.

Verification

  • Source-guard tests (*_ChecksRowsErr) deterministically assert each loop
    checks rows.Err(), failing if a future refactor drops the check.
  • go build ./..., go vet, and the full internal/db,
    internal/handlers/dashboard, internal/semanticcache suites pass.

Fixed

  • A-1 (headroom byte-gain guard): the guard compared only the WHOLE body, so a tool-heavy request (90 KB of unchanged tool schemas plus a message list that halved) was discarded whenever the body shrank under 5%. It now commits when either the messages or the body shrank meaningfully (5% and at least 256 bytes for the message delta, so a few bytes off a tiny message is not treated as a saving), and still refuses any body that grew on the JSON round-trip.
  • A-12 (token-saver chain order comment): the comment claimed headroom "never sees the prompt this process is about to add", which is false — headroom receives the style prompts injected above it and RTK-compressed tool output. The comment now states the real order and the deliberate double-compress path; the global prefix/suffix prompt is the one headroom does not see.

Not fixed (premise refuted on verification)

  • A-11 (capacity-adapter partial-map merge): the audit claimed applyCapacityAdapters replaces the whole map on a partial write. In this tree updateSettings already merges at the raw JSON level before parseSettings runs, and parseSettings starts from DefaultSettings(), so a partial write never drops other pools. No change made; recorded as a refuted finding.

Verification

  • A-1 red-first: TestCompress_CommitsToolHeavyMessageSaving and TestCompress_RefusesGrowingBodyEvenWhenMessagesShrink; the existing phantom-savings table (including the 100→90 byte case that must stay rejected) still passes.
  • Local gates: go build ./..., go vet ./..., go test ./internal/headroom/ ./internal/handlers/chat/ ./internal/db/ -count=1 all PASS.