From c4b39d65f839d35fdd84f319f50bf07ed0cb211d Mon Sep 17 00:00:00 2001 From: nguyenha935 <208228297+nguyenha935@users.noreply.github.com> Date: Thu, 23 Jul 2026 01:08:47 +0700 Subject: [PATCH] fix: normalize Codex URLs and dashboard regressions --- README.md | 54 ++++++++++--------- .../fixes/8233-codex-dashboard-regressions.md | 1 + open-sse/executors/muse-spark-web.ts | 8 +-- src/shared/components/OAuthModal.tsx | 4 +- .../analytics/rechartsUsageCharts.tsx | 2 +- src/shared/utils/codexBaseUrl.ts | 6 +-- tests/unit/check-docs-counts-sync.test.ts | 8 +-- tests/unit/codex-base-url.test.ts | 34 ++++++++---- .../unit/muse-spark-web-continuation.test.ts | 19 +++++++ .../oauth-modal-grok-cli-paste-7610.test.ts | 9 ++-- ...oauth-modal-typescript-regressions.test.ts | 16 ++++++ .../shared/analytics-recharts-lazy.test.ts | 10 ++++ 12 files changed, 116 insertions(+), 55 deletions(-) create mode 100644 changelog.d/fixes/8233-codex-dashboard-regressions.md create mode 100644 tests/unit/oauth-modal-typescript-regressions.test.ts diff --git a/README.md b/README.md index b0d070df0ae..79fc1aa576b 100644 --- a/README.md +++ b/README.md @@ -265,7 +265,7 @@ All **18** strategies — mix & match per combo step: - **🤖 One-command CLI/agent setup** — `setup-*` configures 12+ coding tools; `omniroute launch` / `launch-codex` are zero-config. → [CLI Integrations](docs/guides/CLI-INTEGRATIONS.md) - **🛰️ Remote mode** — drive a remote OmniRoute with scoped tokens (`connect` / `contexts` / `tokens`) + an `antigravity` OAuth helper for VPS installs. → [Remote Mode](docs/guides/REMOTE-MODE.md) - **🧭 Smarter auto-routing** — `auto/:` combos, **Fusion** (model panel + judge), task-aware routing, per-request model / mode / USD-budget overrides. → [Auto-Combo](docs/routing/AUTO-COMBO.md) -- **🗜️ Pluggable compression** — 11 composable engines + Compression Studios: LLMLingua-2, two-tier Ultra, omniglyph, per-step fidelity gate, GCF v3.2, drag-reorder editor. → [Compression](docs/compression/COMPRESSION_ENGINES.md) +- **🗜️ Pluggable compression** — 12 composable engines + Compression Studios: LLMLingua-2, two-tier Ultra, omniglyph, per-step fidelity gate, GCF v3.2, drag-reorder editor. → [Compression](docs/compression/COMPRESSION_ENGINES.md) - **🕵️ Transparent MITM decrypt (TPROXY)** — capture CLIs that ignore proxy env vars, with a per-SNI CA + trust-store installer. → [MITM/TPROXY](docs/security/MITM-TPROXY-DECRYPT.md) - **💸 Cost telemetry everywhere** — `X-OmniRoute-*` cost/usage headers on every endpoint, cache-HIT savings header, per-key USD spend quotas. → [API Reference](docs/reference/API_REFERENCE.md) - **🧠 Memory you control** — off by default, opt-in int8 vector quantization + typed decay, per-request `x-omniroute-no-memory`. → [Memory](docs/frameworks/MEMORY.md) @@ -488,24 +488,26 @@ claude mcp add-server omniroute --type http --url http://localhost:20128/api/mcp -> **Why use many tokens when few tokens do the trick?** Every request passes through OmniRoute's compression pipeline **transparently** — no client changes. It's now a **stack of 11 composable engines** that run in order and mix & match per routing combo — building on ideas from [RTK](https://github.com/rtk-ai/rtk), [Caveman](https://github.com/JuliusBrussee/caveman) (⭐ 90K+), [LLMLingua-2](https://github.com/microsoft/LLMLingua), and [Troglodita](https://github.com/leninejunior/troglodita) (PT-BR). +> **Why use many tokens when few tokens do the trick?** Every request passes through OmniRoute's compression pipeline **transparently** — no client changes. It's now a **stack of 12 composable engines** that run in order and mix & match per routing combo — building on ideas from [RTK](https://github.com/rtk-ai/rtk), [Caveman](https://github.com/JuliusBrussee/caveman) (⭐ 90K+), [LLMLingua-2](https://github.com/microsoft/LLMLingua), and [Troglodita](https://github.com/leninejunior/troglodita) (PT-BR). -### 🧱 The 11-engine stack +### 🧱 The 12-engine stack Engines run in pipeline order; each is independently toggleable and configurable per combo: -| # | Engine | What it does | -| --- | ----------------- | ----------------------------------------------------------------------------------------------------------------------- | -| 1 | **Session-Dedup** | Drops content repeated across turns (content-addressed, cross-turn) | -| 2 | **CCR** | Archives large blocks behind retrieve markers, fetched on demand | -| 3 | **RTK** | Smart tool-result filtering, dedup & truncation (command-aware) | -| 4 | **Headroom** | Lossless tabular compaction of homogeneous JSON arrays, flat or nested (~30%), via a vendored **GCF** codec (spec v3.2) | -| 5 | **Relevance** | Extractive sentence scoring against the last user query | -| 6 | **Caveman** | Rule-based prose compression (~65–75% on output) | -| 7 | **LLMLingua-2** | ML semantic pruning via MobileBERT ONNX — code-safe, async | -| 8 | **Lite** | Whitespace + image-URL trimming (latency-light baseline) | -| 9 | **Aggressive** | Summarization + progressive aging of old turns | -| 10 | **Ultra** | Heuristic token pruning with an optional small-model (SLM) tier | +| # | Engine | What it does | +| --- | ------------------------- | ----------------------------------------------------------------------------------------------------------------------- | +| 1 | **Session-Dedup** | Drops content repeated across turns (content-addressed, cross-turn) | +| 2 | **CCR** | Archives large blocks behind retrieve markers, fetched on demand | +| 3 | **Lite** | Whitespace + image-URL trimming (latency-light baseline) | +| 4 | **RTK** | Smart tool-result filtering, dedup & truncation (command-aware) | +| 5 | **Responses Tool Output** | Conservative, lossless-first compaction of supported OpenAI Responses tool outputs | +| 6 | **Headroom** | Lossless tabular compaction of homogeneous JSON arrays, flat or nested (~30%), via a vendored **GCF** codec (spec v3.2) | +| 7 | **Relevance** | Extractive sentence scoring against the last user query | +| 8 | **Caveman** | Rule-based prose compression (~65–75% on output) | +| 9 | **Aggressive** | Summarization + progressive aging of old turns | +| 10 | **LLMLingua-2** | ML semantic pruning via MobileBERT ONNX — code-safe, async | +| 11 | **Ultra** | Heuristic token pruning with an optional small-model (SLM) tier | +| 12 | **OmniGlyph** | Experimental context-as-image encoding for direct Claude Fable 5 routes | Code blocks, URLs and structured data are **always preserved** byte-perfect. **One-click presets** combine the engines: @@ -538,7 +540,7 @@ Code blocks, URLs and structured data are **always preserved** byte-perfect. **O ### 📖 How it works — pipeline, architecture & savings math -OmniRoute compression pipeline: a client request of 10,000 tokens passes through 11 stacked engines — Session-Dedup, CCR, RTK, Headroom, Relevance, Caveman, LLMLingua-2, Omniglyph, Lite, Aggressive, Ultra — and reaches the provider at about 1,080 tokens, up to 95% saved. Code, URLs and JSON are always preserved byte-perfect. +OmniRoute compression pipeline: a client request of 10,000 tokens passes through 12 stacked engines — Session-Dedup, CCR, Lite, RTK, Responses Tool Output, Headroom, Relevance, Caveman, Aggressive, LLMLingua-2, Ultra, OmniGlyph — and reaches the provider at about 1,080 tokens, up to 95% saved. Code, URLs and JSON are always preserved byte-perfect. Default stacked combo runs `RTK → Caveman`. When both act on the same tool/context payload, savings compound: @@ -552,7 +554,7 @@ Code blocks, URLs, JSON and structured data are **always protected** by the pres ### 🎚️ Beyond the engines — output styles, the adaptive dial & per-request control -The 10 engines above shrink what goes **in**. Three more layers shape **how**, **when**, and what comes **out**: +The 12 engines above shrink what goes **in**. Three more layers shape **how**, **when**, and what comes **out**: - **🪄 Output Styles** _(output-axis steering)_ — inject deterministic, cache-safe response-shaping instructions; combinable, each at `lite` / `full` / `ultra` intensity. Adding a style is a one-line registry entry: - **Terse prose** — drop filler / articles / hedging; keep technical substance exact. @@ -843,15 +845,15 @@ same process on one port, so there is no separate CLI-only package today. ### 📋 Project & Quality -| Document | Description                                                                                                                                                                              | -| -------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [Contributing](CONTRIBUTING.md) | Development setup and guidelines | -| [Branching & Release Model](docs/ops/BRANCHING_MODEL.md) | Where PRs target (`release/*`), what `main` and tags mean | -| [Changelog](CHANGELOG.md) | Full per-version release history | -| [Security Policy](SECURITY.md) | Vulnerability reporting and security practices | -| [i18n Guide](docs/guides/I18N.md) | 40+ language support, translation workflow, RTL | -| [Release Checklist](docs/ops/RELEASE_CHECKLIST.md) | Pre-release validation steps | -| [Coverage Plan](docs/ops/COVERAGE_PLAN.md) | Test coverage strategy and 25,000+ test suite | +| Document | Description                                                                                                                                                                              | +| -------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [Contributing](CONTRIBUTING.md) | Development setup and guidelines | +| [Branching & Release Model](docs/ops/BRANCHING_MODEL.md) | Where PRs target (`release/*`), what `main` and tags mean | +| [Changelog](CHANGELOG.md) | Full per-version release history | +| [Security Policy](SECURITY.md) | Vulnerability reporting and security practices | +| [i18n Guide](docs/guides/I18N.md) | 40+ language support, translation workflow, RTL | +| [Release Checklist](docs/ops/RELEASE_CHECKLIST.md) | Pre-release validation steps | +| [Coverage Plan](docs/ops/COVERAGE_PLAN.md) | Test coverage strategy and 25,000+ test suite |
diff --git a/changelog.d/fixes/8233-codex-dashboard-regressions.md b/changelog.d/fixes/8233-codex-dashboard-regressions.md new file mode 100644 index 00000000000..831e86088ff --- /dev/null +++ b/changelog.d/fixes/8233-codex-dashboard-regressions.md @@ -0,0 +1 @@ +- **fix(dashboard):** Normalize Codex client URLs, restore the analytics input-bar color, resolve OAuth modal TypeScript regressions, synchronize the documented compression-engine count, and sanitize Muse Spark fetch errors ([#8233](https://github.com/diegosouzapw/OmniRoute/pull/8233)) — thanks @nguyenha935 diff --git a/open-sse/executors/muse-spark-web.ts b/open-sse/executors/muse-spark-web.ts index 8893e08fd3c..fb5b00277b7 100644 --- a/open-sse/executors/muse-spark-web.ts +++ b/open-sse/executors/muse-spark-web.ts @@ -5,6 +5,7 @@ import WebSocket from "ws"; import { BaseExecutor, mergeUpstreamExtraHeaders, type ExecuteInput } from "./base.ts"; import { getRotatingApiKey } from "../services/apiKeyRotator.ts"; import { prepareToolMessages, buildToolAwareResult } from "../translator/webTools.ts"; +import { sanitizeErrorMessage } from "../utils/error.ts"; import { normalizeSessionCookieHeader, normalizeSessionCookieHeaders, @@ -12,9 +13,8 @@ import { import { type ParsedMetaAiResponse, isRecord } from "./muse-spark-web/response-parser.ts"; const META_AI_GRAPHQL_API = "https://www.meta.ai/api/graphql"; -// Meta rebranded the chat product from "Abra" to "Ecto"; the session cookie -// `abra_sess` was replaced by `ecto_1_sess`. `normalizeSessionCookieHeader` -// only uses this constant when the user pastes a bare cookie value with no +// Meta rebranded "Abra" to "Ecto"; `abra_sess` became `ecto_1_sess`. +// `normalizeSessionCookieHeader` only uses this constant for bare values with no // `name=` prefix; full cookie lines (with any cookie names) pass through // untouched, so users who paste their entire DevTools cookie line still work. const META_AI_DEFAULT_COOKIE = "ecto_1_sess"; @@ -522,7 +522,7 @@ function buildErrorResponse(status: number, message: string, code?: string | nul return new Response( JSON.stringify({ error: { - message, + message: sanitizeErrorMessage(message), type: "upstream_error", ...(code ? { code } : {}), }, diff --git a/src/shared/components/OAuthModal.tsx b/src/shared/components/OAuthModal.tsx index a925c16a9da..7b54f927aa4 100644 --- a/src/shared/components/OAuthModal.tsx +++ b/src/shared/components/OAuthModal.tsx @@ -274,7 +274,7 @@ export default function OAuthModal({ let token: string | Record = raw; if (provider === "grok-cli") { const parsed = parseGrokCliPasteToken(raw); - if (!parsed.ok) { + if (parsed.ok === false) { setError(parsed.error); return; } @@ -1084,7 +1084,7 @@ export default function OAuthModal({

-