Skip to content

Commit 77b1a61

Browse files
authored
Merge branch 'release/v3.8.51' into fix/12136-responses-upstream-error
2 parents f1bbfb1 + 500568a commit 77b1a61

187 files changed

Lines changed: 23230 additions & 2172 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.env.example

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1466,17 +1466,15 @@ CURSOR_USER_AGENT="Cursor/3.4"
14661466
# FIRECRAWL_BASE_URL=https://api.firecrawl.dev
14671467
# FIRECRAWL_TIMEOUT_MS=30000 # Per-request timeout (default: 30000 = 30s)
14681468

1469-
# ── Claude TLS sidecar (Chromium-fingerprinted client) ──
1470-
# Used by: open-sse/services/claudeTlsClient.ts — wire-level timeout for
1471-
# the bogdanfinn/tls-client koffi binding and the JS-side grace window
1472-
# layered on top of it when the native library is wedged.
1469+
# ── Claude TLS transport (Chromium-fingerprinted client) ──
1470+
# Used by: open-sse/services/claudeTlsClient.ts — native wreq-js request timeout
1471+
# plus the absolute JS hard-deadline grace when the native request is wedged.
14731472
# OMNIROUTE_CLAUDE_TLS_TIMEOUT_MS=60000
14741473
# OMNIROUTE_CLAUDE_TLS_GRACE_MS=10000
14751474

1476-
# ── Perplexity TLS sidecar (Firefox-fingerprinted client) ──
1477-
# Used by: open-sse/services/perplexityTlsClient.ts — wire-level timeout for
1478-
# the bogdanfinn/tls-client koffi binding and the JS-side grace window
1479-
# layered on top of it when the native library is wedged.
1475+
# ── Perplexity TLS transport (Firefox-fingerprinted client) ──
1476+
# Used by: open-sse/services/perplexityTlsClient.ts — native wreq-js request
1477+
# timeout plus the absolute JS hard-deadline grace.
14801478
# OMNIROUTE_PPLX_TLS_TIMEOUT_MS=30000
14811479
# OMNIROUTE_PPLX_TLS_GRACE_MS=10000
14821480

@@ -1488,18 +1486,16 @@ CURSOR_USER_AGENT="Cursor/3.4"
14881486
# meta-commentary. Set to 1/true/yes/on to restore the old behavior.
14891487
# OMNIROUTE_PPLX_SEARCH_HINT=0
14901488

1491-
# ── Grok web TLS sidecar (Chrome-fingerprinted client) ──
1492-
# Used by: open-sse/services/grokTlsClient.ts — wire-level timeout for the
1493-
# bogdanfinn/tls-client koffi binding and the JS-side grace window layered on
1494-
# top of it when the native library is wedged.
1489+
# ── Grok web TLS transport (Chrome-fingerprinted client) ──
1490+
# Used by: open-sse/services/grokTlsClient.ts — native wreq-js request timeout
1491+
# plus the absolute JS hard-deadline grace.
14951492
# OMNIROUTE_GROK_TLS_TIMEOUT_MS=60000
14961493
# OMNIROUTE_GROK_TLS_GRACE_MS=10000
14971494

1498-
# ── Notion web TLS sidecar (Chrome-fingerprinted client) ──
1499-
# Used by: open-sse/services/notionTlsClient.ts — wire-level timeout for the
1500-
# bogdanfinn/tls-client koffi binding and the JS-side grace window layered on
1501-
# top of it when the native library is wedged. The notion-web executor raises
1502-
# the wire timeout per-request to 180000 for long generations.
1495+
# ── Notion web TLS transport (Chrome-fingerprinted client) ──
1496+
# Used by: open-sse/services/notionTlsClient.ts — native wreq-js request timeout
1497+
# plus the absolute JS hard-deadline grace. The notion-web executor raises the
1498+
# native timeout per request to 180000 for long generations.
15031499
# OMNIROUTE_NOTION_TLS_TIMEOUT_MS=30000
15041500
# OMNIROUTE_NOTION_TLS_GRACE_MS=10000
15051501

.github/workflows/electron-release.yml

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,22 @@ jobs:
187187
env:
188188
NPM_CONFIG_LEGACY_PEER_DEPS: true
189189

