Commit Graph

4597 Commits

Author SHA1 Message Date
Diego Rodrigues de Sa e Souza
2b00e4e4fd refactor(compression): extract fidelity-gate step helpers to shrink strategySelector (file-size gate)
bodyToText and gateAdvance moved to fidelityGateStep.ts; StackAccumulator exported.
strategySelector: 889->854 (-35). Residual +6 vs pre-Milestone-B frozen 848 is the
irreducible StackOptions.fidelityGate field + two stacked-loop dispatch reads + import.
Baseline updated to 854 with justification. No cycle introduced (import type only).
940 compression tests pass; typecheck clean.
2026-06-27 02:56:06 -03:00
Diego Rodrigues de Sa e Souza
fc41228a8f docs(compression): note fidelityGate advanced thresholds are intentionally API-omitted 2026-06-27 02:56:06 -03:00
Diego Rodrigues de Sa e Souza
ce802fa296 feat(compression): playground fidelity-gate toggle + lane rejection display 2026-06-27 02:56:06 -03:00
Diego Rodrigues de Sa e Souza
8df1aff301 feat(compression): preview route accepts fidelityGate flag (playground) 2026-06-27 02:56:06 -03:00
Diego Rodrigues de Sa e Souza
d9d8cfa777 feat(compression): wire per-step fidelity gate into stacked pipeline (opt-in) 2026-06-27 02:56:06 -03:00
Diego Rodrigues de Sa e Souza
bccdfac449 feat(compression): fidelityGate config + rejected breakdown fields 2026-06-27 02:56:06 -03:00
Diego Rodrigues de Sa e Souza
5dacaa7f4d feat(compression): pure per-step fidelity checker (4 invariants, fail-open) 2026-06-27 02:56:06 -03:00
Diego Rodrigues de Sa e Souza
1f83bde19e docs(i18n): sync 3.8.38 CHANGELOG section to 41 mirrors (unblock docs-accuracy) (#5144)
The root CHANGELOG [3.8.38] section grew with this cycle's merged PRs, but the
docs/i18n/<lang>/CHANGELOG.md mirrors were not re-synced — drifting >25% in body
size and failing check:docs-sync (the "Docs accuracy" fast-gate step) for every
open PR against the release.

Ran scripts/release/sync-changelog-i18n.mjs 3.8.38 3.8.37 to copy the root
[3.8.38] section into all 41 mirrors. check:docs-all now passes (exit 0).

Sections are copied verbatim; the per-language translation pass runs at release
time via i18n:run — this only restores the size-sync the gate enforces.
2026-06-27 02:47:12 -03:00
Diego Rodrigues de Sa e Souza
5b8bd727f0 feat: salvage batch 2 — diagnostics null-guard (#5096) + observed quota reset windows (#5025) (#5141)
* fix(diagnostics): null-guard content blocks in detectMalformedNonStream

A null (or non-object) entry in a Claude-native `content` array made the
non-stream classifier throw `TypeError: Cannot read properties of null
(reading 'type')`, crashing the malformed-response detection path. Guard
before type-asserting each block: a null/non-object block is simply skipped.

Two regression tests added (null block among valid blocks → null; only-null
blocks → empty_choices).

Salvaged from closed PR #5096 (base-stale; only the defensive guard — the
Claude-shape recognition it also carried already landed via #5108).

Co-authored-by: herjarsa <herjarsa@users.noreply.github.com>

* feat(quota): persist observed provider quota reset windows

Adds `provider_quota_reset_events` (migration 108) + `db/quotaResetEvents.ts`
to record real upstream weekly-quota window transitions whenever a quota
refresh shows the reset rolling to a new cycle (different day, later resetAt).
`apiKeyUsageLimits` now prefers the observed window start over the inferred
`resetAt − 7d`, falling back to snapshot inference when no event is recorded
yet. `quotaCache.setQuotaCache` records the transition opportunistically.

`recordProviderQuotaResetEventIfChanged` only fires for the primary weekly
window (not daily/sonnet), is idempotent (INSERT OR IGNORE on the unique
window key), and no-ops when the reset didn't actually roll. 4 unit tests
(tests/unit/lib/quota-reset-events.test.ts).

Salvaged from closed PR #5025 (which bundled this with two unrelated
features + a colliding migration 104). Renumbered to 108; module re-exported
from localDb (Rule #2).

Co-authored-by: Witroch4 <175152067+Witroch4@users.noreply.github.com>

---------

Co-authored-by: herjarsa <herjarsa@users.noreply.github.com>
Co-authored-by: Witroch4 <175152067+Witroch4@users.noreply.github.com>
2026-06-27 02:39:28 -03:00
Diego Rodrigues de Sa e Souza
1b446cc92d fix(sidebar): drop orphan settings accent color (typecheck:core red) (#5142)
SIDEBAR_ICON_ACCENTS is typed Partial<Record<HideableSidebarItemId, string>>,
but `settings` is not a hideable item id (only `settings-general`,
`settings-appearance`, … and `context-settings` exist; there is no item with
`id: "settings"`), so the accent was unreachable. It broke `typecheck:core`
on the release tip ("'settings' does not exist in type …", introduced by
#3812 colored menu icons). Removing the orphan key restores a clean
typecheck:core (rc=0).
2026-06-27 02:38:29 -03:00
diegosouzapw
9fc84f4ea1 fix(kiro): retire claude-sonnet-4.5 from catalog + pin 400 model-unavailable test (#5140)
Extracted the real change from #5140 (the bot PR regenerated the entire
freeModelCatalog.data.ts + touched package-lock.json; only the targeted
edits are kept here):
- remove claude-sonnet-4.5 from the Kiro registry entry
- remove the matching kiro free-model catalog row
- pin Kiro's verbatim 400 "Invalid model..." to isModelUnavailableError

Closes #4484
2026-06-27 02:33:36 -03:00
Randi
50e6621101 Fix resilience settings page response mapping (#5139)
Integrated into release/v3.8.38. Thanks @rdself for the fix and the regression test.
2026-06-27 02:22:45 -03:00
Diego Rodrigues de Sa e Souza
3654ae50b3 fix(providers): complete grok-cli OAuth wiring + zenmux-free web-session metadata
Base-red repair for #5020 (grok-cli) and #5105 (zenmux-free), surfaced by the
full CI on the release PR (#5078) — the PR->release fast-path does not run the
oauth-providers-config / web-session-credentials / provider-consistency gates.

- grok-cli: register in OAUTH_PROVIDERS (providers.ts canonical list, fixes
  check:provider-consistency), add OAUTH_PROVIDER_IDS.GROK_CLI + GROK_CLI_CONFIG
  in oauth constants (provider config now sourced there, not a local literal),
  align oauth-providers-config.test.ts (EXPECTED_PROVIDER_KEYS + config map).
- zenmux-free: declare its web-session credential requirement (full Cookie header)
  in WEB_SESSION_CREDENTIAL_REQUIREMENTS.

Local: oauth-providers-config 27/27, web-session-credentials 4/4, grok-cli-oauth
7/7, check:provider-consistency OK, +115 OAUTH_PROVIDERS tests green.
2026-06-27 01:29:15 -03:00
Ramel Tecnologia - Rafa Martins
58d1311454 feat(sidebar): add support for colored menu icons (#3812)
Integrated into release/v3.8.38 (recreated on tip — fork had unrelated history; added getSidebarIconAccent regression test, Rule #18). Clean 2-file UI feature.
2026-06-27 01:22:22 -03:00
Diego Rodrigues de Sa e Souza
1677ef55e1 fix(proxy): make SOCKS5 handshake timeout tunable via SOCKS_HANDSHAKE_TIMEOUT_MS (#5109) (#5137) 2026-06-27 01:14:38 -03:00
Diego Rodrigues de Sa e Souza
7b718134e0 fix(providers): add MiniMax M3 & Nemotron 3 Ultra to Cline catalog (#3321) (#5136) 2026-06-27 01:13:11 -03:00
Diego Rodrigues de Sa e Souza
454eb75b31 fix(api): resolve /v1/models/{id} case-insensitively (#5082) (#5135) 2026-06-27 01:12:17 -03:00
Diego Rodrigues de Sa e Souza
c4fc33480c fix(services): embed WS proxy honours LIVE_WS_HOST; reject empty messages early (#5110) (#5133) 2026-06-27 00:14:58 -03:00
Diego Rodrigues de Sa e Souza
b8cc4feef1 fix(proxy): repair one-click Deno & Cloudflare relay deployments (#5128) (#5132) 2026-06-27 00:13:55 -03:00
Diego Rodrigues de Sa e Souza
86b8938e2c fix(security): exact-host Anthropic baseUrl check (CodeQL js/incomplete-url-substring-sanitization #674) (#5130)
The anthropic-compatible Bearer-fallback gate decided whether a configured baseUrl
targeted the official api.anthropic.com host via a substring `.includes("api.anthropic.com")`.
A look-alike upstream such as `https://api.anthropic.com.evil.test` or
`https://evil.test/?x=api.anthropic.com` matched the substring and was wrongly treated as
official, suppressing the Bearer fallback meant for third-party gateways
(CodeQL #674, js/incomplete-url-substring-sanitization, high).

Replace the substring test with an exported `isOfficialAnthropicBaseUrl()` helper that
parses the URL and compares the hostname for exact equality. Empty baseUrl stays official;
scheme-less hosts are parsed with an assumed https://; an unparseable baseUrl falls back to
third-party (Bearer emitted) as the safer default. Behavior for legitimate official/third-party
baseUrls is unchanged.

Adds tests/unit/anthropic-official-baseurl-host.test.ts covering official, look-alike,
scheme-less, and unparseable inputs plus a static guard that the substring pattern is gone.
2026-06-26 23:14:17 -03:00
Diego Rodrigues de Sa e Souza
5eaf230da9 chore(quality): reconcile complexity + file-size baselines for v3.8.38 owner-PR batch
complexity 1972->1978 (+6) and file-size providers.ts 1093->1107 / usageHistory.ts
934->983 — drift from the /review-prs merge batch (#4845/#5105/#5020/#4940/#5093/
#5015 + #5121 cookie-dedup helper extraction). check:complexity/check:file-size do
not run on the PR->release fast-path, so the branch accrued unmeasured; all legit
feature/fix growth, not regression. See per-key justifications in each baseline.
2026-06-26 22:55:40 -03:00
Jan Leon
c0830c95ab Hydrate quota cache and scope auto combo candidates (#5015)
Integrated into release/v3.8.38 (rebased on tip). Kept core quota-cache hydration + auto-combo candidate scoping + combos UI; dropped out-of-scope toolCloaking refactor (conflicted with #4813 stripEnumDescriptions — took tip) and the unrelated sse-auth test split. Added quota-cache-hydrate-5015 regression test (Rule #18); combo-account-allowlist 8/8 + hydration 2/2 green.
2026-06-26 22:51:25 -03:00
KooshaPari
09ac615894 fix(resilience): harden quota and model lockout edge cases (#5093)
Integrated into release/v3.8.38 (rebased on tip). TRUST-BUT-VERIFY: dropped the PR's 0dd7df641 'fix unit gates' commit which reverted #5122 reasoning-replay (preserveReasoningContent) + re-introduced #4849 O(n^2) growth, and restored 5 tests it had realigned. Kept only the 3 declared resilience fixes (quota cutoff guard, gemini MIME, model-lockout maxCooldownMs); 23/23 green.
2026-06-26 22:46:19 -03:00
Diego Rodrigues de Sa e Souza
9fd630c34b chore(test): reconcile golden snapshot + apikey count for new providers
#5020 (grok-cli), #5065 (factory), #5105 (zenmux-free) added providers but did
not regenerate tests/snapshots/provider/translate-path.json (now +3 entries) nor
bump the APIKEY_PROVIDERS count (159->160 for the factory gateway). Test-only
reconciliation; no production change.
2026-06-26 22:44:43 -03:00
KooshaPari
004c0c4fd1 feat(providers): add Factory (factory.ai) as a subscription gateway provider (#5065)
Integrated into release/v3.8.38 (rebased on tip; added factory registry test for PR Test Policy + fixed check:env-doc-sync phantom FACTORY_API_KEY; factory loads in PROVIDERS, no Zod issue — that flag was a false positive)
2026-06-26 22:36:03 -03:00
fulorgnas
2eefe2f76d feat: Add Grok Build (xAI) provider with OAuth import-token flow (#5020)
Integrated into release/v3.8.38 (rebased on tip; Hard Rule #11 fix — Grok public client_id now via resolvePublicCred(grok_id), 3 literals removed; grok-oauth 7/7 + check:public-creds green)
2026-06-26 22:31:40 -03:00
Randi
9e2c2817da fix(streaming): harden long OpenAI-compatible SSE streams (#5124)
Integrated into release/v3.8.38 (rebased on tip; streamHandler conflict with #5007 disconnect-guard resolved — both coexist, stream-handler 22/22 green)
2026-06-26 22:27:11 -03:00
dependabot[bot]
843680f6ca chore(deps): bump actions/cache from 5.0.5 to 6.0.0 (#5112)
Integrated into release/v3.8.38 (retargeted main→release; workflow-only actions/cache bump — unit failures were stale main base-reds)
2026-06-26 22:24:23 -03:00
R. Beltran
5f9bf378e7 fix(dashboard): key model visibility toggle on canonical providerId (#5091)
Integrated into release/v3.8.38 (retargeted main→release; .tsx visibility-key test green 2/2)
2026-06-26 22:24:16 -03:00
Diego Rodrigues de Sa e Souza
4bdbaa0062 fix(usage): dedupe request-usage logging and debounce stats (#4940)
Integrated into release/v3.8.38 (rebased on tip; DB-handle hang was stale-base artifact — resetDbInstance already closes the handle, test green 5/5; file-size drift consolidated at release; CHANGELOG re-injected)
2026-06-26 22:22:00 -03:00
Diego Rodrigues de Sa e Souza
57bed419c4 feat(mcp): web-session robustness — cookie dedup (PR6) + browser-pool observability (PR7) (#3368) (#5121)
Integrated into release/v3.8.38 (rebased on tip; cookie-dedup branch extracted to findExistingCookieConnection helper → complexity-neutral; CHANGELOG added)
2026-06-26 22:20:09 -03:00
Diego Rodrigues de Sa e Souza
594aa94945 feat(dashboard): click-to-edit model alias in provider page (#5119)
Integrated into release/v3.8.38 (rebased on tip, i18n scope verified, CHANGELOG re-injected)
2026-06-26 22:09:29 -03:00
Diego Rodrigues de Sa e Souza
c9fe0fb7a1 feat(providers): add ZenMux Free session-cookie provider (#5105)
Integrated into release/v3.8.38 (rebased on tip, CHANGELOG re-injected)
2026-06-26 22:08:28 -03:00
Diego Rodrigues de Sa e Souza
2b0e1dfd94 fix(sse): convert Gemini body to OpenAI format in antigravity MITM handler (#4845)
Integrated into release/v3.8.38 (rebased on tip, CHANGELOG re-injected)
2026-06-26 22:07:04 -03:00
Jan Leon
25b65ac34a Track final connection IDs in failover logs (#5016)
Integrated into release/v3.8.38
2026-06-26 22:04:39 -03:00
Jan Leon
b8070ed3a8 Ignore disconnect races during in-band stream error handling (#5007)
Integrated into release/v3.8.38
2026-06-26 22:04:33 -03:00
Diego Rodrigues de Sa e Souza
d6f402e0ad test(golden): redact OmniRoute app version from translate-path snapshot (#5126)
Coverage shard golden unblock for #5078.
2026-06-26 20:31:41 -03:00
Diego Rodrigues de Sa e Souza
fe8f1dac0f test(golden): redact live Node version from provider translate-path snapshot (#5125)
Final golden unblock for #5078.
2026-06-26 20:02:33 -03:00
Diego Rodrigues de Sa e Souza
58d942829f fix(translator): preserve reasoning-replay reasoning_content + repair 3 release-green test reds (#5122)
Repairs 3 release-green test reds + test-masking; unblocks #5078.
2026-06-26 19:12:46 -03:00
Diego Rodrigues de Sa e Souza
05071c011c test(release): relocate 2 orphan test files into the collected flat tests/unit dir (#5120)
Unblocks Lint (test-discovery) on #5078. Integrated into release/v3.8.38.
2026-06-26 17:26:40 -03:00
Diego Rodrigues de Sa e Souza
d1a3aa8909 feat(quota): add opt-in Codex/Claude auto-ping keepalive (#5102)
Base-reds fixed (#5117); auto-ping keepalive + file-size rebaseline. Integrated into release/v3.8.38.
2026-06-26 17:20:26 -03:00
Diego Rodrigues de Sa e Souza
68aeb89327 feat(dashboard): expose Fusion judgeModel + fusionTuning in the combo editor (#5074)
Base-reds fixed (#5117); Fusion editor + file-size rebaseline. Integrated into release/v3.8.38.
2026-06-26 17:15:38 -03:00
Diego Rodrigues de Sa e Souza
cfaba4410f fix(responses): default text.format for openai-compatible responses providers (#5101)
Base-reds fixed (#5117); default text.format + file-size rebaseline. Integrated into release/v3.8.38.
2026-06-26 17:13:19 -03:00
Diego Rodrigues de Sa e Souza
135b5daaa5 fix(translator): forward image tool_result blocks as image_url (#5100)
Base-reds fixed (#5117); image tool_result→image_url. Integrated into release/v3.8.38.
2026-06-26 17:11:15 -03:00
Diego Rodrigues de Sa e Souza
2b55659481 chore(quality): rebaseline file-size for responseSanitizer (#5117) + AddApiKeyModal drift 2026-06-26 16:47:07 -03:00
Diego Rodrigues de Sa e Souza
800b04ad6d fix(sse): repair release base-reds — malformed-response false positives + header casing + stale tests (#5117)
Repairs the release/v3.8.38 base-reds; unblocks #5078.
2026-06-26 16:30:51 -03:00
Diego Rodrigues de Sa e Souza
d486ed1643 fix(db): translate pt-BR SQLite driver-fallback log lines to English (#5103) (#5115) 2026-06-26 16:15:13 -03:00
Diego Rodrigues de Sa e Souza
db68c9b790 fix(diagnostics): treat non-streaming Claude messages shape as valid output (#5108) (#5116) 2026-06-26 16:14:14 -03:00
Diego Rodrigues de Sa e Souza
11cb8f0976 feat(providers): allow local/private provider URLs by default with scoped metadata-safe guard (#5066) (#5107) 2026-06-26 14:10:09 -03:00
Diego Rodrigues de Sa e Souza
cc6741dd8c fix(dashboard): surface detailed credential-validation error in add-connection modal (#5088) (#5106) 2026-06-26 14:09:41 -03:00