Compare commits

..

819 Commits

Author SHA1 Message Date
Diego Rodrigues de Sa e Souza
5ffa68e835 Merge pull request #20961 from cheaper-inference/fix/restore-preferred-failover-wiring-v3855
fix(sse): restore the preferred-account failover wiring in chat.ts
2026-11-21 15:41:05 -03:00
Diego Rodrigues de Sa e Souza
65ff1f9494 Merge pull request #20370 from maxmad64bis/fix/plugin-model-row-fidelity
fix(plugin): publish honest model limits and a single free marker
2026-11-21 15:25:16 -03:00
Diego Rodrigues de Sa e Souza
5b6c0af52d Merge pull request #20958 from cheaper-inference/fix/merge-train-h-20261121
chore(release): contributor train h of 5 PRs for v3.8.55 (2026-11-21)
2026-11-21 14:50:16 -03:00
diegosouzapw
3ab4719c07 Merge branch 'release/v3.8.55' into fix/plugin-model-row-fidelity
# Conflicts:
#	@omniroute/opencode-plugin-v2/README.md
2026-11-21 14:17:33 -03:00
Diego Rodrigues de Sa e Souza
4265bb2ad5 Merge pull request #20947 from cheaper-inference/fix/merge-train-g-20261121
chore(release): contributor train g of 15 PRs for v3.8.55 (2026-11-21)
2026-11-21 14:10:26 -03:00
diegosouzapw
7b7b61c6e7 chore(changelog): name the fragment after #20961 2026-11-21 14:08:38 -03:00
diegosouzapw
a86811d79e Merge branch 'release/v3.8.55' into fix/restore-preferred-failover-wiring-v3855 2026-11-21 14:08:03 -03:00
Diego Rodrigues de Sa e Souza
934d6afee6 Merge pull request #20108 from b84330808/fix/usage-guard-once-per-request
fix(sse): compute the usage guard's request numbers once per stream
2026-11-21 14:02:29 -03:00
diegosouzapw
7477ae6c6b fix(sse): restore the preferred-account failover wiring in chat.ts
The preferred-account response-start failover from #19259 stopped working
in the v3.8.55 cycle. The contributor-train merge 60383f4fa5 ("Merge #19592
(head fc4b408e) into contributor train e1b") applied #19592 from a stale
branch whose diff deleted the wiring in src/sse/handlers/chat.ts. The
helper (src/sse/services/preferredConnectionFailover.ts), the Resilience
settings and the dashboard card stayed in place, so the toggle still showed
but no chat request ever used it. The existing tests only cover the helper,
so nothing failed.

Restore the wiring exactly as it was before the train (a78e2a87): resolve
preferredAccountFailover from the cached runtime settings, compute the
preferred deadline before dispatch (still disabled for pinned connections,
managed leases, Muse callers, combos and after the one hop), pass it as
requestUpstreamStartTimeoutMs, make one sibling hop on
REQUEST_SCOPED_UPSTREAM_TIMEOUT, and surface the original timeout when no
sibling is left. The #19592 additions (selectedConnectionPlan,
getCodexPlanType) stay.

Add tests/unit/chat-preferred-account-failover-wiring.test.ts, which drives
handleChat(): with the setting on, a slow preferred account hops once to the
sibling without cooling either account; with it off, the preferred account
serves the request. The enabled case fails on the current base and passes
with this change.
2026-11-21 14:01:58 -03:00
Diego Rodrigues de Sa e Souza
eaf57c1cc1 Merge pull request #19735 from serenity-X/pr/perf/or9r-b-call-log-overflow-index
perf(call-logs): add an ordered partial index for overflow cleanup
2026-11-21 13:53:21 -03:00
Diego Rodrigues de Sa e Souza
a67b47475f Merge pull request #20937 from cheaper-inference/fix/merge-train-kea-qa-20261121
chore(release): dashboard QA train of 6 PRs for v3.8.55 (2026-11-21)
2026-11-21 13:45:45 -03:00
diegosouzapw
d00a056f62 Merge #20546 (head c85000a6) into contributor train h 2026-11-21 13:06:26 -03:00
diegosouzapw
e5e71ddb7c Merge #20598 (head 8afef56d) into contributor train h 2026-11-21 13:06:19 -03:00
diegosouzapw
3abf86af4c Merge #20243 (head eadb47a9) into contributor train h 2026-11-21 13:06:12 -03:00
diegosouzapw
75f9470a57 Merge #19755 (head f5b08ffd) into contributor train h 2026-11-21 13:06:07 -03:00
diegosouzapw
6bb61bfb6e Merge #19542 (head 81a5a241) into contributor train h 2026-11-21 13:06:03 -03:00
Diego Rodrigues de Sa e Souza
ed6619fbba Merge pull request #20904 from cheaper-inference/fix/merge-train-f-20261121
chore(release): contributor train f of 43 PRs for v3.8.55 (2026-11-21)
2026-11-21 12:57:38 -03:00
diegosouzapw
cf32a07f93 Merge branch 'release/v3.8.55' into pr/perf/or9r-b-call-log-overflow-index
# Conflicts:
#	src/lib/db/migrationRunner/constants.ts
2026-11-21 12:42:51 -03:00
diegosouzapw
3472e0a192 Merge branch 'release/v3.8.55' into fix/usage-guard-once-per-request
# Conflicts:
#	open-sse/utils/usageTracking.ts
2026-11-21 12:30:05 -03:00
Diego Rodrigues de Sa e Souza
eaae2e9dc9 Merge pull request #20892 from cheaper-inference/fix/salvage-20225-v3855
fix: salvage the opt-in parts of #20225
2026-11-21 12:28:15 -03:00
Diego Rodrigues de Sa e Souza
43a3fe5812 Merge pull request #20899 from cheaper-inference/fix/salvage-20231-v3855
fix: salvage five independent fixes from #20231
2026-11-21 12:27:56 -03:00
diegosouzapw
fe095c0340 Merge #20679 (head 338fb20d) into contributor train g 2026-11-21 12:18:34 -03:00
diegosouzapw
a77c3573cd Merge #20658 (head 57228db5) into contributor train g 2026-11-21 12:18:32 -03:00
diegosouzapw
1504596191 Merge #20586 (head e17c636e) into contributor train g 2026-11-21 12:18:30 -03:00
diegosouzapw
106bc2758e Merge #20340 (head b35e5d7e) into contributor train g 2026-11-21 12:18:28 -03:00
diegosouzapw
d92a67df7c Merge #20331 (head e507625c) into contributor train g 2026-11-21 12:18:25 -03:00
diegosouzapw
823b761683 Merge #20178 (head ca94adaa) into contributor train g 2026-11-21 12:18:22 -03:00
diegosouzapw
fc137543de Merge #19754 (head 5db98666) into contributor train g 2026-11-21 12:18:19 -03:00
diegosouzapw
8b3c5fea71 Merge #19745 (head d97d07eb) into contributor train g 2026-11-21 12:18:17 -03:00
diegosouzapw
49a8483a7c Merge #19628 (head f47c461a) into contributor train g 2026-11-21 12:18:12 -03:00
diegosouzapw
2ca5a7f0bb Merge #19403 (head b8705ef2) into contributor train g 2026-11-21 12:18:10 -03:00
diegosouzapw
f768febcdf Merge #18804 (head a140f9b7) into contributor train g 2026-11-21 12:18:09 -03:00
diegosouzapw
2a6e168ed8 Merge #20289 (head 4728bd28) into contributor train g 2026-11-21 12:18:07 -03:00
diegosouzapw
077f608e41 Merge #20217 (head d6c80663) into contributor train g 2026-11-21 12:18:05 -03:00
diegosouzapw
70b9bb3748 Merge #20176 (head c97cd688) into contributor train g 2026-11-21 12:18:03 -03:00
diegosouzapw
9f9fa52c07 Merge #19808 (head 1f958366) into contributor train g 2026-11-21 12:18:01 -03:00
Diego Rodrigues de Sa e Souza
b9c1bf0365 Merge pull request #20111 from RayJW/feat/mistral-prompt-caching
feat(sse): enable Mistral prompt caching on Chat and Responses paths
2026-11-21 12:10:57 -03:00
diegosouzapw
0a1a86f05e Merge branch 'release/v3.8.55' into fix/merge-train-kea-qa-20261121 2026-11-21 12:10:14 -03:00
Diego Rodrigues de Sa e Souza
47a8b2590f Merge pull request #20900 from cheaper-inference/fix/salvage-20604-v3855
fix(cli): add --p2c-latency-weight to resilience config set
2026-11-21 12:08:48 -03:00
Diego Rodrigues de Sa e Souza
2e48cdb256 Merge pull request #20895 from cheaper-inference/fix/merge-train-e2-20261121
chore(release): contributor train e2 of 18 PRs for v3.8.55 (2026-11-21)
2026-11-21 12:08:20 -03:00
Diego Rodrigues de Sa e Souza
ea64a83e2e Merge pull request #20890 from cheaper-inference/fix/test-policy-package-tests-v3855
fix(ci): accept new tests in a workspace package's own tests/ directory
2026-11-21 12:06:48 -03:00
Diego Rodrigues de Sa e Souza
2b90085225 Merge pull request #20652 from cheaper-inference/chore/derived-qg-reviewed-combo-skill-20261119
fix(ci): verify explicit OpenAPI routes and synchronize omni-inference
2026-11-21 11:37:51 -03:00
diegosouzapw
9c7b87dfcc fix(security): clear the four CodeQL alerts that train f brought in
CodeQL flagged four new high-severity alerts on this train:

- js/polynomial-redos in refreshCopilotToken (#20763): baseUrl is now
  trimmed with stripTrailingSlashes() from utils/urlSanitize.ts, the
  linear helper the repo already uses for this, instead of /\/+$/.
- js/incomplete-url-substring-sanitization x3 in the #20606 test: the fetch
  stubs matched "chatgpt.com" and "registry.npmjs.org" as substrings of the
  URL; they now compare the parsed hostname exactly.

No behavior change: the copilot and codex discovery tests that import these
files pass (416/416 node, 1/1 vitest).
2026-11-21 11:23:48 -03:00
diegosouzapw
392d88aee8 Merge branch 'release/v3.8.55' into fix/salvage-20604-v3855 2026-11-21 10:34:07 -03:00
diegosouzapw
53ccc79bf0 Merge branch 'release/v3.8.55' into fix/salvage-20231-v3855 2026-11-21 10:33:45 -03:00
diegosouzapw
c3b9ac7164 Merge branch 'release/v3.8.55' into fix/salvage-20225-v3855 2026-11-21 10:33:24 -03:00
diegosouzapw
162bf6d342 Merge branch 'release/v3.8.55' into fix/test-policy-package-tests-v3855 2026-11-21 10:33:04 -03:00
diegosouzapw
d6f6ab44fa Merge #20837 (head 00dae174) into KEA QA train 2026-11-21 10:29:52 -03:00
diegosouzapw
0b192e0db5 Merge #20821 (head e8c2057b) into KEA QA train 2026-11-21 10:29:51 -03:00
diegosouzapw
08e8a035a5 Merge #20836 (head 40abd1fe) into KEA QA train 2026-11-21 10:29:50 -03:00
diegosouzapw
f27304195a Merge #20834 (head 997e83f6) into KEA QA train 2026-11-21 10:29:47 -03:00
diegosouzapw
f12a635de2 Merge #20835 (head 6fe991c7) into KEA QA train 2026-11-21 10:29:44 -03:00
diegosouzapw
ddecb0a735 Merge #20826 (head 7c50da19) into KEA QA train 2026-11-21 10:29:43 -03:00
diegosouzapw
a294d0a7c2 refactor(translator): move the client system relocation out of wrapInCloudCodeEnvelope
The Antigravity envelope builder grew to 81 counted lines once #20204 added
the model-turn-first case to the #9030 client-system relocation, one over the
max-lines-per-function cap of 80, and the complexity ratchet flagged it on
this train (4 -> 5 violations in the file). Move the relocation into
prependClientSystemParts(); the three cases (first turn is user, first turn
is model, empty history) are unchanged.
2026-11-21 10:17:15 -03:00
Diego Rodrigues de Sa e Souza
9821c21f5b Merge branch 'release/v3.8.55' into chore/derived-qg-reviewed-combo-skill-20261119 2026-11-21 10:09:09 -03:00
Diego Rodrigues de Sa e Souza
3712be0df2 Merge pull request #20933 from cheaper-inference/docs/i18n-ui-decision-router-20261121
docs(i18n): localize Decision Router settings
2026-11-21 10:07:54 -03:00
diegosouzapw
a5a1864b34 docs(i18n): localize Decision Router settings 2026-11-21 09:56:25 -03:00
diegosouzapw
f3a3b2a18f Merge #20763 (head 6abef3e0) into contributor train f 2026-11-21 09:39:26 -03:00
diegosouzapw
6b92344ca4 Merge #20753 (head 70fad90b) into contributor train f 2026-11-21 09:39:24 -03:00
diegosouzapw
015a27d007 Merge #20712 (head d5ea5682) into contributor train f 2026-11-21 09:39:22 -03:00
diegosouzapw
6759dfb86b Merge #20667 (head 750e3cf4) into contributor train f 2026-11-21 09:39:19 -03:00
diegosouzapw
08c7418fab Merge #20662 (head 04f84e85) into contributor train f 2026-11-21 09:39:17 -03:00
diegosouzapw
ce301872ed Merge #20656 (head 1a1db0f7) into contributor train f 2026-11-21 09:39:16 -03:00
diegosouzapw
d231772837 Merge #20610 (head 50dfb9d0) into contributor train f 2026-11-21 09:39:13 -03:00
diegosouzapw
846b3447dd Merge #20606 (head 1b23c92d) into contributor train f 2026-11-21 09:39:11 -03:00
diegosouzapw
e5fa3242f3 Merge #20605 (head 3643900d) into contributor train f 2026-11-21 09:39:09 -03:00
diegosouzapw
bfa94c8a09 Merge #20602 (head bd588469) into contributor train f 2026-11-21 09:39:07 -03:00
diegosouzapw
cbd5b320fb Merge #20601 (head 8c91d2f8) into contributor train f 2026-11-21 09:39:05 -03:00
diegosouzapw
e5d2b39c86 Merge #20590 (head 9396d4e3) into contributor train f 2026-11-21 09:39:03 -03:00
diegosouzapw
38ecc2d6e8 Merge #20589 (head 7475d0cd) into contributor train f 2026-11-21 09:39:01 -03:00
diegosouzapw
9b5520f6e3 Merge #20584 (head 03d3ca6d) into contributor train f 2026-11-21 09:38:59 -03:00
diegosouzapw
a7c7ad2c95 Merge #20581 (head 98a60730) into contributor train f 2026-11-21 09:38:56 -03:00
diegosouzapw
14cd5adec9 Merge #20560 (head 6e862732) into contributor train f 2026-11-21 09:38:53 -03:00
diegosouzapw
9a09ec2ab5 Merge #20547 (head 19e08a44) into contributor train f 2026-11-21 09:38:50 -03:00
diegosouzapw
4777ed275a Merge #20507 (head 37f28cbf) into contributor train f 2026-11-21 09:38:48 -03:00
diegosouzapw
3d13dbf528 Merge #20486 (head ef02c753) into contributor train f 2026-11-21 09:38:46 -03:00
diegosouzapw
45b2b12001 Merge #20471 (head 3b2794e9) into contributor train f 2026-11-21 09:38:43 -03:00
diegosouzapw
3cdac64f5f Merge #20458 (head ac46104a) into contributor train f 2026-11-21 09:38:42 -03:00
diegosouzapw
0f475957f1 Merge #20355 (head c4a4f5e4) into contributor train f 2026-11-21 09:38:40 -03:00
diegosouzapw
3a69e6ce2d Merge #20346 (head f682521d) into contributor train f 2026-11-21 09:38:37 -03:00
diegosouzapw
daf345b46a Merge #20245 (head cd5ef453) into contributor train f 2026-11-21 09:38:35 -03:00
diegosouzapw
8734908997 Merge #20242 (head 00e66d2c) into contributor train f 2026-11-21 09:38:33 -03:00
diegosouzapw
fc96a502a9 Merge #20241 (head ab3bac13) into contributor train f 2026-11-21 09:38:31 -03:00
diegosouzapw
44bca20b64 Merge #20199 (head 8e72d917) into contributor train f 2026-11-21 09:38:29 -03:00
diegosouzapw
37d6bd6a80 Merge #20154 (head e73695c4) into contributor train f 2026-11-21 09:38:27 -03:00
diegosouzapw
caf31fb1ce Merge #20126 (head a6ef3f52) into contributor train f 2026-11-21 09:38:25 -03:00
diegosouzapw
7908b1bc04 Merge #19890 (head c026fbd3) into contributor train f 2026-11-21 09:38:23 -03:00
diegosouzapw
2147dc06dc Merge #19831 (head 8f5ad95a) into contributor train f 2026-11-21 09:38:21 -03:00
diegosouzapw
742eba615a Merge #19769 (head 0dcacf5e) into contributor train f 2026-11-21 09:38:19 -03:00
diegosouzapw
3131a94bd1 Merge #19761 (head db60bd3a) into contributor train f 2026-11-21 09:38:17 -03:00
diegosouzapw
05684d1461 Merge #19749 (head 2493627c) into contributor train f 2026-11-21 09:38:15 -03:00
diegosouzapw
c325950d00 Merge #19733 (head 84b3a395) into contributor train f 2026-11-21 09:38:13 -03:00
diegosouzapw
a01be28bc1 Merge #19727 (head ebf4ee4b) into contributor train f 2026-11-21 09:38:12 -03:00
diegosouzapw
0efae9e5bd Merge #19701 (head d3141089) into contributor train f 2026-11-21 09:38:09 -03:00
diegosouzapw
b858b1c5c1 Merge #19690 (head 0e228dab) into contributor train f 2026-11-21 09:38:08 -03:00
diegosouzapw
33f133c2bd Merge #19684 (head b7e971ff) into contributor train f 2026-11-21 09:38:07 -03:00
diegosouzapw
9828894024 Merge #19681 (head f33c524e) into contributor train f 2026-11-21 09:38:05 -03:00
diegosouzapw
4879f114ce Merge #19638 (head a8d10a4a) into contributor train f 2026-11-21 09:38:04 -03:00
diegosouzapw
4dbccddde3 Merge #19634 (head 4af29a42) into contributor train f 2026-11-21 09:38:02 -03:00
diegosouzapw
3be2b29395 Merge #19630 (head 34528b6f) into contributor train f 2026-11-21 09:38:00 -03:00
Diego Rodrigues de Sa e Souza
6d95edb3c9 Merge branch 'release/v3.8.55' into chore/derived-qg-reviewed-combo-skill-20261119 2026-11-21 09:29:00 -03:00
Diego Rodrigues de Sa e Souza
c564e25959 Merge pull request #20852 from cheaper-inference/feat/unified-decision-routing-v3855
feat(combo): add an opt-in decision router with pluggable deciders
2026-11-21 09:23:50 -03:00
diegosouzapw
11eb7c49be chore(changelog): name the salvage fragment after #20900 2026-11-21 08:59:57 -03:00
diegosouzapw
36e85230a4 chore(changelog): name the salvage fragment after #20899 2026-11-21 08:59:14 -03:00
diegosouzapw
6fe991c7a0 test(authz): let the guard's bypass list decide whether Resilience is reported as blocked (KEA-9357)
The reported-paths test pinned /api/resilience/connections and /api/skills/executions as
always blocked for a remote session. Whether they are is the route guard's decision (a GET
exemption or the manage-scope bypass list), and resolveDashboardLocalAccess already asks the
guard. The test now names only paths no configuration opens, and a new case sets the bypass
list both ways and checks the path is reported only while the list leaves it out.
2026-11-21 08:57:57 -03:00
RayJW
52a1322ffe docs: add changelog fragment for Mistral prompt caching 2026-11-21 12:49:35 +01:00
RayJW
2f1d765dff feat(sse): enable Mistral prompt caching on Chat and Responses paths 2026-11-21 12:49:35 +01:00
diegosouzapw
420026a797 Merge #20372 (head fce14fe8) into contributor train e2 2026-11-21 08:31:00 -03:00
diegosouzapw
2819840bf1 Merge #20351 (head 8d848a34) into contributor train e2 2026-11-21 08:30:52 -03:00
diegosouzapw
83d2565f16 Merge #20347 (head c0cbf224) into contributor train e2 2026-11-21 08:30:43 -03:00
diegosouzapw
ba0f8eb125 Merge #20324 (head cd83c2fd) into contributor train e2 2026-11-21 08:30:36 -03:00
diegosouzapw
6093f2bab0 Merge #20293 (head a1ca8e91) into contributor train e2 2026-11-21 08:30:24 -03:00
diegosouzapw
3ad12c8f20 Merge #20240 (head fc0c4497) into contributor train e2 2026-11-21 08:30:10 -03:00
diegosouzapw
bcff48ab08 Merge #20238 (head 4e94e65c) into contributor train e2 2026-11-21 08:29:57 -03:00
diegosouzapw
fcc917c672 Merge #20211 (head c3049412) into contributor train e2 2026-11-21 08:29:45 -03:00
diegosouzapw
07fc19f468 Merge #20206 (head 5eba15a4) into contributor train e2 2026-11-21 08:29:39 -03:00
diegosouzapw
2a5738b81d Merge #20204 (head 65f82359) into contributor train e2 2026-11-21 08:29:33 -03:00
diegosouzapw
9960a983d3 Merge #20201 (head 1e7c336c) into contributor train e2 2026-11-21 08:29:27 -03:00
diegosouzapw
4e900ae045 Merge #20194 (head 1b2a4152) into contributor train e2 2026-11-21 08:29:20 -03:00
diegosouzapw
27d7cb97ca Merge #20167 (head 34f90c8a) into contributor train e2 2026-11-21 08:29:16 -03:00
diegosouzapw
7866bc4ebf Merge #20111 (head ad692750) into contributor train e2 2026-11-21 08:29:10 -03:00
diegosouzapw
07151e3f56 Merge #20096 (head 0aacc3d6) into contributor train e2 2026-11-21 08:29:05 -03:00
diegosouzapw
aae6e2c754 Merge #20095 (head db8e1035) into contributor train e2 2026-11-21 08:29:00 -03:00
diegosouzapw
3da987f450 Merge #19848 (head 346c8415) into contributor train e2 2026-11-21 08:28:56 -03:00
diegosouzapw
2f9367a10b Merge #19797 (head 25295a51) into contributor train e2 2026-11-21 08:28:51 -03:00
Diego Rodrigues de Sa e Souza
49e4a2d212 Merge branch 'release/v3.8.55' into chore/derived-qg-reviewed-combo-skill-20261119 2026-11-21 08:03:20 -03:00
diegosouzapw
3d64833f61 Merge release/v3.8.55 into feat/unified-decision-routing-v3855
# Conflicts:
#	tests/unit/feature-flags-settings.test.ts
#	tests/unit/server-owned-tool-loop-flag.test.ts
2026-11-21 08:03:08 -03:00
diegosouzapw
aa6866babb chore(changelog): name the salvage fragment after #20892 2026-11-21 07:59:08 -03:00
Diego Rodrigues de Sa e Souza
6d3f1d3f70 Merge pull request #20781 from cheaper-inference/feat/plugin-permission-model-opt-in
feat(plugins): opt-in Node.js permission model for plugin processes
2026-11-21 07:59:03 -03:00
diegosouzapw
48cbe84f6c chore(changelog): add the #20890 fragment 2026-11-21 07:56:26 -03:00
diegosouzapw
73a1b44745 fix(ci): accept new tests in a workspace package's own tests/ directory
check-pr-test-policy (from #20677) rejects any new test file outside tests/.
The @omniroute/* workspace packages run their own suites from
<package>/tests/ (52 files in opencode-plugin-v2, 29 in opencode-plugin,
1 in opencode-provider), so a new test there, such as the one in #18804,
was reported as misplaced. Accept @omniroute/<package>/tests/ as well;
any other location, including elsewhere inside a package, is still
rejected.
2026-11-21 07:55:45 -03:00
diegosouzapw
ad4f715d07 Merge release/v3.8.55 into feat/unified-decision-routing-v3855 2026-11-21 07:51:25 -03:00
Diego Rodrigues de Sa e Souza
b7a561a2bb Merge branch 'release/v3.8.55' into chore/derived-qg-reviewed-combo-skill-20261119 2026-11-21 06:50:08 -03:00
Diego Rodrigues de Sa e Souza
93d0cbc243 Merge pull request #20650 from cheaper-inference/fix/qg-release-acceptance-live-20261119
fix(ci): bind shadow acceptance to the real checkout
2026-11-21 06:41:11 -03:00
Diego Rodrigues de Sa e Souza
3f6c13948e Merge branch 'release/v3.8.55' into fix/qg-release-acceptance-live-20261119 2026-11-21 05:14:31 -03:00
Diego Rodrigues de Sa e Souza
34d175955c Merge branch 'release/v3.8.55' into chore/derived-qg-reviewed-combo-skill-20261119 2026-11-21 05:14:30 -03:00
Diego Rodrigues de Sa e Souza
5c3ef759c3 Merge pull request #20870 from cheaper-inference/fix/merge-train-e1b-20261121
chore(release): contributor train e1b of 21 PRs for v3.8.55 (2026-11-21)
2026-11-21 05:12:06 -03:00
Diego Rodrigues de Sa e Souza
e3650eba68 Merge branch 'release/v3.8.55' into chore/derived-qg-reviewed-combo-skill-20261119 2026-11-21 04:02:53 -03:00
Diego Rodrigues de Sa e Souza
113601cb13 Merge branch 'release/v3.8.55' into fix/qg-release-acceptance-live-20261119 2026-11-21 04:02:52 -03:00
Diego Rodrigues de Sa e Souza
a78e2a87cc Merge pull request #20749 from cheaper-inference/fix/qg-mcp-a2a-toggle-readiness-20261120
test(ui): synchronize MCP and A2A toggle fixtures
2026-11-21 04:02:05 -03:00
diegosouzapw
8414b3ad03 Merge #20088 (head 68b07075) into contributor train e1b 2026-11-21 03:46:44 -03:00
diegosouzapw
8e8c9ea23f Merge #20078 (head 0a94768e) into contributor train e1b 2026-11-21 03:46:43 -03:00
diegosouzapw
7ed80d6a59 Merge #19950 (head 00f2a34c) into contributor train e1b 2026-11-21 03:46:42 -03:00
diegosouzapw
3e63be6cb8 Merge #19949 (head 768b4aea) into contributor train e1b 2026-11-21 03:46:40 -03:00
diegosouzapw
3cfb61b269 Merge #19948 (head 1907e831) into contributor train e1b 2026-11-21 03:46:39 -03:00
diegosouzapw
09a94f4e6f Merge #19876 (head b871c074) into contributor train e1b 2026-11-21 03:46:37 -03:00
diegosouzapw
360ec203f8 Merge #19867 (head 9983d081) into contributor train e1b 2026-11-21 03:46:36 -03:00
diegosouzapw
141ed1b6d5 Merge #19763 (head f4eae213) into contributor train e1b 2026-11-21 03:46:35 -03:00
diegosouzapw
2a8d2d520f Merge #19750 (head 668c18fe) into contributor train e1b 2026-11-21 03:46:34 -03:00
diegosouzapw
1a30d83faf Merge #19724 (head 610fbaac) into contributor train e1b 2026-11-21 03:46:32 -03:00
diegosouzapw
1a19467176 Merge #19680 (head d1fa6a36) into contributor train e1b 2026-11-21 03:46:31 -03:00
diegosouzapw
8d030a8bd5 Merge #19678 (head a9b7506a) into contributor train e1b 2026-11-21 03:46:29 -03:00
diegosouzapw
17a0647e93 Merge #19670 (head efd935b2) into contributor train e1b 2026-11-21 03:46:26 -03:00
diegosouzapw
9103f74912 Merge #19669 (head d720f0e6) into contributor train e1b 2026-11-21 03:46:25 -03:00
diegosouzapw
f2aa022ed9 Merge #19667 (head 75535a76) into contributor train e1b 2026-11-21 03:46:23 -03:00
diegosouzapw
60383f4fa5 Merge #19592 (head fc4b408e) into contributor train e1b 2026-11-21 03:46:20 -03:00
diegosouzapw
5464f83a07 Merge #19583 (head 213be12d) into contributor train e1b 2026-11-21 03:46:19 -03:00
diegosouzapw
f381a8876a Merge #18738 (head 01781da0) into contributor train e1b 2026-11-21 03:46:17 -03:00
diegosouzapw
f65c9cceb0 Merge #18674 (head 9aa9b274) into contributor train e1b 2026-11-21 03:46:17 -03:00
diegosouzapw
bc7007b913 Merge #18626 (head 41c6c724) into contributor train e1b 2026-11-21 03:46:15 -03:00
diegosouzapw
7c5ea2388d Merge #18544 (head 039bfcf2) into contributor train e1b 2026-11-21 03:46:14 -03:00
Diego Rodrigues de Sa e Souza
b87bf33013 Merge branch 'release/v3.8.55' into fix/qg-release-acceptance-live-20261119 2026-11-21 02:47:00 -03:00
Diego Rodrigues de Sa e Souza
913f200b34 Merge branch 'release/v3.8.55' into fix/qg-mcp-a2a-toggle-readiness-20261120 2026-11-21 02:46:59 -03:00
Diego Rodrigues de Sa e Souza
1771948e1a feat(ci): omni-queue owner voice and signed merge commits (both off) (#20792)
* feat(ci): omni-queue owner voice and signed merge commits, both off

Owner voice (config `voice`, default "app"): with "owner", the queue's
comments and label removals on pull requests, the dashboard issue and its
comments, base-red comments and the tree-divergence issue go out with
OMNI_QUEUE_LAND_TOKEN (scripts/merge-queue/voice.mjs). Reads, commit
statuses, refs, the state branch and re-runs stay the App's. A missing
token or a 401/403 retries the same write with the App's token and records
one error event per tick. commentOnce trusts markers by the App or by the
owner's login read from the token itself (GET /user).

Signed merge commits (config landing.signing, default "none"): with "ssh"
and landing.actor "owner", composeCandidate signs every merge commit with
the key the tick job writes from the OMNI_QUEUE_SIGNING_KEY secret to a
0600 file under RUNNER_TEMP (removed by an always() step). git gets the
path as per-command configuration through the environment. A missing key
or a failed signature composes unsigned and records one error event per
batch.

The shipped config keeps both off and mode shadow.

* docs(changelog): add the fragment for the omni-queue owner voice and signed merges (#20792)

* test(ci): compare the signed commit's committer by prefix, not a built regex (#20792)
2026-11-21 02:39:36 -03:00
Diego Rodrigues de Sa e Souza
e07bc35c4c Merge branch 'release/v3.8.55' into fix/qg-release-acceptance-live-20261119 2026-11-21 02:39:27 -03:00
Diego Rodrigues de Sa e Souza
f7b9c46a54 Merge branch 'release/v3.8.55' into fix/qg-mcp-a2a-toggle-readiness-20261120 2026-11-21 02:39:26 -03:00
Diego Rodrigues de Sa e Souza
59e3965a8a test(ci): audit only git-tracked files for retired provider asset references (#20827)
The retired-asset audit in provider-assets-generic-fallback.test.mjs walked the
working tree at module load and read every text file whole. In the omni-queue
base check, "Fast Quality Gates" builds config/quality/test-impact-map.json
(gitignored, ~556 MB on release/v3.8.55) before running the whole unit suite,
and readFile(path, "utf8") on it threw "RangeError: Invalid string length"
(run 44795004759).

The audit now lists files with git ls-files (same scope rules; the old walk
stays as the fallback for a tree without git metadata), reads each file with a
64 MiB bound, and reports oversized or unreadable files by name instead of
aborting. A regression test builds a temporary git repository with an
untracked 600 MB sparse file in a walked directory.
2026-11-21 02:32:46 -03:00
diegosouzapw
82723de621 fix(db): salvage six usage and DB fixes from #20225
Brings over the parts of #20225 that do not change any default:

- call logs: skip the "mark missing" UPDATE after a successful detail publish
- providers: read the CodeBuddy CN retry-at phrase (请于 <time> 后重试) as China Standard Time
- db settings: read the database size from page_size/page_count instead of per-table scans
- provider stats: filter wire observations on the row instead of a primary-key self-lookup
- usage: requests-by-provider-date sums archived total_requests and floors raw history at
  retention.usageHistory, like the main analytics route
- db: drop the two plain copies of the summary tables' provider/model/date index at boot,
  keeping the UNIQUE index the rollup upsert needs

Left out: the quota snapshot sweep reading retention.quotaSnapshots, because that setting's
built-in default is 7 days and the sweep's current default is 90; the owner kept 90.

The db-provider-stats planner assertion now accepts any timestamp index: the predicate reads
request_type, which the covering index does not hold.

Co-authored-by: serenity <295272363+serenity-X@users.noreply.github.com>
2026-11-21 02:00:19 -03:00
diegosouzapw
8e05499665 fix: salvage five independent fixes from #20231
Salvaged from #20231 by @serenity-X, without the two members the
maintainer declined (standalone launcher reading the default data-dir
.env, and Claude re-auth with a different accountUUID creating a new
connection).

- fix(models): image rows in GET /v1/models no longer inherit chat
  capabilities and token limits from the chat sibling whose id they
  start with.
- fix(guardrails): the opt-in credential masker also masks a value
  behind a label (DB_PASSWORD=..., client_secret: ..., ?api_key=...);
  error sanitization skips the new pattern, so default error bodies
  are unchanged.
- fix(network): the direct egress dispatcher picks the least loaded
  one-connection agent for the requested origin; equal loads rotate.
- fix(usage): Cline free-bucket models get all-zero price rows, so a
  USD-limited API key no longer fails closed after one request.
- perf(usage): the input-token plausibility check skips serializing
  the body when the reported count is within the fixed allowance.

Co-authored-by: serenity <295272363+serenity-X@users.noreply.github.com>
2026-11-21 01:54:47 -03:00
diegosouzapw
2c71a492da fix(cli): add --p2c-latency-weight to resilience config set
`omniroute resilience config set` had no flag for the p2c latency weight,
so the only way to set it was a hand-written PATCH /api/resilience call.
The flag validates 0..20 client side (the same bounds as
p2cLatencySettingsSchema) and sends { p2cLatency: { weight } }.

Salvaged from #20604 without its PATCH /api/settings 400 change, which
stays as it is today. Refs #20445.
2026-11-21 01:54:29 -03:00
diegosouzapw
d4d5a344d4 refactor(sse): move the per-stream usage guard out of stream.ts
check:file-size froze open-sse/utils/stream.ts at 3992 lines and this
branch had grown it to 3998. Move the request usage basis and the
passthrough usage sanitizer (with its message_delta receipt guard) into
open-sse/utils/streamUsageGuard.ts; stream.ts keeps one constructor
call and reads usageGuard.basis / usageGuard.sanitizePassthrough at the
existing call sites. Behavior is unchanged: the basis is still built
once per stream and the receipt is still rebuilt only for
message_delta. stream.ts is now 3986 lines, below the base.

Add tests/unit/stream-usage-guard.test.ts for the extracted module.
2026-11-21 01:53:58 -03:00
diegosouzapw
466592d8d2 fix(decision): bound the decision timer delay at its call sites
CodeQL flags js/resource-exhaustion when a timer delay comes from
configuration without a visible upper bound at the call. The value was
already clamped to 100-5000 ms by the schema and clampDecisionTimeout,
but through a helper the analysis does not follow. Compare against
MAX_DECISION_TIMEOUT_MS where the timer is set (and where the transport
receives its timeout), so the bound is explicit. Behavior is unchanged.
2026-11-21 01:49:15 -03:00
Diego Rodrigues de Sa e Souza
6204e4082d Merge branch 'release/v3.8.55' into fix/qg-release-acceptance-live-20261119 2026-11-21 01:19:00 -03:00
Diego Rodrigues de Sa e Souza
0c85b5c548 Merge branch 'release/v3.8.55' into fix/qg-mcp-a2a-toggle-readiness-20261120 2026-11-21 01:19:00 -03:00
Diego Rodrigues de Sa e Souza
76b26b8ead Merge pull request #20824 from cheaper-inference/fix/codeql-media-poll-clamp
fix(security): clamp media polling and guard syntx provider rules (CodeQL #1389, #1392)
2026-11-21 00:58:11 -03:00
Diego Rodrigues de Sa e Souza
c8688bcd69 Merge pull request #20820 from cheaper-inference/fix/admission-bypass-process-secret
fix(security): require the per-process token for the internal admission bypass
2026-11-21 00:57:59 -03:00
Diego Rodrigues de Sa e Souza
59bf5d718f Merge pull request #20819 from cheaper-inference/fix/codeql-operator-only-path-roots
fix(security): operator-only credential and denied roots for corpus and vault paths (CodeQL #1371, #1372, #1373)
2026-11-21 00:57:48 -03:00
Diego Rodrigues de Sa e Souza
78a20f38dc Merge pull request #20776 from cheaper-inference/fix/subscription-quota-400-status-gate
fix(security): gate subscription quota text on HTTP 400 behind a structured code
2026-11-21 00:57:36 -03:00
Diego Rodrigues de Sa e Souza
8736b8e086 Merge branch 'release/v3.8.55' into fix/qg-release-acceptance-live-20261119 2026-11-21 00:35:38 -03:00
Diego Rodrigues de Sa e Souza
46d97cae33 Merge branch 'release/v3.8.55' into fix/qg-mcp-a2a-toggle-readiness-20261120 2026-11-21 00:35:37 -03:00
diegosouzapw
8e7622bbc0 chore(changelog): name the decision-router fragment after #20852 2026-11-21 00:20:37 -03:00
diegosouzapw
1bbf798d58 Merge release/v3.8.55 into feat/unified-decision-routing-v3855 2026-11-21 00:19:35 -03:00
Diego Rodrigues de Sa e Souza
0f5237563c Merge branch 'release/v3.8.55' into fix/qg-release-acceptance-live-20261119 2026-11-20 23:01:57 -03:00
diegosouzapw
c3049412ff chore(changelog): credit the #20187 reporter and mention manage-scoped keys 2026-11-20 22:25:56 -03:00
diegosouzapw
2127d0a5ff test(api): cover manage-scoped and inference-only API keys on sync-models (#20187)
Graft the API-key case from #20302: a manage-scoped key passes
requireManagementAuth() and reaches the connection lookup (404), while
an inference-only key is rejected with 403 "lacks 'manage' scope". On
the base route the old isAuthenticated() guard answers the
inference-only key with 401 instead of the scope error, so the test
fails there.

Co-authored-by: Rafa Martins <rafacpti23@users.noreply.github.com>
2026-11-20 22:24:41 -03:00
diegosouzapw
534810ac05 Merge remote-tracking branch 'origin/release/v3.8.55' into feat/unified-decision-routing-v3855 2026-11-20 22:05:04 -03:00
diegosouzapw
6460552cfc Merge release/v3.8.55 into fix/20187-sync-models-management-auth 2026-11-20 21:54:24 -03:00
Diego Rodrigues de Sa e Souza
8399632bb5 Merge branch 'release/v3.8.55' into fix/qg-mcp-a2a-toggle-readiness-20261120 2026-11-20 21:30:12 -03:00
diegosouzapw
34f90c8a62 test(translator): cover a zero-parameter tool followed by a parameterized one
Graft the mixed-tool stream case from #20251: a tool_use with no
parameters closes with "{}" while the next tool_use keeps its streamed
arguments untouched, and message_delta still maps stop_reason tool_use to
finish_reason tool_calls (#20152).

Co-authored-by: Rafa Martins <rafacpti23@users.noreply.github.com>
2026-11-20 21:29:42 -03:00
Diego Rodrigues de Sa e Souza
fe56151a82 Merge branch 'release/v3.8.55' into fix/qg-release-acceptance-live-20261119 2026-11-20 21:29:28 -03:00
diegosouzapw
9acef5ae62 test(authz): pin the locality stamp the dashboard layout reads on page requests (KEA-9357)
The dashboard layout decides which local-only features to replace with a
notice from the pipeline's peer-locality stamp on the page request. Nothing
tested that the stamp reaches a page: without it the session is "undecided"
and every local-only surface sends one request that can only be rejected.

Drives the real pipeline for dashboard page requests (remote, loopback,
private network), rebuilds the request headers a server component sees from
Next's override encoding, and checks resolveDashboardLocalAccess() on them.
2026-11-20 21:28:55 -03:00
diegosouzapw
40abd1fe4f refactor(dashboard): move the Media default-provider choice into helpers (KEA-9390)
The KEA-9390 change pushed two functions of MediaPageClient.tsx over the
complexity limit (the /api/providers handler 16 and switchTab 18, limit 15),
which the complexity ratchet counts in new-code mode (5 -> 7 violations in the
file).

Move the added logic into three module-level helpers of the same file:
listedProviders() (the providers a tab shows), preferredProvider() (the
connected-first choice) and providerToOpenOn() (what the connection list
changes once it loads). switchTab resolves the provider id once instead of
three times. LOCAL_PROVIDERS moves to module scope so the helpers can read it;
the exhaustive-deps directive it needed is gone with it.

No behaviour change. The file is back to its 5 pre-existing violations.
2026-11-20 21:22:43 -03:00
diegosouzapw
25295a51ad test(providers): assert Gemini 4 Carbon ids use thinkingLevel
Graft the isGeminiThinkingLevelModel assertion from #19809 so the bare,
Antigravity tier and vertex-prefixed Carbon ids stay on the thinkingLevel
path. Only the test is taken; the unverified vertex catalog row and CI
input-modality row from #19809 are intentionally left out.

Co-authored-by: Rafa Martins <rafacpti23@users.noreply.github.com>
2026-11-20 21:01:26 -03:00
diegosouzapw
410df5595f refactor(dashboard): keep the skills page within its complexity budget and drop an unused export (KEA-9359)
Follow-up to the local-only notices, for two new-code gates:
- OmniSkillsPageClient gained five branches for the executions local-only
  state. They move to a small helper (executionStat) and a child component
  (ExecutionsPanel), so the page function is back to its previous cyclomatic
  complexity. No behaviour change.
- LocalOnlyNotice exported the component twice; every caller uses the named
  export, so the unused default export is removed.
2026-11-20 20:57:05 -03:00
diegosouzapw
a9c91fd01d perf(usage): memoize estimateInputTokens per request body (#20086)
Graft the per-body WeakMap memo from #20116. The stream path already
reuses one RequestUsageBasis per stream; the callers outside it (cursor
executor, finalizeStreamingUsage, estimateUsage) still serialized and
regex-split the whole body on every call. The estimate is now cached
on the body object, and the entry is released with the body.

The test is adapted from the getter-count test in #20116: repeated
calls on one body read its messages only once.

Co-authored-by: Rafa Martins <rafacpti23@users.noreply.github.com>
2026-11-20 20:56:57 -03:00
diegosouzapw
8a96ca0fd2 Merge release/v3.8.55 into fix/gemini-4-carbon-registry
# Conflicts:
#	open-sse/config/antigravityModelAliases.ts
#	open-sse/config/antigravitySharedModels.ts
#	open-sse/config/providers/registry/gemini/index.ts
#	src/shared/constants/modelSpecs.ts
#	src/shared/constants/pricing/frontier-labs.ts
#	src/shared/constants/pricing/oauth-subscriptions.ts
#	src/shared/constants/pricing/shared-tiers.ts
2026-11-20 20:56:04 -03:00
diegosouzapw
2ef7eaf8d9 test(sse): pin the Responses-delta serialization bound (#20480)
Graft the regression test from #20430: a Responses passthrough stream
with 200 deltas and no usage must serialize the request body a small,
constant number of times. On the base it is serialized once per delta
(sanitizePassthroughUsage rebuilt the accounting receipt for every
event); the message_delta guard in this branch keeps it constant.

Closes #20480

Co-authored-by: bufftop25 <147844179+bufftop25@users.noreply.github.com>
2026-11-20 20:49:23 -03:00
diegosouzapw
997e83f685 refactor(dashboard): move the webhook forms' URL check and field messages into helpers (KEA-9386)
The inline validation added to the Custom, Slack and Discord forms pushed
their components over the complexity ratchet (new-code mode): function
length, cyclomatic and cognitive complexity.

No behaviour change. The debounced server check the three forms each
carried a copy of becomes the `useWebhookUrlCheck` hook, and what a field
shows under itself is derived by pure helpers in webhookFieldValidation.ts
(`webhookUrlFieldFeedback`, `webhookSecretFieldError`).
2026-11-20 20:48:41 -03:00
diegosouzapw
2d5fe880b1 Merge remote-tracking branch 'origin/release/v3.8.55' into feat/unified-decision-routing-v3855 2026-11-20 20:43:22 -03:00
Diego Rodrigues de Sa e Souza
ee1c974f45 Merge branch 'release/v3.8.55' into fix/qg-release-acceptance-live-20261119 2026-11-20 20:09:12 -03:00
diegosouzapw
dafe2abdf8 chore(changelog): name the #20108 fragment after the PR and cover #20480
The fragment needs the <PR>-<slug>.md name, and the fix also covers the
Responses-delta symptom reported in #20480 (credit the reporter).
2026-11-20 20:02:57 -03:00
diegosouzapw
6b3da569df Merge release/v3.8.55 into fix/usage-guard-once-per-request 2026-11-20 20:00:33 -03:00
diegosouzapw
28706c2d30 Merge release/v3.8.55 into fix/empty-tool-args-claude-stream 2026-11-20 20:00:01 -03:00
diegosouzapw
00dae1741a docs(changelog): add the fragment for #20837 2026-11-20 19:59:21 -03:00
diegosouzapw
4aad983d2f docs(changelog): add the fragment for #20836 2026-11-20 19:57:43 -03:00
diegosouzapw
764d1fbcdc Merge remote-tracking branch 'origin/release/v3.8.55' into feat/unified-decision-routing-v3855 2026-11-20 19:56:37 -03:00
diegosouzapw
b0308c6b54 docs(changelog): add the fragment for #20835 2026-11-20 19:30:01 -03:00
diegosouzapw
5454b20a1c docs(changelog): add the fragment for #20834 2026-11-20 19:29:29 -03:00
Diego Rodrigues de Sa e Souza
42573d7883 Merge branch 'release/v3.8.55' into fix/qg-release-acceptance-live-20261119 2026-11-20 19:24:25 -03:00
diegosouzapw
856a8acc92 refactor(combo): split the decision router functions under the complexity limits
check:complexity-ratchets (new-code mode) flagged five new violations:
selectAsync, the combo-model decider, resolveDecisionApiKey (cyclomatic
17 > 15) and DecisionModelSection (289 lines, complexity 16). The
pre-decider checks and the answer checks of the strategy, the
preconditions and in-scope dispatch of the combo-model decider, and the
referenced-connection branch of the credential resolver move into
helpers; the builder section is split into settings, descriptions, test
and preview-hook pieces. Behavior is unchanged: the decision unit tests
and the builder UI tests pass as before.

Co-authored-by: Marcel Rösler <3178520+BelphegorPrime@users.noreply.github.com>
Co-authored-by: Alvin T. Veroy <551419+alvinveroy@users.noreply.github.com>
Co-authored-by: Rafa Martins <146174365+rafacpti23@users.noreply.github.com>
Co-authored-by: Miguel Enes <1568086+miguelenes@users.noreply.github.com>
2026-11-20 18:52:49 -03:00
diegosouzapw
21c3a7a04b Merge remote-tracking branch 'origin/release/v3.8.55' into feat/plugin-permission-model-opt-in 2026-11-20 18:47:42 -03:00
diegosouzapw
d7727a7e99 Merge remote-tracking branch 'origin/release/v3.8.55' into fix/subscription-quota-400-status-gate 2026-11-20 18:47:10 -03:00
diegosouzapw
7f6351956e fix(i18n): serve the formValidation namespace to the forms that use it
The access-token, webhook and eval-suite forms read their inline messages
from the new formValidation namespace, but the per-section namespace map was
not regenerated, so the dashboard would not have sent those messages to the
client. Regenerated with `npm run gen:i18n-routes`; the drift test
tests/unit/i18n-route-namespaces.test.ts fails without it.
2026-11-20 18:43:14 -03:00
diegosouzapw
ce3a7e2b93 docs(combo): document the decision router and harden its typing and logs
Step 12 and integration: AUTO-COMBO.md gains the `decision` strategy
section (deciders, fields, flag, what leaves the box, failure reasons),
ENVIRONMENT.md and .env.example list OMNIROUTE_DECISION_API_KEY and the
COMBO_DECISION_ROUTER_ENABLED flag, openapi.yaml documents
POST /api/combos/decision-preview, and a changelog fragment is added.

Code: an upstream-reported model name only reaches the log when it looks
like a model id (no spaces, at most 100 characters); the failure branches
of the decision results name their variant explicitly, because
`strict: false` does not narrow the `ok` union (check:open-sse-typecheck
flagged them).

Co-authored-by: Marcel Rösler <3178520+BelphegorPrime@users.noreply.github.com>
Co-authored-by: Alvin T. Veroy <551419+alvinveroy@users.noreply.github.com>
Co-authored-by: Rafa Martins <146174365+rafacpti23@users.noreply.github.com>
Co-authored-by: Miguel Enes <1568086+miguelenes@users.noreply.github.com>
2026-11-20 18:37:40 -03:00
diegosouzapw
7c50da1952 docs(changelog): add the fragment for #20826 2026-11-20 18:34:47 -03:00
diegosouzapw
4625936608 chore(changelog): number the media polling fragment for #20824 2026-11-20 18:32:15 -03:00
diegosouzapw
f2573bedba fix(dashboard): keep local-only access undecided when the locality stamp is missing (KEA-9357)
resolveDashboardLocalAccess() read the page request through
getRequestPeerLocality(), which fails closed to "remote" when no trusted
signal is present. If the pipeline's locality stamp ever fails to reach the
dashboard layout, that default would hide every local-only feature from a
local operator.

Only an explicit stamp on the page request now decides "local" or "remote";
without it the session is "unknown", so pages ask once and the response
decides, as they already do behind a trusted private proxy.
2026-11-20 18:29:27 -03:00
diegosouzapw
e8c2057bcd docs(changelog): add the fragment for #20821 2026-11-20 18:26:01 -03:00
diegosouzapw
3e3d4ea62f fix(dashboard): keep Media from sending requests for unconnected providers (KEA-9390)
The Media page knew nothing about connections: every tab opened on the
alphabetically first provider (Adobe Firefly on Image) and "Generate" was
enabled whether or not anything could run it, so the request was sent only to
come back as "No credentials for image provider: adobe-firefly".

- mediaProviderConnection.ts: pure rule that reads the connection list the
  page already loads and says whether a provider is connected, needs no
  connection (local / keyless), is not connected, or cannot be decided. It is
  one-sided on purpose: "not connected" only when the server would certainly
  refuse (ids, aliases and connection-sharing ids are honoured; anything
  undecidable stays usable).
- MediaPageClient: open each tab on a connected provider when there is one,
  mark unconnected providers in the list, disable Generate for them and show
  why with a "Connect this provider" link; when nothing is connected the hint
  says so up front. Tabs no longer open on a hidden local provider.
- Copy: the credentials banner link no longer names a section ("Configure API
  keys in Providers" -> "Open provider connections").

No server change: the missing-credentials check already answers in
milliseconds without any upstream call.
2026-11-20 18:24:38 -03:00
diegosouzapw
c28fec4e9f chore(changelog): name the fragment after PR #20820 2026-11-20 18:23:37 -03:00
diegosouzapw
0d56007238 fix(security): clamp media polling and guard syntx provider rules (CodeQL #1389, #1392)
Caller-supplied poll_interval_ms, timeout_ms and poll_timeout_ms on the
NanoBanana, Magnific, Black Forest Labs and RenderHour image handlers are
clamped (30 s interval, 10 min window) by a shared helper that never
shortens a default. The RenderHour poller passes the request abort signal
to sleep(). applySyntxProviderRules only runs own entries of the rules
table.
2026-11-20 18:22:31 -03:00
diegosouzapw
c003123b7e fix(api): let a remote dashboard read resilience state and skill executions (KEA-9357, KEA-9359)
Resilience > Connections and Skills > Executions could never load on a
dashboard reached remotely (managed instance, tunnel, reverse proxy): both
JSON reads sat behind the loopback-only tier although neither spawns anything.

- /api/resilience/connections stays LOCAL_ONLY and joins the default
  manage-scope bypass list next to /api/mcp/. A remote caller needs an
  authenticated dashboard session or a manage-scope key; an anonymous remote
  caller still gets 403 LOCAL_ONLY, also with requireLogin=false. An install
  that stored its own bypass list keeps it.
- GET /api/skills/executions is exempted by exact path and safe method, the
  shape /api/mcp/audit already uses (#13941). POST, which runs a skill and
  reaches the sandbox spawn, stays loopback-only (GHSA-jx89-f37j-pq89).

The default list lives in three places (route guard constant, runtime
snapshot default, settings default); a test now asserts they agree.
2026-11-20 18:16:24 -03:00
diegosouzapw
035b02bcd1 chore(changelog): number the fragment for #20819 2026-11-20 18:12:44 -03:00
diegosouzapw
b7585df814 fix(dashboard): plugins and embedded services show the local-only notice on a remote session (KEA-9385)
/api/plugins and /api/services/<name>/status (all but the read-only
CLIProxyAPI status) are local-only routes.

- Plugins: a remote session saw the "no plugins" empty state and a scan
  button that could only fail. It now gets the shared notice and no request.
- Services: each service tab polled its status every 5 s from several
  components and the card read "HTTP 403". useServiceStatus no longer fetches
  or polls a status the session cannot reach, the status card shows the
  notice, and the Services page replaces a local-only service tab with the
  notice so its lifecycle and log panels do not poll either. The CLIProxyAPI
  tab is unchanged.
2026-11-20 18:11:25 -03:00
diegosouzapw
edd7ecd731 fix(dashboard): make the eval case model optional and flag suite errors inline (KEA-9388, KEA-9389)
Quality > New suite refused to save a case whose "Model (optional)" was
empty, and reported every problem only as a toast ("This case has
validation errors") with nothing highlighted.

- The model is optional, as labelled: the save schema already takes a
  case without one and the runner resolves it (the run's model or combo
  target, else the case's model, else the default). The dialog no longer
  requires it and omits `model` from the request when empty, since the
  schema refuses an empty string. A hint under the field says what an
  empty model runs on; the default is now one constant shared by the
  runner and the hint.
- A refused save flags each missing field inline (suite name, case name,
  prompt, expected value), marks the required ones, and moves focus -
  and the dialog's scroll position - to the first of them. The messages
  clear as the fields are filled.
2026-11-20 18:11:09 -03:00
diegosouzapw
125afba994 fix(dashboard): traffic inspector shows the local-only notice on a remote session (KEA-9360)
Every Traffic Inspector API (capture modes, sessions, the live socket, the
TPROXY status) is a local-only route. A remote session got an inspector that
looked ready but stayed empty, with silent 403s and a socket that kept
reconnecting.

The page now mounts the inspector workspace only when the session can reach
those routes; otherwise it keeps the header and shows the shared notice, with
no request and no socket. A local-only rejection of the capture-modes read
makes the same switch for sessions the server could not classify up front.
2026-11-20 18:09:36 -03:00
diegosouzapw
05359effd5 fix(dashboard): validate the webhook wizard's fields inline (KEA-9386)
On the configure step, Next was silently disabled while the destination
was empty; plain text such as "not-a-url" was reported 600 ms later as
"a blocked private address"; a URL or secret over the route's limits was
sent and the refusal reached the banner as "[object Object]".

- Next stays enabled: a refused click flags the fields inline and focuses
  the first one (all four integration kinds).
- A value that is not an http(s) URL, or is over the limit, is said at
  once next to the field, without a round trip. The limits (URL 2000,
  secret 500) are the ones the routes' Zod schemas already enforced, now
  shared through src/shared/constants/formLimits.ts. Nothing is cut: the
  secret field has no maxLength, and a 400-character key reaches the API
  whole.
- POST /api/webhooks/validate-url answers `invalid_url` for text that is
  not a URL instead of `blocked_private`.
- A validation refusal from the API is shown by its message.
2026-11-20 18:08:13 -03:00
diegosouzapw
96edc43be2 fix(dashboard): hand the OpenRouter stats over as a pending promise (KEA-9368)
Follow-up to the Providers first-paint fix. The page is frozen at 1985
lines (tests/unit/deprecated-provider-banner-13067.test.ts) and the
separate loader call grew it by three.

loadProviderPageData now starts the stats request with the essential
ones and returns it un-awaited as `openRouterProviderStats` (a promise
that never rejects), so the page keeps its size: one line swaps the
setter for `.then(setter)`. The first paint still never waits for it,
and the request starts in parallel again instead of after the paint.
2026-11-20 18:07:22 -03:00
diegosouzapw
e829d7e036 fix(dashboard): skills executions show the local-only notice instead of an empty list (KEA-9359)
/api/skills/executions is a local-only route. The Skills page parsed the
guard's 403 body as a result, so a remote session saw "No executions found",
0 executions and a 0% success rate.

The Executions tab and the skill inspector's Executions panel now show the
shared notice when the session cannot reach the route, the two execution
stats show a dash, and no executions request is sent once that is known.
A 200 still renders the list, so the page keeps working wherever the server
serves the read.
2026-11-20 18:06:47 -03:00
diegosouzapw
380b6a7786 fix(security): operator-only credential and denied roots for corpus and vault paths (CodeQL #1371, #1372, #1373)
POST /api/settings/local-corpus (rootPath) and POST /api/settings/obsidian/webdav
(vaultPath) now require an operator credential (dashboard session or local CLI) through
requireOperatorCredential; API keys of any scope and access tokens get 403. The webdav
route passes alwaysRequireAuth because /api/settings/obsidian is ALWAYS_PROTECTED.

Both roots also refuse the filesystem root, the home directory itself and the system
directories /etc /usr /bin /sbin /var /proc /sys /dev /boot /root (and below), compared
after path.resolve and realpath, with a fixed 400 message. The vault keeps its DATA_DIR
overlap refusal.
2026-11-20 18:05:40 -03:00
diegosouzapw
26cb8f9014 fix(dashboard): explain the access-token Name field inline (KEA-9387)
Create was silently disabled while Name was empty, and a name over the
route's 100-character limit was sent and came back as a generic
"Invalid request".

Create now stays enabled: a refused click flags Name inline (required,
or over the limit with the current count) and focuses it; an over-long
name is flagged as it is typed and is never cut or sent. The limit lives
in src/shared/constants/formLimits.ts and is the one the route's Zod
schema enforces. Validation messages come from a new shared
`formValidation` namespace (en.json only).
2026-11-20 18:04:53 -03:00
diegosouzapw
322fe4d8a3 Merge remote-tracking branch 'origin/release/v3.8.55' into feat/unified-decision-routing-v3855 2026-11-20 18:04:08 -03:00
diegosouzapw
1d11171379 fix(dashboard): database health card tells a failed or local-only check from "Attention needed" (KEA-9358)
/api/db/health is a local-only route, so on a remote dashboard the check
answers 403. The card read "no report" as unhealthy: "Attention needed" with
0 issues and 0 repairs, and "Run Auto-Repair" could only answer "HTTP 403".

- A session that cannot reach the route gets the shared local-only notice in
  the card, no auto-repair button, and no request (the 15 s poll skips it).
- With no report yet the status reads "Checking…"; when the check fails for
  another reason it reads "Check failed". Issues and repairs show a dash
  until a report exists. Only a real report can say "Attention needed".
2026-11-20 18:03:27 -03:00
diegosouzapw
eec0dbba04 fix(security): require the per-process token for the internal admission bypass
isInternalAdmissionBypass() accepted the bypass header together with a
bearer equal to resolveSelfLoopBearer(), which is the deployment env key
when one is configured. That key is an ordinary API key clients hold, so
it proved nothing about where a request came from.

Apply the rule from #19292: only the per-process self-hop token (held in
memory on globalThis, compared in constant time) grants the bypass and
the internal upstream-start cap. The vision bridge describe call, the
only caller that sends the bypass header, now also sends the token; it
only does so for this process's own listener.
2026-11-20 17:35:35 -03:00
Kiaro-Sama
d6c80663ba Merge release/v3.8.55 and preserve FAL action-settlement tests 2026-11-20 21:42:28 +03:30
diegosouzapw
9dd26ff009 fix(dashboard): show a clear notice for local-only features on a remote session (KEA-9357)
Local-only API routes (the route guard's LOCAL_ONLY tier) answer 403 to any
remote dashboard by design. Resilience > Connections showed a loading state
and then "This page is only accessible from localhost or LAN (LOCAL_ONLY).".

One source of truth for every such surface:
- the dashboard layout reads the authz pipeline's trusted peer-locality stamp
  and asks the route guard which registered dashboard paths a non-local
  session cannot reach (resolveDashboardLocalAccess), so a remote page knows
  before its first request;
- detectLocalOnlyRejection() recognises the guard's 403 body and remembers it
  for the session, for the cases the server cannot decide up front;
- useLocalOnlyBlocked(path) + <LocalOnlyNotice /> give pages one check and
  one plain-language message with no raw code and no retry.

Resilience > Connections now renders the notice on the first paint and sends
no request when the session is remote; a 403 that is not the local-only
rejection keeps the retryable error.

The route guard and every server-side tier are unchanged.
2026-11-20 15:05:01 -03:00
diegosouzapw
05fca3d432 fix(dashboard): label a combo's runtime config rows instead of raw keys (KEA-9368)
The combo detail page listed the stored settings under their config keys
("explorationRate", "routerStrategy", "candidatePool"), most visibly on
the built-in automatic routes.

Each row now shows a readable label: the English name from
comboControl.runtimeConfigLabel.<key> for every key the config schema
accepts, and the key spelled out in words for anything else (the schema
is passthrough, so a stored key can be one no message knows about).
2026-11-20 14:33:27 -03:00
diegosouzapw
23a39931cc fix(dashboard): paint Providers without waiting for OpenRouter stats (KEA-9368)
The Providers page kept its skeleton until five requests settled, one of
them /api/providers/openrouter-stats. That route answers from a 24h disk
cache, but with a cold, expired or unwritable cache it calls three
openrouter.ai endpoints (15s timeout each) before responding, and the
data only feeds the usage-rank chip on each card.

The stats now load beside the first paint (loadOpenRouterProviderStats)
instead of inside its gate; the cards gain the chip when it resolves.
2026-11-20 14:24:02 -03:00
diegosouzapw
6b543c35bc fix(dashboard): head the Analytics counts as "Used in this period" (KEA-9391)
The first block on Usage > Analytics showed Accounts, Providers, API Keys and
Models under the heading "Infrastructure". The four figures are distinct
entities that handled at least one request in the selected period and key
filter (summary.unique* and byProvider of /api/usage/analytics), so a workspace
with connections and keys but no traffic in the period read
"Infrastructure: 0 / 0 / 0 / 0".

The figures are unchanged; the heading now says what they count and a sentence
under it says that connections and keys without traffic are not included.
CompactStatGrid sections take an optional description and test id.
2026-11-20 14:08:07 -03:00
diegosouzapw
93e7b4ed7d fix(dashboard): show stream errors in the Playground instead of ending silently (KEA-9392)
A chat turn that fails after /v1/chat/completions has committed to
200 text/event-stream (the handler outlived the early-keepalive threshold:
1 s, or 15 s for keyless providers) can only report the failure in-band, as a
`data: {"error":{...}}` frame. The Playground's Chat and Compare readers only
looked at `choices[0].delta.content`, so that frame was dropped: "Generating…"
ended with neither a reply nor an error, and the network panel showed no
4xx/5xx.

- chatTabEndpointRequest: add readStreamError() for the in-band failure shapes
  the engine emits (chat `error`, Responses `error` / `response.failed`).
- ChatTab: surface the in-band error, report a stream that closes without any
  content, drop the empty assistant bubble, and buffer lines across network
  chunks so a split error frame is still parsed.
- CompareTab: an in-band error fails the column instead of finishing it empty.

The server side is unchanged: tests pin that withEarlyStreamKeepalive already
delivers the error in-band on the slow path.
2026-11-20 14:00:30 -03:00
diegosouzapw
1a3b4201d8 feat(dashboard): add the decision router settings to the combo builder
Step 10: picking the `decision` router strategy shows a section that
writes `config.decision`: decider (TypeSafe System One, own decision URL,
one of the combo's models), base URL and wire for http, model,
connection ID, timeout (100-5000 ms), minimum confidence, per-model
descriptions with the generated cost-rank text as placeholder, and a
one-off Test decision through POST /api/combos/decision-preview. There is
no API-key field. English strings only in en.json. Adapted from the
#18555 DecisionModelSection and draft helpers.

Co-authored-by: Marcel Rösler <3178520+BelphegorPrime@users.noreply.github.com>
2026-11-20 13:46:43 -03:00
diegosouzapw
451a1f187c feat(api): add the decision preview route for the combo builder
Step 9: POST /api/combos/decision-preview (management auth) builds the
decision menu and the generated cost-rank descriptions for an unsaved
combo. With a prompt it runs one decision with the unsaved settings,
behind the same COMBO_DECISION_ROUTER_ENABLED flag (off = skipped,
nothing fetched); combo-model decisions only exist inside a live request
and are skipped. The body is validated with a strict schema (no apiKey),
failures are log-safe reasons, and errors go through sanitizeErrorMessage.
Adapted from the #18555 preview route.

Co-authored-by: Marcel Rösler <3178520+BelphegorPrime@users.noreply.github.com>
2026-11-20 13:29:36 -03:00
diegosouzapw
87b3300373 feat(combo): validate the decision block in the combo save schema
Step 8: comboRuntimeConfigSchema now validates `config.decision` and the
decision block under `config.auto` with the strict decision schema: the
decider and wire are closed enums, baseUrl is http(s) up to 500
characters without credentials, query or fragment, model up to 200,
timeoutMs an integer from 100 to 5000, minConfidence from 0 to 1, and at
most 50 descriptions (key up to 300, value up to 1000). There is no apiKey
field: `.strict()` rejects it, so no secret can be stored in a combo.
The rest of `config.auto` stays free-form as before.

Co-authored-by: Marcel Rösler <3178520+BelphegorPrime@users.noreply.github.com>
Co-authored-by: Rafa Martins <146174365+rafacpti23@users.noreply.github.com>
2026-11-20 13:27:20 -03:00
diegosouzapw
54424ff5db feat(combo): add the decision auto-router strategy behind a default-off flag
Step 7: a new `decision` strategy in the Auto router registry, next to
nadir. The combo's decision block (config.auto.decision, or
config.decision for top-level router knobs) names the decider:
systemone, http or combo-model. The answer narrows the pool to the chosen
model and rules picks the connection; every failure falls back to rules
with `decision(<kind>): fallback (<reason>)` in the log line, never a URL,
key, prompt or upstream body.

COMBO_DECISION_ROUTER_ENABLED (default false, warning level caution) gates
every decider: while it is off no decider is built, so no credential is
read and nothing is fetched. The jev strategy and its flag are untouched.

resolveAutoStrategy only forwards the parsed block plus the request seams
(signal, handleSingleModel, combos, allowlist) into the routing context.
New tests pin that combos without a decision block keep exactly today's
order and context with the flag on, and that a decision combo with the
flag off routes like the rules fallback with zero fetch. The flag count
tests and the FEATURE_FLAGS.md catalog move from 126 to 127; the strategy
list test gains `decision`.

Co-authored-by: Marcel Rösler <3178520+BelphegorPrime@users.noreply.github.com>
2026-11-20 13:24:24 -03:00
diegosouzapw
1a7d0fce41 feat(decision): add the in-process combo-model decider with a depth guard
Step 6: one of the operator's own provider models answers the routing
question through the combo's handleSingleModel, the way the fusion judge
runs. Combo references (auto, auto/*, configured combo names, ids without
a provider prefix) are refused; the call is non-streaming, tool-free,
temperature 0 with a 256-token budget and carries none of the client's
system prompt, tools or history; an AsyncLocalStorage depth guard refuses
a decision started inside a decision call; the timeout aborts the target.
Prompt and parser are the OpenAI-chat decision wire from #15641.

Co-authored-by: Alvin T. Veroy <551419+alvinveroy@users.noreply.github.com>
2026-11-20 12:52:26 -03:00
diegosouzapw
a509e23269 feat(decision): add the http decider for System One and OpenAI-chat URLs
Step 5: an operator classifier at its own URL, on the System One wire
(#18555) or the OpenAI chat-completions wire (#15641: strict JSON system
prompt, extractJsonObject, confidence defaults to 0). The base URL must be
http(s) without credentials, query or hash; a URL pointing at this gateway
is refused (recursion); a failure cools the endpoint down for 30 s; a
choice outside the menu or a refusal is a failure, never a route.

Co-authored-by: Marcel Rösler <3178520+BelphegorPrime@users.noreply.github.com>
Co-authored-by: Alvin T. Veroy <551419+alvinveroy@users.noreply.github.com>
2026-11-20 12:48:52 -03:00
diegosouzapw
083cb4fcd4 feat(decision): add the TypeSafe System One decider and credential rules
Step 4: the systemone decider asks TypeSafe through the base client
(#15278). Its key comes only from a stored connection by reference
(connectionId, inside the API key allowlist, the jevAsk pattern) or from
OMNIROUTE_DECISION_API_KEY; a referenced connection outside the allowlist
yields no key and never falls back to the environment. The credential
inventory gains the new call site (class B, like jevAsk).

Co-authored-by: Miguel Enes <1568086+miguelenes@users.noreply.github.com>
2026-11-20 12:45:33 -03:00
diegosouzapw
c041def596 fix(typesafe): send System One calls through the guarded decision transport
Step 3: the TypeSafe System One client used a bare fetch, read the body
with an unbounded response.json() and followed redirects. It now posts
through the decision transport: safeOutboundFetch with the provider
outbound guard, no retries, redirects refused, a 64 KB body cap and the
same status-only failures. Timeouts, results and the jev callers are
unchanged.

Co-authored-by: Miguel Enes <1568086+miguelenes@users.noreply.github.com>
Co-authored-by: Rafa Martins <146174365+rafacpti23@users.noreply.github.com>
2026-11-20 12:38:44 -03:00
diegosouzapw
c0e20104bc feat(decision): add the bounded, guarded decision transport
Step 2: every network decider leaves through one path. safeOutboundFetch
with the provider outbound guard, no retries, redirects refused
(redirect "error" on the seam, allowRedirect false on the fetch), a body
read capped at 64 KB, one timeout over the whole round trip, caller abort,
and status-only failures so an upstream body never reaches a log.

Co-authored-by: Rafa Martins <146174365+rafacpti23@users.noreply.github.com>
Co-authored-by: Marcel Rösler <3178520+BelphegorPrime@users.noreply.github.com>
2026-11-20 12:31:46 -03:00
diegosouzapw
cc6c2a5109 feat(decision): add decider contract, choice menu and user-text extractor
Step 1 of the unified decision routing: the shared types every decider
returns (never throws, log-safe failure reasons), the menu of unique pool
models with operator or cost-rank descriptions, the bounded extractor of
the last user message (chat/Claude messages and Responses input; never the
system prompt, tools or instructions), and the anti-recursion header.

Co-authored-by: Marcel Rösler <3178520+BelphegorPrime@users.noreply.github.com>
Co-authored-by: Alvin T. Veroy <551419+alvinveroy@users.noreply.github.com>
2026-11-20 12:29:24 -03:00
Diego Rodrigues de Sa e Souza
03bef29916 Merge branch 'release/v3.8.55' into fix/qg-release-acceptance-live-20261119 2026-11-20 11:10:21 -03:00
Diego Rodrigues de Sa e Souza
d5b9af42f2 Merge branch 'release/v3.8.55' into fix/qg-mcp-a2a-toggle-readiness-20261120 2026-11-20 11:10:20 -03:00
diegosouzapw
661bf4a716 chore(changelog): name the fragment after PR #20781 2026-11-20 11:01:23 -03:00
diegosouzapw
a55e4a75ea feat(plugins): opt-in Node.js permission model for plugin processes
New feature flag PLUGIN_PERMISSION_MODEL_ENABLED (security, default off).
When it is on, pluginManager.activate() asks loadPlugin() to start the plugin
host with the Node.js permission model, built from the manifest by
buildPermissionModelArgs() (src/lib/plugins/permissionModel.ts):

- --permission (accepted by Node 22.22+, 24 and 26);
- --allow-fs-read for the generated host script and the plugin directory,
  plus the plugin data directory (plugin-data/<name> next to the plugin root)
  when file-read or file-write is declared;
- --allow-fs-write for the data directory only when file-write is declared;
- --allow-child-process only when exec is declared.

Workers, addons and WASI stay denied. network stays declarative because the
Node.js permission model does not gate outbound network access. With the flag
off the host argv and env are exactly as before.

PLUGIN_SDK.md gets a flag-off / flag-on permission table, PLUGIN_MARKETPLACE.md
and FEATURE_FLAGS.md document the flag, and the flag-count tests move to 127.
2026-11-20 10:29:23 -03:00
diegosouzapw
667e8bf086 chore(changelog): name the fragment after #20776 2026-11-20 10:26:33 -03:00
diegosouzapw
763fa9896d fix(security): gate subscription quota text on HTTP 400 behind a structured code
Apply the #20567 status contract to the subscription/plan quota text
signals ("usage limit reached", "plan limit", weekly/session usage
limits). On a 400 such a phrase now counts only with a structured
credit/quota code or for the message-only allow-listed providers
(command-code, bai, openai-compatible-*), so a phrase repeated from the
request no longer classifies as QUOTA_EXHAUSTED or puts a shared LLM or
search connection on hold. 429, 403 and every other status are
unchanged.

The status rule is extracted from isCreditsExhaustedForStatus into
quotaTextSignalCountsForStatus and reused by the classifier, the
fallback engine and the search cooldown.
2026-11-20 10:22:56 -03:00
Diego Rodrigues de Sa e Souza
8b6d316fa2 Merge branch 'release/v3.8.55' into fix/qg-release-acceptance-live-20261119 2026-11-20 08:57:25 -03:00
Diego Rodrigues de Sa e Souza
26f2b46a09 Merge branch 'release/v3.8.55' into fix/qg-mcp-a2a-toggle-readiness-20261120 2026-11-20 08:57:25 -03:00
Naresh
6abef3e0b0 refactor(oauth): type CopilotRefreshResult and extract GHE fallback helpers 2026-11-20 16:03:06 +05:30
RayJW
ad692750b8 docs: add changelog fragment for Mistral prompt caching 2026-11-20 11:32:14 +01:00
RayJW
1c7921df6a feat(sse): enable Mistral prompt caching on Chat and Responses paths 2026-11-20 11:32:13 +01:00
Diego Rodrigues de Sa e Souza
372c5bddd0 Merge branch 'release/v3.8.55' into fix/qg-release-acceptance-live-20261119 2026-11-20 07:31:43 -03:00
Diego Rodrigues de Sa e Souza
58d5456411 Merge branch 'release/v3.8.55' into fix/qg-mcp-a2a-toggle-readiness-20261120 2026-11-20 07:31:43 -03:00
Naresh
f6b93c3540 fix(oauth): support GHE data residency copilot_internal/user fallback 2026-11-20 14:54:48 +05:30
Diego Rodrigues de Sa e Souza
6d03588cb9 Merge branch 'release/v3.8.55' into fix/qg-release-acceptance-live-20261119 2026-11-20 06:10:16 -03:00
Diego Rodrigues de Sa e Souza
0c64e2aa0c Merge branch 'release/v3.8.55' into fix/qg-mcp-a2a-toggle-readiness-20261120 2026-11-20 06:10:15 -03:00
Diego Rodrigues de Sa e Souza
bb417eb1fb Merge branch 'release/v3.8.55' into fix/qg-release-acceptance-live-20261119 2026-11-20 04:53:50 -03:00
Diego Rodrigues de Sa e Souza
15a524d68f Merge branch 'release/v3.8.55' into fix/qg-mcp-a2a-toggle-readiness-20261120 2026-11-20 04:53:49 -03:00
Chirag Singhal
70fad90bd0 chore(changelog): add copilot English output fix fragment 2026-11-20 13:02:09 +05:30
Chirag Singhal
1e8823b7c5 fix(copilot): translate Spanish system prompt and help text
Translate the copilot system prompt, help response, knowledge examples, and create-combo guidance from Spanish to English. Keep the multilingual input-matching regexes so Spanish-speaking users are still classified correctly. Add a unit test that pins English output and the preserved matchers.
2026-11-20 13:00:46 +05:30
Diego Rodrigues de Sa e Souza
6e9f26d725 Merge branch 'release/v3.8.55' into fix/qg-release-acceptance-live-20261119 2026-11-20 03:28:52 -03:00
Diego Rodrigues de Sa e Souza
8b91fd1ce7 Merge branch 'release/v3.8.55' into chore/derived-qg-reviewed-combo-skill-20261119 2026-11-20 03:28:51 -03:00
diegosouzapw
850f8e42d4 Merge commit '6a5dadd172195d2e1b39c6904f8f12af32192c91' into fix/qg-mcp-a2a-toggle-readiness-20261120 2026-11-20 03:27:36 -03:00
diegosouzapw
e8e2af304a Merge commit '4624250231f49ed118fb4522a9d735e4894322c6' into fix/qg-mcp-a2a-toggle-readiness-20261120 2026-11-20 02:22:53 -03:00
Diego Rodrigues de Sa e Souza
981285b1eb Merge branch 'release/v3.8.55' into fix/qg-release-acceptance-live-20261119 2026-11-20 01:57:14 -03:00
diegosouzapw
17293dfef7 Merge commit 'bd9b1324abb82f0e00066f631b6dd7744e5d975a' into fix/qg-mcp-a2a-toggle-readiness-20261120 2026-11-20 01:31:15 -03:00
Bl0ck154
ca94adaa17 chore(upstream): refresh Codex live-plan PR on current release base
Incorporate official release/v3.8.55 through bd9b1324ab, including the upstream call-log teardown fix for the previously failing TIA test. Source-only additive merge, no feature-code rewrite or force push.
2026-11-20 06:21:06 +02:00
Bl0ck154
01781da04c chore(upstream): reconcile Terra catalog with current release branch
Additive merge of cheaper-inference/OmniRoute release/v3.8.55; retain upstream's equivalent VS Code Terra effort recognition and keep provider catalog changes focused. Upstream's existing translated-doc whitespace is outside the PR delta.
2026-11-20 06:13:15 +02:00
Jacky Fong
a1ca8e9111 fix quality gates 2026-11-20 12:12:16 +08:00
diegosouzapw
480c40c98e test(ui): synchronize MCP and A2A toggle fixtures 2026-11-20 00:37:15 -03:00
Diego Rodrigues de Sa e Souza
0ff88fa7b9 Merge branch 'release/v3.8.55' into chore/derived-qg-reviewed-combo-skill-20261119 2026-11-20 00:04:36 -03:00
Diego Rodrigues de Sa e Souza
6e82b457ed Merge branch 'release/v3.8.55' into fix/qg-release-acceptance-live-20261119 2026-11-20 00:04:35 -03:00
diegosouzapw
04f84e859c fix(dashboard): keep copilot-m365-web first in providerSupportsOAuth (#20573)
Restructure the keychain-only exclusion so the copilot-m365-web branch stays
the first, unconditional operand (copilot-m365-web is never keychain-only).
Same behaviour; keeps the m365-native-catalog-auth source contract.
2026-11-19 23:34:46 -03:00
Diego Rodrigues de Sa e Souza
2493e493c7 Merge branch 'release/v3.8.55' into chore/derived-qg-reviewed-combo-skill-20261119 2026-11-19 23:14:20 -03:00
Diego Rodrigues de Sa e Souza
f64643f540 Merge branch 'release/v3.8.55' into fix/qg-release-acceptance-live-20261119 2026-11-19 23:14:20 -03:00
Diego Rodrigues de Sa e Souza
07024bc8ae Merge branch 'release/v3.8.55' into fix/qg-release-acceptance-live-20261119 2026-11-19 20:30:10 -03:00
Diego Rodrigues de Sa e Souza
27ffdecfb7 Merge branch 'release/v3.8.55' into chore/derived-qg-reviewed-combo-skill-20261119 2026-11-19 20:20:12 -03:00
serenity
b7e971ff97 fix(routing): cache a bare-model lookup only under the version it was read at
A catalog write can land while the lookup awaits, and a concurrent lookup can
then move the cache to the new version before this one stores its result.
Store the providers only when the model-catalog version is still the one
captured before the query, so a pre-write answer is never kept under the
post-write version.
2026-11-19 20:02:07 -03:00
diegosouzapw
22fa1077a1 Merge remote-tracking branch 'origin/release/v3.8.55' into HEAD 2026-11-19 19:24:10 -03:00
diegosouzapw
8afef56d24 fix(cli): accept null command in healthcheck fall-through helper (#20452) 2026-11-19 19:10:23 -03:00
diegosouzapw
8c91d2f836 test(catalog): align synced-row body contract with #20415 (no placeholder context_length) 2026-11-19 18:57:36 -03:00
Diego Rodrigues de Sa e Souza
673b7b7920 Merge branch 'release/v3.8.55' into fix/qg-release-acceptance-live-20261119 2026-11-19 18:56:30 -03:00
diegosouzapw
bd588469ae refactor(backup): extract schedule tick helpers to satisfy complexity ratchet (#20494) 2026-11-19 18:51:39 -03:00
diegosouzapw
c79e87a395 refactor(cli): extract healthcheck fall-through helper to keep getCliRuntimeStatus under complexity budget (#20452) 2026-11-19 18:50:50 -03:00
Diego Rodrigues de Sa e Souza
d8f7fc2d1c Merge branch 'release/v3.8.55' into chore/derived-qg-reviewed-combo-skill-20261119 2026-11-19 18:41:51 -03:00
Minxi Hou
d5ea56822e providers/oauth: sync models when a connection is created
A provider whose catalog is authoritative only advertises the models its
account returned on the last sync. A connection added through OAuth therefore
stayed active with an empty catalog until the six-hour scheduler reached it, and
every request for a model only that account has failed with "not available in
the active live catalog" until someone pressed sync by hand.

Both create paths now hand the connection to one shared trigger. Eligibility is
the scheduler's own predicate, so antigravity and agy connections qualify on
their default autoSync while API-key providers keep their explicit
autoFetchModels opt-in. The sync goes through the same loopback helper as the
scheduler, keeps the import semantics the API-key path had, and runs at most
once per connection per five minutes so a single sign-in cannot fire one sync
per path it touches.

Signed-off-by: Minxi Hou <houminxi@gmail.com>
2026-11-19 15:15:42 -05:00
Diego Rodrigues de Sa e Souza
ed369ab631 Merge branch 'release/v3.8.55' into fix/qg-release-acceptance-live-20261119 2026-11-19 17:06:49 -03:00
Diego Rodrigues de Sa e Souza
d61cb3d779 Merge branch 'release/v3.8.55' into chore/derived-qg-reviewed-combo-skill-20261119 2026-11-19 17:03:20 -03:00
Diego Rodrigues de Sa e Souza
7c7b65cc4f Merge branch 'release/v3.8.55' into chore/derived-qg-reviewed-combo-skill-20261119 2026-11-19 16:37:57 -03:00
Diego Rodrigues de Sa e Souza
afb71db50a Merge branch 'release/v3.8.55' into chore/derived-qg-reviewed-combo-skill-20261119 2026-11-19 15:25:05 -03:00
Diego Rodrigues de Sa e Souza
f463a50c92 Merge branch 'release/v3.8.55' into fix/qg-release-acceptance-live-20261119 2026-11-19 15:25:03 -03:00
Diego Rodrigues de Sa e Souza
660abd192e Merge branch 'release/v3.8.55' into fix/qg-release-acceptance-live-20261119 2026-11-19 14:41:48 -03:00
Abhishek Divekar
0aacc3d654 docs(api): scope no-log header to every chat-family route
The header is read from clientRawRequest.headers in chatCore, which every route built on handleChat reaches: Chat Completions, Responses, Messages, Completions and the Gemini-compatible path. The previous wording limited it to chat and Responses.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-19 22:33:25 +05:30
Abhishek Divekar
e3e93d7287 docs(api): scope no-log header to chat and Responses
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-19 22:33:25 +05:30
Abhishek Divekar
441ac64b73 fix(api): drop prompt-derived usage context for header no-log
Resolve the effective no-log decision before agent-context extraction and pass it to resolveUsageAgentContext. A normal key sending x-omniroute-no-log: true now drops prompt-derived projectPath, gitBranch and path-derived projectName from usage attribution while keeping explicit header identifiers.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-19 22:33:25 +05:30
Abhishek Divekar
fbe200d813 docs(changelog): add fragment for per-request no-log header
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-19 22:33:25 +05:30
Abhishek Divekar
8e60d2af75 feat(api): add per-request no-log header
Add x-omniroute-no-log as a per-request opt-out of call-log payload persistence. The header is ORed with the API key's no_log flag; the call log row keeps timestamp, model, status, duration and token counts, while request/response bodies, summaries and pipeline artifacts are omitted.

The header is stripped from executor client headers so it never reaches an upstream provider. Memory extraction and the semantic cache remain separate opt-outs (x-omniroute-no-memory / x-omniroute-no-cache).

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-19 22:33:25 +05:30
diegosouzapw
338fb20d5f docs(changelog): add fragment for #20679
Co-authored-by: Nick Krzemienski <krzemienski@gmail.com>
2026-11-19 13:32:17 -03:00
diegosouzapw
d83a028e77 fix(routing): keep local-CLI providers without a binary out of auto and family pools
auto/<family> pools bypass the no-auth allowlist and rely on the readiness
gate alone (#18417). /v1/models already hides auggie and zcode when their
binary cannot be resolved on the host (#18753), but the pools never got
the same verdict, so family pools kept routing to a CLI that cannot start.

registerNoAuthAutoRoutingReadiness() now registers a readiness probe for
every provider localCliAvailability can check (exposed through
getBinaryGatedLocalCliProviderIds(), today auggie and zcode). The probe
reads the module's cached verdict, the same one the catalog uses. No
second availability module: devin-cli-agentic keeps its login probe and
codex-app-server stays fail-open, as #18753 decided.

Salvaged from #19995.

Co-authored-by: Nick Krzemienski <krzemienski@gmail.com>
2026-11-19 13:24:47 -03:00
Jacky Fong
55e72bc7e9 Change the Studio API key to "Studio" to avoid confusion on "FREE" plan_name 2026-11-20 00:23:51 +08:00
Diego Rodrigues de Sa e Souza
dc6d977d93 Merge branch 'release/v3.8.55' into chore/derived-qg-reviewed-combo-skill-20261119 2026-11-19 13:21:15 -03:00
Diego Rodrigues de Sa e Souza
da6ebce463 Merge branch 'release/v3.8.55' into fix/qg-release-acceptance-live-20261119 2026-11-19 13:06:33 -03:00
diegosouzapw
750e3cf4c6 fix(memory): skip a failing rerank model during a backoff window (#20535) 2026-11-19 12:51:21 -03:00
diegosouzapw
3eefe55eec fix(dashboard): stop Zed 'Add' from opening a dead-end OAuth modal (#20573) 2026-11-19 12:35:00 -03:00
diegosouzapw
57228db5f4 docs(changelog): add fragment for #20658
Co-authored-by: Nick Krzemienski <krzemienski@gmail.com>
2026-11-19 12:16:52 -03:00
diegosouzapw
09bfd12c10 fix(cli): keep setup-claude's effortLevel within the model's effort tiers
setup-claude wrote the category's effortLevel (xhigh/high/low) into every
profile even when the catalog row lists the model's effort tiers and the
level is not one of them. The level is now kept within
capabilities.effort_tiers: a level the model does not offer is lowered to
the highest listed level below it (never to minimal, which is not a Claude
Code level), and omitted when no level fits. Without catalog tiers the
category level passes through unchanged.

buildProfileSettings keeps its (modelId, baseUrl, cfg, contextWindow)
contract and takes the tiers as an optional fifth argument;
syncClaudeProfilesFromModels reads them from each catalog row, so the
dashboard auto-sync (claudeProfileAutoSync) gets the same behavior. The
compact-window logic (claudeWindowEnv, #19465) is unchanged.

Salvaged from #19973.

Co-authored-by: Nick Krzemienski <krzemienski@gmail.com>
2026-11-19 12:06:27 -03:00
diegosouzapw
1a1db0f7e9 fix(guardrails): log chat injection-guard blocks and name the matched rule ids (#20526) 2026-11-19 11:53:19 -03:00
diegosouzapw
5f2573a22d fix(ci): validate explicit routes and path parameters in OpenAPI 2026-11-19 11:31:55 -03:00
diegosouzapw
cac1cae3bd chore(docs): reconcile reviewed skills with the current release base 2026-11-19 11:25:04 -03:00
diegosouzapw
c99b06a882 fix(ci): bind shadow acceptance to the real checkout 2026-11-19 11:23:08 -03:00
diegosouzapw
09a914a133 docs(skills): synchronize reviewed VS Code combo routes 2026-11-19 10:36:47 -03:00
Timo Otten
a6ef3f5225 style(tests): apply Prettier to the zed-hosted tool-prefix regression test 2026-11-19 08:45:20 -03:00
diegosouzapw
33bd232991 Merge remote-tracking branch 'origin/release/v3.8.55' into HEAD 2026-11-19 08:31:29 -03:00
Praveen K Palaniswamy
9aa9b27457 test(images): import the combos module before the first Leonardo edit test
check:test-tla-order rejected the top-level await placed between test() calls:
under --test-force-exit the later tests can silently never run (#18045). Move
the combos.ts import up with the other top-level imports.
2026-11-19 08:20:50 -03:00
Stanley Tejakusuma
50dfb9d0d8 fix(sse): treat a withheld terminal as unseen until it is delivered
Address review of the empty-stream hold-back:
- mark the client terminal seen only when it reaches the client, so a client
  that leaves while it is withheld is recorded as a disconnect, not a completion
- skip the hold for a permitted empty turn so it is not delayed by the grace
- stop judging the upstream end after the client has left
- cover reasoning-only length, content_filter, empty-argument tool calls,
  Claude tool_use without input deltas and Responses function calls
2026-11-19 18:16:55 +07:00
diegosouzapw
a8d10a4a89 Merge remote-tracking branch 'origin/release/v3.8.55' into HEAD 2026-11-19 08:11:34 -03:00
diegosouzapw
5dbfad9be4 Merge remote-tracking branch 'origin/release/v3.8.55' into HEAD 2026-11-19 08:08:53 -03:00
Stanley Tejakusuma
70a0fab2a6 docs(sse): clarify the held-terminal grace comment 2026-11-19 17:57:11 +07:00
diegosouzapw
ab3bac1341 Merge remote-tracking branch 'origin/release/v3.8.55' into HEAD 2026-11-19 07:53:06 -03:00
Stanley Tejakusuma
ae003e3106 fix(sse): deliver the empty-stream error before the client terminal
An upstream stream that ends with no content was detected (#8649) only once
the reader reported done, so the translated terminal (data: [DONE],
message_stop, response.completed) had already reached the client and the
error frame landed behind it. The openai SDK stops at [DONE], so Pi recorded
an empty but successful finish_reason: stop and never retried.

Withhold a self-contained terminal while the stream still looks empty and
release or drop it once the stream is judged. A keep-alive upstream that
stays open after its terminal gets it released after a 1 s grace, exactly
as before.
2026-11-19 17:49:29 +07:00
diegosouzapw
fc0c4497a6 Merge remote-tracking branch 'origin/release/v3.8.55' into HEAD 2026-11-19 07:46:52 -03:00
diegosouzapw
90ebc88688 Merge remote-tracking branch 'origin/release/v3.8.55' into HEAD 2026-11-19 07:39:59 -03:00
diegosouzapw
4af29a4213 Merge remote-tracking branch 'origin/release/v3.8.55' into HEAD 2026-11-19 07:31:47 -03:00
diegosouzapw
668c18fed3 Merge remote-tracking branch 'origin/release/v3.8.55' into HEAD 2026-11-19 07:30:40 -03:00
diegosouzapw
81a5a241fc Merge remote-tracking branch 'origin/release/v3.8.55' into HEAD 2026-11-19 07:30:01 -03:00
sdfsdfw2
0a94768e38 style(dashboard): apply prettier to the banned keywords card and its test 2026-11-19 07:26:46 -03:00
diegosouzapw
34528b6f0c Merge remote-tracking branch 'origin/release/v3.8.55' into HEAD 2026-11-19 07:25:34 -03:00
diegosouzapw
7cdaaddf62 Merge remote-tracking branch 'origin/release/v3.8.55' into HEAD 2026-11-19 07:17:26 -03:00
diegosouzapw
f47c461a96 Merge remote-tracking branch 'origin/release/v3.8.55' into HEAD 2026-11-19 07:15:48 -03:00
Dizzle
53274f72a2 test(plugin): record the omitted output limit as a documented parity exclusion
v1 filled a missing gateway max_output_tokens with limit.output 0; v2 now
leaves limit.output out. The v1-vs-v2 mapper parity check asserts both
sides of that divergence explicitly and compares the rest of the payload.
2026-11-19 06:55:41 -03:00
diegosouzapw
346c841505 Merge remote-tracking branch 'origin/release/v3.8.55' into HEAD 2026-11-19 06:52:03 -03:00
diegosouzapw
f339db01bc Merge remote-tracking branch 'origin/release/v3.8.55' into HEAD 2026-11-19 06:39:30 -03:00
Tomas Fecko
c4a4f5e4d6 refactor(sse): move preflight window warnings into a helper
preflightQuota grew past the 80-line function cap once the expired-window
skip landed, which tripped the new-code complexity ratchet. The per-window
warning loop now lives in warnApproachingWindowCutoffs; behavior is unchanged.
2026-11-19 06:34:43 -03:00
diegosouzapw
0a8c4b73c6 Merge remote-tracking branch 'origin/release/v3.8.55' into HEAD 2026-11-19 06:27:35 -03:00
diegosouzapw
cfbad7a0e3 Merge remote-tracking branch 'origin/release/v3.8.55' into HEAD 2026-11-19 06:23:18 -03:00
diegosouzapw
1b23c92de4 fix(providers): keep the stored Codex catalog when a degraded discovery returns a shorter list (#16714) 2026-11-19 06:22:07 -03:00
diegosouzapw
3643900d93 fix(pwa): restore English name and description in the PWA manifest (#20504) 2026-11-19 06:09:20 -03:00
Edo Sulai
7475d0cdcd fix(claude-web): ignore unhandled stream events gracefully
Anthropic Web periodically introduces new telemetry or metadata SSE events.
Previously, unexpected event types triggered an immediate fatal protocol
error in dispatchProtocolEvent, aborting the active text stream.
This changes unhandled events to fail open by returning null, allowing
the text stream to continue uninterrupted.
2026-11-19 16:07:30 +07:00
diegosouzapw
213be12dfa Merge remote-tracking branch 'origin/release/v3.8.55' into HEAD 2026-11-19 06:06:47 -03:00
diegosouzapw
e71c4637d2 fix(backup): scheduled encrypted backups need and use --key-file (#20494) 2026-11-19 06:04:07 -03:00
diegosouzapw
638cc4de86 fix(catalog): do not advertise passthrough provider default as context_length (#20415) 2026-11-19 05:51:26 -03:00
diegosouzapw
eed5f49366 fix(cli): fall through to the next PATH candidate when the first CLI healthcheck fails (#20452) 2026-11-19 05:37:53 -03:00
diegosouzapw
039bfcf2b1 Merge remote-tracking branch 'origin/release/v3.8.55' into HEAD 2026-11-19 05:32:55 -03:00
diegosouzapw
41c6c72406 Merge remote-tracking branch 'origin/release/v3.8.55' into HEAD 2026-11-19 05:19:19 -03:00
diegosouzapw
9396d4e3c7 fix(providers): clamp Cohere reasoning_effort to high and learn its 422 wording (#20363) 2026-11-19 04:56:29 -03:00
diegosouzapw
e17c636eef fix(images): reject non-PNG output_format on Codex GPT Image routes (#19252) 2026-11-19 04:32:42 -03:00
diegosouzapw
03d3ca6d15 fix(providers): dedupe replayed Cloudflare Playground stream chunks (#18732) 2026-11-19 04:21:38 -03:00
Bl0ck154
e507625c5d style(gemini): apply Prettier to explicit thinking level change 2026-11-19 03:59:49 -03:00
Guan Gui
98a607305b docs(changelog): add fragment for #20581 2026-11-19 17:56:44 +11:00
diegosouzapw
0dcacf5e07 Merge remote-tracking branch 'origin/release/v3.8.55' into HEAD 2026-11-19 03:47:22 -03:00
diegosouzapw
cecb3fbb9b Merge remote-tracking branch 'origin/release/v3.8.55' into HEAD 2026-11-19 03:46:20 -03:00
Bl0ck154
b95971b9ed style(tests): apply Prettier to Codex live plan sync tests 2026-11-19 03:41:57 -03:00
diegosouzapw
efd935b29c Merge remote-tracking branch 'origin/release/v3.8.55' into HEAD 2026-11-19 03:30:24 -03:00
Guan Gui
8072ca2feb fix(sse): copy Claude passthrough blocks before hoisting system messages
A combo replays the caller's request body on its next target, and
buildClaudePassthroughBody only shallow-copies it. Hoisting a marked
system/developer message moves its cache_control onto the preceding block
in place (#9436), so that block stays marked in the shared body. On the
next target the hoisted marker can't move again and is kept, and the
request carries 5 cache_control blocks, which Anthropic rejects: "A maximum
of 4 blocks with cache_control may be provided. Found 5."

Copy the blocks once, before any rewrite, instead of only before the
marker-less breakpoint injection.
2026-11-19 17:24:26 +11:00
diegosouzapw
0e610bf3bd Merge remote-tracking branch 'origin/release/v3.8.55' into HEAD 2026-11-19 03:08:47 -03:00
Bl0ck154
75535a76a5 style(tests): restore Prettier 3.9 formatting of image route imports 2026-11-19 02:41:17 -03:00
diegosouzapw
e73695c4f8 Merge remote-tracking branch 'origin/release/v3.8.55' into HEAD 2026-11-19 02:34:01 -03:00
diegosouzapw
941ae91f12 Merge remote-tracking branch 'origin/release/v3.8.55' into HEAD 2026-11-19 02:25:04 -03:00
xiaoyaner0201
37f28cbfb7 fix(combo): keep every unit's status when an earlier reason carries a credential label
Each unit's reason was sanitized on its own and then the joined message was
sanitized again as a whole. The sanitizer redacts a credential label fail-closed,
so the second pass matched an already-redacted "Password: [REDACTED]" and cut
that unit's status and every later unit from the terminal message.

Sanitize the unit label on its own as well and stop re-sanitizing the joined
message: every upstream-derived part is already sanitized and the rest is fixed
text. Adds a RED->GREEN test.
2026-11-19 02:00:32 -03:00
diegosouzapw
92c289d042 Merge remote-tracking branch 'origin/release/v3.8.55' into HEAD 2026-11-19 01:57:22 -03:00
xiaoyaner0201
d720f0e6d8 fix(db): read, merge and write a reasoning rule update in one tick
update() awaited findById() between reading the row and running the
UPDATE, so two overlapping updates of the same rule could both read the
same base row and the second write dropped the first caller's fields.
Read the row synchronously so the read, merge, reference check and write
cannot interleave.
2026-11-19 01:53:45 -03:00
diegosouzapw
8d1f89789a Merge remote-tracking branch 'origin/release/v3.8.55' into HEAD 2026-11-19 01:46:17 -03:00
diegosouzapw
33237e2c6c Merge remote-tracking branch 'origin/release/v3.8.55' into HEAD 2026-11-19 01:43:27 -03:00
serenity
b35e5d7edb fix(qoder): check billing codes 110/112 before the busy heuristic
The inner payload of a billing block can carry `isQueued`, whose name
matches the broad "queued" busy heuristic, so the envelope unwrapper and
the CLI failure parser returned 503 upstream_busy instead of 429
qoder_billing_block. The exact billing codes are now checked first.
2026-11-19 01:37:48 -03:00
serenity
fce14fe8b4 fix(plugins): treat an in-place onRequest body rewrite as a rewrite
A hook that replaces a top-level body property in place and returns the same
object was remembered as a pass-through, so a failover attempt that got its
own top-level copy of the body skipped the hook and lost the rewrite. The gate
now compares the body's top-level property references before and after the
hook and only remembers an unchanged body. The changelog fragment states the
cases that still call the hook again.
2026-11-19 01:19:17 -03:00
serenity
cd5ef453ea docs(changelog): number the fragment (#20245) 2026-11-19 01:19:09 -03:00
Kiaro-Sama
19e08a4492 docs(changelog): format Anthropic fix as a bullet 2026-11-19 07:48:45 +03:30
serenity
67713adb33 fix(translator): copy the Claude content block whose tool id Pass 1.4 rewrites
prepareClaudeRequest sanitized tool_use / tool_result ids in place, so a
Claude-format caller block (shared with later combo targets) lost its
original id. The rewritten block is now a copy. The id assertion of the
normalized-values test no longer accepts a missing id coerced to a string.
2026-11-19 01:18:38 -03:00
diegosouzapw
33e725b52e Merge remote-tracking branch 'origin/release/v3.8.55' into HEAD 2026-11-19 01:16:30 -03:00
diegosouzapw
8687b146ca Merge remote-tracking branch 'origin/release/v3.8.55' into HEAD 2026-11-19 01:08:30 -03:00
serenity
c0cbf22446 fix(usage): keep Command Code extra credits out of the monthly-cap usage
With a known plan cap, used was cap minus ALL remaining credits, so purchased or
free credits hid an exhausted monthly allowance (used=0, 100% left). Used now
follows the monthly pool only; the extra credits still extend the total so the
account stays spendable for quota preflight.
2026-11-19 00:45:30 -03:00
diegosouzapw
6858939017 Merge remote-tracking branch 'origin/release/v3.8.55' into HEAD 2026-11-19 00:36:41 -03:00
diegosouzapw
09cbb1a389 Merge remote-tracking branch 'origin/release/v3.8.55' into HEAD 2026-11-19 00:36:03 -03:00
serenity
f682521dc5 test(command-code): isolate the default CLI version check from COMMAND_CODE_VERSION
COMMAND_CODE_VERSION is a supported override read at module load, so a developer
environment that sets it made the default-version assertions fail. Clear it before
the per-process import.
2026-11-19 00:32:08 -03:00
diegosouzapw
6cd6138ea5 Merge remote-tracking branch 'origin/release/v3.8.55' into HEAD 2026-11-19 00:23:48 -03:00
serenity
eadb47a9d4 fix(responses): keep a placeholder message when dropped tool items leave none
An input of only a blank-id custom_tool_call and its blank-id output now drops
both, which left messages:[] and an upstream 400. Apply the empty-input
placeholder after conversion too, when no message survived.
2026-11-19 00:17:47 -03:00
serenity
00e66d2c3e fix(responses): keep a placeholder message when skipped items leave none
An input of only a replayed image_generation_call is skipped item by item,
which left messages:[] and an upstream 400. Apply the empty-input placeholder
after conversion too, when no message survived.
2026-11-19 00:12:21 -03:00
diegosouzapw
8274bfbc3a Merge remote-tracking branch 'origin/release/v3.8.55' into HEAD 2026-11-19 00:06:00 -03:00
serenity
4e94e65c65 fix(admission): honour the route's queueMs in the structural stage and close the test DB
- withChatAdmission passed CHAT_ADMISSION_QUEUE_MAX_MS to admitChatStructure
  even when the route set queueMs, so queueMs 0 could still wait and admit a
  busy request. The structure stage now gets the same wait as the byte stage
  (regression test: a lease freed during the wait is not taken).
- The structure test drains the call-log writes and resets the DB handle.
2026-11-18 23:58:59 -03:00
serenity
1e7c336c7b fix(qoder): count an image nested in a Claude tool_result as image input
hasQoderImageParts only read top-level content parts, so a Claude request whose
only image sat inside a tool_result (and that declared no tools) did not require
the HTTP transport, and selection could pick a PAT connection.
2026-11-18 23:54:49 -03:00
diegosouzapw
6241ac2524 Merge remote-tracking branch 'origin/release/v3.8.55' into HEAD 2026-11-18 23:51:15 -03:00
Dizzle
6e86273249 fix(syntx): report failed media reference uploads with explicit status
A data URL that could not be decoded or an upload that was rejected was silently dropped and generation continued without the reference; both now return an explicit 400 or 502 and the new cases fail without the change.
2026-11-19 03:45:00 +01:00
diegosouzapw
f3f689c269 Merge remote-tracking branch 'origin/release/v3.8.55' into HEAD 2026-11-18 23:43:38 -03:00
serenity
1b2a4152d0 fix(skills): inject no cached skill when the registry load fails
A failed loadFromDatabase leaves the previous load's entries in the registry,
and the request then advertised them through injectSkillsWithMetadata, so a
removed or changed skill could still reach the model. The request now skips
custom-skill injection after a failed load; client and memory tools stay as
they were.
2026-11-18 23:42:18 -03:00
diegosouzapw
81e6ee6983 Merge remote-tracking branch 'origin/release/v3.8.55' into HEAD 2026-11-18 23:30:00 -03:00
serenity
5eba15a417 fix(translator): keep Gemini 2.5 Pro thinking and Kiro orphan tool errors
- claude-to-gemini: an enabled numeric budget_tokens keeps its priority over
  output_config.effort "none", and Gemini 2.5 Pro (which cannot switch
  thinking off and answers 400 to a zero budget) keeps its upstream default.
  The existing gemini-2.5-pro effort=none test goes back to its base form.
- openai-to-kiro: a failed tool result whose tool call is missing from the
  history keeps the [tool_error: true] line when the builder turns it into
  text, since the status field is dropped with toolResults.
2026-11-18 22:53:04 -03:00
serenity
ebf4ee4ba1 fix(a2a): abort a task's signal when the TTL cleanup fails it
cleanupExpired marked an expired task failed and dropped its controller
without aborting it, so a running smart-routing fetch kept going until its
own timeout. Covered by a failing-then-passing fake-timer test.

Also clear OMNIROUTE_PORT (and restore the port env afterwards) in the
exact config-status test, which expects the default port.
2026-11-18 22:48:51 -03:00
diegosouzapw
31d443937b Merge remote-tracking branch 'origin/release/v3.8.55' into HEAD 2026-11-18 22:45:27 -03:00
serenity
db60bd3aea docs(security): spell out the CCH hash-view replacements
Name the two hashView() patterns in order and note that the model
pattern stops at the first quote, so an escaped quote in a model value
is emptied only up to it, as the captured client does.
2026-11-18 22:42:00 -03:00
serenity
8e72d9176a fix(sse): skip the stripped proxy_ alias when a declared tool matches it in any case
The stream restorer matches tool names case-insensitively, so a search alias
for a declared proxy_search renamed an upstream SEARCH (a declared tool) to
proxy_search. Add the alias only when no declared name equals the stripped
name ignoring case.
2026-11-18 22:41:28 -03:00
diegosouzapw
62e876f89d Merge remote-tracking branch 'origin/release/v3.8.55' into HEAD 2026-11-18 22:38:15 -03:00
diegosouzapw
f7637eea68 Merge remote-tracking branch 'origin/release/v3.8.55' into HEAD 2026-11-18 22:38:07 -03:00
serenity
f5b08ffd72 test(cache): pin that a tool-message part marker never reaches OpenRouter
An OpenAI-format client can mark a part of a role:"tool" message. The
marker moves off the part (Anthropic rejects cache_control inside
tool_result.content) and the OpenAI echo-field pass drops it from the
message, so OpenRouter anthropic/* requests still carry 4 serialized
breakpoints at most.
2026-11-18 22:34:52 -03:00
serenity
610fbaac81 fix(security): budget the encoded-injection decode in bytes, not candidates
A count of 64 candidates let short decoy hex runs placed first use up the
budget, so a base64-encoded instruction after them was never decoded.
Budget decoded bytes instead, sized above what the 16 KB scan text can
produce over both layers, so no candidate is skipped. Covered by a
failing-then-passing decoy test plus a cost test for a text packed with
readable encoded runs.
2026-11-18 22:34:52 -03:00
diegosouzapw
2f6cfeadc2 Merge remote-tracking branch 'origin/release/v3.8.55' into HEAD 2026-11-18 22:31:31 -03:00
serenity
2493627c32 test(cache): drive a content_filter stream through the assembler into the store
The store guard test fed content_filter straight into the assembled body.
Push a passthrough content_filter stream and a translated Claude refusal
through the real stream assemblers and check the assembled body keeps the
reason and the streaming store refuses it.
2026-11-18 22:18:41 -03:00
diegosouzapw
71462bb859 Merge remote-tracking branch 'origin/release/v3.8.55' into HEAD 2026-11-18 22:18:03 -03:00
diegosouzapw
b5ab2b23b3 Merge remote-tracking branch 'origin/release/v3.8.55' into HEAD 2026-11-18 22:17:44 -03:00
diegosouzapw
69f69fa597 Merge remote-tracking branch 'origin/release/v3.8.55' into HEAD 2026-11-18 22:11:44 -03:00
serenity
84b3a39598 fix(codex): end the app-server turn when the event backlog overflows
A push that overflows the AsyncEventQueue backlog throws from the socket
notification and tool-call callbacks, outside run()'s catch. The error
escaped as an uncaught exception and the consumer waited for a terminal
event that never came. Route those pushes through a guard that pushes a
terminal error, closes the queue and settles the turn.
2026-11-18 22:07:43 -03:00
serenity
47a79fcba0 fix(gemini): keep the prose before a joined textual tool call
The joined-text retry cleared all accumulated text once it found a
[Tool call: ...] marker, so a reply such as "Let me check.\n[Tool call: x]
Arguments: {...}" kept the call but lost its preface. Return the text
before the marker from tryParseTextualToolCall and keep it as content.
2026-11-18 22:07:12 -03:00
diegosouzapw
e4ec4a15df Merge remote-tracking branch 'origin/release/v3.8.55' into HEAD 2026-11-18 22:04:35 -03:00
diegosouzapw
d97d07eb56 Merge remote-tracking branch 'origin/release/v3.8.55' into HEAD 2026-11-18 22:02:11 -03:00
diegosouzapw
18c91c9284 Merge remote-tracking branch 'origin/release/v3.8.55' into HEAD 2026-11-18 21:52:26 -03:00
diegosouzapw
b8705ef21a Merge remote-tracking branch 'origin/release/v3.8.55' into HEAD 2026-11-18 21:41:04 -03:00
Kiaro-Sama
b378f6cdf6 docs(changelog): number Anthropic target fix fragment 2026-11-19 01:48:51 +03:30
Kiaro-Sama
f2ffd482d2 fix(sse): keep max_tokens for Anthropic Messages targets 2026-11-19 01:47:58 +03:30
Afonso Dutra Nogueira Filho
db8e10356c fix(stream): arm the post-tool retry only for the latest turn's tool results
requestFollowsToolCalls() searched the whole history, so a tool exchange
that the assistant had already answered armed the buffered empty-turn
retry on every later follow-up and cost those turns incremental
streaming. Walk back from the newest entry and stop at the latest
assistant turn (assistant message, Responses function_call, Gemini model
turn): only tool results after it make the request a post-tool
continuation. A user or system note appended after the tool results
still counts. Covers all four client formats with negative and positive
cases (#20092).
2026-11-18 19:04:46 -03:00
diegosouzapw
c85000a6a7 test(claude): end-to-end guard for auto mode server-side classifier review
Drives the real POST /v1/messages route against a fake Anthropic upstream and
checks the gateway contract from code.claude.com/docs/en/auto-mode-classifier-billing
in both directions, streamed and non-streamed, for the native claude provider and
anthropic-compatible nodes:

- the dangerous-tool-use-2026-09-03 / afk-mode-2026-01-31 betas and the
  safeguards body field reach the upstream together, byte-equal
- tool_use / tool_result ids in history are not rewritten on the way up
- message_delta.delta.safeguard_results (stream) and top-level
  safeguard_results (JSON) plus the new tool_use id reach the client unchanged
- without the paired beta, safeguards is dropped instead of sent unpaired

Characterizes the anthropic-compatible-cc relay bridge, which rebuilds the
body without safeguards (client classifier fallback). Adds a troubleshooting
entry for the "this session isn't eligible" notice to the Claude Code guide.

Refs #17899
2026-11-18 18:49:57 -03:00
diegosouzapw
f903dcf606 Merge remote-tracking branch 'origin/release/v3.8.55' into HEAD 2026-11-18 18:35:55 -03:00
ggdayup
68b0707532 fix(pricing): price Vertex Gemini 3 Flash, 2.5 Pro and 2.5 Flash Lite at their own rates
The new vertex default rows copied Pro rates onto gemini-3-flash-preview
($2/$12 instead of $0.50/$3), used a flat $2/$12 for gemini-2.5-pro
(Google bills $1.25/$10 up to 200K prompt tokens and $2.50/$15 above),
and set the 2.5 Flash Lite cached-input rate to $0.025 instead of $0.01.
Add the long_context tier for 2.5 Pro and a test that pins the rows.
2026-11-18 18:27:16 -03:00
diegosouzapw
6609bd451c Merge remote-tracking branch 'origin/release/v3.8.55' into HEAD 2026-11-18 18:16:58 -03:00
b84330808
43214d2183 fix(sse): keep passthrough usage chunks from rebuilding the accounting receipt
The base's passthrough usage repair built the stream accounting receipt on every
chunk, and the receipt re-estimates input from the request body, so per-chunk
usage serialized the whole body again (the #20086 test saw 45 serializations for
40 chunks vs 6 for one). Only a Claude message_delta consumes that receipt, so
other chunks now skip it. The shared basis is renamed usageBasis so the
passthrough call fits one line and stream.ts stays inside its frozen size.
2026-11-18 14:58:04 -03:00
diegosouzapw
bc6895f958 Merge remote-tracking branch 'origin/release/v3.8.55' into HEAD
# Conflicts:
#	open-sse/utils/stream.ts
#	open-sse/utils/usageTracking.ts
2026-11-18 14:35:25 -03:00
Safeer Ahmad
b871c0747d style(antigravity): format the conversation session-id test with Prettier 2026-11-18 14:19:11 -03:00
diegosouzapw
b36604bf08 Merge remote-tracking branch 'origin/release/v3.8.55' into HEAD
# Conflicts:
#	open-sse/handlers/chatCore.ts
2026-11-18 14:07:32 -03:00
Bl0ck154
ff254bf503 chore(upstream): integrate current v3.8.55 security fixes for PR #19667 2026-11-18 19:04:23 +02:00
Bl0ck154
c026fbd391 chore(upstream): integrate current v3.8.55 security fixes for PR #19890 2026-11-18 19:04:11 +02:00
Bl0ck154
52cfdb00a1 chore(upstream): integrate current v3.8.55 security fixes for PR #20178 2026-11-18 19:03:58 +02:00
Bl0ck154
b09678c709 chore(upstream): integrate current v3.8.55 security fixes for PR #20331 2026-11-18 19:03:40 +02:00
diegosouzapw
a9b7506a16 Merge remote-tracking branch 'origin/release/v3.8.55' into HEAD
# Conflicts:
#	package-lock.json
#	package.json
2026-11-18 13:09:44 -03:00
Dizzle
a140f9b780 test(opencode-plugin-v2): pin the same-name recency tie on the comparator
The release base now disambiguates equal display names in the published
catalog with a route suffix, so two models enriched with the same name no
longer tie on name when published. Assert the published pair in its
disambiguated name order and check the default chain's recency-descending
tie break directly on the comparator.
2026-11-18 11:12:24 -03:00
diegosouzapw
b31fd3e4dc Merge remote-tracking branch 'origin/release/v3.8.55' into HEAD
# Conflicts:
#	@omniroute/opencode-plugin-v2/README.md
#	@omniroute/opencode-plugin-v2/src/options.ts
2026-11-18 11:11:19 -03:00
diegosouzapw
8f5ad95a1f Merge remote-tracking branch 'origin/release/v3.8.55' into HEAD
# Conflicts:
#	package-lock.json
2026-11-18 10:49:44 -03:00
Afonso Dutra Nogueira Filho
a875abad85 Merge commit 'bc4b0c5f5190d4bf64be616225e2a4403ede6492' into fix/20092-empty-post-tool-continuation 2026-11-18 09:42:59 -03:00
bufftop25
f4eae2131b fix(auth): maintain OAuth tokens for inactive connections during background health check 2026-11-18 08:29:28 -03:00
xiaoyaner0201
10ff8372b2 chore(changelog): name the nested combo fragment after PR 20507 2026-11-18 18:40:42 +08:00
Chirag Singhal
ef02c75394 test(cli-runtime): satisfy no-explicit-any lint rule 2026-11-18 10:26:40 +00:00
Chirag Singhal
93327176d3 test(cli-runtime): cover claude healthcheck slower than 4s 2026-11-18 09:14:56 +00:00
xiaoyaner0201
a27e40fde7 fix(combo): redact connection ids before capping each unit's reason
The per-unit 300-char cap ran before connection-id redaction, so a UUID or
long hex id cut in half at the cap no longer matched and leaked most of its
characters. Redact first, then cap. The opencode free-tier label is now
decided on the full reason, so a signal past the cap keeps its label, and
the cap no longer leaves half of a surrogate pair.
2026-11-18 16:23:08 +08:00
Chirag Singhal
b9cff981a2 fix(cli-runtime): raise Claude CLI healthcheck timeout for Windows 2026-11-18 07:10:01 +00:00
xiaoyaner0201
892479ab70 fix(combo): keep every unit's reason when an earlier reason is multi-line or long
Each unit's reason is now collapsed to one line, sanitized on its own and capped
at 300 characters before the reasons are joined. The joined message is still
sanitized as a whole, but that pass keeps only the first line, caps at 4096
characters and treats a path span as running to the end, so a raw HTML 502 page,
a multi-line upstream error or an oversized body in an early unit used to hide
every later unit's reason.

Also split the terminal-body guards out of withRuntimeUnitOutcomes to keep it
under the complexity ratchet, and use neutral model names in the tests.
2026-11-18 13:26:14 +08:00
Kizuno18
3b2794e9b5 style(test): prettier on the Speechmatics provider test 2026-11-18 00:19:57 -03:00
Kizuno18
5e93b7d959 fix(audio): send Gladia uploads as "audio" and give Speechmatics a language
Both batch STT adapters fail on every real request:

- Gladia's /v2/upload reads the file from the "audio" multipart field.
  The adapter used the helper's default "file" field, so Gladia answered
  400 "Invalid parameter(s)" with validation_errors ["Missing audio file"]
  before any job was submitted.
- Speechmatics rejects a job config without transcription_config.language
  ("Job config JSON is invalid ... missing property 'language'"). The
  adapter sent only operating_point. It now passes the request's
  `language` field and falls back to "auto" (language identification).

The Gladia test mock now rejects uploads without the "audio" field, as the
live API does, and new Speechmatics tests check the submitted job config.
Both fixed request shapes were checked against the live APIs.
2026-11-18 00:18:18 -03:00
Dizzle
ac46104a48 fix(providers): accept keyless connections for providers marked optional in the registry
keyless providers declared optional in the registry were rejected by the connect form and API
2026-11-18 04:06:07 +01:00
serenity
51a6de526c refactor(shared): split provider index build and encoded-layer decode into helpers 2026-11-17 19:34:50 +03:30
serenity
cea9cc1a8a Merge release/v3.8.55 into this branch 2026-11-17 19:30:20 +03:30
serenity
9d74fcd8a9 Merge release/v3.8.55 into this branch 2026-11-17 19:01:49 +03:30
serenity
b0849177e7 Merge release/v3.8.55 into this branch 2026-11-17 19:01:35 +03:30
serenity
c9445cfdf9 test(plugins): hoist the top-level await above the first test in the onRequest once-per-request suite 2026-11-17 19:01:07 +03:30
serenity
1feb352c2c Merge release/v3.8.55 into this branch 2026-11-17 18:59:44 +03:30
xiaoyaner0201
ac530de16b fix(combo): list every failed unit's reason when a nested combo fails
executeRuntimeUnitCombo returned only the last unit's response when every
unit failed. An earlier unit's real reason (an empty reply rejected by
quality validation, an HTTP 500) was dropped, so a last unit that was only
skipped before dispatch ("Model X is unavailable") became the only error
the client saw.

Record a {model, status, error, kind} entry per failed unit, mark the
loop's own pre-dispatch skips as kind "skipped", and when two or more
units failed rewrite the terminal error.message with formatComboOutcomes,
the same helper the flat attempt loop uses (#10314). Status, headers,
quota classification, diagnostics and the early-return paths (safety
stop, local pressure, client abort, protected priority target) are
unchanged; single-unit failures keep their exact message.
2026-11-17 22:22:16 +08:00
serenity
5db9866657 fix(usage): count speech and transcription once after the tip merge
The tip already writes a usage_history row for every speech and transcription call
(recordMediaRequest), and the per-key USD limits count that row. Tagging those calls with
the modal ledger tier as well would count each call twice. Only rerank, which writes no
usage_history row, keeps the modal tier. The tests now check the speech ledger row keeps
its own tier and that a transcription with no reported duration adds no spend.
2026-11-17 16:58:19 +03:30
serenity
4693693230 Merge release/v3.8.54 into this branch
# Conflicts:
#	open-sse/services/speechCombo.ts
#	src/app/api/v1/audio/speech/route.ts
#	src/app/api/v1/audio/transcriptions/route.ts
2026-11-17 16:27:45 +03:30
Bl0ck154
9fa9d49c2a refactor(codex-images): isolate bounded edit reference resolution helpers
Reduce PR #19667 new-code complexity without changing 16/128 input eligibility, serial SSRF-pinned fetching, the shared 20 MiB budget, cancellation, or request-shape errors. Keep the exact existing regression suite.
2026-11-17 11:46:42 +02:00
Bl0ck154
04902ab282 ci(codex): resignal PR head after v3.8.55 base rehome
The merge of the active release base was pushed, but the upstream PR head remained pinned to its preceding revision while the remote fork ref had moved. Re-signal the branch head without changing production files or quality baselines.
2026-11-17 11:34:00 +02:00
Bl0ck154
9983d081b7 chore(upstream): sync PR #19867 with active release/v3.8.55 2026-11-17 11:32:29 +02:00
Bl0ck154
1907e8310f chore(upstream): sync PR #19948 with active release/v3.8.55 2026-11-17 11:32:17 +02:00
Bl0ck154
768b4aea86 chore(upstream): sync PR #19949 with active release/v3.8.55 2026-11-17 11:32:06 +02:00
Bl0ck154
00f2a34c61 chore(upstream): sync PR #19950 with active release/v3.8.55 2026-11-17 11:31:56 +02:00
Bl0ck154
d1fa6a3611 chore(upstream): sync PR #19680 with active release/v3.8.55 2026-11-17 11:30:38 +02:00
Bl0ck154
f33c524eb5 chore(upstream): sync PR #19681 with active release/v3.8.55 2026-11-17 11:30:00 +02:00
Bl0ck154
276d292132 style(gemini): remove extra blank line from thinking-level regression 2026-11-17 11:29:25 +02:00
Bl0ck154
e46f7b8c6a chore(upstream): sync PR #19890 with active release/v3.8.55 2026-11-17 11:28:55 +02:00
Bl0ck154
363219832e chore(upstream): sync PR #19667 with active release/v3.8.55 2026-11-17 11:28:43 +02:00
Bl0ck154
a13bbc8d05 chore(upstream): sync PR #20331 with active release/v3.8.55 2026-11-17 11:28:15 +02:00
Bl0ck154
d59f97cb66 chore(upstream): sync PR #18738 with active release/v3.8.55 2026-11-17 11:26:55 +02:00
Bl0ck154
fc4b408ef7 chore(upstream): sync PR #19592 with active release/v3.8.55 2026-11-17 11:26:45 +02:00
Bl0ck154
013da11343 chore(upstream): sync PR #20178 with active release/v3.8.55 2026-11-17 11:24:37 +02:00
Jacky Fong
0c0e627179 Merge branch 'cheaper-inference:release/v3.8.55' into feat/mistral-ai-quota 2026-11-17 11:07:38 +08:00
Praveen K Palaniswamy
36ed4d7e3a Merge remote-tracking branch 'upstream/release/v3.8.55' into feat/leonardo-image-edits
# Conflicts:
#	src/app/api/v1/images/edits/route.ts
2026-11-16 21:09:08 -05:00
serenity
d3141089e0 Merge release/v3.8.54 into this branch 2026-11-17 03:54:04 +03:30
serenity
0e228dabf5 Merge release/v3.8.54 into this branch 2026-11-17 03:37:36 +03:30
serenity
e492910c1d Merge release/v3.8.54 into this branch
# Conflicts:
#	open-sse/services/combo/promptCacheAffinity.ts
2026-11-17 01:59:56 +03:30
serenity
a66ea79ad4 Merge release/v3.8.54 into this branch
# Conflicts:
#	open-sse/translator/response/openai-responses.ts
2026-11-17 01:58:04 +03:30
diegosouzapw
a9539085bd Merge main into release/v3.8.54 (generate-release 0a.0b back-merge) 2026-11-16 19:01:37 -03:00
Afonso Dutra Nogueira Filho
a0f418124b Merge commit 'e9c9f1dd84de6ca77cc35352709219e562a31c7f' into fix/20092-empty-post-tool-continuation
# Conflicts:
#	open-sse/handlers/chatCore/streamingTail.ts
2026-11-16 15:10:53 -03:00
Dizzle
79ef5ecc59 fix(plugin): publish honest model limits and a single free marker
Models without max_output_tokens published a zero output limit, zero token budgets were labelled as quotas and free markers stacked in picker names; publish only known limits, use one leading marker and warn when freeSignals is set without freeOnly.
2026-11-16 18:10:10 +01:00
serenity
bd14f5d70a docs(changelog): number the fragment (#20372) 2026-11-16 20:34:51 +03:30
serenity
e8882ba453 fix(plugins): run the onRequest hook once per client request
chat.ts calls handleChatCore again for each account-fallback attempt, and the
plugin onRequest gate ran inside handleChatCore, so a request that failed over
to a second account ran every onRequest plugin twice. A plugin that counts
requests (the rate limiter example in the plugin guide) counted a failover
twice and halved its real threshold; the shared 100 calls per second plugin
budget was spent twice too.

Remember a plain pass-through per client request (the headers snapshot that
chat.ts builds once) and per provider and model. A block or a body rewrite is
never remembered, so the next attempt still gets the plugin's answer, and a
caller without a headers snapshot is never remembered.

Finding: F-C3-33.
2026-11-16 19:45:26 +03:30
Tomas Fecko
7f3fe3228a fix(sse): release expired quota preflight windows 2026-11-16 14:01:18 +01:00
serenity
8d848a34f9 docs(changelog): number the fragment (#20351) 2026-11-16 16:10:53 +03:30
serenity
d224626a15 feat(qoder): add Sonus/Cantus static fallback model rows
The live /models catalog serves Sonus and Cantus under the opaque ids smodel and cmodel. The static registry listed neither, so those ids stopped resolving whenever the live catalog was unavailable. Add both rows (vision, reasoning, 180k max input); the live catalog still wins when it is reachable. They get no FREE_MODEL_BUDGETS twin: free-budget rows need audited evidence, so the free-catalog parity check now excludes the two static-only rows. Comparison-gap finding e0056.
2026-11-16 16:00:15 +03:30
serenity
cc64d40e80 docs(changelog): number the fragment (#20347) 2026-11-16 15:36:51 +03:30
serenity
535b0dfbf6 feat(usage): resolve Command Code short plan ids and credit caps
The /alpha/billing endpoints can report short plan ids (go, go-v1, goat, pro, pro-v1, provider, max, ultra, teams-pro) and every known plan has a fixed monthly credit cap. The usage fetcher knew only the long individual- ids and derived the credits total from period spend, so a short id showed a raw name and a capped plan showed a nonsense total whenever the usage summary lagged the credit pools. Map the aliases to their canonical ids and, when a plan cap is known, report total=cap and used=max(0, cap-remaining). Unknown plans keep the spend-derived total. Comparison-gap finding e0053.
2026-11-16 15:26:12 +03:30
serenity
bc154887f2 docs(changelog): number the fragment (#20346) 2026-11-16 15:25:44 +03:30
serenity
59d2d648b3 fix(command-code): align CLI-mimic headers with the official CLI 1.88.0
The /alpha/generate fallback and the API-key probe are the only paths that send CLI-mimic headers, and they still announced version 1.15.1 with x-cli-environment: external and no x-cli-surface, matching a CLI profile the upstream retired long ago. Align them with the current CLI 1.88.0 wire format (x-cli-environment: production, x-cli-surface: cli) through one shared buildCommandCodeCliHeaders helper used by both call sites; the chat path is unchanged. The COMMAND_CODE_VERSION override still wins. Comparison-gap finding e0003.
2026-11-16 15:15:07 +03:30
serenity
6e6a0d9830 docs(changelog): number the fragment (#20340) 2026-11-16 14:42:19 +03:30
serenity
55a4a4540f fix(qoder): treat nested codes 110/112 as billing quota blocks
Qoder reports an account that spent its daily credit allowance with nested envelope codes 110 and 112, in the same triple-nested shape as the 10605 queue throttle. The executor mapped them to the outer 403 authentication_error or a generic provider error, parking a healthy PAT on a failure cooldown. Classify them as a 429 qoder_billing_block so routing fails over to another account. Comparison-gap finding e0190.
2026-11-16 14:31:39 +03:30
Bl0ck
c8219db122 test(gemini): rely on existing upstream legacy passthrough regression 2026-11-16 12:51:28 +02:00
Bl0ck154
d90467aed9 fix(gemini): scope enum validation to native thinking-level models
The first head of #20331 regressed the pre-existing legacy Gemini
passthrough contract. Validate normalized explicit values only for
models implementing native thinking levels; retain verbatim values for
legacy models. Add regression to the focused test file.
2026-11-16 12:50:28 +02:00
Bl0ck154
a3a38ef340 test(gemini): isolate explicit thinking-level regressions for changed-file lint 2026-11-16 12:47:18 +02:00
Tomas Fecko
7ab0e30474 Merge release/v3.8.54 into feat/expiry-first-deadline-order
Conflict in src/sse/services/auth.ts (imports only): keep isExpiryFirstDeadlineOrder
from this branch and isWorkspacePolicyBudget429 from #19314.

expiry-first-combo-ordering case 8 (#17829) pinned the old reading of a lapsed
reset as maximally urgent. With this PR a lapsed weekly reset counts as a refilled
window rolled forward one period, so the expected score is 1/167 instead of 3.2.
2026-11-16 10:59:00 +01:00
Bl0ck154
7fd200079b merge(release): refresh PR #20178 on current upstream baseline 2026-11-16 09:15:18 +02:00
Bl0ck154
d3fed13791 chore: reconcile Codex plan header PR with current release 2026-11-16 09:14:57 +02:00
Bl0ck154
22c5dfb464 merge(release): refresh PR #19680 on current upstream baseline 2026-11-16 09:14:37 +02:00
Bl0ck154
56892c1d6d fix(gemini): validate explicit native thinking levels before forwarding
Normalize allowed explicit values and ignore unknown override strings so
Gemini receives a supported thinkingLevel or the model-native fallback.
Add three focused translator regressions for casing and invalid values.
2026-11-16 09:12:48 +02:00
Leon Kolchinsky
cd83c2fd2b docs(changelog): add maintenance fragment for #20324 2026-11-16 15:19:42 +11:00
Leon Kolchinsky
3954292aad test(sse): pin rotated item_id text-snapshot dedupe across more stream shapes
Adds eight cases for the GitHub Copilot rotating item_id fix (#19218, #19575),
each asserting the concatenated delta.content equals the answer exactly once:
stable ids, a message at output_index 1 behind a reasoning item, two messages
with stable and with rotating ids, a lost final delta recovered once, a
completed-only snapshot, and two guards that a new message reusing an
output_index after its own output_item.added stays separate. Cases 2, 4, 5
and 8 fail on the code before #19575; all pass on release/v3.8.54.
2026-11-16 15:19:12 +11:00
Jacky Fong
d49c83e4a2 update review 2026-11-16 02:49:54 +08:00
Jacky Fong
bc7be7c441 Add Mistral AI quota display logic for vibe and api 2026-11-16 02:04:50 +08:00
Kiaro-Sama
4728bd2808 fix(ci): await persisted CLIProxy models in auth regression 2026-11-15 21:11:18 +03:30
serenity
b9f185407e Merge release/v3.8.54 into this branch
# Conflicts:
#	tests/unit/db-migrationrunner-constants-split.test.ts
2026-11-15 21:01:49 +03:30
serenity
f4153f2761 Merge release/v3.8.54 into this branch
# Conflicts:
#	tests/unit/db-migrationrunner-constants-split.test.ts
2026-11-15 21:00:45 +03:30
serenity
ae00aca38d Merge release/v3.8.54 into this branch 2026-11-15 20:55:16 +03:30
serenity
c84fb3e15f Merge release/v3.8.54 into this branch 2026-11-15 20:54:07 +03:30
serenity
f1851e85aa Merge release/v3.8.54 into this branch 2026-11-15 20:52:58 +03:30
serenity
8106c1f68b Merge release/v3.8.54 into this branch 2026-11-15 20:50:06 +03:30
serenity
2b026970c7 Merge release/v3.8.54 into this branch 2026-11-15 20:36:55 +03:30
serenity
65f8235907 Merge release/v3.8.54 into this branch 2026-11-15 20:35:37 +03:30
serenity
963db893b4 Merge release/v3.8.54 into this branch 2026-11-15 20:23:22 +03:30
serenity
270a1c8c94 test(translator): snapshot the messages in the #7293 no-op check
The "already-compliant strict-provider request is a no-op" test compared
translateRequest's output with the caller's own `messages` array. That held
only because translateRequest edited the caller's message objects in place:
the xiaomi-mimo reasoning placeholder (9router#1321) was added to the output
and to the caller's assistant message alike, so the two sides could never
differ. Once translateRequest copies the messages and leaves the caller's
alone, the output carries the placeholder and the caller's array does not, and
the comparison failed.

Take a structuredClone of the messages before the call and compare against
that. The hoist still has to leave the system and user turns and the order
untouched. The one expected difference is the placeholder on the plain
assistant turn, which xiaomi-mimo requires on a reasoning-cache miss and which
translator-xiaomi-mimo-reasoning-replay-1321 already pins. The assertion count
is unchanged.
2026-11-15 19:54:25 +03:30
serenity
c227adf93f fix(executors): keep the stream deadline merge off AbortSignal.any
mergeAbortSignals now returns AbortSignal.any so a merge that never aborts leaves no
listener on a long-lived combo or client signal. The two stream deadline paths
(createStreamDeadlineSignal and withDeadlineSignal) depended on the old plain-controller
merge: Node pins an AbortSignal.any composite in a module-level set while it carries an
abort listener, and those paths hand the merged signal to listeners that close over the
request. A request that completed without aborting then stayed reachable with its whole
wire body, and the stream-deadline-signal "does not pin a completed request" test failed
(0 of 50 requests collected).

Add mergeAbortSignalsUnpinned, the plain-controller merge with the same abort-reason
contract, and use it in those two request-scoped deadline paths. Executor merges keep
AbortSignal.any. Cover the new function in merge-abort-signals-no-abort-leak.
2026-11-15 19:54:08 +03:30
serenity
f99a5c97f6 test(responses): update precedence tests that pinned the bare-leaf namespace filter
responses-additional-tools.test.ts pinned the old behaviour that the
previous commit on this branch changes on purpose. In "Responses -> Chat
gives top-level tools precedence over namespaced members" and "Responses ->
Chat enforces explicit precedence within additional_tools" a flat `exec`
and a custom `exec` inside the `commands` namespace were expected to
produce only `["exec"]`. That held only because the filter compared the
member's bare leaf with the flat names. The Chat conversion qualifies the
member as `commands__exec`, so it is a different tool and must reach Chat.

Both tests keep their intent (an explicit tool wins on a real collision)
and now assert it on a real collision: a flat `commands__run` removes the
member `commands.run`, which has the same Chat wire name. They also assert
that `commands__exec` is kept next to the flat `exec`, and that it is
listed as a custom tool name. No assertion is removed.
2026-11-15 19:52:54 +03:30
serenity
6c9d9030a2 Merge release/v3.8.54 into this branch 2026-11-15 19:35:22 +03:30
serenity
55ef1c2b81 Merge release/v3.8.54 into this branch 2026-11-15 19:34:57 +03:30
serenity
8943ae1d13 Merge release/v3.8.54 into this branch 2026-11-15 19:34:57 +03:30
serenity
557404ea1e chore(db): convert the 240 migration to a timestamp name
#20169 froze the 001-241 series and 240 now belongs to
240_provider_node_custom_json_config.sql on release/v3.8.54, so the
numbering gate rejected this PR's 240_skills_unique_owner_name_version.sql
as a duplicate. Rename it with npm run db:new-migration (same description,
same SQL; the header no longer states a number) and add a
RENAMED_MIGRATION_COMPATIBILITY entry, so a database that ran a build of
this PR moves its 240 row to the new stamp instead of skipping
provider_node_custom_json_config. The entry sits after the first entry, so
the positional spot-checks of the constants test stay put; the count goes
from 107 to 108. The migration test reads the new file name and drops the
number from its file and test names, and the changelog fragment no longer
names a migration number.
2026-11-15 19:09:35 +03:30
serenity
b3410f0f84 Merge release/v3.8.54 into this branch 2026-11-15 19:07:24 +03:30
serenity
5a0f8389c5 chore(db): convert the 238 migration to a timestamp name
#20169 froze the 001-241 series and 238 now belongs to
238_codex_connection_fences.sql on release/v3.8.54. Rename this PR's
migration with npm run db:new-migration (same description, same SQL),
and add a RENAMED_MIGRATION_COMPATIBILITY entry so a database that ran a
build of this PR moves its 238 row to the new stamp instead of skipping
codex_connection_fences. The entry sits after the first entry, so the
positional spot-checks of the constants test stay put; the count goes
from 107 to 108.
2026-11-15 19:00:14 +03:30
serenity
e5b4990f77 Merge release/v3.8.54 into this branch 2026-11-15 18:46:05 +03:30
diegosouzapw
c495b920e9 chore: drop derived values the release refresh now owns
Plan 2026-11-13 (derived numbers resolved only at release): feature PRs no longer write values
that depend on the state of the base. This commit restores the lines this PR changed only to
update such values (counts in docs, the llm.txt mirrors, the Stryker test list, the package
description, counts in agent-instruction files) to the text of the PR's merge base, so merging
the current base brings the values `npm run release:refresh-derived` maintains. Every other
change of the PR is untouched.
2026-11-15 05:14:16 -03:00
diegosouzapw
a52f213ab7 chore: drop derived values the release refresh now owns
Plan 2026-11-13 (derived numbers resolved only at release): feature PRs no longer write values
that depend on the state of the base. This commit restores the lines this PR changed only to
update such values (counts in docs, the llm.txt mirrors, the Stryker test list, the package
description, counts in agent-instruction files) to the text of the PR's merge base, so merging
the current base brings the values `npm run release:refresh-derived` maintains. Every other
change of the PR is untouched.
2026-11-15 05:14:00 -03:00
diegosouzapw
db6313add2 chore: drop derived values the release refresh now owns
Plan 2026-11-13 (derived numbers resolved only at release): feature PRs no longer write values
that depend on the state of the base. This commit restores the lines this PR changed only to
update such values (counts in docs, the llm.txt mirrors, the Stryker test list, the package
description, counts in agent-instruction files) to the text of the PR's merge base, so merging
the current base brings the values `npm run release:refresh-derived` maintains. Every other
change of the PR is untouched.
2026-11-15 05:05:09 -03:00
diegosouzapw
620122f072 chore: drop derived values the release refresh now owns
Plan 2026-11-13 (derived numbers resolved only at release): feature PRs no longer write values
that depend on the state of the base. This commit restores the lines this PR changed only to
update such values (counts in docs, the llm.txt mirrors, the Stryker test list, the package
description, counts in agent-instruction files) to the text of the PR's merge base, so merging
the current base brings the values `npm run release:refresh-derived` maintains. Every other
change of the PR is untouched.
2026-11-15 05:04:47 -03:00
diegosouzapw
589b6c7f34 chore: drop derived values the release refresh now owns
Plan 2026-11-13 (derived numbers resolved only at release): feature PRs no longer write values
that depend on the state of the base. This commit restores the lines this PR changed only to
update such values (counts in docs, the llm.txt mirrors, the Stryker test list, the package
description, counts in agent-instruction files) to the text of the PR's merge base, so merging
the current base brings the values `npm run release:refresh-derived` maintains. Every other
change of the PR is untouched.
2026-11-15 05:03:02 -03:00
diegosouzapw
4a77e2a7ff chore: drop derived values the release refresh now owns
Plan 2026-11-13 (derived numbers resolved only at release): feature PRs no longer write values
that depend on the state of the base. This commit restores the lines this PR changed only to
update such values (counts in docs, the llm.txt mirrors, the Stryker test list, the package
description, counts in agent-instruction files) to the text of the PR's merge base, so merging
the current base brings the values `npm run release:refresh-derived` maintains. Every other
change of the PR is untouched.
2026-11-15 05:00:11 -03:00
diegosouzapw
ddc2f915ee chore: drop derived values the release refresh now owns
Plan 2026-11-13 (derived numbers resolved only at release): feature PRs no longer write values
that depend on the state of the base. This commit restores the lines this PR changed only to
update such values (counts in docs, the llm.txt mirrors, the Stryker test list, the package
description, counts in agent-instruction files) to the text of the PR's merge base, so merging
the current base brings the values `npm run release:refresh-derived` maintains. Every other
change of the PR is untouched.
2026-11-15 04:59:23 -03:00
diegosouzapw
0145450426 chore: drop derived values the release refresh now owns
Plan 2026-11-13 (derived numbers resolved only at release): feature PRs no longer write values
that depend on the state of the base. This commit restores the lines this PR changed only to
update such values (counts in docs, the llm.txt mirrors, the Stryker test list, the package
description, counts in agent-instruction files) to the text of the PR's merge base, so merging
the current base brings the values `npm run release:refresh-derived` maintains. Every other
change of the PR is untouched.
2026-11-15 04:49:04 -03:00
diegosouzapw
7a7cd4a46e chore: drop derived values the release refresh now owns
Plan 2026-11-13 (derived numbers resolved only at release): feature PRs no longer write values
that depend on the state of the base. This commit restores the lines this PR changed only to
update such values (counts in docs, the llm.txt mirrors, the Stryker test list, the package
description, counts in agent-instruction files) to the text of the PR's merge base, so merging
the current base brings the values `npm run release:refresh-derived` maintains. Every other
change of the PR is untouched.
2026-11-15 04:48:51 -03:00
diegosouzapw
7efd90f6f4 chore: drop derived values the release refresh now owns
Plan 2026-11-13 (derived numbers resolved only at release): feature PRs no longer write values
that depend on the state of the base. This commit restores the lines this PR changed only to
update such values (counts in docs, the llm.txt mirrors, the Stryker test list, the package
description, counts in agent-instruction files) to the text of the PR's merge base, so merging
the current base brings the values `npm run release:refresh-derived` maintains. Every other
change of the PR is untouched.
2026-11-15 04:48:35 -03:00
diegosouzapw
c5bdb10fe7 chore: restore derived counts in their original digits
The previous maintainer commit put the derived counts in the translated
README mirrors back to the merge-base values, but wrote them as ASCII
numbers where the mirror uses native digits (for example Persian). The
lines still differed from the base and kept conflicting. This commit
writes the merge-base text back exactly. No other change.
2026-11-15 04:39:07 -03:00
diegosouzapw
6c5ee6bf72 chore: drop derived values the release refresh now owns
Plan 2026-11-13 (derived numbers resolved only at release): feature PRs no longer write values
that depend on the state of the base. This commit restores the lines this PR changed only to
update such values (counts in docs, the llm.txt mirrors, the Stryker test list, the package
description, counts in agent-instruction files) to the text of the PR's merge base, so merging
the current base brings the values `npm run release:refresh-derived` maintains. Every other
change of the PR is untouched.
2026-11-15 04:30:30 -03:00
diegosouzapw
5870041190 chore: restore the final newline the derived-values strip dropped
The previous maintainer commit put derived files back to the merge-base
version but read them through a trimming helper, so each restored file
lost its last newline and still differed from the base. This commit
makes those files byte-identical to the merge base again (or, for
line-level restores, puts the final newline back). No other change.
2026-11-15 04:05:49 -03:00
diegosouzapw
50e104a3e1 chore: restore the final newline the derived-values strip dropped
The previous maintainer commit put derived files back to the merge-base
version but read them through a trimming helper, so each restored file
lost its last newline and still differed from the base. This commit
makes those files byte-identical to the merge base again (or, for
line-level restores, puts the final newline back). No other change.
2026-11-15 04:05:23 -03:00
diegosouzapw
33f2764008 chore: restore the final newline the derived-values strip dropped
The previous maintainer commit put derived files back to the merge-base
version but read them through a trimming helper, so each restored file
lost its last newline and still differed from the base. This commit
makes those files byte-identical to the merge base again (or, for
line-level restores, puts the final newline back). No other change.
2026-11-15 04:05:12 -03:00
diegosouzapw
a4955dd11d chore: restore the final newline the derived-values strip dropped
The previous maintainer commit put derived files back to the merge-base
version but read them through a trimming helper, so each restored file
lost its last newline and still differed from the base. This commit
makes those files byte-identical to the merge base again (or, for
line-level restores, puts the final newline back). No other change.
2026-11-15 04:04:57 -03:00
diegosouzapw
136b3a7ffe chore: restore the final newline the derived-values strip dropped
The previous maintainer commit put derived files back to the merge-base
version but read them through a trimming helper, so each restored file
lost its last newline and still differed from the base. This commit
makes those files byte-identical to the merge base again (or, for
line-level restores, puts the final newline back). No other change.
2026-11-15 04:04:44 -03:00
diegosouzapw
e7f1c4893a chore: restore the final newline the derived-values strip dropped
The previous maintainer commit put derived files back to the merge-base
version but read them through a trimming helper, so each restored file
lost its last newline and still differed from the base. This commit
makes those files byte-identical to the merge base again (or, for
line-level restores, puts the final newline back). No other change.
2026-11-15 04:04:21 -03:00
diegosouzapw
807efa71da chore: drop derived values the release refresh now owns
Plan 2026-11-13 (derived numbers resolved only at release): feature PRs no longer write values
that depend on the state of the base. This commit restores the lines this PR changed only to
update such values (counts in docs, the llm.txt mirrors, the Stryker test list, the package
description, counts in agent-instruction files) to the text of the PR's merge base, so merging
the current base brings the values `npm run release:refresh-derived` maintains. Every other
change of the PR is untouched.
2026-11-15 03:44:18 -03:00
diegosouzapw
e819a84904 chore: drop derived values the release refresh now owns
Plan 2026-11-13 (derived numbers resolved only at release): feature PRs no longer write values
that depend on the state of the base. This commit restores the lines this PR changed only to
update such values (counts in docs, the llm.txt mirrors, the Stryker test list, the package
description, counts in agent-instruction files) to the text of the PR's merge base, so merging
the current base brings the values `npm run release:refresh-derived` maintains. Every other
change of the PR is untouched.
2026-11-15 03:43:52 -03:00
diegosouzapw
290ff16850 chore: drop derived values the release refresh now owns
Plan 2026-11-13 (derived numbers resolved only at release): feature PRs no longer write values
that depend on the state of the base. This commit restores the lines this PR changed only to
update such values (counts in docs, the llm.txt mirrors, the Stryker test list, the package
description, counts in agent-instruction files) to the text of the PR's merge base, so merging
the current base brings the values `npm run release:refresh-derived` maintains. Every other
change of the PR is untouched.
2026-11-15 03:43:39 -03:00
diegosouzapw
56a322a876 chore: drop derived values the release refresh now owns
Plan 2026-11-13 (derived numbers resolved only at release): feature PRs no longer write values
that depend on the state of the base. This commit restores the lines this PR changed only to
update such values (counts in docs, the llm.txt mirrors, the Stryker test list, the package
description, counts in agent-instruction files) to the text of the PR's merge base, so merging
the current base brings the values `npm run release:refresh-derived` maintains. Every other
change of the PR is untouched.
2026-11-15 03:43:29 -03:00
diegosouzapw
2c3d64322f chore: drop derived values the release refresh now owns
Plan 2026-11-13 (derived numbers resolved only at release): feature PRs no longer write values
that depend on the state of the base. This commit restores the lines this PR changed only to
update such values (counts in docs, the llm.txt mirrors, the Stryker test list, the package
description, counts in agent-instruction files) to the text of the PR's merge base, so merging
the current base brings the values `npm run release:refresh-derived` maintains. Every other
change of the PR is untouched.
2026-11-15 03:43:21 -03:00
diegosouzapw
8fd464552e chore: drop derived values the release refresh now owns
Plan 2026-11-13 (derived numbers resolved only at release): feature PRs no longer write values
that depend on the state of the base. This commit restores the lines this PR changed only to
update such values (counts in docs, the llm.txt mirrors, the Stryker test list, the package
description, counts in agent-instruction files) to the text of the PR's merge base, so merging
the current base brings the values `npm run release:refresh-derived` maintains. Every other
change of the PR is untouched.
2026-11-15 03:43:05 -03:00
John Costa
50a8f69c71 Merge branch 'release/v3.8.54' into fix/empty-tool-args-claude-stream 2026-11-14 13:21:45 -08:00
Kiaro-Sama
c2542401e5 test(fal): isolate recovery route requests across UI tests 2026-11-14 23:07:57 +03:30
tiangao88
c9c17b8584 fix(sse): sync opaque reasoning with current release sanitization 2026-11-14 18:46:08 +01:00
Bl0ck
aa82af9453 style(codex): keep plan fence without exceeding provider-limits file cap 2026-11-14 18:45:32 +02:00
zerafachris
51678c67e2 fix(api): guard POST /api/providers/[id]/sync-models with requireManagementAuth (#20187) 2026-11-14 17:42:21 +01:00
Bl0ck
86bb27348a fix(codex): assert session fence immediately before live plan metadata merge 2026-11-14 18:27:50 +02:00
serenity
bcb5520a8f docs(changelog): number the fragment (#20206) 2026-11-14 18:37:41 +03:30
serenity
0b7c0c60d8 docs(changelog): number the fragment (#20204) 2026-11-14 18:05:57 +03:30
serenity
f43b131c43 docs(changelog): number the fragment (#20201) 2026-11-14 17:34:05 +03:30
serenity
e9b28f3b87 docs(changelog): number the fragment (#20199) 2026-11-14 17:18:06 +03:30
serenity
4e2cf2d0a3 docs(changelog): number the fragment (#20194) 2026-11-14 16:30:20 +03:30
serenity
50835c40d6 fix(translator): copy the message list once so translateRequest leaves the caller's messages alone
translateRequest edits the message objects it is given: it strips echo fields
(reasoning_content, reasoning, refusal, annotations, cache_control) for an
OpenAI-format non-reasoner target, fills tool call ids and arguments
(ensureToolCallIds), sets tool_call_id on the matching tool message, and moves a
displaced tool result inside the messages array. A combo copies the body per
target with a shallow copy (#7847), so the message objects are shared. After
target 1 (a non-reasoner) stripped reasoning_content in place, a later reasoning
target that needs the client reasoning_content no longer received it.

Copy the messages, and each message's tool_calls and function object, once at
the entry of translateRequest (callerMessages.ts, 0.4 ms for a 12 MiB body).
The copy is one level deep. content is shared because the translator never
writes into it. Only the sites proven to mutate (probe with frozen bodies) are
covered; no deep clone.

Finding: F-C5-64.
2026-11-14 14:30:15 +03:30
serenity
bbf64bbb9e fix(responses): drop a tool output that has no call id
A Chat tool message with no tool_call_id was sent to a Responses target as a
function_call_output with call_id "". The repair step kept any output whose
call_id was blank, because the old filter only checked outputs that had an id.
A blank id matches no call, so it is an orphan like any other unmatched id.

Drop it in the repairing (default) mode. Strict tool-history mode is unchanged
and still refuses a blank id.

In the other direction a custom_tool_call with a blank call_id got a made-up
id and an empty result, so the output text was lost. Skip such a call, as a
function_call with a blank call_id is skipped (#2893); its output is then
dropped as an orphan.

Malformed input only. What to do with the unpaired text is a maintainer choice;
this keeps the smallest change (drop, do not demote to a user message).

Finding: F-C5-86.
2026-11-14 14:29:47 +03:30
serenity
3a9f9daaae fix(responses): skip a replayed image_generation_call input item
A follow-up Responses request that replays an image_generation_call item (the
image the model made on an earlier turn) failed with a 400 on a Chat
Completions target: "input item type 'image_generation_call' cannot be
represented in Chat Completions".

Skip that one type, as tool_search_call, tool_search_result and web_search_call
are skipped. The narrow slice is deliberate: item_reference, mcp_call and
computer_call_output still throw, because dropping them loses input
(item_reference cannot be resolved; mcp_call carries output). The existing test
that pins the 400 for those three is unchanged.

Finding: F-C5-69.
2026-11-14 14:28:55 +03:30
serenity
01f9d4e16e fix(responses): compare namespace members to flat tools by Chat wire name
collectResponsesTools dropped a namespace member whenever any flat tool or
additional_tools entry had the same bare leaf name. The Chat conversion
qualifies a member as <namespace>__<leaf>, so a flat "search" and
"mcp__github.search" are two different Chat tools, and the member was lost
for no reason. The opposite case also failed: a flat tool already named
"mcp__github__search" did not drop the member that flattens to the same name,
so two Chat tools with one name reached a strict upstream.

Compare the member's flattened wire name (flattenNamespaceToolName, the same
function the conversion uses) with the explicit names. The default "functions"
namespace keeps bare leaf names (#17890), so a flat "exec" still wins over
functions.exec, as the existing tests require.

Intended precedence is unchanged: explicit top-level declarations still win
on a real name collision.

Finding: F-C5-62.
2026-11-14 14:28:10 +03:30
serenity
1e96878591 fix(gemini): keep & as it is in a replayed tool result context
A tool result without a thought signature is replayed to Gemini as text inside a
<previous_tool_result_context> block. The content was escaped for &, < and >.
< and > are the tag breakout guard: they stop a result from closing or
reopening the block. & cannot open or close a tag, so escaping it only changed
what the model reads: "a && b" was sent as "a &amp;&amp; b", and shell, code and
URL results were harder to read.

Drop only the & escape from the content. The < and > escapes stay, so the
breakout guard is unchanged. The attribute escape (source="...") is untouched.
The existing assertion in openai-to-gemini-helpers-split.test.ts that pinned
the & escape for content is changed to match; the breakout tests in
translator-openai-to-gemini.test.ts pass unchanged.

Finding: F-C5-41.
2026-11-14 14:27:44 +03:30
serenity
799bcaf284 fix(admission): apply the structural admission check on withChatAdmission routes
withChatAdmission wraps /v1/messages, /v1/completions, /v1/api/chat,
/v1/providers/{provider}/chat/completions, /v1/relay/chat/completions,
/v1/antigravity and /v1/responses/{path}. It runs the byte admission
(admitChatRequest) only. A request that is small in bytes but heavy in
structure (200 or more messages, or 64 or more tools) took no heavyweight lease
there, while /v1/chat/completions and /v1/responses call admitChatStructure for
it (#9654). The byte budget bounds the body, not the concurrency of heavy
requests.

After admitChatRequest, read a small body once on a clone and pass it to
admitChatStructure with the lease the request already holds. It takes a lease
only for a structurally heavy body and keeps an existing one, so a body that
reached the large-body size is decided by the byte lease alone. A body that is
not JSON goes to the handler. The same controller and lease type are used, so
this is not a second admission path. A rejection is logged like the byte
rejection.

Changes default behaviour on these routes: a structurally heavy small request is
now shed with the retryable 503 while heavyweight capacity is busy and the heap
is under pressure (with a healthy heap it is admitted through the bounded
headroom budget). It costs one extra parse of a body under the large-body size.

Finding: F-C1-20.
2026-11-14 14:25:41 +03:30
serenity
356a91fdb4 chore(changelog): name the bundle fragments 0000-<slug> and make each a bullet
The publisher renames the 0000- placeholders to the PR number.
2026-11-14 14:13:34 +03:30
serenity
569049b7ae fix(gemini): keep the failure flag of an unsigned Claude tool result
Claude to Gemini wrote is_error into functionResponse.response.error for a
signed history (#19405), but a Claude history carries no Gemini signatures, so
the common path turns the tool result into context text. That text dropped the
flag: a failed call read like a success. claude-to-openai already keeps such a
failure visible with a `[tool_error: true]` marker; add the same marker to the
historical tool-result context.

Finding: F-C5-75 (the signed path was fixed in #19405).
(cherry picked from commit 1da069f2b5c0971fe30ee2baaf2df69d267bf1f8)
2026-11-14 14:13:34 +03:30
serenity
93e0e97977 fix(gemini): switch thinking off for a Claude "disabled" or effort "none" request
claude-to-gemini sent no thinkingConfig for thinking:{type:"disabled"} or
output_config.effort:"none". Gemini 2.5 then thinks dynamically and can spend the whole
maxOutputTokens on hidden thoughts, while the OpenAI path already sends an explicit
thinkingBudget 0 for reasoning_effort "none". Send the same off switch here through
buildGeminiThinkingConfig (it drops the zero budget for Flash-Lite, which answers 400).
Models with a thinking-level knob or a zero budget cap keep the upstream default.

One existing test pinned the old "skip" behaviour for effort "none"; it now pins the
explicit off switch.

Finding: F-C5-28
(cherry picked from commit 85d74dc563c62dd711dbea312884ca165b000b2d)
2026-11-14 14:13:34 +03:30
serenity
786ee5d6a0 fix(gemini): deliver a trailing tag prefix at the end of a Gemini stream as text
The Gemini to OpenAI translator holds text that ends in "<", "<t", "<th" ... in case it
opens a <think> tag. At finish nothing emitted the held text, so a stream that ended inside
code such as "Array<" lost its last 1 to 6 characters. Emit the held prefix as content at
finish.

Re-check id: F-C5-51.

(cherry picked from commit 9cf398c989089061bdf4781ff2343399a4916bda)
2026-11-14 14:13:34 +03:30
serenity
ccb20c992a fix(sse): keep signed Gemini image parts
A signed image part no longer takes the standalone-signature skip, so the image reaches OpenAI clients. Finding F-C5-23.

(cherry picked from commit e40f9c9dd7948e30c519a168d873555d70a04e8a)
2026-11-14 14:13:34 +03:30
serenity
2f82c8675c fix(kiro): send status error for a failed tool run from a Claude request
A Claude request pivots through OpenAI before it reaches Kiro. The OpenAI
tool role has no error flag, so claude-to-openai writes a "[tool_error: true]"
line at the start of the tool text. The Kiro builder hardcoded
status "success" for the tool role, so a failed tool run reached Kiro as a
success with a marker in the text. A direct Claude tool_result block already
mapped is_error to "error".

The Kiro builder now reads the marker at the start of a tool message, sends
status "error" and the original text without the marker. A marker in the
middle of the text is left alone.

Finding: 9rself-36 (the small fix, not new direct translators)
(cherry picked from commit c8e46b5134204de647ff8f5a57674403a9ca2c54)
2026-11-14 14:13:34 +03:30
serenity
327751424c fix(kiro): seed the conversationId from the user text, not the clock line
buildKiroPayload prepends `[Context: Current time is <ISO>]` to the final
content. With no pre-compression body and an empty history (turn 1) the
conversationId seed fell back to that content, so turn 1 got a fresh random id
on every call and a different one from turn 2 (which seeds from history[0]).
Keep the content before the clock line for the seed.

Finding: F-C5-80.
(cherry picked from commit abfc2cea324d86606e4433b62983f4b930774c34)
2026-11-14 14:13:34 +03:30
serenity
a16312ff66 fix(kiro): note an image that Kiro cannot take in the request text
Kiro accepts only inline image bytes, and only for Claude models. A remote image URL, or any
image for a non-Claude model, was dropped with nothing left in the text, so the model answered
as if no image was sent. Count the image blocks that were not attached and add one line to
the message text. The prettier pre-commit hook also reformatted three lines that were already
off in this file.

Re-check id: F-C5-42. A 400 instead of a note is a product choice; the note keeps today's
requests working.

(cherry picked from commit a107f54a33a98a105668cf717a28a574f9f9057f)
2026-11-14 14:13:33 +03:30
serenity
3887fe078c test(translator): update the mixed tool-result array test for native Gemini media
A tool result array that holds an image now sends the image as its own part and the text
as the function result (gemini-sampling-tools). The old test expected the array unchanged.
2026-11-14 14:11:53 +03:30
serenity
830a5983c8 chore(changelog): name the bundle fragments 0000-<slug> and make each a bullet
The publisher renames the 0000- placeholders to the PR number.
2026-11-14 14:11:53 +03:30
serenity
f4e3160a23 fix(translator): drop Claude Code's billing line from Gemini and Antigravity system prompts
What: openaiToGeminiBase now removes a leading "x-anthropic-billing-header:" line
from each system message before it becomes a systemInstruction part. The Antigravity
envelope builds on the same base, so both targets are covered.

Why: the Claude-to-OpenAI translator already strips this line. An OpenAI-format
client that forwards it (Claude Code behind an OpenAI-shape proxy) reached Gemini
and Antigravity with the line intact. It changes every turn, so it breaks the
prompt prefix cache. A system message that is only the line now leaves no empty
part.

Finding: e0204 (comparison re-check). The Hermes identity rewrite named in that
row has no source we can check, so it is not built.

(cherry picked from commit 90320ad461e165c5b86708bb68e0cc71069dca3f)
2026-11-14 14:11:53 +03:30
serenity
a4cdca8dd7 fix(antigravity): do not move client system text into a model turn
The #9030 relocation prepended the client system parts to contents[0] without
checking its role. When the history opens with an assistant turn (for example
system, assistant, user, or a truncated history), the system text became a
model utterance. Prepend into contents[0] only when it is a user turn,
otherwise insert a leading user turn.

Finding: F-C5-79.
(cherry picked from commit 16f665d8eedf86857feb79f193ceb764350d66b4)
2026-11-14 14:11:53 +03:30
serenity
ce0e54fb5f fix(sse): preserve Gemini tool media and model sampling rules
Keep image bytes out of function-response JSON and retain them as native media. Omit sampling fields removed by Gemini 4 while preserving older models. F-C5-16 and F-C5-21.

(cherry picked from commit 1aaf64c4e95e4191fdcab8c69f1b9cb655471f2c)
2026-11-14 14:11:53 +03:30
serenity
e3e6c76acd fix(translator): keep a bare block object as message content for Claude
What: the OpenAI to Claude translator now wraps a message `content` that is one
bare block object into a one-item array, for system turns (normalizeContentToString)
and user turns (getContentBlocksFromMessage).

Why: a system turn with a bare text block was read as "" and sent as an empty
system block. A user turn with a bare text block was dropped, and the request went
out with "." as its text. Array and string content are unchanged.

Finding: e0217 (comparison re-check). The 4-marker cache cap half of that row is
already on the tip.

(cherry picked from commit 36cb4e8ad29612e2ba8012ebe31c193f97eb2ebd)
2026-11-14 14:11:53 +03:30
serenity
d9cd7e2379 fix(sse): accept line breaks in base64 data URLs for Claude
The data URL regex ended in `(.+)$`, and `.` does not match a newline. A
MIME-wrapped base64 image became `{type:"url", url:"data:..."}`, which
Anthropic rejects, and the same regex for file parts dropped the attachment.
Match any character and strip white space from the payload.

Finding: F-C5-77.
(cherry picked from commit 5cea7bfcbdc77720a04517af5084f4598048d312)
2026-11-14 14:11:52 +03:30
serenity
a1588bcc4b fix(translator): three request-shape errors in the OpenAI to Claude translator
- thinking {type:"enabled"} without budget_tokens (the DeepSeek/GLM/Kimi shape) was sent
  as is; Anthropic answers 400 "budget_tokens: Field required". A missing or zero budget
  now gets the model's default budget (1024 minimum), then fitThinkingToMaxTokens fits it.
- An empty system or developer message produced system:[{type:"text",text:""}], which
  Anthropic rejects. Empty system parts are now dropped.
- temperature was dropped for every claude-(opus|sonnet)-4* model for every provider, and
  also when thinking was disabled. The name-based drop is for Claude OAuth, whose beta
  header forces thinking, so it now applies to that provider only, and the final guard
  skips thinking.type "disabled".

Findings: F-C5-25, F-C5-31, F-C5-30
(cherry picked from commit a3e0f3aa07f6ac67db1ad3a61c7dfdf68f9f0964)
2026-11-14 14:11:52 +03:30
serenity
f93666a3f2 fix(sse): drop Claude thinking when a tool call is forced
Anthropic rejects extended thinking with a forced tool choice. Reconcile the two fields in the shared OpenAI to Claude translator. F-C5-20.

(cherry picked from commit 56a8eaf7e97f697437c936b4a8c716a867e917f8)
2026-11-14 14:11:52 +03:30
serenity
f47bfe19d2 test(sse): let the wiring tests accept the served credentials in onRequestSuccess
rotation-success-bookkeeping reads the credentials of the account that served the request
(`served`) in onRequestSuccess. Two source-text tests pinned the old variable name.
Accept both names; the asserted calls are unchanged.
2026-11-14 14:10:27 +03:30
serenity
00b01d07ff chore(changelog): name the bundle fragments 0000-<slug> and make each a bullet
The publisher renames the 0000- placeholders to the PR number.
2026-11-14 14:10:27 +03:30
serenity
ec15e430a9 fix(sse): do not cool a pooled session down for a client abort
executeWithSessionPool reported a cooldown for any throw, including the caller's
AbortError, so a user who cancelled a request penalised a healthy session
(consecutiveFails and the back-off grow). Skip the cooldown for a local stream
lifecycle error (the same classifier the circuit breaker uses) and still release
the session.

Finding: F-C4-15.
(cherry picked from commit 3753fb6dd60a322f89a68571b8bb31311dec90ba)
2026-11-14 14:10:27 +03:30
serenity
c9f4704ccf fix(sse): keep client instructions that share a block with the Claude sentinel
stripClaudeSystemPrefixBlocks removed a whole system block when its text
started with the Claude Code sentinel. A client that sent the sentinel and its
own instructions in one block lost the instructions. Remove only the sentinel
prefix and drop the block when nothing else is left; the billing header block
is still removed whole.

Finding: F-C4-12.
(cherry picked from commit 9a653fa6c5003126d3fd68b1a116400f5a1ac5d3)
2026-11-14 14:10:27 +03:30
serenity
fdce326325 fix(sse): keep the CLI body-field order on a recovery retry
The first send goes through applyFingerprint, which builds an ordered body. The
live transformedBody keeps the client order, and serializeRetryBody used a
plain JSON.stringify, so every recovery retry (field downgrade, clamp) went out
in the client order although the code comment calls the order a fingerprint.
Serialize through applyFingerprint when the first send did.

Finding: F-C4-13.
(cherry picked from commit 593ddad140303b4a045eea29c60dca8ce72c1d35)
2026-11-14 14:10:27 +03:30
serenity
ca9b65ad86 fix(executors): use AbortSignal.any in mergeAbortSignals so no listener outlives the merge
The manual merge removed its two abort listeners only after an abort. A merge that never
aborted (one per fetch attempt or retry) left both listeners on the long-lived combo or client
signal. AbortSignal.any (Node 22 and later, the engines range) holds no listener on its inputs
and keeps the abort reason.

Re-check id: F-C1-24.

(cherry picked from commit 10b2067e5a3316e733ebc2499113f13a7b0deab8)
2026-11-14 14:10:27 +03:30
serenity
d019508f9b fix(qoder): refuse image input on a PAT connection instead of dropping it
A Qoder PAT connection runs the local qodercli binary and sends it text only.
The prompt builder replaced every image part with the text "[Image omitted]",
while the registry still declares supportsVision, so image requests were routed
to a PAT connection and the model answered without the picture.

Image requests now use the same rule as caller tools: credential selection skips
PAT connections (a combo goes on to its next target), and the executor answers
400 image_input_unsupported before it starts the CLI. HTTP connections still
forward images. The registry flag stays true because the HTTP transport serves
images; no image forwarding is added to the CLI path.

Finding: e0212.
(cherry picked from commit ef7e47491f45ec886540558eb7eeb4953a89308a)
2026-11-14 14:10:27 +03:30
serenity
d7f516d501 fix(routing): credit the account that served after a Codex 429 rotation
When a Codex request got a 429, the provider pipeline moved it to a sibling
account B. The pipeline rewrites the refreshed copy of the credentials, but
chat.ts and the onRequestSuccess hook kept reading the original object that
still named the failed account A. On success the handler then:
- set the selected-connection header to A,
- marked A quota-healthy for 30 minutes (A had just answered
  usage_limit_reached), and cleared its error state,
- left B's own error state in place.

Read the connection id from the refreshed credentials, which follow the
rotation, in the success path of chat.ts and in onRequestSuccess.

Finding: F-C3-26.
(cherry picked from commit 8d7c7880fd2dbcdefeef6e0c499d368fa281367a)
2026-11-14 14:10:27 +03:30
serenity
d017a93d2e fix(sse): keep combo target scope on redirect and free the OAuth slot on rule errors
Forward the redirected target pin and allow-list, and release the OAuth session slot before rethrowing a connection reasoning rule error, as the sibling stages do. Findings F-C1-17, F-C1-18.

(cherry picked from commit e0407e7ab2b0da9222e80164ccfdfe42e334af5a)
2026-11-14 14:10:27 +03:30
serenity
faeb7b6c6c chore(changelog): name the bundle fragments 0000-<slug> and make each a bullet
The publisher renames the 0000- placeholders to the PR number.
2026-11-14 14:09:46 +03:30
serenity
42c95f7abb fix(sse): restore a client tool named with a proxy_ prefix in Claude passthrough replies
The native Claude executor strips a leading "proxy_" from every tool name
before dispatch. The passthrough name ledger assumed the opposite: it mapped
"proxy_" + name back to name. A client tool literally named "proxy_search"
went upstream as "search", and the reply reached the client as "search".

Build the ledger from the executor's real behaviour as well: for a declared
tool whose name starts with "proxy_", map the stripped name back to the
declared name, unless the client also declared the stripped name itself.
The old prefixed entries stay, so a prefixed echo still restores.

Finding: F-C3-21.
(cherry picked from commit 04bf04a083dfa21d36e6c66508fafe27ecebff85)
2026-11-14 14:09:46 +03:30
serenity
6f58e85512 fix(sse): read epoch seconds and numeric strings in isTokenExpiringSoon
isTokenExpiringSoon passed the value to `new Date(...)`. An epoch in seconds
became a date in 1970 (a valid token looked expired). A numeric string
became an invalid date (an expired token looked valid). The shared
parseTokenExpiryMs already reads both forms and is used by
BaseExecutor.needsRefresh; use it here.

Finding: F-C3-40.
(cherry picked from commit 91567f50b3272d995e15445a6739e0c3b06b56e2)
2026-11-14 14:09:46 +03:30
serenity
e640bb4585 fix(sse): log the cooldown writes that were swallowed silently
excludeConnectionForCooldown ended its cooldown write in an empty catch, and
markCodexScopeRateLimited used `.catch(() => null)`. When the write failed the
connection was selected again with no trace of why. Keep the fallback behaviour
and warn with the sanitized message (Hard Rule 12: never the raw err.message).

Finding: F-C2-41 (two of the five sites; the executeProviderRequest and
chatStreamController catches are left).

(cherry picked from commit 0fa0b83d81320b38fba90b3a1716d27f3c9a85fb)
2026-11-14 14:09:46 +03:30
serenity
fe6142d218 fix(sse): cancel the native response body that the proxy fallback drops
In `fallback` mode the wrapper returned only the proxy leg's result when the
native answer had a retryable status, and never cancelled the native body, which
held its socket until GC. Cancel it before the proxy call.

Finding: F-C2-40 (the body-cancel half only; recording the native 429 cooldown
needs a design decision and is left).

(cherry picked from commit 58bc8bca8591e50a5ad05479a7627710c351e679)
2026-11-14 14:09:46 +03:30
serenity
f8b3e23552 fix(sse): swap credentials on an empty-turn retry instead of merging
The retry did Object.assign(deps.credentials, nextCreds). Keys that the next
connection's object does not define stayed from the first one: routing, an
exclusive lease, and the account-bound copilotSessionToken. Replace the keys
with the same helper that already restores the snapshot when the retry is
rejected.

Finding: F-C2-39.
(cherry picked from commit f94d8bfaff553297165fe35fa3a7dfb3af2a0985)
2026-11-14 14:09:46 +03:30
serenity
861d6f782e fix(sse): do not take an Android user agent for the Droid CLI
The Droid CLI check was `userAgent.includes("droid")`, which also matches
"Android". A Dalvik or mobile browser client was treated as the Droid CLI, so
a Responses-shaped body on a non-/responses endpoint kept the Responses
response format instead of collapsing to Chat Completions. Match the whole
word `droid`.

Finding: F-C3-22.
(cherry picked from commit 47946f644e202aa1fc5c947eec4f178f0cb1e6ad)
2026-11-14 14:09:45 +03:30
serenity
b8c4167ff2 chore(changelog): name the bundle fragments 0000-<slug> and make each a bullet
The publisher renames the 0000- placeholders to the PR number.
2026-11-14 14:08:21 +03:30
serenity
f7b0669038 fix(skills): renumber the unique-skill migration to 240
The tip took 239 (call_logs_pending_detail_index). Move the skills migration and its test to 240
and bump the migration count in the docs from 236 to 237 (count tokens only).
2026-11-14 14:08:21 +03:30
serenity
59acff1206 fix(sse): drop repeated tool names for DeepSeek models
DeepSeek answers a request with a repeated tool name with HTTP 400
"Tool names must be unique", on its own API and on every gateway that
serves a deepseek-* model. OmniRoute only de-duplicated names for Gemini,
so a client that sends the same tool twice (two MCP servers, a merged
tool list) got the 400.

finalizeTranslatedRequest now keeps the first definition of each name
when the upstream model id is deepseek-*, for both the Chat and the
flat Responses tool shape. Tools without a name and other models are
not changed. tool_choice and history refer to tools by name, so they
stay valid.

Finding 9rself-27.

(cherry picked from commit b788d06923dd28ca85c954c2f03eeeb7bde42bb7)
2026-11-14 14:08:20 +03:30
serenity
acd7b38f65 fix(sse): strip the Codex effort suffix conflict on a copy of output_config
A combo gives each target a shallow copy of the client body, so output_config is shared.
The Codex guard that drops output_config.effort when the model name already encodes
effort used `delete oc.effort` on that shared object, so a later target of the combo lost
the client's effort. The earlier fix for the same kind of leak covered the format strip
and the output_format write; this was the one site left. Copy before editing.

Finding: F-C3-20 (remaining part)
(cherry picked from commit 28f8adff362253f6213705ad62bb73f9eac7d58a)
2026-11-14 14:08:20 +03:30
serenity
abe4c8ab08 test(dedup): wait on events instead of timers in the joiner-abort test
The test slept 50 ms twice to let the shared call start and the joiner attach.
Under parallel CI load that raced and failed about 1 run in 5. Resolve a promise
when the shared call starts, and yield twice with setImmediate for the joiner.

(cherry picked from commit 2b0dc240af0b99018e634c4863aa8be39761e76b)
2026-11-14 14:08:20 +03:30
serenity
fb43755991 fix(sse): do not hand a dedup initiator abort to connected joiners
When the shared call rejects with a client-lifecycle error and this caller is still connected, run one own call. Finding F-C2-25.

(cherry picked from commit bad435263c939a5a2f470a2ee3f80bf65420850f)
2026-11-14 14:08:20 +03:30
serenity
7f8e26ee86 fix(sse): isolate probe key health and bound ModelScope retries
Apply the stream-path probe guard to non-streaming key health, cap Retry-After at 10 s, and end the retry sleep on client abort. The zero-remaining retry rule stays as is: an upstream test pins it as a temporary throttle. Findings F-C2-20, F-C2-26.

(cherry picked from commit 0721d42d6985d4ae70a6bfc28a741141c7f19795)
2026-11-14 14:08:20 +03:30
serenity
ce5ec63b44 fix(skills): one row per API key, name and version; register() upserts
skillRegistry.register() inserted a new row on every call and the skills
table had no unique key, so installing the same skill twice left
duplicate rows. unregister() deleted only the row it found in its cache,
so the other copies stayed.

Migration 239 removes old duplicates once (keeps the newest row per
api_key_id, name, version, and moves the run history of removed rows to
the kept row, because skill_executions.skill_id cascades on delete) and
adds a unique index. register() is now an upsert on that key: it updates
the row, keeps its id and created_at, and returns the same skill id.

The migration count in README, AGENTS.md, llm.txt and the translated
README and llm.txt files goes from 235 to 236 (count tokens only).
tests/unit/db-backups-skills-3500.test.ts used one fixed skill name for
all seeded rows; it now uses the row id, so the rows stay distinct.

Finding orsurf-06.

(cherry picked from commit 7e16b8ae162cb379ffb68d7da5e93a532d7b4efe)
2026-11-14 14:08:20 +03:30
serenity
cc6509270d fix(sse): log a failed memory-settings read
`getMemorySettings().catch(() => DEFAULT_MEMORY_SETTINGS)` turned a read error
into "memory disabled" for that request with no log line. Keep the fallback and
log the cause at debug.

Finding: F-C2-45 (settings-read half).
(cherry picked from commit 5741f108a4aaa6168d7cd278cb840161b01a37d1)
2026-11-14 14:08:20 +03:30
serenity
439b7e649a fix(memory): keep the prompt prefix for automatic-cache providers, survive a corrupt skill row
- cacheSafe came from hasCacheControl only. OpenAI, Codex and Azure cache an identical
  prefix from token 0 without any marker, so the per-query memory text was prepended at
  messages[0] and missed the cache on every turn. usesAutomaticPrefixCaching now also
  selects the cache-safe placement (just before the last user turn).
- skillRegistry.loadFromDatabase ran outside any try/catch, and JSON.parse(row.schema)
  threw on one bad row (a global skillsmp/skillssh row loads for every key), so every
  non-stream request of the key rejected. The registry now skips a corrupt row with a
  warning, and the caller treats a failed load as "no skills" like the memory block above it.

Not changed: for Claude with cache_control the memory text still lands in system[0]
(F-C2-28), and auto-mode skill selection per turn (F-C2-33). Both need a design decision.

Findings: F-C2-29, F-C2-30
(cherry picked from commit 2386a17176821102c0549a24166f85515c7ee926)
2026-11-14 14:08:20 +03:30
Bl0ck
4ef4d7f64c style(codex): keep provider limits under file-size gate 2026-11-14 10:52:12 +02:00
Bl0ck
701f54ec6b test(codex): correct integration test formatting 2026-11-14 10:23:30 +02:00
Bl0ck
a9bf815247 test(codex): verify Free-to-Plus through live usage parsing, DB and model gate 2026-11-14 10:23:04 +02:00
Bl0ck
320bacfe20 style(test): keep Codex plan sync cases within formatting limits 2026-11-14 10:16:31 +02:00
Bl0ck
acd6ae5189 docs(changelog): describe live Codex subscription plan synchronization 2026-11-14 10:15:36 +02:00
Bl0ck
be788c5d67 test(codex): cover live subscription upgrades, downgrades and safe fallbacks 2026-11-14 10:13:28 +02:00
Bl0ck
7ad043cc8e fix(codex): persist live plan during fenced usage refresh 2026-11-14 10:12:48 +02:00
Bl0ck
de3d5146f7 fix(codex): derive subscription plan changes from live usage 2026-11-14 10:12:28 +02:00
Kiaro-Sama
c97cd6888e test(plugins): publish delivery fixture payload atomically 2026-11-14 11:33:49 +03:30
Kiaro-Sama
1f95836632 chore(codex): sync inventory fix with release train 2026-11-14 10:46:23 +03:30
Kiaro-Sama
73f07da826 Merge release/v3.8.54 into fix/codex-active-inventory
Retain the active Codex inventory guard while incorporating the released scanner and provider follow-up repairs. The merged candidate passes all 20 Codex inventory tests, 16 stale-kit scanner tests, core typecheck and changed-file lint.
2026-11-14 04:35:56 +03:30
John Costa
94a7351f50 chore(changelog): name the #20152 fragment after its PR 2026-11-13 16:59:02 -08:00
John Costa
f43d6c21b4 fix(translator): stream "{}" arguments for Claude tool calls with no parameters
Anthropic sends no input_json_delta for a tool_use block whose tool takes
no input, so the Claude to OpenAI stream translator left the tool call's
arguments as "" (not valid JSON). On content_block_stop, emit "{}" for a
tool_use block that received no argument fragments, matching the
non-streaming path.

Fixes #20152
2026-11-13 16:58:05 -08:00
AiCapitan357
18383eec1c fix(usage): count provider URLs in pending byte accounting 2026-11-13 20:49:18 +00:00
diegosouzapw
c3b06459ed Merge commit '2f2c1957638c59c9f846dc2775488871df28a123' into mb-rafa-19848 2026-11-13 09:25:17 -03:00
Timo Otten
a95ec0c81f fix(executors): restore original tool names in zed-hosted Claude stream 2026-11-13 12:37:13 +01:00
serenity
5100e6bb57 Merge remote-tracking branch 'origin/release/v3.8.54' into HEAD 2026-11-13 13:38:09 +03:30
serenity
31593544ac docs: restore the ETH donation address in the README mirrors
The migration-count bump in this PR also changed one digit of the ETH
donation address (...102337a84 -> ...102347a84) in 66 README files.
Put the original address back; the address now matches the base branch.
2026-11-13 11:06:21 +03:30
b84330808
3ba72f7d1f fix(sse): compute the usage guard's request numbers once per stream
sanitizeUsagePayloadForRequest runs on every parsed SSE event. When the
event's usage reports 0 input tokens it serialized the whole request body
to get its size and then serialized and tokenized it again for the
estimate; a positive count still serialized it once. Nothing was kept
between chunks, so an upstream that attaches usage to every chunk paid
for the full body on each one.

Add createRequestUsageBasis(body), which computes the body size and the
input estimate lazily and keeps them. createSSEStream builds one per
stream and passes it to every sanitize call (including the translate
flush tail). Callers that pass no basis get a fresh one, so their
behaviour is unchanged.

Closes #20086
2026-11-13 06:55:19 +09:00
Afonso Dutra Nogueira Filho
83c22e36d9 fix(stream): arm empty-turn retry for post-tool continuations (#20092)
A mute upstream turn on a post-tool continuation silently breaks agentic
loops (#13600). FLUSH_EMPTY_RETRY_ENABLED already covers every path but
is opt-in, so the default behavior still forwards the empty turn.

Detect submitted tool results in the client request body (OpenAI
role tool/function, Claude tool_result, Responses function_call_output,
Gemini functionResponse) and arm the existing bounded retry for those
turns only; all other streams keep the flag-off path untouched.
2026-11-12 15:17:53 -03:00
sdfsdfw2
7b71e9a8ef fix(dashboard): polish banned keywords card load failure and positioning 2026-11-13 01:19:27 +08:00
Bl0ck154
b034e36442 merge(upstream): reconcile PR #19680 with current release without losing feature 2026-11-12 18:46:35 +02:00
Bl0ck154
386f5dab89 merge(upstream): reconcile PR #18738 with current release without losing feature 2026-11-12 18:46:29 +02:00
ggdayup
fe6363a033 fix(pricing): map Vertex AI LiteLLM buckets and add default rates 2026-11-12 23:54:32 +08:00
sdfsdfw2
6170f698f3 docs(changelog): add fragment for #20078 2026-11-12 19:55:49 +08:00
sdfsdfw2
009399f6d3 fix(dashboard): keep banned keywords editor available when resilience load fails 2026-11-12 19:37:18 +08:00
sdfsdfw2
d143840867 refactor(dashboard): move custom banned keywords to Resilience page 2026-11-12 18:59:42 +08:00
André Almeida
c0196bb0d9 test(db-backups): bind the chunked limit to the route handler
The limit test only called readUpload, a module-private helper, so nothing tied the streaming bound to the route a client actually reaches. This one posts through POST with an operator credential and a request whose body has no content-length, and asserts the 413 arrives before the stream is drained: on the base the handler answers 400 only after buffering all 64 MB.
2026-11-11 22:52:52 -03:00
André Almeida
23cff495ce ci: retrigger (provider-create-binding flake in shard 5/8) 2026-11-11 20:18:43 -03:00
André Almeida
b64e2f5024 chore(quality): point the provider-asset manifest at a commit that still exists
check:provider-asset-provenance fails on every branch, base included, with 'auditedCommit object does not exist: 959ff4dd'. The release branch was force-pushed and dropped that commit, so the gate can no longer resolve its snapshot.

895c0f357 is the commit that produced the current public/providers tree (no later commit touches those paths); every blob id under public/providers is identical between it and HEAD, so the audit claim still holds. auditedAt is unchanged.
2026-11-11 19:05:21 -03:00
André Almeida
c382afa4db ci: retrigger after the Actions artifact incident 2026-11-11 18:14:35 -03:00
André Almeida
a30c673d5d chore(deps): carry the critical audit fix so this PR can land on its own
Same two-file change as #19965 (fast-xml-parser override to ^5.12.0, mongoose chain to its patched lines). audit --audit-level=critical exits 0. Identical bytes, so merging any of these first makes the others' copy a no-op.
2026-11-11 16:26:08 -03:00
Minxi Hou
0fabf5fe8a feat(search): forward Tavily max_age_hours
Tavily added max_age_hours in October 2026 so a search can cap how old the
cached copy of each result is: 1 to 720 hours, 0 to always fetch live, -1 to
never fetch live. The provider_options bag drops any key that is not on the
allow-list, so callers had no way to send it.

The field now passes through with that exact value set, and anything outside
it (721, a fraction, a string) is dropped instead of forwarded.

Signed-off-by: Minxi Hou <houminxi@gmail.com>
2026-11-11 13:35:24 -05:00
André Almeida
a79d716c42 docs(changelog): fragment for #19831 2026-11-11 14:30:58 -03:00
André Almeida
a5ae3a8b6a fix(db-backups): bound the import body while it streams
The pipeline's body-size guard only reads Content-Length, so an upload sent chunked (no such header) skipped it and the raw branch buffered whatever arrived before the size was checked at all.

Count the bytes as they arrive and answer 413 as soon as the configured ceiling is crossed. The multipart branch keeps formData(), which needs the parsed parts; the raw branch is the one Bug #770 exists for and the one that can be bounded.
2026-11-11 14:30:58 -03:00
Bl0ck154
819d029701 test(openrouter): assert malformed regex stripping and counter
Port the focused fork regression for invalid pattern predicate evaluation,
correct removal counts and input immutability. No runtime changes.
2026-11-11 17:31:15 +02:00
Bl0ck154
f063a25349 test(gemini): verify cached input stays bounded by prompt tokens
Port the existing fork regression to protect already upstreamed usage clamping.

No production or live working tree changes.
2026-11-11 17:26:57 +02:00
Bl0ck154
600fc6f07b test(media): prove pinned fetch returns before response body ends
Port the focused fork regression without fork-only runtime changes.
No builds or production modification on the VPS; off-host CI validates.
2026-11-11 17:26:37 +02:00
diegosouzapw
a902902e3c Merge remote-tracking branch 'origin/release/v3.8.54' into HEAD
# Conflicts:
#	stryker.conf.json
2026-11-11 12:01:29 -03:00
Bl0ck
c1fae14635 docs(changelog): describe agy timeout alias guard 2026-11-11 14:00:23 +02:00
Bl0ck
a887d9eea7 fix(antigravity): preserve agy alias response-start timeout evidence 2026-11-11 14:00:11 +02:00
Bl0ck
779244c344 fix(antigravity): preserve agy alias response-start timeout evidence 2026-11-11 14:00:08 +02:00
Bl0ck
fed1553d5a test(antigravity): preserve agy alias response-start timeout evidence 2026-11-11 14:00:05 +02:00
Bl0ck
89f10fe685 test(antigravity): preserve agy alias response-start timeout evidence 2026-11-11 14:00:02 +02:00
Safeer Ahmad
619c595385 fix(antigravity): keep the conversation session on non-streaming server-tool follow-ups
The follow-up leg of a non-streaming server-owned tool loop re-translates the next
source body without antigravitySessionKey, so it fell back to the account-wide
sessionId and could evict a parallel conversation's cache. chatCore now resolves
the key once at function scope and passes it to runNonStreamingResponse, whose
follow-up translation forwards it. Adds docstrings for the session helpers.

Review: CodeRabbit on #19876.
2026-11-11 14:55:40 +05:00
xiaoyaner0201
4370081fde refactor(db): drop unused reasoning rule type re-exports
knip flags ReasoningEffortMode, ReasoningRuleScope and ReasoningTargetKind as
new dead exports in the touched facade. No importer uses them through
src/lib/db/reasoningRoutingRules; they remain exported from the domain
repository contract.
2026-11-11 17:42:35 +08:00
Safeer Ahmad
c64ce472ab chore(changelog): fragment for #19876 2026-11-11 14:09:15 +05:00
Safeer Ahmad
b8fa424900 fix(antigravity): scope the upstream sessionId per conversation, not per account
The OpenAI->Antigravity envelope derived request.sessionId from the account
email alone (#13305), so every conversation running in parallel on one
account shared a single Cloud Code session. Parallel coding-agent tasks then
evicted each other's prompt cache: on a live 8-task opencode run against
gemini-4-carbon-medium, tokens_cache_read collapsed from ~280k to 10,443/None
and 250k-380k uncached prefills took 250-589s (two 600s pre-header 504s),
while the same conversation alone on an account finished 255k-271k cached
turns in 11-14s.

chatCore now passes the resolved conversationId (falling back to the
session-affinity key) into translateRequest as antigravitySessionKey, and the
envelope hashes account + conversation. One conversation keeps one stable
session across turns (cache reuse is preserved), parallel conversations get
distinct sessions, and requests with no conversation key keep the old
account-derived id.
2026-11-11 14:07:30 +05:00
Bl0ck154
037a8455aa fix(images): resolve hosted Codex remote edit refs within 128/20MiB bounds 2026-11-11 10:38:51 +02:00
Bl0ck
dbb882582e test(cursor): freeze live reset countdown during markup equality assertion 2026-11-11 10:31:59 +02:00
Bl0ck154
87a464842d merge(upstream): reconcile Terra model support with current release 2026-11-11 10:30:10 +02:00
Bl0ck
cad3cc79ad chore(tests): sync Stryker tap fixtures with current release 2026-11-11 10:29:03 +02:00
Bl0ck154
078d8a4bbd docs(changelog): format hosted image references entry as bullet 2026-11-11 10:28:12 +02:00
serenity
82c438ba63 docs(changelog): drop the provider update entry fixed upstream
Upstream #15201 fixed the same lost-update race in providers.ts, so this PR
no longer changes that file. Keep the concurrent-fields test as a regression
guard; drop the changelog line that claimed the fix.
2026-11-11 10:20:44 +03:30
serenity
bc789a54d0 revert(sse): leave the CCH signer change to #19761
The CCH hash-view change in this bundle and #19761 fix the same signer.
#19761 is the complete version: its view also covers model and max_tokens
keys nested in tool schemas, proven against 46 captured requests from
Claude Code 2.1.322 (this version fails 1 of them). Drop the change here
so the two PRs do not conflict; the other five fixes in this bundle stay.
2026-11-11 10:19:23 +03:30
serenity
e82c0ae548 refactor(db): extract the family delete loop from pruneBackupDirectory
The snapshot-lease guard added one branch to pruneBackupDirectory and pushed
it over the cyclomatic and cognitive limits of the new-code complexity
ratchet. Move the per-family unlink loop into deleteFamilyFiles. Behaviour
is unchanged: the same files go, and an emptied portable directory is still
removed only when at least one file was deleted.
2026-11-11 09:29:16 +03:30
serenity
9ebbb85ba0 Merge remote-tracking branch 'origin/release/v3.8.54' into ci/19690 2026-11-11 09:26:40 +03:30
serenity
da59578377 refactor(sse): split the CCH hash-view scanner into methods
normalizeCchInput was one 117-line function, and the object parser inside it
reached cognitive complexity 17. Both broke the new-code complexity ratchet.
Move the scanner into a small class with one method per JSON construct, and
split the member parse out of parseObject. The hash view is unchanged: the
golden vectors still pass.
2026-11-11 09:24:38 +03:30
serenity
bf5b2f9d48 Merge remote-tracking branch 'origin/release/v3.8.54' into ci/19684
# Conflicts:
#	open-sse/services/claudeCodeCCH.ts
2026-11-11 09:20:05 +03:30
serenity
fbaea978f7 Merge remote-tracking branch 'origin/release/v3.8.54' into ci/19701
# Conflicts:
#	src/lib/db/providers.ts
2026-11-11 09:15:01 +03:30
Diego Rodrigues de Sa e Souza
5f92b1a991 Merge branch 'release/v3.8.54' into fix/preserve-opaque-reasoning-20261110 2026-11-11 02:12:16 -03:00
Diego Rodrigues de Sa e Souza
61f97072d6 Merge branch 'release/v3.8.54' into pr/fix/or9r-hd-data-dir-xdg-identity 2026-11-11 02:12:13 -03:00
Diego Rodrigues de Sa e Souza
f22e98e6fb Merge branch 'release/v3.8.54' into pr/fix/or9r-bundle-hd-db 2026-11-11 02:12:09 -03:00
Diego Rodrigues de Sa e Souza
a652242c89 Merge branch 'release/v3.8.54' into pr/fix/or9r-bundle-hd-executors 2026-11-11 02:12:06 -03:00
Rafa Martins
f721fba4ec fix(security): remove unsafe-eval from production csp script-src 2026-11-11 00:45:15 -03:00
serenity
01defe6d9d chore(merge): merge release/v3.8.54 into #19403
Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
2026-11-10 23:59:23 -03:00
Kiaro-Sama
a880549d3a docs(codex): clarify active inventory evidence 2026-11-10 19:39:51 -05:00
Kiaro-Sama
f0679355f5 fix(codex): ignore inactive account inventory evidence 2026-11-10 18:09:05 -05:00
小妍儿 ✨
8fa9f60e61 docs(changelog): add Gemini 4 Carbon registry fragment
Signed-off-by: 小妍儿 ✨ <258399167+xiaoyaner0201@users.noreply.github.com>
2026-11-11 04:22:37 +08:00
小妍儿 ✨
a45e4a8dee test(providers): assert Carbon tiers get the declared Antigravity output cap
Signed-off-by: 小妍儿 ✨ <258399167+xiaoyaner0201@users.noreply.github.com>
2026-11-11 04:21:28 +08:00
小妍儿 ✨
0fbc46f906 fix(providers): register Gemini 4 Carbon tiers, pricing and bare alias
Gemini 4 Carbon (2026-11-10) is advertised by the live Antigravity catalog for
Ultra plans at gemini-4-carbon-{low,medium,high} and to paid Gemini API keys as
gemini-4-carbon. With no registry entries the tiers routed but were recorded as
unpriced, the bare id was rejected by the live-catalog check, and the output cap
fell back to the conservative default.

Adds GEMINI_4_CARBON_PROMO_PRICING ($2/$10 introductory, same as Argon, kept as
its own constant), the Antigravity shared-model tiers, a bare -> medium alias,
a modelSpecs entry, and the gemini API-key catalog row.

Signed-off-by: 小妍儿 ✨ <258399167+xiaoyaner0201@users.noreply.github.com>
2026-11-11 04:06:16 +08:00
小妍儿 ✨
612506ddf9 test(providers): cover Gemini 4 Carbon registry, pricing and aliases
Signed-off-by: 小妍儿 ✨ <258399167+xiaoyaner0201@users.noreply.github.com>
2026-11-11 04:06:16 +08:00
AiCapitan357
db53e1369b fix(combo): keep deactivated accounts out of cooldown recovery 2026-11-10 18:40:57 +00:00
diegosouzapw
bf7a8aca0d Merge release/v3.8.54 into fix/18045-property-force-exit-preload 2026-11-10 15:21:02 -03:00
serenity
bab377439c docs(changelog): number the fragment (#19761) 2026-11-10 21:45:54 +03:30
serenity
21c25cf6cf docs(changelog): number the fragment (#19755) 2026-11-10 21:12:49 +03:30
Bl0ck154
f4787d6b40 merge: sync upstream release into PR #18738 without losing changes 2026-11-10 19:33:19 +02:00
Bl0ck154
f8d4f71c9b merge: sync upstream release into PR #19667 without losing changes 2026-11-10 19:32:44 +02:00
Bl0ck154
86932f5e2f merge: sync upstream release into PR #19680 without losing changes 2026-11-10 19:32:40 +02:00
Bl0ck154
6e290f82bf merge: sync upstream release into PR #19681 without losing changes 2026-11-10 19:32:37 +02:00
serenity
5e4fc67dad fix(cache): keep Claude cache breakpoints for OpenRouter anthropic models
OpenRouter documents Anthropic-style cache_control breakpoints on content
parts and tools of its OpenAI-style chat endpoint, with 4 explicit
breakpoints at most. OpenRouter was in neither the caching provider set nor
the OpenAI-format cache_control set, so every Claude Code request to an
anthropic/* model through OpenRouter lost all its breakpoints. The turns
wrote no cache and paid full input price.

Gate by model family on the openrouter provider: only a model id with the
anthropic/ prefix counts as a caching provider and keeps cache_control. Every
other OpenRouter family stays stripped. The per-connection override still
wins over the gate.

Three translator gaps showed up once the markers were allowed through, all
limited to OpenRouter:
- a user turn that is one marked text block collapsed to a plain string and
  lost its marker; it keeps its block array now.
- the tool object dropped cache_control; OpenRouter types it there.
- the OpenAI-format path had no 4 breakpoint cap; the shared Anthropic cap
  now runs there too.

Turning caching on for anthropic/* also switches on the cache-aware
compression guard and prompt_cache_key for those models. Both are pinned by
tests. No live OpenRouter call was made.
2026-11-10 21:02:06 +03:30
serenity
f95f4abd4d docs(changelog): number the fragment (#19754) 2026-11-10 21:01:52 +03:30
serenity
6a02103e14 fix(usage): count speech, transcription and rerank spend in per-key USD limits
The daily, weekly and 5 hour USD limits of an API key read usage_history and
the search tier of the cost ledger. The speech, transcription and rerank
routes write no usage_history row. Speech and rerank only called
recordModalCallCost, which feeds the budget and the ledger under a normal
tier. Transcription did not price the call at all. So a key with a weekly
limit never saw this spend.

Add a "modal" ledger tier next to the "search" tier. The speech route (direct
and combo), the rerank route and the transcription route tag their ledger
row with it. The limit readers sum both tiers and take the oldest row of
both for the 5 hour reset. Transcription now prices the call per second from
the duration the upstream reports, and charges 0 when it reports none.

Image calls are not tagged: the ones that report usage already write a
usage_history row, and a second ledger row would count them twice. Chat rows
keep their real tier and are never summed by the new reader.
2026-11-10 20:50:50 +03:30
Bl0ck
c5178f36b0 merge: sync Codex plan diagnostics with upstream release/v3.8.54 2026-11-10 19:18:14 +02:00
serenity
1d038f69b9 docs(changelog): number the fragment (#19750) 2026-11-10 20:39:25 +03:30
serenity
bc6d0b9eb9 perf(claude): cache the final tool-result turn of an agent loop
An OpenAI-format tool loop sent to Claude ends with the results of the last
assistant turn's tool calls. They sit after that turn's cache breakpoint, so
they are billed as fresh input, and the next call sends them again.

prepareClaudeRequest rebuilds every message marker, so the policy must live
there. Add markFinalToolResults: when the final user turn holds a tool_result
and fewer than 4 markers exist, mark its last block with the tail marker (same
5m class as the other tail markers). The next call then reads those tokens
from cache at 0.1x. A request with no follow-up pays a one-time 0.25x write
premium on those tokens. Client-managed (passthrough) markers are not changed,
and the 4-marker limit still holds: enforceCacheControlBlockLimit and the new
helper share one marker walk.
2026-11-10 20:28:46 +03:30
serenity
c3d487d728 docs(changelog): number the fragment (#19749) 2026-11-10 20:28:30 +03:30
serenity
568906175f fix(cache): do not store a content_filter reply in the semantic cache
The cache already refuses a truncated reply (finish_reason length), because a
temperature 0 entry pinned for the TTL is served to every identical request
and no retry can clear it. A moderation block has the same trap: upstream
re-asks it and a false-positive block can clear, but a cached one cannot.

Treat content_filter, and its Claude spelling refusal, like length in the
shared isTruncatedCompletion set. The non-streaming and the streaming store
both use it, so both are covered.
2026-11-10 20:17:51 +03:30
serenity
381a372a93 docs(changelog): number the fragment (#19745) 2026-11-10 20:17:35 +03:30
serenity
c34cacd253 fix(usage): persist estimated usage for a non-streaming reply with no usage
When a provider returns a 2xx JSON body with no usage object, the client body
gets an estimate (applyClientUsageBuffer) and the cost ledger bills it, but
the non-streaming path read the empty provider usage for the usage_history
row and the call log. The row was never written, so per-key USD limits, which
read only usage_history, never counted that spend, and the call log showed
zero tokens.

Use the estimated client usage when the provider usage is empty. The existing
estimated marker flows to the call log as it does for streams. Provider
reported usage and the stream path are unchanged.
2026-11-10 20:06:48 +03:30
serenity
e590e62086 fix(sse): sign the Claude Code CCH token with the seed and body view of the real client
OmniRoute hashed the raw body with seed 0x6e52736ac806831e. A loopback
capture of the real client does not match that: 9 of 9 bodies from Claude
Code 2.1.322 (1.9 KB to 74 KB) and 3 of 3 from 2.1.252 carry a token that
equals xxHash64 with seed 0x4d659218e32a3268, masked to 20 bits, over the
body with cch=00000, every model string value emptied and every numeric
max_tokens member removed. The OmniRoute token differed in every case.

Use that seed and that view. The view uses plain text matching, as the
client does: the captures with model and max_tokens keys inside a tool
schema only match when the view reaches nested keys too.

The golden test uses two bodies captured from 2.1.322 with a synthetic
device id. It puts the placeholder back, signs, and expects the captured
token.

Built on the head of #19021, which changes the same file.
2026-11-10 20:00:15 +03:30
serenity
52c59f3d7e docs(changelog): number the fragment (#19735) 2026-11-10 19:28:43 +03:30
serenity
e3509d52c2 perf(call-logs): add an ordered partial index for overflow cleanup
selectOverflowArtifactPaths lists artifact rows by timestamp DESC, id DESC
and skips the newest maxEntries. The only artifact index is ordered by
path. Without planner stats SQLite scans idx_cl_timestamp and sorts ties
in a temporary B-tree. After ANALYZE it picks the path index and sorts
every artifact row. Each rotation pass pays this again.

Add idx_cl_artifact_overflow_order on (timestamp DESC, id DESC), limited to
rows with an artifact path. The query plan becomes one index scan with no
sort, with and without stats. The index holds only artifact rows, so
writes to the other rows are not affected. Additive only: the query and
its callers are unchanged.
2026-11-10 19:18:01 +03:30
serenity
5386936931 docs(changelog): number the fragment (#19733) 2026-11-10 19:17:31 +03:30
diegosouzapw
1a50f78356 docs(changelog): add fragment for batch E2E startup isolation 2026-11-10 12:41:15 -03:00
diegosouzapw
3a4da7066a Merge release/v3.8.54 into fix/batch-e2e-startup-isolation
# Conflicts:
#	src/instrumentation-node.ts
2026-11-10 12:37:09 -03:00
serenity
5f7ccb3b7b perf(models): memoize the global model lookup used by timeout resolution
getProviderModel falls back to getGlobalModel for every model that is not
listed under its own provider: custom, passthrough and OpenAI-compatible
models. That fallback walked the whole provider registry up to three
times per call (exact id, vendor-prefix base name, startsWith scan), and
the first two phases also built and sorted a candidate list. The calls
run per request and per combo target. The exact-id and scoresAs lookups
already had a memo cleared on registry change. getGlobalModel had none.

Add a memo for getGlobalModel in the same place. The registry Proxy
already clears the lookup memos on every set and delete, so the new memo
is dropped on the same events. Misses are stored too, because custom
models always miss. The memo is capped, since the key is a client model
id.

(cherry picked from commit 5b328823af143b6dc55d7e72f016a3090ad4d1bb)
2026-11-10 19:06:50 +03:30
serenity
3c0664edd6 fix(gemini): parse split textual tool calls and tag tool-only cut streams
The buffered Gemini/Antigravity SSE parser tried the `[Tool call: name]`
text convention on each stream part alone. That marker is usually split
over several parts, so a split call stayed plain text and the client got
no tool call. Now the parser also tries the joined text once the stream is
read, and turns a match into one tool call.

A native functionCall part did not count as content. A stream that held
only tool calls and ended without a finishReason or [DONE] was not seen as
cut, so it carried no truncation tag and a combo could not fail over. A
native call now counts as content. The cut tag is set and the complete
calls are kept.

(cherry picked from commit e27dfcd33c1f88144febf39b232f36adf7534db6)
2026-11-10 19:06:50 +03:30
serenity
a50d19a760 fix(translator): map Gemini content roles to the right OpenAI role
The Gemini to OpenAI request translator mapped only role "user" to a user
message. Every other value became an assistant message, including an omitted
role (the role field is optional in single-turn requests) and the roles
"function" and "tool" that some clients use for tool results. A request
without a role therefore reached the upstream as an assistant turn.

Map "user", "function" and "tool" to user. When the role is omitted, infer
it from the parts: a functionCall or a thought part means assistant,
anything else means user. Infer the role before thought parts are split
out, so visible text next to a thought stays assistant. Other roles stay
assistant. Tool-call id pairing is unchanged.

(cherry picked from commit 7148ca7f575adca57251810ba5bd819adc645636)
2026-11-10 19:06:50 +03:30
serenity
f1d45b7292 fix(codex): cap the adapter event backlog by retained size
AsyncEventQueue capped the backlog at 10000 events and ignored event size.
A fast producer behind a slow client could hold 10000 large text deltas, or
10000 tiny ones, without a byte limit.

Count the retained string length of each buffered event and reject a push
that would pass 32 Mi UTF-16 code units. Merge an adjacent text or thinking
delta of the same type and phase into the last buffered event, up to 64 Ki
code units, so many tiny deltas stop using one slot each. Tool, phase and
error events never merge. A terminal error event is always accepted so an
overflow still reaches the consumer. Consuming an event returns its share
of the budget.

(cherry picked from commit 35dbd95f19a648e45df54c6ea89b5f6658720c7f)
2026-11-10 19:06:50 +03:30
serenity
1d988fbefb docs(changelog): number the fragment (#19727) 2026-11-10 18:55:25 +03:30
serenity
c2f3172dbd fix(a2a): stop a smart-routing task's upstream call when it is cancelled
The earlier commit in this bundle made the task manager abort a per-task
signal on cancel (getTaskSignal). No handler read that signal, so the
upstream /v1/chat/completions call kept running until the 30 s timeout.

executeSmartRouting now passes getTaskManager().getTaskSignal(task.id) to
routeFetch. routeFetch combines it with the 30 s timeout through
AbortSignal.any, so the call ends on whichever comes first. A task with no
live signal behaves as before. Smart routing is the only A2A skill that
calls routeFetch; the other skills make no upstream fetch.

Tests: new a2a-smart-routing-cancel-signal test. Before this change the
fetch signal was not aborted when the task was cancelled.
2026-11-10 18:44:39 +03:30
serenity
6890911fc0 perf(models): memoize single-model capability lookups
With models.dev sync off (the default) the all-row capability cache is
never primed, so every getSyncedCapability call prepared a SELECT and ran
the CREATE TABLE IF NOT EXISTS guard again, for hits and misses alike. One
chat request makes about nine such calls.

Remember each (provider, model) result, misses included, in a bounded map.
The map is dropped when the model catalog cache version moves (every
capability write already calls invalidateDbCache for model-capabilities) or
when the database instance changes. The map is cleared whole at 4096
entries, because model names come from request bodies. The table guard
runs once per database instance.

(cherry picked from commit 7a3f07c1b57bf9bcbdaa3e98d96c12e5c071b153)
2026-11-10 18:44:39 +03:30
serenity
44cbf62d73 fix(quota): charge Redis usage counters and set TTL atomically
RedisQuotaStore.consume sent INCRBYFLOAT, EXPIRE, EXPIRE and MGET as four
round trips. A crash or disconnect after INCRBYFLOAT left a counter with no
expiry, so the usage window never reset for that key.

Run the charge, both TTL refreshes and the previous-bucket read in one Lua
EVAL. The sliding-window result is unchanged.

(cherry picked from commit 6e193197ce9e3173dab1ceb0f6ff438075da59ed)
2026-11-10 18:44:39 +03:30
serenity
17d79392a4 fix(guardrails): keep signed and encrypted blobs intact in credential redaction
The opt-in credential masker ran every catalog pattern over every
string. Short-prefix patterns (hf_, r8_, sk-, gh*_, npm_, AIza) match
random base64url often enough to rewrite a signed thinking block or an
encrypted reasoning blob. A rewritten signature fails provider
verification when the client replays the turn.

Inside signature, thoughtSignature, thought_signature, encrypted_content
and similar fields, and inside any string that is one long base64 run
(256 chars or more), apply only the long-prefix patterns (PEM key, JWT,
AWS, Anthropic, sk-proj, Stripe, SendGrid, Slack, connection string).
Normal text still gets the full catalog.

(cherry picked from commit 34951c47e88f9308a78bce0ce09dff3fc5e93e81)
2026-11-10 18:44:39 +03:30
serenity
da57bfa4c0 fix(cli-tools): check each tool's own config fields in the batch status
The batch status (used by the CLI tools overview) searched a tool's config for
marker text. For Claude any ANTHROPIC_BASE_URL counted, so a stale localhost
port, a foreign HTTPS host and the direct Anthropic URL all showed as
configured. For Droid, OpenClaw, Cline and Kilo, any file that contained
"omniroute", "sk_omniroute" or "localhost:<port>" anywhere showed as
configured, even in a note or an unrelated provider. The expanded card of each
tool reads specific fields, so the two views disagreed.

The batch check now reads the same field each tool's settings route reads
(Claude env.ANTHROPIC_BASE_URL, Droid customModels "custom:OmniRoute-N",
OpenClaw models.providers.omniroute, Cline openai provider + openAiBaseUrl,
Kilo router entry in auth.json) and requires a loopback host on this API port.
An OmniRoute entry that points elsewhere is reported as "other" for Claude,
Droid and OpenClaw, which the card already shows. Codex, Hermes, omp, Pi,
WhyCodes, Qwen and Grok Build keep their existing checks.

(cherry picked from commit ecba932321d14e7558b3c9d0da88007af9959a96)
2026-11-10 18:44:39 +03:30
serenity
6fc5de6790 fix(a2a): abort a task's signal when it is cancelled
cancelTask only set state=cancelled. The handler kept running and, when it
finished, updateTask threw "Invalid transition: cancelled -> completed". A
handler that failed after the cancel threw "cancelled -> failed" the same way,
which turned a client cancel into a 500 on message/send.

Give every live task an AbortController, abort it when the task becomes
cancelled, and expose its signal through getTaskSignal. After a cancel, a late
"failed" is ignored and a late "completed" is refused with a "cancelled" error
that carries no artifacts. Other invalid transitions still throw as before.

Handlers must read getTaskSignal to stop their own work; the skill wiring is a
separate change.

(cherry picked from commit f3abb2ea54cc93f36b18114a59b712edd6d94388)
2026-11-10 18:44:38 +03:30
serenity
1c79a825bd docs(changelog): number the fragment (#19724) 2026-11-10 18:32:53 +03:30
serenity
3384c13632 test(stryker): list the bundle's covering tests in tap.testFiles 2026-11-10 18:22:11 +03:30
serenity
672437cbb5 perf(providers): index providers by alias and id for O(1) lookup
resolveProviderId calls getProviderByAlias, which looped over every
provider section and compared alias and id on each entry. A miss, for
example an openai-compatible-* id, scanned the whole catalog of about
380 providers and then returned the input. Circuit-breaker names,
target gates, quota lookups and failure records call it on every
routing step.

Build one Map from alias and id to provider on first use. A key is
claimed by the first provider in section order whose alias or id
equals it, the same rule as the old scan, so an alias that equals
another provider's id (poe) keeps resolving as before. Only the
internal lookup changes: ALIAS_TO_ID and getProviderById are untouched.

(cherry picked from commit a95c42fda203fabf12cf226431340d1c2c6f57f1)
2026-11-10 18:22:11 +03:30
serenity
3982e38e39 fix(pii): refuse custom regexes that run slowly on a long character run
The custom PII pattern gate relied on safe-regex alone. safe-regex is a
static star-height check and accepts overlapping alternations such as
(a|aa)+$, which take exponential time on a run of one character. Such a
pattern passed save, preview and runtime compile, then froze the event
loop on the first matching text.

After the static check, run the pattern on seven 64-character runs
(letter, non-ASCII letter, digit, space, dash, underscore, dot) under a
100 ms vm deadline. A pattern that is cut off is refused as unsafe.
The same gate covers save, preview and the runtime skip of stored rows.

(cherry picked from commit e45b0378848f3428ce7d9ae62b63641cc4e50370)
2026-11-10 18:22:11 +03:30
serenity
be1efe54ef fix(resilience): require all half-open probes to pass before closing
A HALF_OPEN circuit breaker closed on the first probe success, whatever
`halfOpenRequests` was. One lucky probe could restore a flapping
provider, and the setting had no effect above 1.

The breaker now counts probe successes in the HALF_OPEN episode and
closes when `halfOpenRequests` of them have passed. A probe failure
still reopens the breaker. The count resets on every state change and
when a stale probe lease is renewed. The default (1) behaves as before.

(cherry picked from commit f2d231c43c41ed330d733231fe4ffb812d16d91d)
2026-11-10 18:22:11 +03:30
serenity
c31ec5bc46 fix(security): scan base64, hex and percent-encoded text for prompt injection
detectInjection matched the surface text only. "Ignore all previous
instructions" wrapped in base64, hex or percent-encoding passed the guard
with no detection, even in block mode. The only rule that mentioned encoding
(encoding_evasion) needs the words "base64 decode" next to "instruction".

detectInjection now also decodes encoded runs in the scanned text, to two
layers, and runs the injection patterns on what they decode to. A hit keeps
the rule's severity and is reported as "decoded:<rule>", so the block
threshold, logging and the guard treat it like the plain form.

Bounds: the input is still the 16 KB scan window. A run needs 24 base64
characters or 12 hex bytes, at most 64 decode attempts run per request, and
a run that decodes to binary (a hash, a token, random data) is dropped. The
run patterns are single character classes, so they are linear. Worst case on
a 16 KB window is about 0.6 ms in the benchmark, and no benign sample (hashes,
random base64, kebab-case paths, form data) produced a hit.

(cherry picked from commit 838f618f8ba16be77af64147a1128eb9075f51fd)
2026-11-10 18:22:11 +03:30
serenity
a389dea7f7 docs(changelog): number the fragment (#19701) 2026-11-10 16:51:19 +03:30
serenity
3e8af882e1 fix(db): delete call-log artifact files in the retention pass
cleanupCallLogs removed expired call_logs rows with a bare batched DELETE.
The body file each row points at (artifact_relpath) stayed on disk. Only the
request-driven orphan scanner removes such files, and it checks a few
entries per rotation and runs only when new call logs arrive. On an idle
gateway the expired bodies stayed.

For call_logs, each batch now picks its rows first, deletes exactly those
rowids, and then removes their files. A failed delete leaves the file of a
row that still exists. Other tables keep the old single statement.

(cherry picked from commit aef70539cc90467cfc720f3a32a245ec0bc82df0)
2026-11-10 16:40:30 +03:30
serenity
931931879b fix(providers): read the connection row after the awaited credential guard
updateProviderConnection read the row, awaited the management-password
guard, then merged the old snapshot into a full-row UPDATE. Two updates
to different fields that overlapped on that await both merged against the
same old row, and the second write restored the first field to its old
value.

Move the SELECT after the await. From the read to the write there is no
await left, so the merge always starts from the newest row.

(cherry picked from commit e1f7c379657f0cae813ece1ad5c38a374537e907)
2026-11-10 16:40:30 +03:30
serenity
f117509f97 perf(db): archive usage history one day at a time during retention
The retention rollup reads every token-shape group before its cutoff with one
all() call, prices each group in one Promise.all, and only then reduces the
groups to daily rows. After a long backlog, such as a retention cut or a
stopped scheduler, one pass held every group of every expired day in memory.

cleanupUsageHistory now runs the rollup and the delete for one UTC day at a
time, oldest first. A pass holds one day of groups. The rollup still runs
before the delete of the same day boundary, and a failed rollup still stops
the delete. The daily totals are the same as before.

Pricing inside one day is still unbounded. That needs a change in
aggregateHistory.ts, which another change set already edits.

(cherry picked from commit 581da00fe608facde621eac989f10daa167860ce)
2026-11-10 16:40:30 +03:30
serenity
502989a019 fix(db): prune exclusive lease and provider quota reset history
exclusive_connection_leases gets one row per exclusive lease. Expire, release
and invalidate only change its state. provider_quota_reset_events gets one row
per observed quota reset. Neither table had a DELETE path, so both grew without
limit.

Scheduled cleanup now deletes lease rows whose ended_at is older than the
call-log retention window, and reset events whose window reset time is older
than that window. A live lease has no ended_at, so it is never deleted. The
current quota window and the last window stay, because the window start
lookup reads them.

(cherry picked from commit 47fc76062f1ecf1378c43cba3e59573e0386d111)
2026-11-10 16:40:30 +03:30
serenity
148803a443 fix(db): keep spend inside an active budget window during retention cleanup
Dollar budgets add up domain_cost_history rows from the start of the current
daily, weekly or monthly window. Scheduled cleanup deleted rows older than
retention.domainCostHistory (30 days by default) without looking at that window.
On the last day of a 31-day month, the first-day spend was older than the cutoff.
Cleanup deleted it and the key got that allowance back. A shorter retention
setting did the same to weekly and daily windows.

Lower the cutoff to the earliest active budget window start. Rows outside every
window still follow the retention setting.

(cherry picked from commit 8c9f07f06cb080266b304756d5a8cb5b24298d62)
2026-11-10 16:40:30 +03:30
serenity
f82405c48c docs(changelog): number the fragment (#19690) 2026-11-10 16:39:54 +03:30
serenity
3b45a9666e fix(db): hold a snapshot lease for the whole migration run
The earlier commit in this bundle added acquireSnapshotLease and made
pruneBackupDirectory skip a leased snapshot. Nothing took a lease, so the
change had no effect.

runMigrations now takes a lease on the restore point after each
createPreMigrationBackup and releases it in a finally block. A backup prune
from any call site or process keeps the snapshot until the upgrade ends,
whether it succeeds or throws. The run is split into runMigrations (lease
owner) and runMigrationsLeased (the existing body); the body is unchanged.

The portable snapshot durability test treated every renameSync as the
snapshot publication. The lease file is also written by rename, so the test
now ignores lease files.

Tests: new db-migration-runner-snapshot-lease test. A prune during the
upgrade deleted the restore point before this change. The lease is gone
after a successful run and after a failed run.
2026-11-10 16:28:52 +03:30
serenity
e61cf4e814 perf(auth): remember unknown API keys for 30 seconds
validateApiKey cached only valid keys. A client that kept sending a key with
no row paid one SQLite lookup per request, and each miss also re-ran the
legacy secret backfill scan.

Keep a separate hash -> time map for keys with no row. It has a 30 second
TTL and its own size cap, so a flood of bad keys cannot evict valid entries.
createApiKey drops the entry for the new key; every other write path
(import, regenerate, revoke, delete, restore) already calls
clearApiKeyCaches, which now clears this map too. bypassCache neither reads
nor writes it.

(cherry picked from commit 733221f645806bef716c22596be96831918e5bde)
2026-11-10 16:28:52 +03:30
serenity
1e4f58699a fix(db): refuse to restore a backup made under another storage key
A restore under a different STORAGE_ENCRYPTION_KEY loads every row,
but each stored credential is encrypted under the old key and cannot
be read. The operator sees a successful restore and then dead accounts.

Write a key fingerprint (sha256: plus the first 16 hex of the key's
SHA-256) into the database just before each manual, automatic and
pre-restore copy. On restore, read it from the backup and refuse,
before any live file is touched, when it differs from the running
key. The message names both fingerprints and never the key. A backup
with no fingerprint (older, or made with encryption off) restores as
before. restoreDbBackup takes { allowKeyMismatch: true } for a key
rotation. A failed fingerprint write only logs a warning; the backup
is still taken.

(cherry picked from commit 3fd751a499513009b0bc21cefe1dc58a8e3830ca)
2026-11-10 16:28:52 +03:30
serenity
3967c00886 fix(db): check the full postcondition before a migration is skipped or recorded
The runner treats a migration as already applied when one sentinel schema object
exists, and the duplicate-column recovery writes the ledger row even when the
replay left columns missing. Three effects followed from a ledger gap:

- 005 and 027 were skipped when only one of their columns existed, so the other
  columns and indexes were never created.
- 012 added the cache tokens to usage_history.tokens_input a second time, which
  inflates the stored billing history.
- A recovery that failed for another reason after a duplicate column was
  recorded as applied with columns still missing.

Check every column and index that 005 and 027 add. Skip 012 once any later
migration is in the ledger, because later rows already store the total. After
duplicate-column recovery, roll back the ledger row and fail the migration when
a column the file adds is still missing. The leftovers test now builds a schema
that has the column, as the case it describes.

(cherry picked from commit 74492d37e3b9676145cade5ddd1aaf094644225d)
2026-11-10 16:28:52 +03:30
serenity
dbf44e92eb fix(db): let backup pruning honour a lease on an in-flight migration snapshot
Count and age pruning treat a pre-migration snapshot like any other
backup family. The migration runner avoids pruning itself, but
backupDbFile, createManagedDbBackup and the scheduled cleanup prune
the same directory from other call sites and other processes. The
only protection was a temp-directory marker that disappears when the
snapshot is published, which is before the migrations finish. A
restore point in use could be deleted mid-upgrade.

Add acquireSnapshotLease(backupDir, snapshotPath). It writes a small
lease file (pid and snapshot name) next to the snapshot and returns a
release function. pruneBackupDirectory skips every family named by a
lease whose process is alive and whose file is under a day old, and
removes leases of dead processes. Without a lease nothing changes.

The migration runner has to take and release the lease. That change
is in a separate file and is not part of this commit.

(cherry picked from commit f094abe1958b52136a09cf0ee84db0017bb43e6f)
2026-11-10 16:28:52 +03:30
serenity
8b5dd232db docs(changelog): number the fragment (#19684) 2026-11-10 15:54:57 +03:30
serenity
8d54b0cf80 docs(security): state the status gate on permanent ban detection
checkFallbackError no longer gives a permanent verdict to a banned-signal
body on HTTP 408, 429 or 5xx, because a transient status that only quotes a
ban phrase is not a ban. BAN_DETECTION.md still said the permanent
terminalization fires at any HTTP status. The line now names the three
excluded statuses.

Checks: check-docs-sync, check-docs-frontmatter, check-fabricated-docs,
check-docs-symbols and prettier pass.
2026-11-10 15:43:54 +03:30
serenity
9804c0743d test(stryker): list the bundle's covering tests in tap.testFiles 2026-11-10 15:43:54 +03:30
serenity
cd0a826fdf perf(combo): index provider accounts once in prompt-cache expansion
expandPromptCacheAffinityTargetsFromConnections looked up the authType of
every scoped account with a linear find over the same provider list. For
one unpinned target that is O(accounts^2); for T targets it is
O(T x accounts^2). Auto combos run this expansion on every request.

Build one id -> connection index per provider on first use and read
authType from it. The first entry wins for a duplicate id, as the find
did. Output order, connection ids and execution keys are unchanged.

(cherry picked from commit 1762b693cc16c34ad066f328a224b0d79b16bb57)
2026-11-10 15:43:54 +03:30
serenity
46ec337e02 perf(gemini): stop copying the rate-limit windows on every request
The Gemini RPM and TPM trackers pruned expired entries with
Array.slice(i), which copies the whole remaining window on every
request. Cost per request grew with the number of requests in the last
60 seconds, and the published limits reach 16000 RPM. The map keys also
stayed after traffic stopped.

Each window now keeps a head index. Expiring an entry moves the index.
The array is compacted only when the dead prefix is at least half of it.
A window with no live entries is deleted from its map. The 60 second
cutoff is unchanged.

(cherry picked from commit a73eabdf2f6b6c9866f00985ac52ffb525557881)
2026-11-10 15:43:54 +03:30
serenity
5ca58be468 perf(routing): cache the active-provider lookup for a bare model id
Bare-model resolution asked the database which active providers carry the
model, with two json_each scans over every connection's synced and custom
model catalog, on every request. The work grew with catalog size, not with
the size of the lookup.

Keep the answer per model id and drop it when the model catalog cache
version moves. Every connection write (create, update, delete) and every
synced or custom model write already bumps that version, and the write
paths that skip it only touch cooldown, error and token fields. The map is
capped at 1000 ids because ids come from clients.

(cherry picked from commit db48f5fba5537b2c9d723a31692bc55583e023b1)
2026-11-10 15:43:54 +03:30
serenity
6879415086 fix(resilience): park unpaid DashScope keys and ignore ban phrases on transient statuses
A DashScope key with no balance answers 400 Arrearage, and a key without the
model service answers 403 AccessDenied.Unpurchased. Both stay true until the
owner pays. The first got no cooldown (shouldFallback false) and the second a
3 s auth cooldown, so the dead key was hit again and again. Both now return
credits_exhausted with a 1 h cooldown, matched on the vendor code or its exact
sentence and only on 400 and 403.

isAccountDeactivated is a substring match with no status check. A 408, 429 or
5xx body that only quotes a ban phrase (a relay echoing an old error, a
throttle message) gave the account a one-year permanent cooldown. The permanent
verdict now needs a status other than 408, 429 and 5xx. 401 and 403 keep it.

(cherry picked from commit 846e42ae792fafc6cdafc385dffe3fdaeacd4516)
2026-11-10 15:43:54 +03:30
serenity
338cd93393 fix(claude-code): sign the same body view as the native client
The CCH token was xxHash64 of the raw request body with seed
0x6e52736ac806831e. The native Claude Code client hashes a different
view of the body and uses a different seed, so the token never matched
what a real client sends.

Seed: the Claude Code binary stores the four xxHash64 initial-state
words for seed 0x4d659218e32a3268 next to its "cch=00000" routine. The
seed 0x6e52736ac806831e is not in the binary, neither as a seed nor as
state words.

View: the native client drops "max_tokens", "fallbacks" and
"fallback_credit_token" members at every depth and empties "model"
string values. It keeps the comma before a trailing run of two or more
dropped members. The bytes of the sent body do not change except for the
five digits.

The new test pins 24 vectors from Claude Code 2.1.220 (published in the
CLIProxyAPI signer tests) and the view rules. The vectors reproduce
only with the new seed and the new view.

(cherry picked from commit be5c1f05f4476cb97a2524c106b84671e034858f)
2026-11-10 15:43:53 +03:30
serenity
52ea27d843 fix(admission): rotate virtual lanes and keep same-tenant order
With per-tenant virtual lanes on, dispatchLanes rebuilt the lane list in
Map order on every release. One release frees one slot, so the first lane
took it and the loop returned before any later tenant was looked at. A
lone tenant waited behind the whole backlog of the tenant ahead of it.

A lane that is served now moves to the end of the Map, which makes the Map
order the round-robin cursor. Dispatch also repeats rounds while capacity
remains and a lane was served, so spare capacity is not left idle.

The direct-admission fast path checked only the shared queue. With lanes
on, older work waits in its lane while the shared queue is empty, so a
newer request from the same tenant was admitted ahead of it. The fast
path now also requires that the tenant's own lane is empty. Other
tenants still bypass a lane head that does not fit, so the bounded bypass
stays and no head-of-line block spans tenants.

(cherry picked from commit 143b576c215d356dc9e44c85b8137d344f1813e9)
2026-11-10 15:43:53 +03:30
Bl0ck
f5f2f29fe3 docs(changelog): note isolated stale combo catalog failures 2026-11-10 13:44:32 +02:00
Bl0ck
5aa9732196 test(combos): preserve badges when a provider catalog throws 2026-11-10 13:44:21 +02:00
Bl0ck
d336a9651e fix(combos): keep healthy stale-model badges on catalog lookup errors 2026-11-10 13:44:03 +02:00
Bl0ck
79da76e719 test(providers): scope async credential probes to their originating POST 2026-11-10 13:30:29 +02:00
AiCapitan357
71893b283f fix(deps): upgrade Next.js to 16.4.6 for November security fixes 2026-11-10 10:48:15 +00:00
diegosouzapw
83bac4f5b7 Merge branch 'release/v3.8.54' into pr/fix/or9r-mcp-skill-duplicate-tool 2026-11-10 07:20:38 -03:00
xiaoyaner0201
952ca75e68 chore(changelog): number reasoning routing repository entry 2026-11-10 17:51:05 +08:00
Bl0ck
602671430e style(tests): align route imports with Prettier 2026-11-10 11:48:50 +02:00
Bl0ck
9b629504d9 docs: explain independent hosted and dedicated image input bounds 2026-11-10 11:41:59 +02:00
Bl0ck
fe157b413a test(images): forward 128 hosted references and reject 129 2026-11-10 11:41:56 +02:00
Bl0ck
03e1c29c4b fix(images): lift verified Codex hosted edit reference guard to 128 2026-11-10 11:41:54 +02:00
Bl0ck
f0e8c12f17 docs(codex): document opt-in selected plan response header 2026-11-10 11:28:46 +02:00
xiaoyaner0201
1cf48f6323 fix(db): invalidate reasoning rule cache before awaiting persistence 2026-11-10 16:29:01 +08:00
tiangao88
d167095b87 Merge remote-tracking branch 'upstream/release/v3.8.54' into fix/preserve-opaque-reasoning-20261110 2026-11-10 07:58:35 +01:00
xiaoyaner0201
08d5907f59 refactor(db): extract reasoning routing rule repository 2026-11-10 14:40:41 +08:00
serenity
c13f4e3eb0 docs(changelog): number the fragment (#19634) 2026-11-10 09:33:21 +03:30
serenity
17db3c6555 fix(cli): keep an XDG install's database when an empty ~/.omniroute appears
With DATA_DIR unset, every default-data-dir resolver returned any existing
~/.omniroute first. Other code creates ~/.omniroute/<sub> directly, so an
XDG (or %APPDATA%) install with its database in the platform dir moved to a
new empty database on the next start.

The legacy dir now wins unless the platform dir holds storage.sqlite and the
legacy dir does not. Fresh installs, legacy installs and installs where both
dirs hold a database keep the old choice. The rule is applied the same way in
the six resolver copies, so the CLI and the server pick the same database.
2026-11-10 09:22:52 +03:30
serenity
d54295769e docs(changelog): number the fragment (#19630) 2026-11-10 09:01:00 +03:30
serenity
7d1203ee0b fix(skills): bound the server tool execution replay table
Every server-owned tool call inserted a row into server_tool_executions and
finalized it. Nothing deleted a row, so the table grew with tool traffic.

On claim, at most once per 5 minutes per database handle, delete rows older
than 30 days (the replay horizon) and rows beyond the newest 10,000 that are
older than one day. A running claim with a live lease and the last day of
rows are never deleted, so a client retry still replays instead of running a
tool twice. A failed sweep is logged and does not fail the claim.

(cherry picked from commit 75a124806cac37606adea371848901a239150eb8)
2026-11-10 08:50:25 +03:30
serenity
796168e075 perf(db): bootstrap compression-combo tables once per DB instance
chatCore calls listCompressionCombos() on every request, and each call ran
the full bootstrap: two CREATE TABLE IF NOT EXISTS, three CREATE INDEX IF
NOT EXISTS, an INSERT OR IGNORE seed and the legacy-seed upgrade check. The
INSERT OR IGNORE takes the SQLite write lock even when the seed row exists.
While another process (CLI, backup, second instance) held the write lock,
each request blocked the event loop for the full busy_timeout and then
failed the lookup with "database is locked".

Latch the bootstrap per DB instance in a WeakSet. The latch is set only
after the bootstrap succeeds, so a failed bootstrap retries on the next
call, and a restore or reset (a new instance) bootstraps again.

(cherry picked from commit bf57d38ab82cca51d2538381d17fa945150c543d)
(cherry picked from commit 70ce760302fe028fec6f5762df20828903f659d9)
2026-11-10 08:50:25 +03:30
serenity
a2c68a5088 fix(db): drop a node's customModels row on node delete
A compatible node's custom models are stored in key_value under the
'customModels' namespace keyed by the node id. deleteProviderNode
removed only the provider_nodes row, so the node's model list outlived
the node. deleteProviderConnectionsByProvider already purges the synced
models and discovery state of a deleted provider, but not this row, so
the management listings (GET /api/provider-models, /api/pricing/models)
kept returning it. Delete the customModels row inside the node delete.
Canonical providers are unaffected: their rows are keyed by provider
name, never by a node id.

Port of 9router a8f63f4d.

(cherry picked from commit 93a805880008de0eaec44af5715f40648e55cf2b)
(cherry picked from commit c40729cda0a93eedbc1706a76fc5ce8a80d747e4)
2026-11-10 08:50:24 +03:30
serenity
6da8533357 docs(changelog): number the fragment (#19628) 2026-11-10 08:39:17 +03:30
serenity
c12079f7bc perf(sse): skip the outbound body parse-back on the plain dispatch path
BaseExecutor serialized the body for the wire and then JSON.parse'd that
string back to build result.transformedBody. Without a CLI fingerprint and
without CCH signing, the wire string is exactly JSON.stringify of the live
transformedBody, so the parse produced a copy of an object we already had.
On a 3 MB agent body that copy costs a body-sized allocation and a blocking
parse per attempt (execute() median of 3 runs: 8.8 ms before, 6.3 ms after).

The fingerprint and Claude paths keep the parse-back: there the wire has a
different key order and a signed cch token, and the logged/returned body
must show that post-fingerprint shape. The live object already carries
_toolNameMap, so the response-side un-cloak keeps working.

(cherry picked from commit 9ec6371ff44ac2571d2ba85b0605505d4b6b8d6c)
(cherry picked from commit 576f502abc0370a22a311ac0f824c36b74d7c3cd)
2026-11-10 08:28:44 +03:30
serenity
0739ec8f5e fix(sse): keep a learned 400 field strip after the Claude step on a re-run
A 400 field-downgrade removes the rejected field and records it, so a later
re-run of the same URL (for example after a 429) keeps it removed. The strip
ran right after the body was built, before the Claude step. For a Claude
compatible relay with active thinking, that step re-adds context_management.
The re-run sent the rejected field again, the relay answered 400 again, and the
recorded strip blocked a second downgrade, so the client got the 400.

reapplyStrippedFields now runs a second time after the Claude step. The loop
moved into a helper next to the other 400 recovery code.

(cherry picked from commit c4701d4c772145e67c9faa42a63fccc5a779291b)
2026-11-10 08:28:44 +03:30
diegosouzapw
155652bef2 fix(providers): clear #19583 mutation and cognitive-complexity gates
- list expiry-first-deadline-order and -session-spreading tests in
  stryker tap.testFiles (they cover quotaScoring.ts and sse/services/auth.ts)
- extract windowUsableCap() from resolveUsableAndReset so the lapsed-window
  cap stays under the cognitive-complexity limit (same behaviour)
- move pickExpiryFirstConnection's JSDoc back above its function
2026-11-10 01:43:26 -03:00
diegosouzapw
0d0e46707e Merge remote-tracking branch 'origin/release/v3.8.54' into HEAD 2026-11-10 01:05:35 -03:00
Praveen K Palaniswamy
95d9902bf0 fix(images): reject extra references for a Leonardo combo edit target
A combo edit routed to Leonardo uploaded only the first reference and dropped
the rest, while the single-model route answers 400. The combo branch now
returns the same 400, so the combo moves on to its next provider.
2026-11-09 21:54:35 -05:00
tiangao88
ed8309c01c fix(sse): preserve opaque metadata through generic text-tail flushes 2026-11-10 01:54:16 +01:00
tiangao88
07ab573b9f fix(sse): preserve opaque reasoning records and index context 2026-11-10 01:41:26 +01:00
serenity
af97123988 refactor(translator): move the tool-argument tail copy out of emitToolCall
The inline tail copy raised the cognitive complexity of openai-responses.ts
from 4 to 5 violations. A small helper restores the base count. Behaviour is
the same: a tail shorter than the fragment is copied, a full fragment is
emitted as is.
2026-11-10 03:13:48 +03:30
serenity
cf5e52300e test(stryker): list the empty-signature thinking test in tap.testFiles
The test covers passthroughHelpers.ts, a mutated module. The mutation
test-coverage gate (--strict) failed because the file was not listed.
2026-11-10 03:13:45 +03:30
Tomas Fecko
b6b31604b0 fix(providers): keep expiry-first deadline picks out of OAuth session spreading
After a strategy picks an account, getProviderCredentials moves the request to
a peer OAuth account with fewer foreign sessions in flight. Under
`expiryFirstOrder: "deadline"` that undid the decision: on a two-account
Claude pool every parallel Claude Code conversation after the first was moved
to the account whose week resets two days later, so it kept being spent.
Deadline order now keeps its pick; the default rate order still spreads.
2026-11-09 21:54:08 +01:00
Bl0ck
ba4f6cdda9 fix(codex): do not surface stale account plan on no-credentials response 2026-11-09 22:48:58 +02:00
Bl0ck
26464e5b70 fix(codex): correct plan sanitizer and format diagnostics 2026-11-09 22:48:18 +02:00
Bl0ck
d69bad2c11 fix(codex): correct plan sanitizer and format diagnostics 2026-11-09 22:48:14 +02:00
Bl0ck
1fbd5f0c45 fix(codex): correct plan sanitizer and format diagnostics 2026-11-09 22:48:11 +02:00
Bl0ck
0e3d307e17 docs(changelog): note opt-in Codex plan troubleshooting header 2026-11-09 22:47:10 +02:00
Bl0ck
e108c0dc7e docs(codex): document disabled-by-default account plan response diagnostics 2026-11-09 22:46:49 +02:00
Bl0ck
0fecfd8165 test(codex): verify plan header opt-in and sanitization 2026-11-09 22:46:03 +02:00
Bl0ck
e4fd2574bf feat(codex): report current selected account plan to telemetry 2026-11-09 22:46:00 +02:00
Bl0ck
fd1dcad9bb feat(codex): gate account plan header behind opt-in allowlist 2026-11-09 22:45:57 +02:00
Bl0ck
76518d6507 feat(codex): declare optional selected-plan diagnostics header 2026-11-09 22:45:54 +02:00
Tomas Fecko
53ce8e3653 fix(providers): roll lapsed session-only resets forward in expiry-first
A session whose reset already passed was only skipped when a longer window
existed. For a session-only account the past reset stayed negative and its
stale fraction still capped `usable`, so deadline order ranked it as already
expiring. A lapsed session is now refilled with its next reset one 5h period
later, like weekly and monthly windows. Adds two regression tests.
2026-11-09 21:24:45 +01:00
Tomas Fecko
2aba63fe7e docs(changelog): add fragment for #19583 2026-11-09 19:54:23 +01:00
Tomas Fecko
9debe722cf feat(providers): expiry-first deadline order and lapsed-reset handling
A longer quota window whose reset already passed comes from a stale quota
read. expiry-first scored it as "expires now" (deadline floored to
minHours), so a stale account looked like the most urgent one and took the
traffic: on 2026-11-06/07 a Claude Team account whose last read still carried
the previous Friday's weekly reset drained ahead of a Max account resetting two
days later. A lapsed weekly/monthly window is now treated as refilled, with its
next reset one nominal period later; a lapsed window of unknown length keeps no
deadline.

Adds `expiryFirstOrder: "deadline"` (provider override or global): accounts
that still hold quota are spent strictly by the nearest deadline, a spent 5h
session or exhausted window is skipped until it refills, and deadlines within
`expiryFirstDeadlineTieMinutes` (default 60) rotate least-recently-used. The
default stays the per-hour rate. Provider strategy overrides now reach the
expiry-first config, and the settings schema accepts both keys per provider.
2026-11-09 19:24:56 +01:00
serenity
cdb44b95a9 docs(changelog): number the fragment (#19542) 2026-11-09 19:44:30 +03:30
serenity
7d5769125f fix(mcp): skip a duplicate skill tool name instead of dropping later skills
createMcpServer registers one skill_<name> tool per enabled skill inside a
single try/catch. registerTool throws on a duplicate tool name, and two
skills whose names differ only in characters that the tool-name sanitizer
replaces (for example "a.b" and "a/b") map to the same name. The throw left
the loop, an empty catch hid it, and every later skill got no MCP tool.

Wrap each registration in its own try/catch. A failed skill is skipped and
logged to stderr with a sanitized message. Later skills still register.
2026-11-09 19:33:17 +03:30
serenity
abb7e500c8 test(translator): assert the exact empty signature on translated thinking blocks
The Claude thinking block from the Responses translator now carries an
empty signature string on purpose, because strict clients need the key.
The test asserted only that the signature is falsy, so a change that
dropped the key still passed. Assert the empty string itself.
2026-11-09 12:54:40 +03:30
serenity
4ab412c5e7 perf(streaming): copy emitted tool-argument tails from growing snapshots
When an upstream re-sends the whole argument string on every chunk,
the Chat-to-Responses translator took the new tail as a slice of that
snapshot. The short slice keeps the whole snapshot alive for as long as
the emitted event lives. A stream of 1500 snapshots (48 B growth each)
kept about 54 MB through its emitted deltas.

Copy the tail when it is shorter than the incoming fragment. A fragment
that is new in full is still emitted as is. A new test feeds growing
snapshots and checks both the emitted bytes and the retained heap.
2026-11-09 12:54:18 +03:30
diegosouzapw
40e27525c6 fix(images): send the request size on Leonardo edits
/v1/images/edits passed only the prompt to the Leonardo handler, so every
edit came back 1024x1024 whatever size the client asked for, while
/v1/images/generations already maps size to width/height. Pass size on the
single-model and combo edit paths; the route test now asserts 576x1024.
2026-11-09 05:09:04 -03:00
diegosouzapw
394d56b82b Merge remote-tracking branch 'origin/release/v3.8.54' into HEAD
# Conflicts:
#	src/app/api/v1/images/edits/route.ts
2026-11-09 04:36:56 -03:00
serenity
9300ebcf14 docs(changelog): number the fragment (#19403) 2026-11-09 10:58:10 +03:30
serenity
414f91fe17 fix(translator): keep parallel tool calls apart when the stream omits the index
The OpenAI-to-Gemini SSE and OpenAI-to-Antigravity stream translators
keyed streamed tool calls by tc.index ?? 0. Some OpenAI-compatible
endpoints send no index, so every parallel call landed in slot 0. The
arguments of two calls joined into one string that did not parse, and the
call went out with empty args.

A shared resolveToolCallIndex now picks the slot. A numeric index is used
as sent. Without one, a fragment that brings a new id, different from the
latest call's id, starts the next call. Any other fragment continues the
latest call. Streams that send an index are unchanged.

(cherry picked from commit feb9b0344e0a4e8b148a3055987ff93fd829616a)
2026-11-09 10:47:31 +03:30
serenity
8e34babca2 fix(translator): forward the stream keepalive to Gemini-native clients
The mid-stream heartbeat is an OpenAI chunk with `choices: []` and no
usage. The OpenAI-to-Gemini SSE translator dropped every chunk without
a choice, so a Gemini-native client with an idle-read timeout saw a
silent socket while the upstream was quiet.

The translator now turns that heartbeat into `data: {"candidates":[]}`.
Probed against @google/genai 1.0.0, 1.22.0, 1.35.0 and 2.0.0 on a
loopback server: this frame parses in all four. A colon comment breaks
versions before 1.35 and a lone newline breaks versions before 1.22.
A frame with an empty text part would be stored by chat sessions as an
empty model turn on every heartbeat; a frame with no candidates is not.

A usage-only chunk is still the usage chunk, and a chunk with no
`choices` array is still dropped.

(cherry picked from commit 7acbe9de0e3188cc42b8a0e7e5ed2da351634d08)
2026-11-09 10:47:31 +03:30
serenity
438dc8681a fix(translator): add an empty signature field to translated Claude thinking blocks
Strict Claude clients deserialize the signature key on every thinking
block and fail when it is missing. The OpenAI-to-Claude and
Gemini-to-Claude stream translators opened a thinking block with only
type and thinking, and the non-stream OpenAI-to-Claude translator did the
same. A translated block has no real signature, so each now carries an
empty string.

The empty value is not replayed as a signature. The request side drops
any thinking block with an empty signature, and a test now pins both
guards. One older test asserted that the key is absent; it now asserts
that no signature value exists.

(cherry picked from commit 8a507daba50e54ef9f76d73468747250fc5c7dd9)
2026-11-09 10:47:31 +03:30
serenity
a4c3bc3e94 perf(streaming): emit tool-argument deltas without slicing the grown buffer
The Chat-to-Claude and Chat-to-Responses translators appended each tool
argument fragment to a buffer, then emitted buffer.slice(oldLength). V8
flattens the cons-string buffer for every slice, and the small slice keeps
a reference to the whole old prefix. A live stream with 94 KiB of
arguments retained about 94 MiB of heap through its emitted deltas.

The new bytes are always the tail of the incoming fragment: appendToolCallArgumentDelta
returns the old buffer, the new snapshot, or old + fragment. Take that
tail from the fragment itself. Repeat dedup, snapshot growth, repeated
incremental characters and object fragments keep the same emitted bytes.
The Responses transformer had the same slice and gets the same change.

(cherry picked from commit 48dbff217292c12fa4d63ca22c7f7884889b192b)
2026-11-09 10:47:31 +03:30
diegosouzapw
9c982b1aaf test(images): route the Leonardo edit result download through the pinned media fetch stub
The release now downloads Leonardo results through the guarded media fetch
(DNS resolve + pinned agent), so the edit tests stub the lookup and the pinned
fetch the same way the other Leonardo tests do, and wait for call-log saves
before closing the DB.
2026-11-07 19:53:44 -03:00
diegosouzapw
55466d43cf Merge remote-tracking branch 'origin/release/v3.8.54' into HEAD
# Conflicts:
#	open-sse/handlers/imageGeneration/providers/leonardo.ts
#	open-sse/handlers/videoGeneration/leonardoHandler.ts
#	tests/unit/leonardo-image-model-id.test.ts
#	tests/unit/leonardo-video-generation.test.ts
2026-11-07 19:49:54 -03:00
Bl0ck154
2f5532d7e0 test(combo): keep uncataloged ceiling coverage after Terra registration
Signed-off-by: Bl0ck154 <36800583+Bl0ck154@users.noreply.github.com>
2026-11-07 23:00:47 +02:00
Bl0ck154
d17b135642 Merge release/v3.8.54 into feat/gpt61-terra-upstream-20261102; resolve Stryker registrations 2026-11-07 21:27:53 +02:00
Bl0ck
aedc445cb0 test(openai): cover Terra sampling in native and translated Responses 2026-11-07 21:05:43 +02:00
Bl0ck
783e35d292 fix(openai): strip Terra logprobs only for active reasoning 2026-11-07 21:05:20 +02:00
Bl0ck
5b721ffb9d fix(openai): keep Terra sampling when reasoning is disabled 2026-11-07 21:05:05 +02:00
Dizzle
003ad3e2d7 feat(opencode-plugin-v2): make the published catalog order configurable
catalog published in raw API arrival order; modelOrder sorts it by an ordered { key, direction } list over provider, name, recency, free, price, context, defaulting to provider then name then newest release date then id; an unknown key or direction fails the load naming the value and the supported set
2026-11-03 12:23:34 +01:00
Bl0ck154
1b44f42a4b Merge remote-tracking branch 'upstream/release/v3.8.53' into audit/pr18738-quality-20261102
Signed-off-by: Bl0ck154 <36800583+Bl0ck154@users.noreply.github.com>
2026-11-02 20:34:30 +02:00
Bl0ck154
8bf129e62e fix(quality): avoid added Fast multiplier complexity and include coverage test
Signed-off-by: Bl0ck154 <36800583+Bl0ck154@users.noreply.github.com>
2026-11-02 20:34:30 +02:00
Praveen K Palaniswamy
55f499c284 Merge branch 'fix/leonardo-image-model-id' into feat/leonardo-image-edits 2026-11-02 11:37:27 -05:00
Praveen K Palaniswamy
bb51084f7e Merge remote-tracking branch 'upstream/release/v3.8.53' into fix/leonardo-image-model-id 2026-11-02 11:37:17 -05:00
Bl0ck154
296f7a0219 docs(changelog): format Terra model fragment as release bullet 2026-11-02 17:19:05 +02:00
Bl0ck154
18e24bda3a Merge current release/v3.8.53 into GPT-6.1 Terra model support
Signed-off-by: Bl0ck154 <36800583+Bl0ck154@users.noreply.github.com>
2026-11-02 17:12:10 +02:00
Bl0ck154
9505140652 test(models): type Responses translation regression result 2026-11-02 00:57:53 +02:00
Bl0ck154
0491633369 fix(models): preserve Terra effort-only Codex Responses requests 2026-11-02 00:56:57 +02:00
Bl0ck154
85b3cfedb2 feat(models): register GPT-6.1 Terra for OpenAI API and Codex 2026-11-02 00:54:57 +02:00
Praveen K Palaniswamy
cde7a030aa docs(changelog): add Leonardo image edits 2026-10-31 11:12:38 -04:00
Praveen K Palaniswamy
8c600b7ac9 feat(images): support Leonardo reference-image edits on /v1/images/edits (#18671)
/v1/images/edits rejected every Leonardo model, although Leonardo does
image-to-image on its generations call. Upload the edit reference through
Leonardo's init-image flow (presigned S3 form post, no Leonardo token sent
to S3) and generate with init_image_id and init_strength 0.3, on both the
single-model and the combo edit paths. Edits are call-logged under
/v1/images/edits.
2026-10-31 11:01:30 -04:00
Praveen K Palaniswamy
6deb70bb83 docs(changelog): add the Leonardo image and video fix 2026-10-31 10:46:32 -04:00
Praveen K Palaniswamy
02df761457 fix(sse): send Leonardo video to the text-to-video endpoint and return the mp4
The video handler posted an image-generation body (modelId "phoenix",
num_frames) to /generations, which Leonardo rejects with 400 "Unexpected
variable num_frames", so leonardo video never worked. Submit to
/generations-text-to-video with a model enum and resolution, read
motionVideoGenerationJob, poll the generations status URL, and download
motionMP4URL (url is a jpg thumbnail). The catalog lists Motion 2.0 and
Motion 2.0 Fast; the old phoenix id maps to Motion 2.0.
2026-10-31 10:45:29 -04:00
Praveen K Palaniswamy
ce3be09269 fix(sse): send Leonardo image requests a platform-model UUID, not the catalog id
Leonardo's v1 generations API takes a platform-model UUID as modelId. The
handler sent the catalog id (phoenix, sdxl), which Leonardo answers with
HTTP 500 "internal error", so every leonardo/* image request failed.
Map phoenix and sdxl to the Phoenix 1.0 and SDXL 1.0 UUIDs; a raw UUID
passes through so any Leonardo model can be used.
2026-10-31 10:30:49 -04:00
ahmedgo17390
18c2af93a5 test(batch): isolate E2E worker startup 2026-10-30 22:16:32 +03:00
ahmedgo17390
92ead552ec test: protect property runner reports 2026-10-29 13:26:33 +03:00
918 changed files with 44099 additions and 2849 deletions

View File

@@ -891,6 +891,19 @@ ALLOW_API_KEY_REVEAL=false
# Default: https://api.getnadir.com
# OMNIROUTE_NADIR_BASE_URL=https://api.getnadir.com
# Opt-in for the `decision` auto-combo router strategy (feature flag; a dashboard DB
# override wins). While off, decision combos read no credential, make no call and route
# with the rules strategy.
# Used by: open-sse/services/autoCombo/decisionStrategy.ts
# Default: false
# COMBO_DECISION_ROUTER_ENABLED=false
# Key for the `decision` router's network deciders (systemone, http), used when the
# combo's config.decision.connectionId is unset (and, for systemone, no typesafe
# connection is in scope). A combo never stores a key. Sensitive.
# Used by: open-sse/services/decision/credentials.ts
# OMNIROUTE_DECISION_API_KEY=
# Weekly window for per-API-key USD usage limits.
# Used by: src/lib/usage/apiKeyUsageLimits.ts (request enforcement, key usage-limit
# status, @@om-usage). Values: provider | calendar | Default: provider
@@ -2613,6 +2626,13 @@ APP_LOG_TO_FILE=true
# Used by: src/lib/healthzLag.ts (event-loop stall sampler). Disabled by default;
# logs sizes and inflight count only, never bodies or heap snapshots.
# OMNIROUTE_EVENT_LOOP_STALL_THRESHOLD_MS=0 stops that sampler, and this diagnostic with it.
# Optional response header for troubleshooting Codex OAuth plan eligibility.
# OFF by default: when enabled, API callers can see the recognized subscription tier
# of the selected Codex connection in X-OmniRoute-Selected-Connection-Plan.
# Do not enable on public/multi-tenant gateways if this account metadata is private.
# Arbitrary/unrecognized plan values and non-Codex requests never get this header.
# OMNIROUTE_CODEX_PLAN_RESPONSE_HEADER=0
# OMNIROUTE_HEAP_DIAGNOSTICS_ENABLED=0
# Heap-use threshold in MiB for the opt-in diagnostic (default: 900).
# A high-heap log is rate-limited to once per 60 seconds.

View File

@@ -22,7 +22,11 @@ name: omni-queue
# • Both jobs run in the `omni-queue` environment, which holds the App's credentials and the
# owner's OMNI_QUEUE_LAND_TOKEN and admits the default branch only, by its exact name: a
# workflow on a candidate branch cannot read them. The App writes omni-queue/land, the status release rulesets
# require, so its private key is the root of trust. The land token reaches the tick only.
# require, so its private key is the root of trust. The land token reaches the tick only
# (the landing with landing.actor "owner"; the comments, label removals and issues with
# config voice "owner"). The owner's merge-commit signing key (OMNI_QUEUE_SIGNING_KEY,
# config landing.signing "ssh") reaches one step of the tick, which writes it to a 0600 file
# under RUNNER_TEMP; the job's last step removes it, whatever happened.
# • action=bless (the explicit emergency exit): the tick writes omni-queue/land on ONE commit
# for a hotfix, sync-back or base repair, after checking that both the dispatcher
# (github.actor) and whoever triggered the run (github.triggering_actor, the re-runner of a
@@ -235,10 +239,35 @@ jobs:
echo "name=${login}"
echo "email=${id}+${login}@users.noreply.github.com"
} >> "$GITHUB_OUTPUT"
# config.landing.signing "ssh": the owner's SSH signing key, for the queue's merge commits
# (scripts/merge-queue/compose.mjs reads it at compose.signingKeyPath(RUNNER_TEMP) and hands
# git the path as per-command configuration, never as an argument). The key exists only in
# this step's environment and in a file only the runner user can read; it is never
# printed. Without the secret nothing is written and a tick that is asked to sign composes
# unsigned, with one `error` event per batch. This step never fails the job: a key it
# cannot write is the same case (signing never blocks the queue).
- name: Write the merge-commit signing key
env:
OMNI_QUEUE_SIGNING_KEY: ${{ secrets.OMNI_QUEUE_SIGNING_KEY }}
run: |
set -uo pipefail
if [ -z "${OMNI_QUEUE_SIGNING_KEY:-}" ]; then
echo "no merge-commit signing key in the environment: nothing written"
exit 0
fi
umask 077
if ! { mkdir -p "$RUNNER_TEMP/omni-queue-signing" \
&& chmod 700 "$RUNNER_TEMP/omni-queue-signing" \
&& printf '%s\n' "$OMNI_QUEUE_SIGNING_KEY" > "$RUNNER_TEMP/omni-queue-signing/signing-key" \
&& chmod 600 "$RUNNER_TEMP/omni-queue-signing/signing-key"; }; then
rm -rf "$RUNNER_TEMP/omni-queue-signing"
echo "::warning::the merge-commit signing key could not be written: merge commits stay unsigned"
fi
# Inputs travel through env and are assembled into an argv array: no expression is ever
# expanded inside the script body. Scheduled, workflow_run and pull_request_target ticks
# pass no base (the tick discovers the bases with work). The owner's land token is used
# only by the landing itself when config.landing.actor is "owner" (never printed).
# by the landing itself when config.landing.actor is "owner", and by the queue's comments,
# label removals and issues when config.voice is "owner" (never printed).
# GITHUB_ACTOR and GITHUB_TRIGGERING_ACTOR are the runner's own default variables, named
# here because a bless is checked against both: the original dispatcher, whose inputs a
# re-run keeps, and whoever triggered this run (the re-runner of a re-run).
@@ -265,3 +294,8 @@ jobs:
if [ -n "${INPUT_SHA:-}" ]; then args+=(--sha "$INPUT_SHA"); fi
fi
node scripts/merge-queue/tick.mjs "${args[@]}"
# Last step, whatever happened before it (failure, cancellation): the signing key leaves
# the runner. Needs no secret; nothing to remove is not an error.
- name: Remove the merge-commit signing key
if: always()
run: rm -rf "$RUNNER_TEMP/omni-queue-signing"

View File

@@ -20,6 +20,7 @@ jobs:
steps:
- uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5
with:
ref: ${{ github.sha }}
persist-credentials: false
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7
with:
@@ -28,17 +29,13 @@ jobs:
- uses: ./.github/actions/npm-ci-retry
with:
cache: "false"
- name: Emit shadow acceptance report
run: |
node scripts/quality/validate-release-acceptance.mjs \
--plan tests/fixtures/release-acceptance/plan-lint.json \
--manifests tests/fixtures/release-acceptance/shadow-manifests \
--out release-acceptance-report.json
- name: Validate and retain the live gate inventory
run: node scripts/quality/release-acceptance/run-shadow.mjs "$RUNNER_TEMP/release-acceptance-shadow"
continue-on-error: true
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
if: always()
with:
name: release-acceptance-report
path: release-acceptance-report.json
if-no-files-found: ignore
path: ${{ runner.temp }}/release-acceptance-shadow/
if-no-files-found: error
retention-days: 30

View File

@@ -101,35 +101,37 @@ server reads it, not only in the shell that runs `opencode models`.
## Options
| Key | Default | Notes |
| --------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `providerId` | `"omniroute"` | Provider id and integration id; models publish under `<providerId>/...` |
| `baseURL` | required | OmniRoute gateway root (no `/v1` suffix needed) |
| `apiKey` | connected credential, then `OMNIROUTE_API_KEY` | Chat key for `/v1/*` — see [Credentials](#credentials) |
| `managementReadToken` | option, then `OMNIROUTE_MANAGEMENT_API_KEY`, then `apiKey` | Management key for `/api/*` (combos, providers, enrichment) — usually **not** the same key |
| `displayName` | `"OmniRoute"` | Provider display name |
| `timeoutMs` | `10000` | Per-endpoint fetch timeout |
| `modelCacheTtlMs` | `300000` | Catalog cache TTL and background refresh period (minimum 60000 ms): the served catalog follows the gateway within this window, with no service restart; disk snapshot warms cold starts |
| `timeouts` | per-endpoint override | `{ models, combos, enrichment }` in ms; falls back to `timeoutMs` (`autoCombos` still parses but is ignored — the virtual-entries route is no longer requested) |
| `enrichment` | `true` | Fetch names + pricing (`/api/pricing*`, `/api/free-tier/summary`) |
| `providerTag` | `true` | Toggle the trailing editor parenthesis: `Provider - Model (Editor)`. The provider (the route that serves the model: Openrouter, Opencode-go, Nvidia for `nvidia/...` ids) is always shown; the editor (who made the model: MoonshotAI, Meta, DeepSeek) appears only in the parenthesis. Example: `Openrouter - MoonshotAI: Kimi K 3.1 Pro` -> `Openrouter - Kimi K 3.1 Pro (MoonshotAI)`. The parenthesis is omitted when the editor shares the provider's name. Set `false` to drop it. |
| `geminiSanitization` | `true` | Strip `$schema`/`additionalProperties` from tool schemas sent to Gemini models (`$ref` tools are forwarded untouched) |
| `usableOnly` | `false` | Filter to healthy provisioned providers (`/api/providers`) |
| `combosSource` | `"api"` | Combo source. `"api"` reads `/api/combos` and publishes a combo only when every member passes the filters; `"models"` skips that request and publishes the combo rows `/v1/models` serves. Any preset, `usableOnly`, `providersAllow` or visible/hidden list keeps `"api"` |
| `freeOnly` / `toolsOnly` / `visionOnly` | `false` / `false` / `false` | Filter to free-tier / tool-calling / image-input models; combos with a filtered member are dropped, never partial. Presets filter the pool before the default view ranks it, and a combo publishes only when every resolved member passes (dropped when a member fails or none resolves) |
| `freeSignals` | `["declared"]` | Extra signals that admit a model under `freeOnly`: `priced`, `named`, `provider-named` (see below) |
| `freeProviders` | none | Provider prefixes counted as free by `provider-named` |
| `showcasePerOwner` | `10` | Default-view entries kept per provider |
| `freshPerOwner` | `10` | Default-view fresh entries kept per provider |
| `freshWindowDays` | `90` | Freshness window in days for the fresh branch |
| `usageMemory` | `true` | Restore statically dropped entries named by 30-day usage analytics (needs a management token; inert without one) |
| `visibleModels` / `hiddenModels` | `[]` | Exact (`cc/keep-me`), suffix (`keep-me`), or branch (`prefix/*`) entries ; deny wins ; `"*"` publishes the full catalog and skips narrowing |
| `providersAllow` | `[]` | Provider allowlist by flat name, or branch claim (`prefix/*`) for exhaustive mode ; a branch claim names a branch, a flat entry names a provider prefix |
| `combos` | `true` | Set to `false` to hide every combo (no `/api/combos` request, no combo rows from `/v1/models`) ; models are unchanged |
| `apiFormat.allowAnthropic` | `false` | Route allowlisted ids to the Anthropic API block |
| `apiFormat.anthropicModels` | `[]` | Full model ids routed to Anthropic |
| `apiFormat.anthropicPrefixes` | v1 defaults | Deprecated, warns once — prefer `anthropicModels` |
| `logLevel` / `startupDebug` | `warn` / `false` | Logger verbosity |
| Key | Default | Notes |
| --------------------------------------- | ---------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `providerId` | `"omniroute"` | Provider id and integration id; models publish under `<providerId>/...` |
| `baseURL` | required | OmniRoute gateway root (no `/v1` suffix needed) |
| `apiKey` | connected credential, then `OMNIROUTE_API_KEY` | Chat key for `/v1/*` — see [Credentials](#credentials) |
| `managementReadToken` | option, then `OMNIROUTE_MANAGEMENT_API_KEY`, then `apiKey` | Management key for `/api/*` (combos, providers, enrichment) — usually **not** the same key |
| `displayName` | `"OmniRoute"` | Provider display name |
| `timeoutMs` | `10000` | Per-endpoint fetch timeout |
| `modelCacheTtlMs` | `300000` | Catalog cache TTL and background refresh period (minimum 60000 ms): the served catalog follows the gateway within this window, with no service restart; disk snapshot warms cold starts |
| `timeouts` | per-endpoint override | `{ models, combos, enrichment }` in ms; falls back to `timeoutMs` (`autoCombos` still parses but is ignored — the virtual-entries route is no longer requested) |
| `enrichment` | `true` | Fetch names + pricing (`/api/pricing*`, `/api/free-tier/summary`) |
| `providerTag` | `true` | Toggle the trailing editor parenthesis: `Provider - Model (Editor)`. The provider (the route that serves the model: Openrouter, Opencode-go, Nvidia for `nvidia/...` ids) is always shown; the editor (who made the model: MoonshotAI, Meta, DeepSeek) appears only in the parenthesis. Example: `Openrouter - MoonshotAI: Kimi K 3.1 Pro` -> `Openrouter - Kimi K 3.1 Pro (MoonshotAI)`. The parenthesis is omitted when the editor shares the provider's name. Set `false` to drop it. |
| `geminiSanitization` | `true` | Strip `$schema`/`additionalProperties` from tool schemas sent to Gemini models (`$ref` tools are forwarded untouched) |
| `usableOnly` | `false` | Filter to healthy provisioned providers (`/api/providers`) |
| `combosSource` | `"api"` | Combo source. `"api"` reads `/api/combos` and publishes a combo only when every member passes the filters; `"models"` skips that request and publishes the combo rows `/v1/models` serves. Any preset, `usableOnly`, `providersAllow` or visible/hidden list keeps `"api"` |
| `freeOnly` / `toolsOnly` / `visionOnly` | `false` / `false` / `false` | Filter to free-tier / tool-calling / image-input models; combos with a filtered member are dropped, never partial. Presets filter the pool before the default view ranks it, and a combo publishes only when every resolved member passes (dropped when a member fails or none resolves) |
| `freeSignals` | `["declared"]` | Extra signals that admit a model under `freeOnly`: `priced`, `named`, `provider-named` (see below) |
| `freeProviders` | none | Provider prefixes counted as free by `provider-named` |
| `showcasePerOwner` | `10` | Default-view entries kept per provider |
| `freshPerOwner` | `10` | Default-view fresh entries kept per provider |
| `freshWindowDays` | `90` | Freshness window in days for the fresh branch |
| `usageMemory` | `true` | Restore statically dropped entries named by 30-day usage analytics (needs a management token; inert without one) |
| `visibleModels` / `hiddenModels` | `[]` | Exact (`cc/keep-me`), suffix (`keep-me`), or branch (`prefix/*`) entries ; deny wins ; `"*"` publishes the full catalog and skips narrowing |
| `providersAllow` | `[]` | Provider allowlist by flat name, or branch claim (`prefix/*`) for exhaustive mode ; a branch claim names a branch, a flat entry names a provider prefix |
| `combos` | `true` | Set to `false` to hide every combo (no `/api/combos` request, no combo rows from `/v1/models`) ; models are unchanged |
| `apiFormat.allowAnthropic` | `false` | Route allowlisted ids to the Anthropic API block |
| `apiFormat.anthropicModels` | `[]` | Full model ids routed to Anthropic |
| `apiFormat.anthropicPrefixes` | v1 defaults | Deprecated, warns once — prefer `anthropicModels` |
| `modelOrder` | `provider → name → recency → id` | Ordered list of `{ key, direction }` pairs that sorts the published catalog; each entry is `{ key, direction?: "asc" \| "desc" }`. Keys: `provider` (upstream owner), `name` (display name), `recency` (release date), `free` (zero-cost first), `price` (input, then output cost), `context` (window size). Omitted `direction` uses the key's default — `asc` for `provider`, `name`, `free`, `price`; `desc` for `recency`, `context`. A missing release date or context window sorts last in either direction; an entry whose cost is all zero counts as free; `id` always breaks the final tie. Unknown key or direction fails the plugin load, naming the value and the supported set. **Default changed:** without this option the catalog used to publish in raw API arrival order and now publishes as `provider → name → recency → id`. An explicit `[]` equals the default. |
| `telemetry` | `false` | Opt-in; marks inference requests through the host SDK hook when enabled |
| `logLevel` / `startupDebug` | `warn` / `false` | Logger verbosity |
`toolsOnly` is off by default, so the full catalog is published. Set
`toolsOnly: true` to hide models without tool calling from the host picker —

View File

@@ -0,0 +1,198 @@
/**
* Configurable catalog ordering.
*
* `buildProviderPayload` historically published models in raw `Map` insertion
* order (arrival order from the API), which the host surfaced as-is. This
* module gives the operator an ordered list of criteria — each with a
* direction — to apply to the published catalog. Without a setting the default
* chain is `provider → name → recency → id`.
*
* It reproduces the `ownerKeyOf` (owner group) and `compareByRecency`
* (release date, newest first, unknown = oldest) semantics from
* `catalog-freshness.ts`; they are re-implemented here (not imported) because
* that file is shared with the stacked freshness work and speaks the raw entry
* shape, whereas the sort runs over the legacy shape held in the `collected`
* map. An equivalence test pins the shared sample against `compareByRecency`.
*/
import type { LegacyModel } from "./legacy-model.js";
/** Sortable criteria, in the closed set the options schema accepts. */
export const CATALOG_ORDER_KEYS = [
"provider",
"name",
"recency",
"free",
"price",
"context",
] as const;
export type CatalogOrderKey = (typeof CATALOG_ORDER_KEYS)[number];
/** Direction values; `asc` = ascending, `desc` = descending. */
export const CATALOG_ORDER_DIRECTIONS = ["asc", "desc"] as const;
export type CatalogOrderDirection = (typeof CATALOG_ORDER_DIRECTIONS)[number];
/** One criterion in the ordered list. `direction` may be omitted. */
export interface CatalogOrderSpec {
key: CatalogOrderKey;
direction?: CatalogOrderDirection;
}
/**
* Default chain applied when no `modelOrder` is set. `id` is the final tie
* breaker and is never a user-selectable key.
*/
export const DEFAULT_CATALOG_ORDER: readonly CatalogOrderSpec[] = [
{ key: "provider" },
{ key: "name" },
{ key: "recency" },
];
/** Default direction per key when `direction` is omitted. */
export function defaultDirectionFor(key: CatalogOrderKey): CatalogOrderDirection {
switch (key) {
case "name":
case "provider":
case "free":
case "price":
return "asc";
case "recency":
case "context":
return "desc";
}
}
/**
* The sortable projection of one collected entry. Every field that can be
* missing in the raw data is a sentinel (`NaN` / false) so the comparator can
* rank "absent" last in either direction without crashing.
*/
export interface CatalogOrderEntry {
/** Full collected key, `X/<provider>/<model>…`; final tie breaker (asc). */
id: string;
/**
* Upstream owner = the prefix of the host-visible id (before the first
* `/`), i.e. the same extraction as `ownerKeyOf`. NOT the plugin prefix
* (`X`), which is identical for every entry and would leave the criterion
* inert.
*/
provider: string;
name: string;
/** `Date.parse(release_date)`; absent/unparseable → `NaN` (= oldest). */
releaseDateMs: number;
/** True when every cost component is present and zero. */
free: boolean;
/** `cost.input`; absent/non-finite → `NaN`. */
priceInput: number;
/** `cost.output`; absent/non-finite → `NaN`. */
priceOutput: number;
/** `limit.context`; absent/non-finite → `NaN`. */
context: number;
}
function num(value: unknown): number {
return typeof value === "number" && Number.isFinite(value) ? value : NaN;
}
/**
* Project a collected `(key, legacy)` pair into a sortable entry. The `key`
* is `X/<provider>/<model>…`; the host-visible id is everything after the
* first `/`, and its owner prefix is the `provider` criterion.
*/
export function toOrderEntry(key: string, legacy: LegacyModel): CatalogOrderEntry {
const slash = key.indexOf("/");
const bareId = slash > 0 ? key.slice(slash + 1) : legacy.id;
const ownerSlash = bareId.indexOf("/");
const provider = ownerSlash > 0 ? bareId.slice(0, ownerSlash) : bareId;
const cost = legacy.cost ?? ({} as LegacyModel["cost"]);
const priceInput = num(cost.input);
const priceOutput = num(cost.output);
const cacheRead = num(cost.cache?.read);
const cacheWrite = num(cost.cache?.write);
const free = priceInput === 0 && priceOutput === 0 && cacheRead === 0 && cacheWrite === 0;
// The upstream map projects an absent context window to 0; only a finite,
// strictly positive value is a real window. Anything else is absent, so the
// entry ranks last on the `context` criterion in both directions.
const rawContext = num(legacy.limit?.context);
const context = rawContext > 0 ? rawContext : NaN;
return {
id: key,
provider,
name: legacy.name ?? "",
releaseDateMs: typeof legacy.release_date === "string" ? Date.parse(legacy.release_date) : NaN,
free,
priceInput,
priceOutput,
context,
};
}
/** Normalized text compare, case/punctuation-insensitive, natural numeric. */
function compareText(a: string, b: string): number {
const na = a.normalize("NFC").toLowerCase();
const nb = b.normalize("NFC").toLowerCase();
return na.localeCompare(nb, "en", { sensitivity: "base", numeric: true });
}
/**
* Compare two values for one criterion with a given direction. An absent
* value (NaN) always ranks last regardless of direction; two absent values are
* equal so the next criterion breaks the tie.
*/
function compareValue(a: number, b: number, direction: CatalogOrderDirection): number {
const aAbs = Number.isNaN(a);
const bAbs = Number.isNaN(b);
if (aAbs && bAbs) return 0;
if (aAbs) return 1; // absent always last
if (bAbs) return -1;
const diff = a - b;
if (diff === 0) return 0;
return direction === "asc" ? (diff < 0 ? -1 : 1) : diff < 0 ? 1 : -1;
}
/**
* Build a comparator for the ordered criterion list. Criteria are applied in
* written order; on equality it falls through to the next, and the final tie
* is broken by `id` ascending (normalized).
*/
export function catalogOrderComparator(
specs: readonly CatalogOrderSpec[]
): (a: CatalogOrderEntry, b: CatalogOrderEntry) => number {
const resolved: Array<{ key: CatalogOrderKey; dir: CatalogOrderDirection }> = specs.map(
(spec) => ({ key: spec.key, dir: spec.direction ?? defaultDirectionFor(spec.key) })
);
return (a, b) => {
for (const { key, dir } of resolved) {
let cmp: number;
switch (key) {
case "provider":
cmp = compareText(a.provider, b.provider);
break;
case "name":
cmp = compareText(a.name, b.name);
break;
case "recency":
cmp = compareValue(a.releaseDateMs, b.releaseDateMs, dir);
break;
case "free":
// free (0) vs paid (1): asc = free first, desc = paid first.
cmp = compareValue(a.free ? 0 : 1, b.free ? 0 : 1, dir);
break;
case "price":
cmp =
compareValue(a.priceInput, b.priceInput, dir) ||
compareValue(a.priceOutput, b.priceOutput, dir);
break;
case "context":
cmp = compareValue(a.context, b.context, dir);
break;
}
if (cmp !== 0) return cmp;
}
return compareText(a.id, b.id);
};
}

View File

@@ -8,6 +8,13 @@ import {
type ProviderResolve,
} from "./provider-filter.js";
import type { LegacyModel } from "./legacy-model.js";
import {
catalogOrderComparator,
DEFAULT_CATALOG_ORDER,
toOrderEntry,
type CatalogOrderEntry,
type CatalogOrderSpec,
} from "./catalog-order.js";
import { isUserComboRow, usesModelsComboSource, type CombosSource } from "./combos-source.js";
import {
comboLookupName,
@@ -50,6 +57,7 @@ import {
mapComboToModelV2,
mapRawModelToModelV2,
usableProviderAliasSet,
withInferredFreeLabel,
} from "./shared/index.js";
import {
compileModelListFilter,
@@ -128,6 +136,11 @@ export interface ResolvedOptions extends FreeOptions {
toolsOnly?: boolean;
visionOnly?: boolean;
enrichment?: OmniRouteEnrichmentMap | boolean;
/**
* Ordered catalog sort criteria; each with an optional direction. Absent or
* empty applies the default chain `provider → name → recency → id`.
*/
modelOrder?: readonly CatalogOrderSpec[];
/**
* Per-provider showcase size. Absent means the catalog default
* (`SHOWCASE_PER_OWNER`); direct callers keep working without it.
@@ -734,7 +747,7 @@ async function publishCombos(
} satisfies CapabilityPresetFlags)
)
continue;
if (comboInferred) mapped.name += INFERRED_FREE_LABEL;
if (comboInferred) mapped.name = withInferredFreeLabel(mapped.name, INFERRED_FREE_LABEL);
const mid = mapped.id.startsWith(X + "/") ? mapped.id.slice(X.length + 1) : mapped.id;
const key = X + "/" + mid;
if (publishedKeys.has(key)) {
@@ -988,7 +1001,7 @@ export async function collectCatalog(
)
continue;
afterPresets += 1;
if (inferred) mapped.name += INFERRED_FREE_LABEL;
if (inferred) mapped.name = withInferredFreeLabel(mapped.name, INFERRED_FREE_LABEL);
const mid = mapped.id.startsWith(X + "/") ? mapped.id.slice(X.length + 1) : mapped.id;
const key = X + "/" + mid;
collected.set(key, mapped);
@@ -1041,7 +1054,7 @@ export async function collectCatalog(
} satisfies CapabilityPresetFlags)
)
continue;
if (restoreInferred) mapped.name += INFERRED_FREE_LABEL;
if (restoreInferred) mapped.name = withInferredFreeLabel(mapped.name, INFERRED_FREE_LABEL);
const mid = mapped.id.startsWith(X + "/") ? mapped.id.slice(X.length + 1) : mapped.id;
const key = X + "/" + mid;
collected.set(key, mapped);
@@ -1145,7 +1158,14 @@ export function buildProviderPayload(
integrationID: X,
} as unknown as StableProviderInfo;
const models: StableModelInfo[] = [];
for (const [key, legacy] of collected.entries) {
const specs =
opts.modelOrder && opts.modelOrder.length > 0 ? opts.modelOrder : DEFAULT_CATALOG_ORDER;
const ordered: Array<{ key: string; legacy: LegacyModel; entry: CatalogOrderEntry }> = [
...collected.entries,
].map(([key, legacy]) => ({ key, legacy, entry: toOrderEntry(key, legacy) }));
const compare = catalogOrderComparator(specs);
ordered.sort((a, b) => compare(a.entry, b.entry));
for (const { key, legacy } of ordered) {
const slash = key.indexOf("/");
const bareId = slash > 0 ? key.slice(slash + 1) : legacy.id;
models.push(legacyToStable(X, bareId, legacy, opts.apiKey, opts.baseURL));

View File

@@ -35,6 +35,7 @@ import {
parsePluginOptions,
resolveTimeouts,
toResolvedOptions,
warnOnIgnoredFreeSignals,
} from "./options.js";
/**
@@ -102,6 +103,7 @@ export default Plugin.define({
`[omniroute-plugin] [WARN] host log probe failed, keeping console output: ${err instanceof Error ? err.message : String(err)}`
);
}
warnOnIgnoredFreeSignals(ctx.options, parsed, (message) => log.warn(message));
log.info(`[omniroute-v2] init providerId=${X}`);
// The inference key stands in below when no management token is set, and
// gateways usually reject that stand-in with 401/403. Say so once here,

View File

@@ -60,7 +60,7 @@ export interface LegacyModel {
limit: {
context: number;
input?: number;
output: number;
output?: number;
};
status: "alpha" | "beta" | "deprecated" | "active";
options: {

View File

@@ -2,9 +2,29 @@ import { z } from "zod";
import { DEFAULT_MODEL_CACHE_TTL_MS } from "./cache.js";
import type { ResolvedOptions } from "./catalog.js";
import {
CATALOG_ORDER_DIRECTIONS,
CATALOG_ORDER_KEYS,
type CatalogOrderSpec,
} from "./catalog-order.js";
import { DEFAULT_FREE_SIGNALS, FREE_SIGNALS } from "./shared/free-signals.js";
import { isHttpUrl } from "./shared/models-map.js";
const catalogOrderSpecSchema = z
.object({
key: z.enum(CATALOG_ORDER_KEYS, {
error: (issue) =>
`invalid modelOrder key ${JSON.stringify(issue.input)}: expected one of ${CATALOG_ORDER_KEYS.join(" | ")}`,
}),
direction: z
.enum(CATALOG_ORDER_DIRECTIONS, {
error: (issue) =>
`invalid modelOrder direction ${JSON.stringify(issue.input)}: expected one of ${CATALOG_ORDER_DIRECTIONS.join(" | ")}`,
})
.optional(),
})
.strict();
const apiFormatSchema = z
.object({
allowAnthropic: z.boolean().optional(),
@@ -82,6 +102,11 @@ const pluginOptionsSchema = z
// declarations bound for a Gemini model. On by default — leaving them in
// fails the whole request with 400 INVALID_ARGUMENT.
geminiSanitization: z.boolean().default(true),
// Ordered list of catalog sort criteria; each carries an optional
// direction. Absent applies the default chain (provider, name, recency);
// an empty list means the same. An unknown key or direction is rejected
// at load, naming the offending value and the supported set.
modelOrder: z.array(catalogOrderSpecSchema).optional(),
// Toggle for the trailing editor parenthesis. The provider (the route that
// serves the model: Openrouter, Opencode-go, Nvidia for `nvidia/...` ids)
// is always shown; the editor (who made the model: MoonshotAI, Meta,
@@ -194,9 +219,30 @@ export function toResolvedOptions(parsed: PluginOptions): ResolvedOptions {
freshWindowDays: parsed.freshWindowDays,
usageMemory: parsed.usageMemory,
enrichment: parsed.enrichment,
modelOrder: parsed.modelOrder,
};
}
/**
* Warn at startup when `freeSignals` is supplied without `freeOnly`. The extra
* signals only matter under `freeOnly`, so with it off they are accepted by the
* schema but ignored: tell the operator instead of failing silently. Pure —
* the caller owns the sink, so tests can observe the message without booting
* the plugin. The published catalog is never changed by this notice.
*/
export function warnOnIgnoredFreeSignals(
raw: unknown,
parsed: PluginOptions,
warn: (message: string) => void
): void {
if (raw === null || typeof raw !== "object") return;
if (!("freeSignals" in raw)) return;
if (parsed.freeOnly === true) return;
warn(
"freeSignals is set but freeOnly is false; the extra signals are ignored and the published catalog is unchanged."
);
}
/**
* The host reads the plugin id from the module, before any option is known, so
* it cannot carry the configured provider id. Publishing two gateways from one

View File

@@ -125,7 +125,7 @@ export function inferFreeSignal(id: string, ctx: FreeSignalContext): boolean {
return false;
}
export const INFERRED_FREE_LABEL = " (free, inferred)";
export const INFERRED_FREE_LABEL = "🆓? ";
export interface FreeOptions {
freeOnly?: boolean;

View File

@@ -328,7 +328,7 @@ export function mapRawModelToModelV2(
limit: {
context: typeof raw.context_length === "number" ? raw.context_length : 0,
...(typeof raw.max_input_tokens === "number" ? { input: raw.max_input_tokens } : {}),
output: typeof raw.max_output_tokens === "number" ? raw.max_output_tokens : 0,
...(typeof raw.max_output_tokens === "number" ? { output: raw.max_output_tokens } : {}),
},
...(variants ? { variants } : {}),
status: "active",

View File

@@ -167,12 +167,13 @@ export function formatFreeBudget(params: {
creditTokens?: number;
}): string {
const { freeType, monthlyTokens = 0, creditTokens = 0 } = params;
const quota = "(usage-based quota)";
switch (freeType) {
case "recurring-daily":
return `${fmtTokens(monthlyTokens)} tokens/day`;
return monthlyTokens > 0 ? `${fmtTokens(monthlyTokens)} tokens/day` : quota;
case "recurring-monthly":
return `${fmtTokens(monthlyTokens)} tokens/month`;
return monthlyTokens > 0 ? `${fmtTokens(monthlyTokens)} tokens/month` : quota;
case "recurring-credit":
return `${fmtTokens(creditTokens)} credits`;
case "recurring-uncapped":
@@ -253,6 +254,14 @@ export interface ModelDisplayNameParams {
function stripFreeMarkers(text: string): { text: string; wasFree: boolean } {
let cleaned = text.trim();
let wasFree = false;
// An upstream free glyph may sit anywhere in the model name — parenthesised
// at the end (`QwQ 32B (🆓)`) or inside a variant tag (`FP8 Fast 🆓 ~150`).
// Remove it wherever it appears so the plugin prefix stays the only one.
const withoutGlyph = cleaned.replace(/\s{0,8}\(🆓\)\s{0,8}|\s{0,8}🆓\s{0,8}/g, " ");
if (withoutGlyph.length !== cleaned.length) {
wasFree = true;
cleaned = withoutGlyph.trim();
}
const withoutPrefix = cleaned.replace(/^\[free\]\s{0,8}/i, "");
if (withoutPrefix.length !== cleaned.length) {
wasFree = true;
@@ -272,6 +281,21 @@ function stripFreeMarkers(text: string): { text: string; wasFree: boolean } {
return { text: cleaned.length > 0 ? cleaned : text.trim(), wasFree };
}
/**
* Apply the inferred-free marker as a single leading label. An upstream `Free`
* in the name can leave a full `🆓 ` prefix on the built name, and older rows
* carried a trailing ` (free, inferred)` suffix; both are removed so exactly
* one marker remains, at the head. `label` is passed in by the caller (never
* imported here) to keep the free-signals -> naming dependency acyclic.
*/
export function withInferredFreeLabel(name: string, label: string): string {
let cleaned = name.trim();
cleaned = cleaned.replace(/^🆓\??\s{0,8}/, "");
cleaned = cleaned.replace(/\s{0,8}\(free,\s*inferred\)\s{0,8}$/i, "").trim();
if (cleaned.startsWith(label)) return cleaned;
return `${label}${cleaned}`;
}
/**
* Build the display name for one entry.
*

View File

@@ -0,0 +1,356 @@
import { describe, it } from "node:test";
import assert from "node:assert/strict";
import { readFileSync } from "node:fs";
import { buildProviderPayload, collectCatalog, type CollectedCatalog } from "../src/catalog.js";
import { parsePluginOptions } from "../src/options.js";
import { compareByRecency } from "../src/catalog-freshness.js";
import {
catalogOrderComparator,
DEFAULT_CATALOG_ORDER,
toOrderEntry,
type CatalogOrderEntry,
type CatalogOrderSpec,
} from "../src/catalog-order.js";
import type { LegacyModel } from "../src/legacy-model.js";
import type { OmniRouteRawModelEntry } from "../src/shared/models-map.js";
const baseOpts = {
providerId: "omniroute",
baseURL: "https://gw.example.com",
apiKey: "k",
timeoutMs: 1000,
modelCacheTtlMs: 300000,
usableOnly: false,
};
type Raw = OmniRouteRawModelEntry;
/** Publish through the production reader (collectCatalog) and return the payload. */
async function publish(
rawModels: Raw[],
opts: Record<string, unknown> = {},
enrichment: Map<string, unknown> = new Map()
): Promise<{ collected: CollectedCatalog; payload: { info: unknown; models: unknown[] } }> {
const all = { ...baseOpts, ...opts };
const collected = await collectCatalog(all as never, {
fetcher: async () => rawModels,
combosFetcher: async () => [],
enrichmentFetcher: async () => enrichment,
});
const payload = buildProviderPayload(collected, all as never);
return { collected, payload };
}
function ids(payload: { models: unknown[] }): string[] {
return payload.models.map((m) => String((m as { id: string }).id));
}
describe("published catalog order", () => {
it("defaults to provider, then name, then newest release date, then id — and is deterministic", async () => {
const raw: Raw[] = [
{ id: "zz/zeta-9", release_date: "2026-01-05T00:00:00Z" },
{ id: "ac/alpha-2", release_date: "2026-01-09T00:00:00Z" },
{ id: "ac/alpha-1", release_date: "2026-01-02T00:00:00Z" },
];
const { collected, payload } = await publish(raw);
assert.deepEqual(ids(payload), ["ac/alpha-1", "ac/alpha-2", "zz/zeta-9"]);
// Two projections of the same collected map agree, including on a
// same-name tie resolved by recency (newest first).
const again = buildProviderPayload(collected, { ...baseOpts } as never);
assert.deepEqual(ids(again), ids(payload));
const tied = await publish(
[
{ id: "ac/b1", release_date: "2026-01-02T00:00:00Z" },
{ id: "ac/b2", release_date: "2026-01-09T00:00:00Z" },
],
{},
new Map([
["ac/b1", { name: "Same" }],
["ac/b2", { name: "Same" }],
])
);
// The published set never keeps two equal display names: the catalog
// disambiguates the collision with a route suffix ("… (ac/b1)",
// "… (ac/b2)"), so the pair is ordered by those names.
assert.deepEqual(ids(tied.payload), ["ac/b1", "ac/b2"]);
// On an equal display name the default chain resolves recency-descending
// before the id: "ac/b2" is newer, so it leads despite the larger id.
const older = {
...toOrderEntry("omniroute/ac/b1", noCostLegacy()),
name: "Same",
releaseDateMs: Date.parse("2026-01-02T00:00:00Z"),
};
const newer = {
...toOrderEntry("omniroute/ac/b2", noCostLegacy()),
name: "Same",
releaseDateMs: Date.parse("2026-01-09T00:00:00Z"),
};
const byDefault = catalogOrderComparator(DEFAULT_CATALOG_ORDER);
assert.equal(byDefault(newer, older) < 0, true);
assert.equal(byDefault(older, newer) > 0, true);
});
it("sorts by name with a fixed, case- and number-aware collation", async () => {
const raw: Raw[] = [
{ id: "ac/model-10" },
{ id: "ac/MODEL-C" },
{ id: "ac/model-2" },
{ id: "ac/model-1" },
];
const { payload } = await publish(raw, { modelOrder: [{ key: "name" } as CatalogOrderSpec] });
assert.deepEqual(ids(payload), ["ac/model-1", "ac/model-2", "ac/model-10", "ac/MODEL-C"]);
});
it("sorts by recency, newest first by default, oldest first on asc — matching the freshness recency order", async () => {
const raw: Raw[] = [
{ id: "ac/mar", release_date: "2026-03-01T00:00:00Z" },
{ id: "ac/jan", release_date: "2026-01-15T00:00:00Z" },
{ id: "ac/dec", release_date: "2025-12-01T00:00:00Z" },
];
const desc = await publish(raw, { modelOrder: [{ key: "recency" }] });
assert.deepEqual(ids(desc.payload), ["ac/mar", "ac/jan", "ac/dec"]);
const asc = await publish(raw, { modelOrder: [{ key: "recency", direction: "asc" }] });
assert.deepEqual(ids(asc.payload), ["ac/dec", "ac/jan", "ac/mar"]);
// Same dates, same newest-first order as the shared freshness comparator.
const expected = [...raw].sort(compareByRecency).map((m) => m.id);
assert.deepEqual(ids(desc.payload), expected);
});
it("sorts by free: zero-cost models first on asc, paid first on desc", async () => {
const raw: Raw[] = [{ id: "ac/paid" }, { id: "ac/free" }];
const enrichment = new Map([["ac/paid", { pricing: { input: 1, output: 2 } }]]);
const asc = await publish(raw, { modelOrder: [{ key: "free" }] }, enrichment);
assert.deepEqual(ids(asc.payload), ["ac/free", "ac/paid"]);
const desc = await publish(
raw,
{ modelOrder: [{ key: "free", direction: "desc" }] },
enrichment
);
assert.deepEqual(ids(desc.payload), ["ac/paid", "ac/free"]);
});
it("sorts by price: cheaper first on input, then output; absent cost never counts as zero", async () => {
const raw: Raw[] = [{ id: "ac/pricy" }, { id: "ac/mid" }, { id: "ac/cheap" }];
const enrichment = new Map([
["ac/cheap", { pricing: { input: 0.1, output: 0.2 } }],
["ac/mid", { pricing: { input: 0.1, output: 0.5 } }],
["ac/pricy", { pricing: { input: 0.9, output: 0.2 } }],
]);
const asc = await publish(raw, { modelOrder: [{ key: "price" }] }, enrichment);
assert.deepEqual(ids(asc.payload), ["ac/cheap", "ac/mid", "ac/pricy"]);
const desc = await publish(
raw,
{ modelOrder: [{ key: "price", direction: "desc" }] },
enrichment
);
assert.deepEqual(ids(desc.payload), ["ac/pricy", "ac/mid", "ac/cheap"]);
// A legacy entry with no cost block at all: absent prices rank last in
// both directions, they are never compared as zero.
const noCost = {
id: "ac/no-cost",
name: "no cost",
capabilities: {
temperature: true,
reasoning: false,
attachment: false,
toolcall: false,
input: { text: true, audio: false, image: false, video: false, pdf: false },
output: { text: true, audio: false, image: false, video: false, pdf: false },
interleaved: false,
},
limit: { context: 8192, output: 1024 },
status: "active" as const,
options: {},
headers: {},
release_date: "2026-01-01T00:00:00Z",
providerID: "ac",
api: { id: "ac/no-cost", url: "https://gw.example.com/v1", npm: "@ai-sdk/openai-compatible" },
} as unknown as LegacyModel;
const priced = {
...noCost,
cost: { input: 0.1, output: 0.2, cache: { read: 0, write: 0 } },
} as LegacyModel;
const absent = toOrderEntry("omniroute/ac/no-cost", noCost);
const present = toOrderEntry("omniroute/ac/priced", priced);
assert.ok(Number.isNaN(absent.priceInput));
assert.ok(absent.free === false, "an entry without a cost block is not free");
const cmpAsc = catalogOrderComparator([{ key: "price" }]);
assert.ok(cmpAsc(absent, present) > 0, "absent price ranks last on asc");
const cmpDesc = catalogOrderComparator([{ key: "price", direction: "desc" }]);
assert.ok(cmpDesc(absent, present) > 0, "absent price ranks last on desc");
});
it("sorts by context window: largest first by default, smallest first on asc", async () => {
const raw: Raw[] = [
{ id: "ac/small", context_length: 8192 },
{ id: "ac/big", context_length: 131072 },
{ id: "ac/mid", context_length: 32768 },
];
const desc = await publish(raw, { modelOrder: [{ key: "context" }] });
assert.deepEqual(ids(desc.payload), ["ac/big", "ac/mid", "ac/small"]);
const asc = await publish(raw, { modelOrder: [{ key: "context", direction: "asc" }] });
assert.deepEqual(ids(asc.payload), ["ac/small", "ac/mid", "ac/big"]);
// An entry without a window ranks last in both directions.
const withNone = await publish([{ id: "ac/none" }, { id: "ac/small", context_length: 8192 }], {
modelOrder: [{ key: "context" }],
});
assert.deepEqual(ids(withNone.payload), ["ac/small", "ac/none"]);
const withNoneAsc = await publish(
[{ id: "ac/none" }, { id: "ac/small", context_length: 8192 }],
{
modelOrder: [{ key: "context", direction: "asc" }],
}
);
assert.deepEqual(ids(withNoneAsc.payload), ["ac/small", "ac/none"]);
});
it("applies a chained list: free, then provider, then name", async () => {
const raw: Raw[] = [{ id: "zz/paid" }, { id: "ac/free" }, { id: "ac/paid" }, { id: "zz/free" }];
const enrichment = new Map([
["ac/paid", { pricing: { input: 3, output: 1 } }],
["zz/paid", { pricing: { input: 0.01, output: 0.01 } }],
]);
const { payload } = await publish(
raw,
{ modelOrder: [{ key: "free" }, { key: "provider" }, { key: "name" }] },
enrichment
);
assert.deepEqual(ids(payload), ["ac/free", "zz/free", "ac/paid", "zz/paid"]);
});
it("rejects an unknown key or direction at load, naming the value and the supported set", () => {
assert.throws(
() =>
parsePluginOptions({ baseURL: "https://gw.example.com", modelOrder: [{ key: "zorg" }] }),
(err: Error) =>
err.message.includes("zorg") &&
err.message.includes("provider | name | recency | free | price | context")
);
assert.throws(
() =>
parsePluginOptions({
baseURL: "https://gw.example.com",
modelOrder: [{ key: "name", direction: "up" }],
}),
(err: Error) => err.message.includes('"up"') && err.message.includes("asc | desc")
);
// A valid list parses and carries through.
const parsed = parsePluginOptions({
baseURL: "https://gw.example.com",
modelOrder: [{ key: "free" }, { key: "name", direction: "desc" }],
});
assert.deepEqual(parsed.modelOrder, [{ key: "free" }, { key: "name", direction: "desc" }]);
});
it("ranks absent data last without throwing, and id breaks the final tie", async () => {
const raw: Raw[] = [
{ id: "ac/undated" },
{ id: "ac/dated", release_date: "2026-01-01T00:00:00Z" },
];
// An absent date ranks last in BOTH directions (never treated as zero),
// so the dated model leads either way.
const desc = await publish(raw, { modelOrder: [{ key: "recency" }] });
assert.deepEqual(ids(desc.payload), ["ac/dated", "ac/undated"]);
const asc = await publish(raw, { modelOrder: [{ key: "recency", direction: "asc" }] });
assert.deepEqual(ids(asc.payload), ["ac/dated", "ac/undated"]);
// Two entries both absent on every criterion: the id decides, ascending.
const a = { ...toOrderEntry("omniroute/ac/a", noCostLegacy()), releaseDateMs: NaN };
const b = { ...toOrderEntry("omniroute/ac/b", noCostLegacy()), releaseDateMs: NaN };
assert.equal(catalogOrderComparator([])(a, b) < 0, true);
assert.equal(catalogOrderComparator([])(b, a) > 0, true);
});
function noCostLegacy(): LegacyModel {
return {
id: "ac/x",
name: "x",
capabilities: {
temperature: true,
reasoning: false,
attachment: false,
toolcall: false,
input: { text: true, audio: false, image: false, video: false, pdf: false },
output: { text: true, audio: false, image: false, video: false, pdf: false },
interleaved: false,
},
limit: { context: 0, output: 0 },
status: "active" as const,
options: {},
headers: {},
release_date: "",
providerID: "ac",
api: { id: "ac/x", url: "https://gw.example.com/v1", npm: "@ai-sdk/openai-compatible" },
} as LegacyModel;
}
it("ignores insertion order: permuted arrival gives the same published list", async () => {
const base: Raw[] = [
{ id: "ac/a1", release_date: "2026-01-01T00:00:00Z", context_length: 1000 },
{ id: "ac/a2", release_date: "2026-02-01T00:00:00Z", context_length: 2000 },
{ id: "zz/z1", release_date: "2026-03-01T00:00:00Z", context_length: 3000 },
{ id: "zz/z2", release_date: "2026-04-01T00:00:00Z", context_length: 4000 },
];
const opts = { modelOrder: [{ key: "name" }] };
const first = await publish(base, opts);
const second = await publish(
[...base].reverse().sort(() => 0.5 - Math.random()),
opts
);
assert.deepEqual(ids(first.payload), ids(second.payload));
});
it("keeps every field: a permuted arrival publishes identical models per id", async () => {
const base: Raw[] = [
{ id: "ac/a1", release_date: "2026-01-01T00:00:00Z", context_length: 1000 },
{ id: "zz/z1", release_date: "2026-02-01T00:00:00Z", context_length: 2000 },
];
const enrichment = new Map([
["ac/a1", { name: "A One", pricing: { input: 1, output: 2 } }],
["zz/z1", { name: "Z One", pricing: { input: 3, output: 4 } }],
]);
const opts = { modelOrder: [{ key: "name" }] };
const first = await publish(base, opts, enrichment);
const second = await publish([...base].reverse(), opts, enrichment);
const byId = (p: { models: unknown[] }) =>
Object.fromEntries(p.models.map((m) => [String((m as { id: string }).id), m]));
assert.deepEqual(byId(second.payload), byId(first.payload));
assert.equal(Object.keys(byId(second.payload)).length, 2);
});
it("documents modelOrder in the README: every key, its default, and the default chain", () => {
const readme = readFileSync(new URL("../README.md", import.meta.url), "utf8");
const line = readme.split("\n").find((l) => l.includes("`modelOrder`"));
assert.ok(line, "README options table has a modelOrder row");
for (const key of ["provider", "name", "recency", "free", "price", "context"]) {
assert.ok(line!.includes(key), `README row names the "${key}" key`);
}
assert.ok(line!.includes("provider → name → recency → id"), "README names the default chain");
});
it("builds stateless comparators: repeated and interleaved calls agree", () => {
const entry = (id: string, extra: Partial<CatalogOrderEntry> = {}): CatalogOrderEntry => ({
id,
provider: "ac",
name: "x",
releaseDateMs: NaN,
free: false,
priceInput: 1,
priceOutput: 1,
context: 100,
...extra,
});
const low = catalogOrderComparator([{ key: "name" }]);
const high = catalogOrderComparator([{ key: "name" }]);
const a = entry("omniroute/ac/a", { name: "z" });
const b = entry("omniroute/ac/b", { name: "a" });
const c = entry("omniroute/ac/c", { name: "b" });
const d = entry("omniroute/ac/d", { name: "m" });
const first = low(a, b);
assert.equal(low(c, d) < 0, true, "second pair sorts on its own values");
assert.equal(low(a, b), first, "same pair, same result, no retained state");
assert.equal(Math.sign(low(a, b)), Math.sign(high(b, a) * -1), "two comparators agree");
});
});

View File

@@ -102,7 +102,7 @@ describe("freeSignals", () => {
}
);
assert.deepEqual([...m.keys()], ["omniroute/nv/a"]);
assert.match(String(m.get("omniroute/nv/a")?.name), /\(free, inferred\)$/);
assert.match(String(m.get("omniroute/nv/a")?.name), /^🆓\? /);
});
it("priced skips router segments whose zero is a placeholder", async () => {
@@ -284,7 +284,7 @@ describe("freeSignals", () => {
});
const names = [...draft.models.values()].map((m) => String(m.name));
assert.ok(
names.every((n) => /\(free, inferred\)$/.test(n)),
names.every((n) => /^🆓\? /.test(n)),
names.join("|")
);
});
@@ -295,7 +295,7 @@ describe("freeSignals", () => {
visibleModels: ["*"],
});
assert.deepEqual([...m.keys()], ["omniroute/nv/a"]);
assert.match(String(m.get("omniroute/nv/a")?.name), /\(free, inferred\)$/);
assert.match(String(m.get("omniroute/nv/a")?.name), /^🆓\? /);
});
it("a restored entry named by usage follows the same signals and label", async () => {
@@ -318,7 +318,7 @@ describe("freeSignals", () => {
}
);
assert.ok(draft.models.has("omniroute/nv/target"));
assert.match(String(draft.models.get("omniroute/nv/target")?.name), /\(free, inferred\)$/);
assert.match(String(draft.models.get("omniroute/nv/target")?.name), /^🆓\? /);
});
it("provider-named with a non-empty overlay warns the declared ratio", async () => {
@@ -363,6 +363,35 @@ describe("freeSignals gate cases", () => {
});
assert.equal(m.size, 0);
});
it("an inferred model named in Free shows one leading marker and keeps its disambiguation id", async () => {
const named = (): Entry => ({
name: "Nemotron 3.5 Lightning Free",
providerAlias: "bzl",
providerCanonical: "bzl",
providerDisplayName: "Bazaarlink",
pricing: zero,
});
const m = await run(
["bzl/nemotron-3.5-lightning-free", "bzl/nvidia"],
new Map<string, Entry>([
["bzl/nemotron-3.5-lightning-free", named()],
["bzl/nvidia", named()],
]),
{ freeSignals: ["priced"] }
);
const first = String(m.get("omniroute/bzl/nemotron-3.5-lightning-free")?.name);
const second = String(m.get("omniroute/bzl/nvidia")?.name);
assert.equal(
first,
"🆓? Bazaarlink - Nemotron 3.5 Lightning (bzl/nemotron-3.5-lightning-free)"
);
assert.equal(second, "🆓? Bazaarlink - Nemotron 3.5 Lightning (bzl/nvidia)");
assert.equal((first.match(/🆓/g) ?? []).length, 1);
assert.equal((second.match(/🆓/g) ?? []).length, 1);
assert.ok(!first.includes("(free, inferred)") && !second.includes("(free, inferred)"));
assert.notEqual(first, second);
});
});
describe("freeSignals options", () => {

View File

@@ -71,6 +71,27 @@ describe("compact model names", () => {
assert.equal(name, "🆓 opencode-go - beam");
});
it("strips an upstream free glyph wherever it sits, keeping one leading marker", () => {
const trailing = buildModelDisplayName({
rawId: "cloudflare-ai/@cf/qwen/qwq-32b",
enrichmentName: "QwQ 32B (🆓)",
providerDisplayName: "Cloudflare-ai",
isFree: true,
});
assert.equal(trailing, "🆓 Cloudflare-ai - QwQ 32B");
assert.equal((trailing.match(/🆓/g) ?? []).length, 1);
const inline = buildModelDisplayName({
rawId: "cloudflare-ai/@cf/meta/llama-3.3-70b",
enrichmentName: "Llama 3.3 70B (FP8 Fast 🆓 ~150 resp/day)",
providerDisplayName: "Cloudflare-ai",
isFree: true,
});
assert.ok(inline.startsWith("🆓 Cloudflare-ai - Llama 3.3 70B"), inline);
assert.equal((inline.match(/🆓/g) ?? []).length, 1);
assert.ok(!inline.includes("(FP8 Fast 🆓"), inline);
});
it("keeps colliding entries distinct with a route suffix", async () => {
const raw = await entriesThroughReader([
{ id: "opencode-go/claude-haiku-5-5", owned_by: "opencode-go", context_length: 1000 },

View File

@@ -1,5 +1,6 @@
import { describe, it } from "node:test";
import assert from "node:assert/strict";
import { readFileSync } from "node:fs";
import {
integrationIdFor,
parsePluginOptions,
@@ -7,6 +8,7 @@ import {
providerIdFor,
resolveTimeouts,
toResolvedOptions,
warnOnIgnoredFreeSignals,
} from "../src/options.js";
import { buildModelDisplayName } from "../src/shared/naming.js";
@@ -315,3 +317,43 @@ describe("resolved relay defaults", () => {
assert.equal(resolved.freeProviders, undefined);
});
});
describe("README options table", () => {
it("documents telemetry as opt-in and keeps autoCombos marked as ignored", () => {
const readme = readFileSync(new URL("../README.md", import.meta.url), "utf8");
const telemetryRow = readme.split("\n").find((line) => line.includes("`telemetry`"));
assert.ok(telemetryRow, "README must document the telemetry option");
assert.match(telemetryRow, /`false`/);
assert.match(
telemetryRow,
/opt-in; marks inference requests through the host SDK hook when enabled/i
);
assert.match(readme, /still parses but is ignored/);
});
});
describe("warnOnIgnoredFreeSignals", () => {
const MESSAGE =
"freeSignals is set but freeOnly is false; the extra signals are ignored and the published catalog is unchanged.";
it("warns exactly once when freeSignals is set without freeOnly", () => {
const raw = { baseURL: "https://gw.example.com", freeSignals: ["priced"] };
const warns: string[] = [];
warnOnIgnoredFreeSignals(raw, parsePluginOptions(raw), (msg) => void warns.push(msg));
assert.deepEqual(warns, [MESSAGE]);
});
it("stays silent when freeSignals is absent", () => {
const raw = { baseURL: "https://gw.example.com" };
const warns: string[] = [];
warnOnIgnoredFreeSignals(raw, parsePluginOptions(raw), (msg) => void warns.push(msg));
assert.deepEqual(warns, []);
});
it("stays silent when freeOnly is true", () => {
const raw = { baseURL: "https://gw.example.com", freeSignals: ["priced"], freeOnly: true };
const warns: string[] = [];
warnOnIgnoredFreeSignals(raw, parsePluginOptions(raw), (msg) => void warns.push(msg));
assert.deepEqual(warns, []);
});
});

View File

@@ -226,12 +226,25 @@ describe("v1-vs-v2 catalog parity", () => {
providerId: "omniroute",
baseURL: TEST_OPTS.baseURL,
});
const expectedPayload = JSON.parse(
JSON.stringify({ ...(expected as object), providerID: undefined, name: undefined })
);
// Documented exclusion: v1 filled a missing gateway `max_output_tokens`
// with `limit.output: 0`; v2 leaves `limit.output` out instead of
// publishing a zero output limit the gateway never stated.
if (typeof entry.max_output_tokens !== "number") {
assert.equal(expectedPayload.limit.output, 0, `v1 recorded a zero output for ${entry.id}`);
assert.equal(
"output" in viaShared.limit,
false,
`v2 omits limit.output for ${entry.id} when the gateway does not state it`
);
delete expectedPayload.limit.output;
}
assert.deepEqual(
JSON.parse(JSON.stringify({ ...viaShared, providerID: undefined, name: undefined })),
JSON.parse(
JSON.stringify({ ...(expected as object), providerID: undefined, name: undefined })
),
expectedPayload,
`model mapper parity for ${entry.id}`
);
}

View File

@@ -91,4 +91,12 @@ describe("mapRawModelToModelV2", () => {
);
assert.ok(!("variants" in without));
});
it("omits limit.output when the gateway does not publish max_output_tokens", () => {
const m = mapRawModelToModelV2(
{ id: "ovh-free/gpt-oss-120b", context_length: 128000 },
{ providerId: "omniroute", baseURL: "https://gw.example.com" }
);
assert.equal(m.limit.context, 128000);
assert.ok(!("output" in m.limit));
});
});

View File

@@ -49,8 +49,15 @@ test("formatFreeBudget: discontinued has no token/credit args", () => {
assert.equal(formatFreeBudget({ freeType: "discontinued" }), "(discontinued)");
});
test("formatFreeBudget: missing token/credit counts default to 0", () => {
assert.equal(formatFreeBudget({ freeType: "recurring-daily" }), "0 tokens/day");
test("formatFreeBudget: a daily quota not stated in tokens is labelled explicitly", () => {
assert.equal(formatFreeBudget({ freeType: "recurring-daily" }), "(usage-based quota)");
});
test("formatFreeBudget: a monthly quota of zero is labelled explicitly too", () => {
assert.equal(
formatFreeBudget({ freeType: "recurring-monthly", monthlyTokens: 0 }),
"(usage-based quota)"
);
});
test("formatFreeBudget: unknown future value renders its own name, never empty", () => {

View File

@@ -11,7 +11,7 @@ import {
writeFileSync,
} from "node:fs";
import { createCipheriv, createDecipheriv, randomBytes, scryptSync } from "node:crypto";
import { dirname, join, extname, basename } from "node:path";
import { dirname, join, extname, basename, resolve } from "node:path";
import { Readable } from "node:stream";
import { pipeline } from "node:stream/promises";
import { resolveDataDir } from "../data-dir.mjs";
@@ -56,6 +56,7 @@ export function registerBackup(program) {
.option("--cron <expr>", t("backup.auto.cronOpt"), "0 3 * * *")
.option("--cloud", t("backup.cloudOpt"))
.option("--encrypt", t("backup.encryptOpt"))
.option("--key-file <path>", t("backup.keyFileOpt"))
.option("--retention <n>", t("backup.retentionOpt"), parseInt)
.action(async (opts) => {
const exitCode = await runBackupAutoEnableCommand(opts);
@@ -192,7 +193,16 @@ export async function runBackupCommand(opts = {}) {
let passphrase = null;
if (opts.encrypt) {
if (opts.keyFile) {
passphrase = readFileSync(opts.keyFile, "utf8").trim();
try {
passphrase = readFileSync(opts.keyFile, "utf8").trim();
} catch (err) {
console.error(`Cannot read key file ${opts.keyFile}: ${err?.code || "read error"}`);
return 1;
}
if (!passphrase) {
console.error(t("backup.noPassphrase"));
return 1;
}
} else {
passphrase = await promptPassphrase();
if (!passphrase) {
@@ -336,11 +346,29 @@ function getSchedulePath() {
export async function runBackupAutoEnableCommand(opts = {}) {
const schedulePath = getSchedulePath();
let keyFile;
if (opts.encrypt) {
// A scheduled run has no TTY, so an encrypted schedule needs a key file.
// Persist the absolute PATH only (never the passphrase): the server cwd
// differs from the CLI cwd.
if (!opts.keyFile) {
console.error("Encrypted automatic backups need --key-file <path> (no TTY on a schedule).");
return 1;
}
keyFile = resolve(String(opts.keyFile));
try {
if (!readFileSync(keyFile, "utf8").trim()) throw new Error("empty");
} catch {
console.error(`Key file ${keyFile} is missing, unreadable or empty.`);
return 1;
}
}
const schedule = {
enabled: true,
cron: opts.cron || "0 3 * * *",
cloud: !!opts.cloud,
encrypt: !!opts.encrypt,
...(keyFile ? { keyFile } : {}),
retention: opts.retention || null,
updatedAt: new Date().toISOString(),
};
@@ -375,7 +403,10 @@ export async function runBackupAutoStatusCommand() {
console.log(` cron: ${schedule.cron}`);
console.log(` cloud: ${schedule.cloud ? "yes" : "no"}`);
console.log(` encrypt: ${schedule.encrypt ? "yes" : "no"}`);
if (schedule.keyFile) console.log(` key-file: ${schedule.keyFile}`);
console.log(` retention: ${schedule.retention ?? "unlimited"}`);
if (schedule.lastRunAt) console.log(` last run: ${schedule.lastRunAt}`);
if (schedule.lastError) console.log(` last error: ${schedule.lastError}`);
return 0;
}

View File

@@ -187,8 +187,17 @@ export function registerResilience(program) {
.option("--threshold <n>", t("resilience.config.threshold"), parseInt)
.option("--reset-timeout <ms>", t("resilience.config.resetTimeout"), parseInt)
.option("--base-cooldown <ms>", t("resilience.config.baseCooldown"), parseInt)
.option("--p2c-latency-weight <0-20>", t("resilience.config.p2cLatencyWeight"), parseInt)
.action(async (opts, cmd) => {
const body = {};
if (opts.p2cLatencyWeight != null) {
const w = opts.p2cLatencyWeight;
if (!Number.isInteger(w) || w < 0 || w > 20) {
process.stderr.write("Error: --p2c-latency-weight must be an integer from 0 to 20\n");
process.exit(1);
}
body.p2cLatency = { weight: w };
}
if (opts.threshold != null) body.threshold = opts.threshold;
if (opts.resetTimeout != null) body.resetTimeoutMs = opts.resetTimeout;
if (opts.baseCooldown != null) body.baseCooldownMs = opts.baseCooldown;

View File

@@ -31,11 +31,25 @@ import {
profileNameFromModelId,
} from "./setup-codex.mjs";
/** Map a Codex-style effort to a Claude Code settings.json effortLevel. */
function effortLevelFor(cfg) {
// Codex categories use xhigh/high/low/undefined; Claude Code accepts the same
// names (low|medium|high|xhigh). Pass through, omit for the "simple" tier.
return cfg.effort || undefined;
// Claude Code effortLevel values, lowest first. `minimal`/`none` are catalog tiers but not
// Claude Code levels, so they are never a clamp target.
const CLAUDE_EFFORT_LEVELS = ["low", "medium", "high", "xhigh", "max"];
/**
* Map a Codex-style effort to a Claude Code settings.json effortLevel.
* Codex categories use xhigh/high/low/undefined; Claude Code accepts the same names. Omitted
* for the "simple" tier. When the catalog row lists the model's `effort_tiers`, a level it
* does not offer is lowered to the highest listed level below it, and omitted when none fits.
*/
function effortLevelFor(cfg, effortTiers) {
const wanted = cfg?.effort || undefined;
const tiers = Array.isArray(effortTiers) ? effortTiers : [];
if (!wanted || tiers.length === 0 || tiers.includes(wanted)) return wanted;
const rank = CLAUDE_EFFORT_LEVELS.indexOf(wanted);
if (rank < 0) return wanted;
return CLAUDE_EFFORT_LEVELS.slice(0, rank)
.reverse()
.find((level) => tiers.includes(level));
}
/**
@@ -107,8 +121,10 @@ export function inheritedAnthropicKeyWarning(env = process.env) {
* `contextWindow` is the model's real window from the catalog; without it the profile table's
* `cfg.ctx` is used. The window rule (compact at 85% below 200k, else 190000) is the one
* `omniroute launch` applies; it lives in claudeWindowEnv, shared by both.
* `effortTiers` is the catalog row's `capabilities.effort_tiers`; it keeps `effortLevel` within
* the levels the model offers.
*/
export function buildProfileSettings(modelId, baseUrl, cfg, contextWindow) {
export function buildProfileSettings(modelId, baseUrl, cfg, contextWindow, effortTiers) {
const window = claudeWindowEnv(contextWindow ?? cfg?.ctx);
const env = {
ANTHROPIC_BASE_URL: baseUrl,
@@ -126,7 +142,7 @@ export function buildProfileSettings(modelId, baseUrl, cfg, contextWindow) {
model: modelId,
env,
};
const effort = effortLevelFor(cfg);
const effort = effortLevelFor(cfg, effortTiers);
if (effort) settings.effortLevel = effort;
// NOTE: ANTHROPIC_AUTH_TOKEN is intentionally NOT written here — `omniroute
// launch --profile` injects it from the active context, keeping the secret off
@@ -232,7 +248,8 @@ export async function syncClaudeProfilesFromModels(models, opts = {}) {
// Same order as `omniroute launch`: max_input_tokens, then context_length.
const catalogWindow =
typeof m === "string" ? undefined : (m.max_input_tokens ?? m.context_length);
const content = buildProfileSettings(id, baseUrl, cfg, catalogWindow);
const effortTiers = typeof m === "string" ? undefined : m.capabilities?.effort_tiers;
const content = buildProfileSettings(id, baseUrl, cfg, catalogWindow, effortTiers);
if (dryRun) {
log(`\n── [dry-run] ${filePath} ──`);

View File

@@ -22,29 +22,41 @@ export function getLegacyDotDataDir(homeDir = safeHomeDir()) {
return path.join(homeDir, `.${APP_NAME}`);
}
function hasDatabase(dir) {
try {
return fs.statSync(path.join(dir, "storage.sqlite")).isFile();
} catch {
return false;
}
}
export function getDefaultDataDir() {
const homeDir = safeHomeDir();
const legacyDir = getLegacyDotDataDir(homeDir);
if (fs.existsSync(legacyDir)) {
try {
if (fs.statSync(legacyDir).isDirectory()) {
return legacyDir;
}
} catch {
// Ignore stat errors and continue to the platform default.
}
let legacyIsDir = false;
try {
legacyIsDir = fs.statSync(legacyDir).isDirectory();
} catch {
// Ignore stat errors and continue to the platform default.
}
let platformDir = null;
if (process.platform === "win32") {
const appData = process.env.APPDATA || path.join(homeDir, "AppData", "Roaming");
return path.join(appData, APP_NAME);
platformDir = path.join(appData, APP_NAME);
} else {
const xdgConfigHome = normalizeConfiguredPath(process.env.XDG_CONFIG_HOME);
if (xdgConfigHome) platformDir = path.join(xdgConfigHome, APP_NAME);
}
const xdgConfigHome = normalizeConfiguredPath(process.env.XDG_CONFIG_HOME);
if (xdgConfigHome) return path.join(xdgConfigHome, APP_NAME);
return legacyDir;
// An existing legacy dir wins, unless the platform dir holds the database and the legacy dir
// does not: other code creates ~/.omniroute/<sub> directly, and that alone must not move an
// XDG/APPDATA install to an empty database.
if (legacyIsDir && !(platformDir && !hasDatabase(legacyDir) && hasDatabase(platformDir))) {
return legacyDir;
}
return platformDir ?? legacyDir;
}
export function resolveDataDir() {

View File

@@ -973,7 +973,8 @@
"description": "Manage resilience config",
"threshold": "Failure threshold",
"resetTimeout": "Reset timeout in ms",
"baseCooldown": "Base cooldown in ms"
"baseCooldown": "Base cooldown in ms",
"p2cLatencyWeight": "p2c latency weight, 0 (off) to 20"
}
},
"nodes": {

View File

@@ -0,0 +1 @@
- **feat(images):** `/v1/images/edits` supports Leonardo: the reference image is uploaded through Leonardo's init-image flow and the generation is guided by it (`init_image_id`, `init_strength` 0.3), instead of the edit being rejected as unsupported. Leonardo takes one reference image; more than one returns 400, and a combo moves on to its next provider rather than editing with the first image only ([#18674](https://github.com/cheaper-inference/OmniRoute/pull/18674), closes [#18671](https://github.com/cheaper-inference/OmniRoute/issues/18671))

View File

@@ -0,0 +1 @@
- **feat(opencode-plugin-v2):** make the published catalog order configurable through `modelOrder` — an ordered list of `{ key, direction }` pairs over `provider`, `name`, `recency`, `free`, `price` and `context`, each with its direction — so the OpenCode plugin publishes models deterministically by default (`provider → name → recency → id`, replacing raw API arrival order) and the operator can reorder the picker ([#18804](https://github.com/cheaper-inference/OmniRoute/pull/18804)) — thanks @maxmad64bis

View File

@@ -0,0 +1 @@
- **feat(providers):** `expiry-first` treats a lapsed weekly/monthly reset (stale quota read) as refilled instead of "expires now", and gains an opt-in `expiryFirstOrder: "deadline"` (per provider) that spends the account whose quota is lost first while it has quota ([#19583](https://github.com/diegosouzapw/OmniRoute/pull/19583)) — thanks @feci

View File

@@ -0,0 +1 @@
- **feat(api):** add the per-request `x-omniroute-no-log` header to omit request/response payloads from call logs while keeping timestamp, model, status, duration and token counts ([#20096](https://github.com/cheaper-inference/OmniRoute/pull/20096))

View File

@@ -0,0 +1 @@
- **feat(sse):** Mistral now counts as an automatic-prefix-caching provider (cache-aware compression guard, cache stats) and gets a stable `prompt_cache_key` on both Chat Completions and Responses bodies ([#20111](https://github.com/cheaper-inference/OmniRoute/pull/20111)) — thanks @RayJW

View File

@@ -0,0 +1 @@
- Command Code short plan ids (go, goat, pro, ultra, teams-pro) now resolve to their plan names, and known plans show their fixed credit cap as the quota total. ([#20347](https://github.com/cheaper-inference/OmniRoute/pull/20347))

View File

@@ -0,0 +1 @@
- Qoder's Sonus (smodel) and Cantus (cmodel) are now in the static model fallback, so the ids stay routable when the live catalog is unavailable. ([#20351](https://github.com/cheaper-inference/OmniRoute/pull/20351))

View File

@@ -0,0 +1 @@
- **feat(plugins):** Opt-in `PLUGIN_PERMISSION_MODEL_ENABLED` feature flag (off by default) runs each plugin process under the Node.js permission model built from its manifest: reads confined to the plugin directory, writes only to its data directory with `file-write`, child processes only with `exec`; `network` stays declarative

View File

@@ -0,0 +1 @@
- **feat(ci):** omni-queue can speak as the owner and sign its merge commits, both off by default. With `voice: "owner"` in `config/merge-queue/config.json`, the queue's comments and label removals on pull requests, the dashboard issue and its comments, base-red comments and the tree-divergence issue go out with `OMNI_QUEUE_LAND_TOKEN`; statuses, refs, the state branch, re-runs and reads stay the App's, and a missing or refused token falls back to the App with one `error` event. With `landing.signing: "ssh"` (owner actor only), every merge commit the queue composes is signed with the owner's key from the `OMNI_QUEUE_SIGNING_KEY` environment secret, and a missing key composes unsigned with one `error` event per batch ([#20792](https://github.com/cheaper-inference/OmniRoute/pull/20792))

View File

@@ -0,0 +1 @@
- **feat(combo):** new `decision` router strategy for Auto combos: a decider picks the model for each request and `rules` picks the account. The decider can be TypeSafe System One, your own decision URL (System One or OpenAI chat format), or one of the combo's own models called in process. Only the last user message (up to 8000 characters) and the model menu are sent; the key comes from a stored connection inside the API key's allowed connections or from `OMNIROUTE_DECISION_API_KEY`, never from the combo. Calls go through the outbound guard with no redirects, a 64 KB answer cap and a 2 s default timeout (5 s max), and any failure routes with `rules`. Off by default behind `COMBO_DECISION_ROUTER_ENABLED`; combos without a decision block do not change. The combo builder gets the settings and a Test decision button, and the TypeSafe client now uses the same guarded transport — thanks @BelphegorPrime, @alvinveroy, @rafacpti23 and @miguelenes

View File

@@ -0,0 +1 @@
- Add an opt-in `X-OmniRoute-Selected-Connection-Plan` response header for Codex account-routing troubleshooting (`OMNIROUTE_CODEX_PLAN_RESPONSE_HEADER=1`), off by default with an explicit plan allowlist.

View File

@@ -0,0 +1 @@
- **feat(models):** add GPT-6.1 Terra to OpenAI API and Codex model catalogs, including Responses-only tool routing, supported reasoning tiers, verified token pricing, long-context rates, and Codex aliases.

View File

@@ -0,0 +1 @@
- fix(providers): a Codex discovery with a failed client-version refresh no longer shrinks the stored synced catalog (#16714)

View File

@@ -0,0 +1 @@
- fix(providers): Cloudflare Playground (cfp) no longer emits duplicated content deltas when upstream replays chunks (`replay: true` or repeated `seq`) (#18732)

View File

@@ -0,0 +1 @@
- fix(images): Codex GPT Image routes now reject a non-PNG `output_format` with a clear 400 instead of silently returning PNG (#19252)

View File

@@ -0,0 +1 @@
- **fix(translator):** thinking blocks that OmniRoute translates for Claude clients now carry an empty `signature` field, so strict Claude clients no longer fail to parse reasoning from OpenAI-shaped and Gemini providers. ([#19403](https://github.com/cheaper-inference/OmniRoute/pull/19403))

View File

@@ -0,0 +1 @@
- **fix(translator):** Gemini-native streams (`/v1beta/models/*:streamGenerateContent`) now forward the mid-stream keepalive as an empty `data:` frame, so a client idle-read timer resets while the upstream is quiet. Before, the keepalive was dropped and the socket stayed silent. ([#19403](https://github.com/cheaper-inference/OmniRoute/pull/19403))

View File

@@ -0,0 +1 @@
- **fix(translator):** parallel tool calls from OpenAI-compatible providers that omit the tool-call index no longer merge into one call with empty arguments on Gemini-format and Antigravity streams. ([#19403](https://github.com/cheaper-inference/OmniRoute/pull/19403))

View File

@@ -0,0 +1 @@
- **fix(mcp):** one skill with a duplicate MCP tool name no longer stops the later skills from getting tools. The duplicate is skipped and logged. ([#19542](https://github.com/cheaper-inference/OmniRoute/pull/19542))

View File

@@ -0,0 +1 @@
- **fix(sse):** A field that a provider rejected with a 400 stays removed when the same URL is re-run after a 429, also for Claude-compatible relays with active thinking. The Claude step re-added `context_management` after the learned strip, so the relay rejected the same field again and the client got the 400. The learned strip now runs once more after that step. Follow-up to [#19033](https://github.com/cheaper-inference/OmniRoute/pull/19033). ([#19628](https://github.com/cheaper-inference/OmniRoute/pull/19628))

View File

@@ -0,0 +1 @@
- **perf(sse):** large chat requests to plain (non-fingerprinted, unsigned) providers no longer re-parse the outbound body after serialization, which saves a body-sized copy and about 2.5 ms of blocking time per attempt on a 3 MB agent body ([#19628](https://github.com/cheaper-inference/OmniRoute/pull/19628))

View File

@@ -0,0 +1 @@
- **perf(db):** chat requests no longer re-run the compression-combo table bootstrap and default seed on every call, so a request no longer stalls for up to 2 s with "database is locked" while another process holds the SQLite write lock ([#19630](https://github.com/cheaper-inference/OmniRoute/pull/19630))

View File

@@ -0,0 +1 @@
- **fix(db):** Deleting a compatible provider node now also deletes its custom model list, so no orphaned model rows are left behind. ([#19630](https://github.com/cheaper-inference/OmniRoute/pull/19630))

View File

@@ -0,0 +1 @@
- **fix(skills):** the server tool replay table no longer grows without limit; rows older than 30 days and rows beyond the newest 10,000 (never the last day, never a live claim) are removed. ([#19630](https://github.com/cheaper-inference/OmniRoute/pull/19630))

View File

@@ -0,0 +1 @@
- **fix(cli):** an XDG or %APPDATA% install keeps using its own database when an empty `~/.omniroute` folder appears, instead of silently switching to a new empty database on the next start. ([#19634](https://github.com/cheaper-inference/OmniRoute/pull/19634))

View File

@@ -0,0 +1 @@
- **fix(admission):** with per-tenant virtual lanes on, a freed slot now rotates across tenants instead of always serving the first lane, and a newer request no longer jumps an older request queued in its own lane. ([#19684](https://github.com/cheaper-inference/OmniRoute/pull/19684))

View File

@@ -0,0 +1 @@
- **fix(resilience):** a DashScope key with no balance (400 `Arrearage`) or without the model service (403 `AccessDenied.Unpurchased`) now parks as credits exhausted instead of being retried every few seconds; a ban phrase quoted inside a 408, 429 or 5xx body no longer gives the account a one-year permanent cooldown ([#19684](https://github.com/cheaper-inference/OmniRoute/pull/19684))

View File

@@ -0,0 +1 @@
- **fix(db):** automatic and manual backup pruning now skips a migration restore point that a running upgrade still holds, once the upgrade takes its lease; a lease left by a dead process is ignored. ([#19690](https://github.com/cheaper-inference/OmniRoute/pull/19690))

View File

@@ -0,0 +1 @@
- **fix(db):** a migration that was left out of the ledger now repairs every missing column and index it adds, no longer adds cache tokens to usage history a second time, and no longer gets recorded as applied when a column it adds is still missing. ([#19690](https://github.com/cheaper-inference/OmniRoute/pull/19690))

View File

@@ -0,0 +1 @@
- **fix(db):** restoring a database backup made under a different `STORAGE_ENCRYPTION_KEY` is refused with a message that names both key fingerprints, instead of loading credentials that cannot be read. Pass `allowKeyMismatch` for a key rotation. ([#19690](https://github.com/cheaper-inference/OmniRoute/pull/19690))

View File

@@ -0,0 +1 @@
- **fix(db):** Retention cleanup no longer deletes spend that an active daily, weekly or monthly API-key budget window still counts, so a 31-day month cannot reopen its used allowance. ([#19701](https://github.com/cheaper-inference/OmniRoute/pull/19701))

View File

@@ -0,0 +1 @@
- **fix(db):** Scheduled cleanup now prunes ended exclusive-connection lease rows and past provider quota-reset events, so these two history tables stop growing forever. ([#19701](https://github.com/cheaper-inference/OmniRoute/pull/19701))

View File

@@ -0,0 +1 @@
- **fix(db):** the scheduled call-log retention pass now also deletes the request/response body files of the rows it removes, so an idle gateway no longer keeps expired bodies on disk. ([#19701](https://github.com/cheaper-inference/OmniRoute/pull/19701))

View File

@@ -0,0 +1 @@
- **fix(security):** the prompt-injection guard now decodes base64, hex and percent-encoded text in a request and scans the result, so an instruction hidden in an encoded string is scored like the same instruction in plain text. ([#19724](https://github.com/cheaper-inference/OmniRoute/pull/19724))

View File

@@ -0,0 +1 @@
- **fix(resilience):** a circuit breaker with `halfOpenRequests` above 1 now needs that many probe successes in a row before it closes, so one lucky probe no longer restores a flapping provider. ([#19724](https://github.com/cheaper-inference/OmniRoute/pull/19724))

View File

@@ -0,0 +1 @@
- **fix(pii):** a custom PII regex that backtracks for exponential time on a long run of one character, such as an overlapping alternation, is now refused when you save or test it, instead of freezing the gateway. ([#19724](https://github.com/cheaper-inference/OmniRoute/pull/19724))

View File

@@ -0,0 +1 @@
- **fix(a2a):** cancelling an A2A task now aborts the task's signal and a task that finishes after a cancel is refused with a clear "cancelled" error, instead of failing with "Invalid transition: cancelled → completed". ([#19727](https://github.com/cheaper-inference/OmniRoute/pull/19727))

View File

@@ -0,0 +1 @@
- **fix(cli-tools):** the CLI tools overview no longer shows Claude, Droid, OpenClaw, Cline and Kilo as configured when their config only mentions OmniRoute in unrelated text, or points at another host or port. The badge now follows the same fields the tool's own settings page reads. ([#19727](https://github.com/cheaper-inference/OmniRoute/pull/19727))

View File

@@ -0,0 +1 @@
- **fix(guardrails):** opt-in credential redaction no longer rewrites signed thinking blocks, encrypted reasoning or long base64 blobs because random bytes look like a short-prefix key, so replayed signatures stay valid. Full-format keys inside them are still redacted. ([#19727](https://github.com/cheaper-inference/OmniRoute/pull/19727))

View File

@@ -0,0 +1 @@
- **fix(quota):** the Redis quota store now charges a usage counter and sets its expiry in one atomic call, so a crash between the two steps can no longer leave a counter that never expires. ([#19727](https://github.com/cheaper-inference/OmniRoute/pull/19727))

View File

@@ -0,0 +1 @@
- **fix(codex):** The Codex ChatGPT Web and app-server adapters now cap the buffered event backlog by retained text size and merge adjacent small text deltas, so a fast producer behind a slow client can no longer grow memory without bound. ([#19733](https://github.com/cheaper-inference/OmniRoute/pull/19733))

View File

@@ -0,0 +1 @@
- **fix(gemini):** a non-streaming Gemini or Antigravity reply whose `[Tool call: ...]` text arrives in several stream parts now returns one tool call, and a tool-only stream cut before its finish reason is now marked as cut so a combo can try the next target. ([#19733](https://github.com/cheaper-inference/OmniRoute/pull/19733))

View File

@@ -0,0 +1 @@
- **fix(translator):** Gemini requests now map content roles `function` and `tool` to user messages, and infer a missing role from the parts, so single-turn Gemini requests without a role no longer reach the upstream as assistant messages. ([#19733](https://github.com/cheaper-inference/OmniRoute/pull/19733))

View File

@@ -0,0 +1 @@
- **fix(usage):** A non-streaming reply with no usage object now writes its estimated token counts to usage history and the call log, as a stream already does, so per-key USD limits count that spend. ([#19745](https://github.com/cheaper-inference/OmniRoute/pull/19745))

View File

@@ -0,0 +1 @@
- **fix(cache):** The semantic cache no longer stores a reply that ended in a content filter block (`content_filter`, or Claude `refusal`), so a false-positive block can clear on retry instead of being served from cache for the whole TTL. ([#19749](https://github.com/cheaper-inference/OmniRoute/pull/19749))

View File

@@ -0,0 +1 @@
- **fix(usage):** rerank spend now counts toward a key's daily, weekly and 5-hour USD limits. Speech and transcription already count through their usage history rows and are counted once. ([#19754](https://github.com/cheaper-inference/OmniRoute/pull/19754))

View File

@@ -0,0 +1 @@
- **fix(cache):** Claude Code requests to OpenRouter `anthropic/*` models keep their prompt-cache breakpoints (4 at most), so those turns write and read the prompt cache instead of paying full input price. Other OpenRouter families are unchanged. ([#19755](https://github.com/cheaper-inference/OmniRoute/pull/19755))

View File

@@ -0,0 +1 @@
- **fix(sse):** Claude Code CCH signing now uses the seed and the body view of the real client (verified on Claude Code 2.1.252 and 2.1.322), so the `cch=` token in the billing header equals the token the real client sends for the same body. ([#19761](https://github.com/cheaper-inference/OmniRoute/pull/19761))

View File

@@ -0,0 +1 @@
- **fix(providers):** Gemini 4 Carbon is registered like Argon — `gemini-4-carbon-{low,medium,high}` on Antigravity/AGY and `gemini-4-carbon` on the Gemini API key are priced at the published $2/$10 introductory rate, the bare id aliases to `-medium`, and the tiers get the declared 65535 output cap instead of the 16384 fallback ([#19797](https://github.com/cheaper-inference/OmniRoute/pull/19797), closes [#19796](https://github.com/cheaper-inference/OmniRoute/issues/19796)) — thanks @xiaoyaner0201

View File

@@ -0,0 +1 @@
- **fix(db-backups):** a chunked import upload is refused at the configured size while it streams, instead of being buffered in full and rejected afterwards ([#19831](https://github.com/cheaper-inference/OmniRoute/pull/19831)) — thanks @AndreAlmeidaDC

View File

@@ -0,0 +1 @@
- **fix(security):** strip `'unsafe-eval'` from the Content-Security-Policy `script-src` directive in production builds while retaining it strictly in development mode for React Fast Refresh and HMR ([#19836](https://github.com/cheaper-inference/OmniRoute/issues/19836)).

View File

@@ -0,0 +1 @@
- **fix(antigravity):** parallel conversations on one account no longer share a single Cloud Code session and evict each other's prompt cache — the upstream `sessionId` is now derived from account + conversation ([#19876](https://github.com/cheaper-inference/OmniRoute/pull/19876)) — thanks @adevwithpurpose

View File

@@ -0,0 +1 @@
- **fix(dashboard):** move the custom banned-keyword editor back to the Resilience settings tab (next to Auto Disable) instead of Security, and harden its save/load path: keywords appear only after the server accepts the PATCH, a failed settings load surfaces an error instead of a misleading empty list, the 200-character limit is enforced in the UI, and removals match by keyword value rather than index. The editor now also stays available when `/api/resilience` fails to load ([#20078](https://github.com/cheaper-inference/OmniRoute/pull/20078)) — thanks @sdfsdfw2

View File

@@ -0,0 +1 @@
- **fix(sse):** the usage guard computes the request body size and the input-token estimate once per request instead of on every streamed chunk that carries usage, so an upstream that repeats `usage` (for example with 0 input tokens) on each chunk no longer re-serializes and re-tokenizes a large request per chunk and starves the event loop, and a Responses passthrough stream no longer rebuilds the accounting receipt for every delta ([#20086](https://github.com/cheaper-inference/OmniRoute/issues/20086), [#20480](https://github.com/cheaper-inference/OmniRoute/issues/20480)) — thanks @mmatus3 and @javargasm

View File

@@ -0,0 +1 @@
- **fix(translator):** streamed chat completions from Claude models now return `"{}"` as the arguments of a tool call that takes no parameters, matching the non-streamed response. Before, the arguments were an empty string, which is not valid JSON. ([#20152](https://github.com/cheaper-inference/OmniRoute/issues/20152))

View File

@@ -0,0 +1 @@
- **fix(codex):** Keep subscription tier badges and paid-model routing eligibility in sync with the latest successful Codex usage response, including upgrades from Free to Plus and subsequent downgrades ([#20178](https://github.com/cheaper-inference/OmniRoute/pull/20178)) — thanks @Bl0ck154

View File

@@ -0,0 +1 @@
- Guard `POST /api/providers/[id]/sync-models` with `requireManagementAuth()` when not called with an internal model-sync token so validated management subjects (local CLI token, scoped `oma_` access tokens, manage-scoped API keys, internal service token) are accepted consistently and inference-only keys get 403 ([#20187](https://github.com/cheaper-inference/OmniRoute/issues/20187)) — thanks @wsk0715

View File

@@ -0,0 +1 @@
- **fix(sse):** in a combo, the Codex effort-suffix guard no longer removes the client's `output_config.effort` from the request body that the next combo target reads. ([#20194](https://github.com/cheaper-inference/OmniRoute/pull/20194))

View File

@@ -0,0 +1 @@
- **fix(sse):** let a deduplicated request run its own upstream call when the first caller disconnects. ([#20194](https://github.com/cheaper-inference/OmniRoute/pull/20194))

View File

@@ -0,0 +1 @@
- **fix(sse):** requests to DeepSeek models (`deepseek-*`, on any provider) keep only the first definition of a repeated tool name, because DeepSeek answers a repeated name with HTTP 400 "Tool names must be unique". Other models are not changed. ([#20194](https://github.com/cheaper-inference/OmniRoute/pull/20194))

View File

@@ -0,0 +1 @@
- **fix(sse):** a failed memory-settings read is logged at debug level; the request still runs with memory off, as before, but the cause is now visible. ([#20194](https://github.com/cheaper-inference/OmniRoute/pull/20194))

View File

@@ -0,0 +1 @@
- **fix(memory):** memory injection no longer puts the per-query memory text at the head of an OpenAI, Codex or Azure prompt (it broke automatic prefix caching on every turn), and one corrupt skill row no longer makes every non-streaming request of an API key fail. ([#20194](https://github.com/cheaper-inference/OmniRoute/pull/20194))

View File

@@ -0,0 +1 @@
- **fix(sse):** stop probe key-health writes on non-streaming calls and cap ModelScope retry waits. ([#20194](https://github.com/cheaper-inference/OmniRoute/pull/20194))

View File

@@ -0,0 +1 @@
- **fix(skills):** registering the same skill again (same API key, name and version) now updates the existing row and keeps its id and run history, instead of adding a duplicate. A migration removes old duplicates once (keeps the newest) and adds a unique index. ([#20194](https://github.com/cheaper-inference/OmniRoute/pull/20194))

View File

@@ -0,0 +1 @@
- **fix(sse):** A Claude passthrough request whose tool is named with a leading `proxy_` (for example `proxy_search`) gets the same tool name back in the reply; the executor strips that prefix upstream and the reply used to show the stripped name. ([#20199](https://github.com/cheaper-inference/OmniRoute/pull/20199))

View File

@@ -0,0 +1 @@
- **fix(sse):** an Android user agent (Dalvik, mobile browsers) is no longer taken for the Droid CLI, so a Responses-shaped body sent to a non-`/responses` endpoint by such a client is converted back to Chat Completions as before. ([#20199](https://github.com/cheaper-inference/OmniRoute/pull/20199))

View File

@@ -0,0 +1 @@
- **fix(sse):** the empty-turn retry on another connection now replaces the request credentials instead of merging into them, so keys that only the first connection defines (lease routing, a Copilot session token) are not sent to the second. ([#20199](https://github.com/cheaper-inference/OmniRoute/pull/20199))

View File

@@ -0,0 +1 @@
- **fix(sse):** when the upstream-proxy fallback drops a failed native response and retries through CLIProxyAPI or Dario, the dropped response body is cancelled at once instead of holding its socket until garbage collection. ([#20199](https://github.com/cheaper-inference/OmniRoute/pull/20199))

View File

@@ -0,0 +1 @@
- **fix(sse):** a failed connection-cooldown write (geo-blocked or project-required connection) and a failed Codex scope-cooldown persist are logged as warnings instead of being dropped, so a connection that is selected again can be traced to the failed write. ([#20199](https://github.com/cheaper-inference/OmniRoute/pull/20199))

View File

@@ -0,0 +1 @@
- **fix(sse):** `isTokenExpiringSoon` now reads a token expiry given in epoch seconds or as a numeric string, so a valid token is no longer reported as expiring (seconds) or as never expiring (numeric string). ([#20199](https://github.com/cheaper-inference/OmniRoute/pull/20199))

View File

@@ -0,0 +1 @@
- **fix(sse):** keep the combo target pin on safety-net redirects and release the OAuth slot when a connection reasoning rule fails. ([#20201](https://github.com/cheaper-inference/OmniRoute/pull/20201))

View File

@@ -0,0 +1 @@
- **fix(sse):** the retry that follows a rejected field or a clamped limit on a CLI-fingerprinted upstream (Claude Code) keeps the CLI body-field order of the first send instead of the client order. ([#20201](https://github.com/cheaper-inference/OmniRoute/pull/20201))

View File

@@ -0,0 +1 @@
- **fix(sse):** when a client sends the Claude Code sentinel and its own instructions in one system block, only the sentinel is replaced; the client's instructions are kept instead of being deleted with the block. ([#20201](https://github.com/cheaper-inference/OmniRoute/pull/20201))

View File

@@ -0,0 +1 @@
- **fix(sse):** a client abort during a request on a pooled-session provider (for example llm7) no longer puts the healthy session into cooldown; only real upstream failures do. ([#20201](https://github.com/cheaper-inference/OmniRoute/pull/20201))

View File

@@ -0,0 +1 @@
- **fix(executors):** merged abort signals no longer leave listeners on the long-lived request signal when nothing aborts. ([#20201](https://github.com/cheaper-inference/OmniRoute/pull/20201))

View File

@@ -0,0 +1 @@
- **fix(qoder):** A Qoder PAT connection runs the local `qodercli`, which gets text only, so an image in the request was replaced by the text `[Image omitted]` and the model answered blind. Image requests now skip PAT connections (a combo goes on to its next target), and a PAT call that still gets an image answers 400 `image_input_unsupported` before it starts the CLI. HTTP connections still forward images. ([#20201](https://github.com/cheaper-inference/OmniRoute/pull/20201))

Some files were not shown because too many files have changed in this diff Show More