190+
# The Linux leg produces x64 + arm64 installers from one x64 runner. npm
191+
# deliberately installs only host-compatible optional dependencies, so
192+
# hydrateNativeDeps cannot source the arm64 fork unless we fetch the exact
193+
# package pinned in package-lock before either build path runs.
194+
- name: Install Linux arm64 wreq binding for cross-package
195+
if: matrix.platform == 'linux'
196+
shell: bash
197+
run: |
198+
npm install --no-save --ignore-scripts --force --legacy-peer-deps \
199+
@wreq-js/binding-linux-arm64-gnu@3.2.0
200+
git diff --exit-code -- package.json package-lock.json
201+
mkdir -p "$RUNNER_TEMP/omniroute-wreq-verify"
202+
DATA_DIR="$RUNNER_TEMP/omniroute-wreq-verify" node --import tsx/esm --test \
203+
--test-name-pattern='wreq-js 3.2 manifest pins all nine' \
204+
tests/unit/wreq-native-manifest.test.ts
205+
190206
- name: Sanitize Windows home directory
191207
if: runner.os == 'Windows'
192208
shell: bash
@@ -235,9 +251,9 @@ jobs:
235251
# targets, and no unlisted files) byte-for-byte.
236252
# hydrate: the bundle was built on ubuntu, so install-machine-forked native
237253
# optionals (@img/sharp-*, @img/sharp-libvips-*, @ngrok/ngrok-*,
238-
# fsevents) carry linux forks. Replace them with the forks this
254+
# @wreq-js/binding-*, fsevents) carry linux forks. Replace them with the forks this
239255
# leg's own `npm ci` resolved, then assert every bundled native
240-
# (koffi triplets, better-sqlite3 prebuilds, wreq-js, onnxruntime)
256+
# (better-sqlite3 prebuilds, wreq-js, onnxruntime)
241257
# can service this leg's platform/arch before packaging starts.
242258
run: |
243259
node scripts/build/standaloneBundle.mjs restore --archive web-bundle.tar.gz

.trivyignore

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,3 @@
1818
#
1919
# Keep this list SHORT and reviewed every release. Prefer fixing (rebuild on a
2020
# patched base / bump the dep) over suppressing. Stale entries are debt.
21-
#
22-
# CVE-2025-68121 — Go stdlib crypto/tls (session-resumption certificate validation)
23-
# inside the PREBUILT bogdanfinn/tls-client v1.15.1 .so that tls-client-node's
24-
# postinstall downloads (built with go 1.24.1; fixed in 1.24.13). No upstream
25-
# rebuild exists (v1.15.1 is still the latest release) and nothing in this repo
26-
# can bump it. The binary is only loaded by the browser-TLS web-provider
27-
# executors (claude-web / grok-web / lmarena / perplexity-web / notion-web),
28-
# whose handshakes go through utls. Tracking issue: #12084. Revisit at the next
29-
# tls-client release or base-image bump and BEFORE the v3.8.51 tag (2026-09-15).
30-
CVE-2025-68121

AGENTS.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Repository map and Reference Documentation sections below.
4646

4747
## Project at a Glance
4848

49-
**OmniRoute** — unified AI proxy/router. One endpoint, 354 LLM providers, auto-fallback.
49+
**OmniRoute** — unified AI proxy/router. One endpoint, 355 LLM providers, auto-fallback.
5050

5151
| Layer | Location | Purpose |
5252
| ------------- | ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
@@ -56,7 +56,7 @@ Repository map and Reference Documentation sections below.
5656
| Translators | `open-sse/translator/` | Format conversion (OpenAI↔Claude↔Gemini) |
5757
| Transformer | `open-sse/transformer/` | Responses API ↔ Chat Completions |
5858
| Services | `open-sse/services/` | Combo routing, rate limits, caching, etc |
59-
| Database | `src/lib/db/` | SQLite domain modules (167 migrations) |
59+
| Database | `src/lib/db/` | SQLite domain modules (168 migrations) |
6060
| Domain/Policy | `src/domain/` | Policy engine, cost rules, fallback logic |
6161
| MCP Server | `open-sse/mcp-server/` | 110 tools (45 canonical + memory/skill/GitHub/pool/gamification/plugin/Notion/Obsidian/local-corpus/RTK modules), 3 transports (stdio / SSE / Streamable HTTP), 33 scopes |
6262
| A2A Server | `src/lib/a2a/` | JSON-RPC 2.0 agent protocol |

