Centralize remote image downloads behind a shared helper that
validates outbound URLs, enforces redirect and size limits, and
applies request timeouts before bytes are read.
Wire the helper into image generation and vision bridge flows so
remote image inputs and result URLs follow the same fetch policy and
block redirects to private hosts. Update key management routes to use
structured logging and document the WebSocket bridge secret in the
example environment file.
The billing header fingerprint was computed from the first user message text
via computeFingerprint(), which changes every conversation turn. This mutated
the system[] prefix on each request, invalidating Anthropic's prompt-cache
prefix and forcing ~100% cache_create (vs 96% cache_read with stable prefix).
Now uses a per-day SHA-256 hash of the date + ccVersion, keeping the billing
header format while preserving prompt-cache prefix stability across turns.
Includes 6 unit tests.
The prompt_cache_key was derived from the account-wide workspaceId, meaning
all conversations from the same OAuth account shared one cache partition.
The official Codex CLI uses conversation_id (a unique UUID per session).
Priority: body.session_id > body.conversation_id > workspaceId.
Session IDs are captured BEFORE deletion from the body.
Includes 10 unit tests.
When a provider returns 429 with quota_exhausted reason, set cooldown until
tomorrow 00:00 instead of exponential backoff. Includes isDailyQuotaExhausted()
detection in chat handler and unit tests.
Co-authored-by: clousky2020 <clousky2020@users.noreply.github.com>
Integrated into release/v3.7.1 — fixes Electron installer shipping empty node_modules. Adds separate extraResources FileSet, CI smoke test job, and cross-platform packaged app validation script. Closes#1636.
Prevent upstream 400 failures when clients omit prior
reasoning_content in multi-turn tool-calling conversations.
Capture reasoning_content from streaming and non-streaming assistant
responses, persist it in a memory-plus-SQLite cache keyed by
tool_call_id, and re-inject it on later requests when available.
Add the reasoning cache migration, service layer, authenticated API
endpoints, dashboard tab, and unit coverage to support inspection,
cleanup, and crash recovery.
- PR #1630: Set NPM_CONFIG_LEGACY_PEER_DEPS=true in Dockerfile, remove duplicate COPY
- PR #1631: Hide deprecated gemini-claude-* models from catalogs, redirect to Claude 4.6
- Fix provider-models-route test to match renamed model display name
- Update CHANGELOG.md with both PR entries
- Use jsonc-parser to update only provider.omniroute in opencode.json,
preserving MCP servers, comments, and other provider entries
- Add /api/cli-tools/keys endpoint returning raw keys for CLI tools UI
(session-auth protected via requireCliToolsAuth)
- Fix OpenCode guide step 3 to use ICU-style {baseUrl} placeholder
instead of broken {{baseUrl}} across all 40+ locales
- Restore valid OpenCode light/dark SVG logos (were broken HTML downloads)
- Add customCliTab translation key to en.json
- Add modelLabels support for human-readable model names in config
- Fix 9 additional locale files (bn, fa, gu, in, mr, sw, ta, te, ur)
that were added after the original PR and still had double-braces
Co-authored-by: JasonLandbridge <JasonLandbridge@users.noreply.github.com>
- Add 'github' to hasPerModelQuota() so 429 on one model doesn't lock the
entire connection — same pattern already used for Gemini
- Add 'github' to getLimiterKey() for model-scoped Bottleneck rate limiter
keys (github:connectionId:model)
- Add unit tests for hasPerModelQuota, shouldMarkAccountExhaustedFrom429,
lockModelIfPerModelQuota (account-fallback-service.test.ts)
- Add integration test for model-scoped limiter keys (rate-limit-manager.test.ts)
Co-authored-by: slewis3600 <slewis3600@users.noreply.github.com>
- sync-env.mjs: add hasEncryptedCredentials() guard before generating
STORAGE_ENCRYPTION_KEY, matching the existing guard in bootstrap-env.mjs
- bootstrap-env.mjs: add decrypt-probe diagnostic on startup to detect
key mismatch and log actionable recovery instructions
- bin/omniroute.mjs: add 'reset-encrypted-columns' CLI recovery command
that nulls encrypted credential columns while preserving provider config
- tests/unit/sync-env.test.ts: isolate tests with DATA_DIR override
Root cause: postinstall → syncEnv() generated fresh crypto secrets into
the package-local .env on every 'npm install -g' upgrade, since the
package directory is wiped and recreated. The bootstrap-env guard never
triggered because sync-env already filled in the new keys. The DB still
contained credentials encrypted under the previous key, making them
permanently unrecoverable (AES-GCM auth-tag mismatch → silent 401s).
CI sets INITIAL_PASSWORD and JWT_SECRET env vars, which makes
isAuthRequired() return true even with a fresh temp DB. The tests
call route handlers directly without session cookies, so auth must
be fully disabled by clearing all auth-related env vars.
- guide-settings-route.test.ts: control XDG_CONFIG_HOME so OpenCode config
path resolves to the test dummy dir (CI runners have XDG set)
- proxy-registry-flow.test.ts: disable DASHBOARD_PASSWORD to prevent 401 on
direct route handler calls (CI postinstall auto-generates it)
- _chatPipelineHarness.ts: clear DASHBOARD_PASSWORD for all integration tests
using the shared chat pipeline harness
Replace placeholder builtin skill responses with real file, HTTP, and
code-execution flows constrained to per-key workspaces, size limits, and
sanitized request headers.
Harden the Docker sandbox with dropped capabilities, tmpfs-backed
workdirs, configurable runtime limits, and clearer failure behavior for
disabled browser automation.
Also consolidate legacy dashboard usage navigation into logs, remove
stale sidebar and SSE backup artifacts, and expand tests to lock in the
new runtime and routing contracts.
Several merges (primarily #1602 by @JasonLandbridge) added new i18n keys
with English values to all locale files instead of translated text.
This commit auto-translates all remaining untranslated pt-BR.json keys
using Google Translate, with manual fixups for technical terms (Proxy,
Fallback, Streaming, Playground, Skills, etc).
commit ff0a718e65
Author: Jean Brito <jean.f.brito@gmail.com>
Date: Sat Apr 25 16:45:23 2026 -0300
feat(providers): add CrofAI as a built-in API-key provider
CrofAI (https://crof.ai) ships an OpenAI-compatible /v1 endpoint with
Bearer auth and a /v1/models discovery route. It hosts a curated set of
hosted open models (DeepSeek V3.2/V4 Pro, Kimi K2.5/K2.6, GLM 4.7/5.x,
Gemma 4, MiniMax M2.5, Qwen3.5/3.6) that today users can only attach
through the generic "Add OpenAI Compatible" flow — losing branding,
defaults, prefix routing, and showing up under "API Key Compatible
Providers" instead of the curated "API Key Providers" section.
This change wires CrofAI as a first-class built-in, mirroring how Kimi
is registered (OpenAI format + bearer auth + seed model list).
Files touched (kept tight):
- src/shared/constants/providers.ts
Add `crof` to APIKEY_PROVIDERS with id/alias/name/icon/color/textIcon/website.
- src/shared/constants/config.ts
Register PROVIDER_ENDPOINTS.crof = "https://crof.ai/v1/chat/completions".
- open-sse/config/providerRegistry.ts
Add a `crof` REGISTRY entry: format "openai", executor "default",
authType "apikey", authHeader "bearer", and a seed model list pulled
from a live GET https://crof.ai/v1/models on 2026-04-25 (DeepSeek,
Kimi, GLM, Gemma, MiniMax, Qwen variants). Runtime /models discovery
keeps the live catalog up to date.
- src/shared/components/ProviderIcon.tsx
Map `crof -> "crof"` in PROVIDER_ICON_MAP. Not added to PNG_PROVIDERS
so the UI falls back to the textIcon ("CR") until a logo asset ships
at public/providers/crof.png.
- tests/unit/crof-provider.test.ts (new)
Pins the registration shape (provider identity, base URL, registry
entry, seed model families). Required by the repo's PR Test Policy.
Verified end-to-end against a locally rebuilt image:
- CrofAI appears under "API Key Providers" alongside GLM Coding/Minimax.
- The connection-add dialog opens with title "Add CrofAI API Key".
- POST /api/providers/validate returns "Valid" against /v1/models.
- POST /api/providers persists a connection (testStatus=active).
- POST /v1/chat/completions { model: "crof/kimi-k2.5", ... } returns 200
with a real Kimi K2.5 response — full proxy path resolves through the
new registry entry.
- npm run test:unit passes locally including tests/unit/crof-provider.test.ts.
Notes for the maintainer:
- No logo file is included; happy to follow up with a PNG for
public/providers/crof.png. Until then the UI uses the "CR" textIcon.
- Pricing (src/shared/constants/pricing.ts) is intentionally not
hardcoded — CrofAI exposes per-model pricing via /v1/models response,
and runtime sync is preferable to stale baked-in numbers. Happy to add
a stub block if requested.
- Anthropic-compatible endpoint (https://anthropic.nahcrof.com/v1/messages)
is not wired in this PR. Users can still add it via "Add Anthropic
Compatible" if needed.
# Conflicts:
# src/shared/components/ProviderIcon.tsx
Require management authentication across combo, settings, skill,
webhook, provider auth, restart, and shutdown management routes to
prevent unauthenticated access to privileged operations.
Tighten the OpenAPI try endpoint to only proxy same-origin OmniRoute API
paths and strip hop-by-hop or forwarded headers before dispatching.
Add unit coverage for the new auth guards and proxy validation rules.
Reported by user testing in Open WebUI: across three turns
user "test 1" -> "1"
user "test 2" -> "12" (should be "2")
user "test 3. reply only with 3" -> "1123" (should be "3")
The model was literally APPENDING prior assistant outputs into the new
generation instead of producing a fresh response. Root cause: when
sending each prior turn as a separate `assistant`-role entry in
`/backend-api/f/conversation`'s `messages` array, ChatGPT's web API
("action: next") treats those as in-progress messages the model can
continue rather than as completed turns. So the new generation extends
the most recent assistant message.
Fix: don't replay prior turns as separate messages. Instead fold the
full history into the system message as plain text and send only the
current user query as a single new turn. Verified end-to-end:
Turn 1 -> "1"
Turn 2 -> "2"
Turn 3 -> "3"
user "favorite color is teal" / assistant "Got it" / user "what color?"
-> "Teal" (memory still preserved through the system-message channel)
Streaming + multi-turn -> correct, real-time chunks
Updated two unit tests that previously asserted history items showed up
as separate `user`/`assistant` messages in the request — they now check
for the single-user-message + history-in-system-message shape.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Round of fixes addressing the gemini-code-assist and chatgpt-codex review
comments on the initial PR.
## High priority
- **PoW solver no longer blocks the event loop** (gemini #1, #2). The 100k
prekey solver and 500k proof-of-work solver were synchronous SHA3-512
loops that pinned a CPU core for tens to hundreds of milliseconds per
request. Both are now async and `await`-yield to the event loop every
1000 iterations via setImmediate, so concurrent requests and I/O still
get scheduled. Wall time is approximately the same; what changes is
fairness, not throughput.
- **Real upstream streaming for stream=true requests** (codex #6). The
conv call now passes `stream: true` through to the TLS client when the
caller asked for streaming. The TLS client uses tls-client-node's
streamOutputPath primitive to write the response body to a temp file
as it arrives, and we tail that file as a ReadableStream so clients
see chunks in real time instead of getting one buffered burst at the
end. Also peeks the first 256 bytes — if the response starts with
`{` it's almost certainly a JSON error envelope, so we wait for the
full body and surface as a non-streaming error response.
## Medium priority
- **Per-cookie device id** (gemini #3). Replaced the single
process-wide DEVICE_ID with a per-cookie SHA-256-derived UUID that's
stable across requests for one connection but unique per cookie. This
matches how the browser's persistent oai-did cookie behaves and
avoids cross-account fingerprint sharing. Cache is bounded to 200
entries with FIFO eviction.
- **Removed dead conv-cache code** (gemini #4). The convCache /
convLookup / convStore trio (~70 LOC) was unused — conversationId is
hard-pinned to null because Temporary Chat conversation_ids 404 on
reuse. Deleted entirely; the comment explains why we don't persist.
- **No more console.log in the conv 4xx path** (gemini #5). Replaced
with log?.warn so it respects the application's logging
configuration.
- **Bound the warmup cache** (codex #7). The (cookie, accessToken) ->
timestamp map was unbounded; long-running multi-user deployments
with rotating tokens would grow it forever. Now capped at 200
entries with FIFO eviction (Map iteration order = insertion order).
- **Honor abort signals in TLS fetch** (codex #8). tlsFetchChatGpt now
checks options.signal before issuing the upstream call, after the
call returns, and the streaming body listens for abort to stop
tailing the temp file. tls-client-node's koffi binding can't cancel
an in-flight request mid-call, but we no longer process / re-emit a
response that the caller has already given up on.
## Tests
All 27 chatgpt-web tests still pass; updated several to find calls by
URL via findIndex rather than hardcoded indices, since the warmup
sequence (/me, /conversations, /models) and two-stage Sentinel
(prepare + chat-requirements) shifted positional offsets.
Manually verified end-to-end:
- Non-streaming completions
- Streaming completions (real-time chunks; SSE [DONE] terminator)
- Multi-turn with full history each turn (memory preserved correctly)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds a new chatgpt-web provider that routes through chatgpt.com's internal
backend-api using a Plus/Pro subscription session cookie, enabling access
to GPT-5.x models without an OpenAI API key.
Heavier than perplexity-web/grok-web because chatgpt.com layers more bot
protection — this PR builds out the full pipeline needed to look like a
real browser session.
## New executor: open-sse/executors/chatgpt-web.ts
Auth/request pipeline (per chat completion):
1. exchangeSession() GET /api/auth/session cookie -> JWT (cached ~5min)
2. fetchDpl() GET / scrape data-build + script src
3. runSessionWarmup() GET /backend-api/me, /conversations, /models
4. POST /sentinel/chat-requirements/prepare -> prepare_token
5. POST /sentinel/chat-requirements -> chat-requirements-token + PoW seed/diff
6. solveProofOfWork() SHA3-512 loop -> "gAAAAAB..." sentinel proof token
7. POST /backend-api/f/conversation with all sentinel headers
8. parse SSE stream -> OpenAI chat.completion[.chunk] format
Notable details:
- 18-element prekey config matching chat2api/openai-sentinel (browser fingerprint
values, U+2212 MINUS SIGN in `webdriver−false`). Thin shapes get escalated to
mandatory Turnstile.
- Two-stage Sentinel handshake (/prepare + /chat-requirements) — sending only
the prepare result returns a 403 "Unusual activity" response.
- `turnstile.required: true` from Sentinel is treated as advisory; the conv
endpoint accepts requests without a Turnstile token as long as PoW + chat-
requirements-token are valid. Optional bring-your-own Turnstile via
`providerSpecificData.turnstileToken` for accounts that hard-require it.
- SSE parser tracks message_id and resets the accumulator on a new turn —
chatgpt.com echoes prior assistant messages (with status finished_successfully)
before sending the new turn.
- entity["...","value", ...] internal markup stripped from output (browser
renders these client-side).
- Conversation-continuity cache disabled by default: we send
history_and_training_disabled: true (Temporary Chat mode) and those
conversation_ids expire too fast to reuse — re-using returned 404. Each
request now sends conversation_id: null and replays full history, matching
what Open WebUI and OpenAI-API-style clients send anyway.
## TLS impersonation: open-sse/services/chatgptTlsClient.ts
ChatGPT's Cloudflare config pins cf_clearance to JA3/JA4 TLS fingerprint +
HTTP/2 SETTINGS frame. Plain Node Undici fetch always returns
cf-mitigated: challenge regardless of cookies. The wrapper module loads
`tls-client-node` (Firefox 148 fingerprint) in native runtime mode (.so via
koffi) — managed mode spawns a sidecar that conflicts with OmniRoute's
global fetch proxy patch.
- Lazy singleton TLSClient with process exit hooks
- Streaming-capable (file tail) and non-streaming modes
- Test injection point: __setTlsFetchOverrideForTesting() lets unit tests mock
the client without touching globalThis.fetch
## Provider wiring
- open-sse/executors/index.ts — register ChatGptWebExecutor with cgpt-web alias
- open-sse/config/providerRegistry.ts — registry entry, format=openai,
authHeader=cookie, model gpt-5.3-instant
- src/shared/constants/providers.ts — WEB_COOKIE_PROVIDERS UI metadata
(icon, color, authHint)
- src/lib/providers/validation.ts — validateChatGptWebProvider hits
/api/auth/session via the TLS client, detects cf-mitigated/HTML responses
and returns a clear "paste full Cookie line" hint instead of a generic
"Invalid"
- next.config.mjs — mark tls-client-node, koffi, tough-cookie as external
packages (Turbopack can't bundle the native .so)
## Cookie format
Validator and executor accept any of:
- bare value: "eyJhbGc..."
- unchunked cookie line: "__Secure-next-auth.session-token=eyJ..."
- chunked cookie line: "__Secure-next-auth.session-token.0=...; __Secure-next-auth.session-token.1=..."
- full DevTools Cookie header line: "Cookie: __Secure-next-auth.session-token.0=...; cf_clearance=...; ..."
NextAuth chunks the JWE when it exceeds 4KB; chunked cookies pass through
verbatim (NextAuth reassembles server-side). Recommend pasting the full
DevTools Cookie line so cf_clearance, __cf_bm, _cfuvid, _puid travel along —
without cf_clearance, Cloudflare blocks the request before NextAuth sees it.
## Tests
tests/unit/chatgpt-web.test.ts — 27 tests, all passing:
- Registration + alias resolution
- Token exchange (cookie -> Bearer flow)
- Token cache TTL
- Refreshed cookie surfaced via onCredentialsRefreshed callback
- Sentinel call ordering (session -> prepare -> chat-requirements -> conv)
- Sentinel chat-requirements-token forwarded on conv request
- PoW token has gAAAAAB prefix
- Turnstile.required: true does NOT block conv (passes through)
- Non-streaming chat.completion JSON
- Streaming SSE chunks ending with [DONE]
- Cumulative-parts diffing yields non-overlapping deltas
- Errors: 401 session, 403 sentinel, 429 conv rate-limit
- Empty messages -> 400 without any fetch
- Missing apiKey -> 401 without any fetch
- Cookie format: bare value, unchunked, chunked, "Cookie: ..." DevTools line
- Conversation continuity: each call starts a fresh conversation
- Browser-like headers on conv POST (UA, Origin, Sec-Fetch-Site, Accept)
- Payload shape (action, model=gpt-5-3, history_and_training_disabled)
- Provider registry contains chatgpt-web with gpt-5.3-instant model
Verification: typecheck:core clean, lint clean (no new warnings),
end-to-end manually verified across single-turn, multi-turn (memory
preserved), streaming, and Open WebUI-style sequential growing-history
flows.
## References
- bogdanfinn/tls-client (Go) — TLS impersonation upstream
- fatihkabakk/tls-client-node — Node bindings
- lanqian528/chat2api — Sentinel/PoW/prekey reference impl (Python)
- leetanshaj/openai-sentinel — Prekey config + SHA3-512 solver
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Register AgentRouter across the provider registry, pricing, docs, and
dashboard metadata so it appears as a first-class OpenAI-compatible
passthrough option.
Add a dedicated `/api/models/test` endpoint and provider-page controls
for on-demand single-model diagnostics, including latency feedback and
success/error status, to help verify mappings without triggering broader
connection tests or rate limits.
Align header casing expectations in provider validation tests with the
current registry contract.
Add the Codex Auto Review model to the provider registry and prefer
Codex when resolving unprefixed `codex-auto-review` and `gpt-5.5`
requests.
Broaden provider icon mappings and bundled PNG assets so more providers
render correctly in the shared UI. Also tighten chatCore stream cleanup
behavior so streaming responses return immediately while semaphore slots
and model locks are released on completion or failure, with tests and
artifact policy coverage updated accordingly.
Register AWS Polly as an audio provider with SigV4 request signing,
speech engine discovery, and API-key validation for managed provider
flows.
Add Lemonade as a self-hosted OpenAI-compatible provider, expand
static model discovery to audio registries, and support Azure OpenAI
deployment discovery from resource endpoints.
Sanitize sensitive provider-specific AWS fields in API responses and
update related tests and release notes.
* fix(sse): preserve Responses API hosted tools in Codex executor
normalizeCodexTools was dropping every non-function tool, which stripped
Codex CLI's built-in image_generation tool (and other hosted tools like
web_search / file_search) before they reached OpenAI. Add a whitelist
and structural check so they pass through, while keeping unknown types
filtered locally with a debug log.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* feat(sse): route DALL-E-style image generation through Codex hosted tool
Adds a Codex branch to the /v1/images/generations handler so DALL-E-style
requests with `model: codex/*` (or `cx/*`) are translated into /responses
calls with the `image_generation` hosted tool, then unpacked back into
OpenAI image response shape. Enables OpenWebUI and other clients that hit
the legacy images endpoint to drive Codex image generation.
Also defaults `store: false` in the Codex executor whenever an
`image_generation` tool is present — the Codex backend rejects store=true
with hosted image generation ("Store must be set to false").
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* feat(sse): forward size/quality from DALL-E body to Codex image_generation tool
The Codex image-gen shim was ignoring `size` and `quality` from the incoming
/v1/images/generations body, so OpenWebUI's size and quality selectors had
no effect. Forward both into the hosted tool config, mapping DALL-E's
`standard`/`hd` to the image_generation tool's `medium`/`high` so legacy
clients keep working.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* feat(providers): add Petals and Nous Research provider support
Register Nous Research as an OpenAI-compatible gateway with remote
model discovery and validation against chat completions.
Add Petals provider metadata, default config, validation, and a
specialized executor that maps OpenAI-style requests to the public
generate endpoint. Also allow optional API keys and configurable base
URLs for Petals in the dashboard and provider schemas.
Expand provider model and catalog tests to cover both integrations.
* fix(resilience): sync queue updates and clear stale discovery caches
Await runtime request queue updates so limiter settings and auto-enabled
API key protections are recomputed when resilience settings change.
Preserve cancelled batch state for in-flight work by marking input files
processed without generating output artifacts, and replace cached synced
models with an empty set when remote discovery returns no models so the
providers route falls back to the local catalog instead of stale cache.
---------
Co-authored-by: Payne <trader-payne@users.noreply.github.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-authored-by: diegosouzapw <diegosouzapw@users.noreply.github.com>