Repository navigation
Fixed
- W-1: WorkBuddy's Sync Models no longer dead-ends. The sync path reused the generic handler, which built
<BaseURL>/modelsout of the chat completions URL and got a 404, so the dashboard button returned nothing. WorkBuddy now serves its catalogue from the authenticatedGET /v3/configupstream 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: SaaSwas 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_Completewere written first and failed against the unmodified tree, then passed after the fix.- Mutation proofs: disabling the object-map branch made
TestParseWorkbuddyConfig_ObjectMapFormfail with "object-map form parsed 0 models"; changing the chat lane's X-IDE-Version madeTestWorkbuddyStaticHeaders_Completefail 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 ./..., fullgo test ./... -count=1,bun test src,bun run buildall 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: maintrio that the gateway gates every chat route on (error 11128). - Conversation/turn tracking headers are set:
X-Conversation-Message-ID=X-Request-IDper request (32 hex),X-Conversation-Request-IDstable per unanswered turn,X-Conversation-IDstable per conversation, both salted-sha256 and never overwriting a caller-provided value. - The body is normalized before it leaves the gateway:
max_completion_tokensfolded tomax_tokens,developerrole folded tosystem,x-anthropic-billing-header:stripped, system-first injection, Gemini turn alignment (11153), tool-name/parameters fitting andtool_choicesanitization (11133), and the anti-ban string replacements that rewrite competitor client names (11128).
- The chat header profile gains the required
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/appwires both into the lifecycle hook, gated on the persistedtunnelEnabledsetting and carrying the stored connector/API tokens. - T-2: the dashboard's
tunnelWatchdogEnabledandtailscaleWatchdogEnabledswitches 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_HonoursTheSettingcovers 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_ReadTheLiveSettingsRowpins the two gates' independence and their live reads;TestTunnelGates_FailClosedpins the unreadable-settings case.- Mutation proof: forcing the
tunnelEnabledgate open made the disabled case fail with "resume ran while tunnelEnabled was false"; restoring the gate returned green. - Local gates:
go build ./...,go vet ./..., fullgo test ./... -count=1,bun test src(926 pass),bun run buildall 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/tunnelcan spawn its own userspacetailscaledon a socket inside the gateway data dir, waits for it to finish starting, and passes--socketon 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 rawcurl | shhint 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
BackendStateis ready. The wait runs only while the state reports no answer orStarting; a logged-out daemon still reaches the interactive login instead of being mistaken for a slow one. - T-7:
tunnelSafetyGatenow 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_PinsTheSocketFlagForEveryCallpin the spawn contract, the system-daemon short-circuit and the per-call--socketflag.TestWaitForDaemonState_SurvivesWarmup/TestWaitForDaemonState_FailsWhenNeverReadypin the bounded wait.TestTunnelMutationsRequireSafetyGateasserts tailscale-enable and repair-origin refuse with the gate closed and never exec;TestTailscaleInstallRoute_PinsContractasserts the install route is registered and answers with a contract-fulfilling status.- Mutation proof: removing the tailscale-enable gate made
TestTunnelMutationsRequireSafetyGate/tailscale_enablefail with "mutation executed ... while the safety gate was closed"; restoring it returned green. - The pre-existing
TailscaleEnable_NeedsLoginIsNotAnErrorcase now opens the gate first, since the gate is part of the contract being tested. - Local gates:
go build ./...,go vet ./..., fullgo 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.
connRotationStrategynow maps sticky-round-robin onto the sticky rotation path,failoverkeeps 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
TestEmptyUpstreamErrortable gained the issue #82 cases: OpenAI-shape
retiredenvelope, Claude-shapedeprecatedenvelope, anddiscontinuedall
fail (red before the fix), whileretired: nulland an unrelated
retirement_policy_urlkey still pass (no false positive).TestEmptyUpstreamError_LenientAboutProviderBodiesstill 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, fullinternal/proxysuite 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+lockedUntilare set when another account serving the same model is still cooling; the SPA badge readsOK (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_ClearsLocksOnSuccessfailed before the fix (probe left model locked and account cooling), then passed after the unlock block was extracted toclearLocksOnSuccessand called before the probe return. - Red-first:
TestProbeModelForHealth_FlagsOtherParkedAccountfailed before the frontend fix (verdict did not setlocked), then passed afterearliestModelLockwas added. - Mutation proof: commenting out the
earliestModelLockcall madeTestProbeModelForHealth_FlagsOtherParkedAccountfail 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/searchwithmodel: keenable/searchcallsPOST https://api.keenable.ai/v1/search(max_resultscapped at the API's limit of 50), and/v1/web/fetchwithmodel: keenable/fetchcallsPOST https://api.keenable.ai/v1/fetchand returns the page as Markdown. Requests and answers are adapted ininternal/handlers/media/keenable_search.go, the same way as the AI/ML API Toolbox lane.Both ids are listed by
/v1/models/webfrom 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 withX-Keenable-Title: 9RouterX; the key is attached only when the target is exactlyhttps://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,HandleSearchandHandleWebFetchdispatch with no connection, barekeenablewith a stored key.cd web && bun test src/lib/providers.test.ts: catalog wiring.
Changed
- One Keenable implementation. This replaces the
keenableentry from the providers batch (#39): the URL builders ininternal/providers/keenable.goare removed,KnownProviders["keenable"]points at the keyedPOSTpaths (the handler switches to/publicwhen there is no key) and keepsX-Keenable-Title: 9RouterXinStaticHeaders, which the handler sends on every request. Fetch usesPOST /v1/fetch/publicwith{"urls": [...]}:GET /v1/fetchandGET /v1/fetch/publicare deprecated and stop working on 1 March 2027 (docs.keenable.ai/api-reference). The registry entry lists the lanes aswebSearchandwebFetch, 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 ininternal/handlers/oauth/device.godoes not match on — so it surfaced as a hard error. The poll now decodes the status envelope (matched case-insensitively, coveringpending,authorization_pendingandslow_down) before the token shape and returns theauthorization_pendingsentinel 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, 403consent_requiredsurfaces as a real error, and 400{"code":"bad_request"}surfaces as a real error (confirmed against the live upstream probe).
Verification
TestFreepiPollPendingIsRetried,TestFreepiPollCaseInsensitivePending,TestFreepiPollConsentRequiredIsHardErrorandTestFreepiPollBadRequestIsHardErrorwere written first and failed against the unmodified tree with exactly the reported symptom, then passed after the fix. ExistingTestFreepiDeviceFlowConsentBeforePollandTestFreepiDeviceFlowConsentFailedStopsremain 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 ./..., fullgo test ./... -count=1,bun test src,bun run buildall 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_tokenso a live body carryingtokenis authorized instead of failing "no access_token". - FP-4: the pending envelope carries
retry_aftervia 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
freepifilter 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
assertionfwdErr.(*upstreamError), which misses a wrapped error and records
the generic "error" instead of the provider's HTTP status. Extracted into
chatTraceStatususingerrors.As, so a wrapped*upstreamErrornow
surfaces the real status on/debug/traces.internal/mcpserver/mcpserver.go: the stdio stop check usederr != context.Canceled, which misses a wrappedcontext.Canceledand logs a
spurious warning. Extracted intoisStdioCleanStopusingerrors.Is, and
treats nil (clean EOF) as a clean stop.
Verification
TestChatTraceStatus_WrappedUpstreamError/_DirectUpstreamError/
_ZeroStatusFallsThroughprove wrapped and unwrapped upstream errors surface
the provider status, and a zero-status error falls back to the generic token.TestIsStdioCleanStop_WrappedCanceledproves a wrappedcontext.Canceledis
treated as a clean stop;_variant covers nil / direct / real failure.go build ./...,go vet, fullinternal/handlers/chat(114s) and
internal/mcpserversuites 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
liveschemaValidate.bypassResponse(internal/handlers/chat/bypass.go) — its shape was never
used;handleBypassRequestbuilds 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; onlymodelLockoutRecord{Failure,Success}
stayed in use.removeEnvVar(internal/handlers/media/hermes_yaml.go).
Verification
go build ./...,go veton the touched packages, and full
internal/handlers/chat(115s),internal/guardrails,
internal/handlers/mediasuites pass.- Deletion is behavior-neutral: all seven were unexported and unreferenced, so
no exported surface changed.
Changed
- A-5:
TestOVHModelPacingAndOptionalAuthslept through two real 30s
ovhModelIntervalwaits (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. Theinternal/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-aiis registered and wired (executor/init.go:299, with
lmarena/arenaresolving 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 vetclean; fullinternal/proxy/executorsuite passes in ~19s.
Audit and analytics reads now fail loudly on truncation
Fixed
VerifyAuditChain(internal/db/auditlog_chain.go) checksrows.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
BackfillCompressionAnalyticsscan loops (requestDetails and
usageHistory passes) checkrows.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. HandleGetBurnRatebudget projection checksrows.Err()and returns a 500
instead of under-reporting armed budgets from a partial read.PersistentLRUStore.Hydratechecksrows.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
checksrows.Err(), failing if a future refactor drops the check. go build ./...,go vet, and the fullinternal/db,
internal/handlers/dashboard,internal/semanticcachesuites 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
applyCapacityAdaptersreplaces the whole map on a partial write. In this treeupdateSettingsalready merges at the raw JSON level beforeparseSettingsruns, andparseSettingsstarts fromDefaultSettings(), so a partial write never drops other pools. No change made; recorded as a refuted finding.
Verification
- A-1 red-first:
TestCompress_CommitsToolHeavyMessageSavingandTestCompress_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=1all PASS.