Dockerfile

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -103,25 +103,12 @@ RUN test -f package-lock.json \
103103
# node-gyp comes from npm's own bundled copy (deterministic, already in the image)
104104
# instead of `npx --yes`, which would install an arbitrary registry version
105105
# on-demand and run its lifecycle scripts (Sonar docker:S6505).
106-
#
107-
# tls-client-node (claude-web/grok-web/lmarena/perplexity-web TLS
108-
# impersonation) hits the same --ignore-scripts wall: its own postinstall.js
109-
# fetches a platform .so/.dylib/.dll from the bogdanfinn/tls-client GitHub
110-
# Releases API and is never invoked when npm ci skips lifecycle scripts. Unlike
111-
# better-sqlite3 above, that script never throws on failure — it only
112-
# `console.warn`s and exits 0 — so a rate-limited or offline build would
113-
# otherwise succeed silently with an empty bin/ and only fail at first request
114-
# in production (TlsClientUnavailableError, #7802). Run it explicitly here so
115-
# a broken/rate-limited fetch fails the BUILD loudly instead of shipping a
116-
# broken image.
117106
RUN --mount=type=cache,id=s/92ca8a61-c1ba-421f-a389-d48ac7258c2d-npm-cache,target=/root/.npm \
118107
npm ci --include=optional --no-audit --no-fund --legacy-peer-deps --ignore-scripts \
119108
&& (cd node_modules/better-sqlite3 \
120109
&& node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js rebuild) \
121110
&& node -e "require('better-sqlite3')(':memory:').close()" \
122-
&& node node_modules/tls-client-node/scripts/postinstall.js \
123-
&& (test -n "$(find node_modules/tls-client-node/bin -mindepth 1 -print -quit 2>/dev/null)" \
124-
|| (echo "tls-client-node native binary missing after postinstall — GitHub API fetch likely rate-limited or failed (#7802)" >&2 && exit 1))
111+
&& node -e "const wreq=require('wreq-js'); if(typeof wreq.createTransport!=='function') process.exit(1)"
125112

126113
# Build with Turbopack (stable in Next 16, the repo default). The v3.8.27-era
127114
# TurbopackInternalError panic ("entered unreachable code: there must be a path to a

Dockerfile.bun

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,8 @@ COPY scripts/dev/sync-env.mjs ./scripts/dev/sync-env.mjs
3131
# Fast Bun native package install
3232
RUN bun install --include=optional --quiet
3333

34-
# Fetch tls-client-node native binary if script exists
35-
RUN if [ -f "node_modules/tls-client-node/scripts/postinstall.js" ] && [ ! -d "node_modules/tls-client-node/bin" ]; then \
36-
bun node_modules/tls-client-node/scripts/postinstall.js || true; \
37-
fi
34+
# Fail the build if wreq-js cannot resolve its current platform binding.
35+
RUN bun -e "const wreq = require('wreq-js'); if (typeof wreq.createTransport !== 'function') process.exit(1)"
3836

3937
# Smoke check native database driver used by Bun (bun:sqlite)
4038
RUN bun -e "import { Database } from 'bun:sqlite'; const db = new Database(':memory:'); db.query('SELECT 1 AS ok').get(); db.close(); console.log('bun:sqlite smoke: OK');"

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
# 🚀 OmniRoute — The Free AI Gateway
99

10-
<img src="./docs/diagrams/readme-hero.svg" width="100%" alt="OmniRoute — Never stop coding. Every AI tool → 354 providers — 150+ free — through one endpoint. Claude Code, Codex, Cursor, Cline, Copilot & Antigravity into FREE Claude / GPT / Gemini with auto-fallback. RTK + Caveman stacked compression saves 15–95% tokens (~89% avg) — never hit limits. 354 AI providers · 150+ free tiers · ~1.51B free tokens/mo · 19 routing strategies · $0 to start."/>
10+
<img src="./docs/diagrams/readme-hero.svg" width="100%" alt="OmniRoute — Never stop coding. Every AI tool → 355 providers — 150+ free — through one endpoint. Claude Code, Codex, Cursor, Cline, Copilot & Antigravity into FREE Claude / GPT / Gemini with auto-fallback. RTK + Caveman stacked compression saves 15–95% tokens (~89% avg) — never hit limits. 355 AI providers · 150+ free tiers · ~1.51B free tokens/mo · 19 routing strategies · $0 to start."/>
1111

