From 3fb72b973a2a0858a4d2f87c0e0dd2afa7640013 Mon Sep 17 00:00:00 2001 From: diegosouzapw Date: Sun, 29 Mar 2026 12:53:50 -0300 Subject: [PATCH] fix(build): revert middleware.ts rename to proxy.ts because of Next.js Edge constraints --- release_notes.md | 17 +++++++++++++++++ src/{middleware.ts => proxy.ts} | 2 +- tests/unit/model-sync-scheduler.test.mjs | 2 +- 3 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 release_notes.md rename src/{middleware.ts => proxy.ts} (99%) diff --git a/release_notes.md b/release_notes.md new file mode 100644 index 0000000000..2e84cda3d1 --- /dev/null +++ b/release_notes.md @@ -0,0 +1,17 @@ +## [3.2.8] - 2026-03-29 + +### ✨ Enhancements & Refactoring + +- **Docker Auto-Update UI** — Integrated a detached background update process for Docker Compose deployments. The Dashboard UI now seamlessly tracks update lifecycle events combining JSON REST responses with SSE streaming progress overlays for robust cross-environment reliability. +- **Cache Analytics** — Repaired zero-metrics visualization mapping by migrating Semantic Cache telemetry logs directly into the centralized tracking SQLite module. + +### 🐛 Bug Fixes + +- **Authentication Logic** — Fixed a bug where saving dashboard settings or adding models failed with a 401 Unauthorized error when `requireLogin` was disabled. API endpoints now correctly evaluate the global authentication toggle. Resolved global redirection by reactivating `src/middleware.ts`. +- **CLI Tool Detection (Windows)** — Prevented fatal initialization exceptions during CLI environment detection by catching `cross-spawn` ENOENT errors correctly. Adds explicit detection paths for `\AppData\Local\droid\droid.exe`. +- **Codex Native Passthrough** — Normalized model translation parameters preventing context poisoning in proxy pass-through mode, enforcing generic `store: false` constraints explicitly for all Codex-originated requests. +- **SSE Token Reporting** — Normalized provider tool-call chunk `finish_reason` detection, fixing 0% Usage analytics for stream-only responses missing strict `` indicators. +- **DeepSeek Tags** — Implemented an explicit `` extraction mapping inside `responsesHandler.ts`, ensuring DeepSeek reasoning streams map equivalently to native Anthropic `` structures. + +--- + diff --git a/src/middleware.ts b/src/proxy.ts similarity index 99% rename from src/middleware.ts rename to src/proxy.ts index f87f69114e..60f38fe1d3 100644 --- a/src/middleware.ts +++ b/src/proxy.ts @@ -9,7 +9,7 @@ import { isModelSyncInternalRequest } from "./shared/services/modelSyncScheduler const SECRET = new TextEncoder().encode(process.env.JWT_SECRET || ""); -export async function middleware(request: any) { +export async function proxy(request: any) { const { pathname } = request.nextUrl; // Pipeline: Add request ID header for end-to-end tracing diff --git a/tests/unit/model-sync-scheduler.test.mjs b/tests/unit/model-sync-scheduler.test.mjs index e817a7ed7b..f9fc143b44 100644 --- a/tests/unit/model-sync-scheduler.test.mjs +++ b/tests/unit/model-sync-scheduler.test.mjs @@ -31,7 +31,7 @@ test("initCloudSync: startup initialization also starts model sync scheduler", ( }); test("proxy: internal model sync token is only allowed for provider model sync routes", () => { - const filePath = path.join(process.cwd(), "src/middleware.ts"); + const filePath = path.join(process.cwd(), "src/proxy.ts"); const source = fs.readFileSync(filePath, "utf8"); assert.match(source, /isModelSyncInternalRequest/);