1212
</div>
1313

@@ -210,7 +210,7 @@ curl http://localhost:20128/v1/chat/completions \
210210

211211
</div>
212212

213-
<img src="./docs/diagrams/promise-pillars.svg" width="100%" alt="The Promise — One endpoint and 354 providers. Automatic fallback keeps routing while another healthy target is available. Six pillars: resilient fallback across 354 providers · up to 95% token savings on eligible workloads · $0 to start with 150+ free tiers and 53 recurring/keyless free-forever providers · 36 CLI/agent integrations through one config · OpenAI, Claude, Gemini and Responses API compatibility at /v1 · production controls including circuit breakers, TLS stealth, MCP 110 tools, A2A, memory, guardrails, evals and 39,000+ static test declarations across 5,100+ tracked test files."/>
213+
<img src="./docs/diagrams/promise-pillars.svg" width="100%" alt="The Promise — One endpoint and 355 providers. Automatic fallback keeps routing while another healthy target is available. Six pillars: resilient fallback across 355 providers · up to 95% token savings on eligible workloads · $0 to start with 150+ free tiers and 53 recurring/keyless free-forever providers · 36 CLI/agent integrations through one config · OpenAI, Claude, Gemini and Responses API compatibility at /v1 · production controls including circuit breakers, TLS stealth, MCP 110 tools, A2A, memory, guardrails, evals and 39,000+ static test declarations across 5,100+ tracked test files."/>
214214

215215
<br/>
216216
<br/>
@@ -463,7 +463,7 @@ All **19** strategies — mix & match per combo step:
463463

464464
</div>
465465

466-
<img src="./docs/diagrams/comparison-table.svg" width="100%" alt="What sets OmniRoute apart — a dated feature snapshot vs 9router, OpenRouter, CLIProxyAPI and LiteLLM across 13 capabilities. OmniRoute: 354 providers, 150+ free tiers built in, 19 routing strategies, 12-engine token compression, built-in MCP server with 110 tools, A2A agent protocol, persistent memory, guardrails, cloud agents, TLS fingerprint stealth, Desktop/Termux/PWA and 43 i18n UI locales. OmniRoute is MIT-licensed and self-hostable. Competitor capabilities and counts may change; see the linked methodology."/>
466+
<img src="./docs/diagrams/comparison-table.svg" width="100%" alt="What sets OmniRoute apart — a dated feature snapshot vs 9router, OpenRouter, CLIProxyAPI and LiteLLM across 13 capabilities. OmniRoute: 355 providers, 150+ free tiers built in, 19 routing strategies, 12-engine token compression, built-in MCP server with 110 tools, A2A agent protocol, persistent memory, guardrails, cloud agents, TLS fingerprint stealth, Desktop/Termux/PWA and 43 i18n UI locales. OmniRoute is MIT-licensed and self-hostable. Competitor capabilities and counts may change; see the linked methodology."/>
467467

468468
<sub>📊 Full methodology &amp; per-feature detail vs 9router, OpenRouter, CLIProxyAPI &amp; LiteLLM → [`docs/comparison/OMNIROUTE_VS_ALTERNATIVES.md`](docs/comparison/OMNIROUTE_VS_ALTERNATIVES.md)</sub>
469469

@@ -1208,7 +1208,7 @@ Métricas canônicas em 2026-08-24: **1.029 vídeos únicos** · **11.132.922 vi
12081208
<tr><td nowrap><b>Runtime</b></td><td>Node.js 22.x / 24.x LTS — <code>&gt;=22.22.2 &lt;23 || &gt;=24.0.0 &lt;27</code></td></tr>
12091209
<tr><td nowrap><b>Language</b></td><td>TypeScript 6.0 — <b>100% TypeScript</b> across <code>src/</code> and <code>open-sse/</code> (zero <code>any</code> in core since v2.0)</td></tr>
12101210
<tr><td nowrap><b>Framework</b></td><td>Next.js 16 + React 19 + Tailwind CSS 4</td></tr>
1211-
<tr><td nowrap><b>Database</b></td><td>better-sqlite3 (SQLite, WAL journaling) + LowDB (JSON legacy) — 122 domain modules, 167 migrations</td></tr>
1211+
<tr><td nowrap><b>Database</b></td><td>better-sqlite3 (SQLite, WAL journaling) + LowDB (JSON legacy) — 122 domain modules, 168 migrations</td></tr>
12121212
<tr><td nowrap><b>Memory</b></td><td>SQLite FTS5 full-text + int8-quantized vector embeddings, typed decay</td></tr>
12131213
<tr><td nowrap><b>Schemas</b></td><td>Zod 4 — MCP tool I/O validation + API contracts</td></tr>
12141214
<tr><td nowrap><b>Protocols</b></td><td>MCP (stdio / HTTP / SSE) + A2A v0.3 (JSON-RPC 2.0 + SSE)</td></tr>

THIRD_PARTY_NOTICES.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,51 @@
11
# Third-Party Notices
22

3+
## wreq-js 3.2.0 native transport
4+
5+
OmniRoute ships `wreq-js@3.2.0` and its platform-specific native bindings for browser-
6+
fingerprinted HTTP transport. The npm package and all nine binding tarballs are tied by npm SLSA
7+
attestations to signed tag `v3.2.0` and immutable source commit
8+
[`0d52d5fa252841aeef34d4d063b1766a59612bf7`](https://github.com/sqdshguy/wreq-js/commit/0d52d5fa252841aeef34d4d063b1766a59612bf7).
9+
10+
- Root tarball:
11+
<https://registry.npmjs.org/wreq-js/-/wreq-js-3.2.0.tgz>
12+
- npm integrity:
13+
`sha512-dawhEbhvd5hxivKZSvv/mAQGO3mwZYESyctOvIIZ/H3DvQJzUM2UoFQsij0fg7hIClQ/GEQgg+2259UcFwhpMQ==`
14+
- Exact platform, integrity, size, and SHA-256 receipts for all nine native addons:
15+
[`config/release/wreq-js-native-manifest.json`](config/release/wreq-js-native-manifest.json)
16+
- Locked per-target Cargo closure, with runtime and compile-only packages kept separate:
17+
[`config/release/wreq-js-rust-license-inventory.json`](config/release/wreq-js-rust-license-inventory.json)
18+
- Deduplicated license texts and attribution notices for the conservative native runtime closure,
19+
including patched BoringSSL, Unicode ICU4X components, and Mozilla root-certificate data:
20+
[`config/release/wreq-js-rust-notices.md`](config/release/wreq-js-rust-notices.md)
21+
22+
The native tarballs themselves contain no LICENSE/NOTICE file. The bundled inventory is therefore
23+
shipped beside them. It intentionally over-approximates the locked link-eligible Cargo closure;
24+
exact post-LTO membership cannot be claimed without an upstream artifact SBOM/link map or a
25+
reproducible-build receipt. The Android addon also dynamically requires `libc++_shared.so`, which
26+
is not included in its npm tarball; any artifact that supplies that library needs its separate
27+
LLVM/Apache-with-LLVM-exception notice.
28+
29+
MIT License
30+
31+
Copyright (c) 2025 will-work-for-meal
32+
Copyright (c) 2025 Oleksandr Herasymov
33+
34+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
35+
associated documentation files (the "Software"), to deal in the Software without restriction,
36+
including without limitation the rights to use, copy, modify, merge, publish, distribute,
37+
sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
38+
furnished to do so, subject to the following conditions:
39+
40+
The above copyright notice and this permission notice shall be included in all copies or substantial
41+
portions of the Software.
42+
43+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
44+
NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
45+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
46+
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT
47+
OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
48+
349
## codex-chatgpt-web
450

551
Parts of `open-sse/vendor/codex-chatgpt-web/` are adapted from
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- **fix(providers):** Claude, Grok, LMArena, Notion, and Perplexity web-cookie transports now use pooled `wreq-js` 3.2 instead of the native sidecar, with all nine supported bindings pinned and audited, and the applicable platform binding plus native-license evidence included in each release artifact ([#12429](https://github.com/diegosouzapw/OmniRoute/pull/12429), supersedes [#11753](https://github.com/diegosouzapw/OmniRoute/pull/11753)).

0 commit comments

Comments
 (0)