Skip to content
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
4287673
feat(api): expose compression engine catalog + config schema
diegosouzapw Jun 14, 2026
d48ed7f
feat(api): per-engine compression preview
diegosouzapw Jun 14, 2026
ee1d62a
feat(analytics): per-engine compression analytics aggregation + route
diegosouzapw Jun 14, 2026
c2aa5f4
feat(combos): toggle engine in default combo + support new engines in…
diegosouzapw Jun 14, 2026
f20e7bb
feat(compression-ui): EngineConfigForm renders engine config schema
diegosouzapw Jun 14, 2026
f934467
feat(compression-ui): EngineConfigPage rich per-engine config template
diegosouzapw Jun 14, 2026
56dea25
feat(compression-ui): engine config pages + compression menu group
diegosouzapw Jun 14, 2026
85dd60a
feat(compression-ui): pure pipeline reducer for the combos editor
diegosouzapw Jun 14, 2026
09a9083
feat(compression-ui): ordered-layer combos editor with per-engine config
diegosouzapw Jun 14, 2026
f6c0943
feat(compression-ui): surface Compression Settings in the compression…
diegosouzapw Jun 14, 2026
94de481
feat(ws): live dashboard WebSocket default-on (loopback-bound)
diegosouzapw Jun 14, 2026
9f4abc4
fix(compression-ui): review fixes — single-engine activation, error s…
diegosouzapw Jun 14, 2026
48ac312
test(compression-ui): unmount React roots in render-test cleanup to f…
diegosouzapw Jun 14, 2026
6a4b33c
fix(i18n): add sidebar message keys for new compression menu items (H…
diegosouzapw Jun 14, 2026
5879285
perf(compression-ui): parallelize EngineConfigPage initial fetches (s…
diegosouzapw Jun 14, 2026
a49b407
revert(compression-ui): defer combos ordered-layer redesign (Task 8/9…
diegosouzapw Jun 14, 2026
5c52b54
feat(compression-ui): add Compression Hub + Lite/Aggressive/Ultra eng…
diegosouzapw Jun 15, 2026
5869798
Merge remote-tracking branch 'origin/release/v3.8.25' into fix-3860-f…
diegosouzapw Jun 15, 2026
69ec8da
chore(quality): re-baseline file-size for #3860 compression UI growth
diegosouzapw Jun 15, 2026
dbeb07b
test(ws): move live-ws-default test to a collected runner path
diegosouzapw Jun 15, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/reference/ENVIRONMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ OmniRoute uses **SQLite** (via `better-sqlite3`) for all persistence. These vari
| `LIVE_WS_PORT` | `20129` | `src/server/ws/liveServer.ts` | Port for the real-time WebSocket live monitoring server. |
| `LIVE_WS_HOST` | `127.0.0.1` | `src/server/ws/liveServer.ts` | Bind address for the live WebSocket server. Set to `0.0.0.0` to expose on LAN (also configure `LIVE_WS_ALLOWED_ORIGINS`). |
| `LIVE_WS_ALLOWED_ORIGINS` | _(unset)_ | `src/server/ws/liveServer.ts` | Comma-separated extra origins allowed to open a live WebSocket. Loopback dashboard origins are already permitted by default. |
| `OMNIROUTE_ENABLE_LIVE_WS` | `false` | `src/server/ws/liveServer.ts` | Set to `1` or `true` to enable the real-time WebSocket server (disabled by default). |
| `OMNIROUTE_ENABLE_LIVE_WS` | `true` | `src/server/ws/liveServer.ts` | Set to `0` or `false` to disable the real-time WebSocket server (enabled by default, loopback-bound). |
| `OMNIROUTE_DISABLE_LIVE_WS` | `false` | `scripts/start-ws-server.mjs` | CI/harness toggle that disables the standalone live WebSocket helper script. |
| `RELAY_IP_PER_MINUTE` | `30` | `src/app/api/v1/relay/chat/completions/route.ts` | Per-(token, IP) relay rate limit, requests/minute. In-memory, per instance. `0` or negative disables the IP-dimension gate (per-token DB limit still applies). |
| `NODE_ENV` | `production` | Next.js core | Controls logging verbosity, caching, error detail exposure, and Next.js optimizations. |
Expand Down
5 changes: 4 additions & 1 deletion open-sse/handlers/chatCore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2486,7 +2486,10 @@ export async function handleChatCore({
const isStackedCompressionCombo = (
compressionCombo: RuntimeCompressionCombo | null
): compressionCombo is RuntimeCompressionCombo => {
return Boolean(compressionCombo && compressionCombo.pipeline.length > 1);
// >= 1: a single-engine default combo (user enabled exactly one layer via the
// per-engine config page) must still apply. applyCompressionComboConfig already
// guards length === 0.
return Boolean(compressionCombo && compressionCombo.pipeline.length >= 1);
};
if (isCombo && comboName) {
try {
Expand Down
7 changes: 7 additions & 0 deletions src/app/(dashboard)/dashboard/context/ccr/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
"use client";

import { EngineConfigPage } from "@/shared/components/compression/EngineConfigPage";

export default function CcrPage() {
return <EngineConfigPage engineId="ccr" />;
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,24 @@

import { useEffect, useState } from "react";
import { useTranslations } from "next-intl";
import {
togglePipelineStep,
movePipelineStep,
setStepIntensity,
setStepConfig,
availableEngines,
} from "@/shared/components/compression/compressionPipelineModel";
import { EngineConfigForm } from "@/shared/components/compression/EngineConfigForm";
import type { EngineConfigField } from "@omniroute/open-sse/services/compression/engines/types";

type PipelineStep = { engine: string; intensity?: string };
type PipelineStep = { engine: string; intensity?: string; config?: Record<string, unknown> };
type EngineEntry = {
id: string;
name: string;
icon: string;
stackPriority: number;
configSchema: EngineConfigField[];
};
type CompressionCombo = {
id: string;
name: string;
Expand Down Expand Up @@ -35,6 +51,7 @@ export default function CompressionCombosPageClient() {
const [combos, setCombos] = useState<CompressionCombo[]>([]);
const [routingCombos, setRoutingCombos] = useState<RoutingCombo[]>([]);
const [languagePacks, setLanguagePacks] = useState<LanguagePack[]>([]);
const [engineCatalog, setEngineCatalog] = useState<EngineEntry[]>([]);
const [editingId, setEditingId] = useState<string | null>(null);
const [name, setName] = useState("");
const [description, setDescription] = useState("");
Expand All @@ -44,6 +61,7 @@ export default function CompressionCombosPageClient() {
const [outputModeIntensity, setOutputModeIntensity] = useState("full");
const [assignmentIds, setAssignmentIds] = useState<string[]>([]);
const [saving, setSaving] = useState(false);
const [expandedEngine, setExpandedEngine] = useState<string | null>(null);

const refresh = () => {
fetch("/api/context/combos")
Expand All @@ -62,6 +80,10 @@ export default function CompressionCombosPageClient() {
.then((res) => (res.ok ? res.json() : null))
.then((data) => setLanguagePacks(Array.isArray(data?.packs) ? data.packs : []))
.catch(() => {});
fetch("/api/compression/engines")
.then((res) => (res.ok ? res.json() : null))
.then((data) => setEngineCatalog(Array.isArray(data?.engines) ? data.engines : []))
.catch(() => {});
}, []);

const resetForm = () => {
Expand Down Expand Up @@ -145,20 +167,6 @@ export default function CompressionCombosPageClient() {
if (res.ok) refresh();
};

const updateStep = (index: number, patch: Partial<PipelineStep>) => {
setPipeline((current) =>
current.map((step, stepIndex) => {
if (stepIndex !== index) return step;
const next = { ...step, ...patch };
const allowed = ENGINE_INTENSITIES[next.engine] ?? ["standard"];
return {
...next,
intensity: allowed.includes(next.intensity ?? "") ? next.intensity : allowed[0],
};
})
);
};

const togglePack = (language: string, enabled: boolean) => {
setSelectedPacks((current) =>
enabled
Expand Down Expand Up @@ -192,50 +200,147 @@ export default function CompressionCombosPageClient() {
</div>

<div className="mt-4 space-y-3">
<div className="flex items-center justify-between">
<h2 className="text-sm font-semibold text-text-main">{t("pipeline")}</h2>
<button
onClick={() =>
setPipeline((current) => [...current, { engine: "caveman", intensity: "full" }])
}
className="rounded-lg border border-border px-3 py-1.5 text-xs text-text-main"
>
{t("addStep")}
</button>
<h2 className="text-sm font-semibold text-text-main">{t("pipeline")}</h2>

{/* Active layers */}
<div className="space-y-2">
{pipeline.map((step, index) => {
const entry = engineCatalog.find((e) => e.id === step.engine);
const displayName = entry?.name ?? step.engine;
const intensities = ENGINE_INTENSITIES[step.engine];
const hasConfig = (entry?.configSchema?.length ?? 0) > 0;
const isExpanded = expandedEngine === step.engine;
return (
<div key={step.engine} className="rounded-lg border border-border bg-bg p-2">
<div className="flex items-center gap-2">
<button
onClick={() =>
setPipeline((p) =>
movePipelineStep(
p as Parameters<typeof movePipelineStep>[0],
step.engine,
"up"
)
)
}
disabled={index === 0}
className="rounded border border-border px-2 py-1 text-xs text-text-main disabled:opacity-40"
aria-label="Move up"
>
↑
</button>
<button
onClick={() =>
setPipeline((p) =>
movePipelineStep(
p as Parameters<typeof movePipelineStep>[0],
step.engine,
"down"
)
)
}
disabled={index === pipeline.length - 1}
className="rounded border border-border px-2 py-1 text-xs text-text-main disabled:opacity-40"
aria-label="Move down"
>
↓
</button>
<span className="flex-1 text-sm font-medium text-text-main">{displayName}</span>
{intensities && (
<select
value={step.intensity ?? intensities[0]}
onChange={(event) =>
setPipeline((p) =>
setStepIntensity(
p as Parameters<typeof setStepIntensity>[0],
step.engine,
event.target.value
)
)
}
className="rounded border border-border bg-bg px-2 py-1 text-xs text-text-main"
>
{intensities.map((intensity) => (
<option key={intensity} value={intensity}>
{intensity}
</option>
))}
</select>
)}
{hasConfig && (
<button
onClick={() =>
setExpandedEngine((prev) => (prev === step.engine ? null : step.engine))
}
className="rounded border border-border px-2 py-1 text-xs text-text-main"
aria-label="Toggle config"
>
⚙
</button>
)}
<button
onClick={() =>
setPipeline((p) =>
togglePipelineStep(
p as Parameters<typeof togglePipelineStep>[0],
step.engine,
engineCatalog
)
)
}
className="rounded border border-border px-2 py-1 text-xs text-text-main"
>
{t("removeStep")}
</button>
</div>
{isExpanded && entry && entry.configSchema.length > 0 && (
<div className="mt-2 border-t border-border pt-2">
<EngineConfigForm
schema={entry.configSchema}
value={step.config ?? {}}
onChange={(cfg) =>
setPipeline((p) =>
setStepConfig(
p as Parameters<typeof setStepConfig>[0],
step.engine,
cfg
)
)
}
/>
</div>
)}
</div>
);
})}
</div>
{pipeline.map((step, index) => (
<div key={index} className="grid grid-cols-[1fr_1fr_auto] gap-2">
<select
value={step.engine}
onChange={(event) => updateStep(index, { engine: event.target.value })}
className="rounded-lg border border-border bg-bg px-3 py-2 text-sm text-text-main"
>
{Object.keys(ENGINE_INTENSITIES).map((engine) => (
<option key={engine} value={engine}>
{engine}
</option>
))}
</select>
<select
value={step.intensity ?? ""}
onChange={(event) => updateStep(index, { intensity: event.target.value })}
className="rounded-lg border border-border bg-bg px-3 py-2 text-sm text-text-main"
>
{(ENGINE_INTENSITIES[step.engine] ?? ["standard"]).map((intensity) => (
<option key={intensity} value={intensity}>
{intensity}
</option>
))}
</select>
<button
onClick={() => setPipeline((current) => current.filter((_, i) => i !== index))}
className="rounded-lg border border-border px-3 py-2 text-sm text-text-main"
disabled={pipeline.length <= 1}
>
{t("removeStep")}
</button>

{/* Available engines to add */}
{availableEngines(engineCatalog, pipeline as Parameters<typeof availableEngines>[1])
.length > 0 && (
<div className="flex flex-wrap gap-2 pt-1">
{availableEngines(
engineCatalog,
pipeline as Parameters<typeof availableEngines>[1]
).map((e) => (
<button
key={e.id}
onClick={() =>
setPipeline((p) =>
togglePipelineStep(
p as Parameters<typeof togglePipelineStep>[0],
e.id,
engineCatalog
)
)
}
className="rounded-lg border border-border px-3 py-1.5 text-xs text-text-main"
>
+ {(e as EngineEntry).name ?? e.id}
</button>
))}
</div>
))}
)}
</div>

<div className="mt-4 grid grid-cols-1 gap-4 lg:grid-cols-3">
Expand Down
7 changes: 7 additions & 0 deletions src/app/(dashboard)/dashboard/context/headroom/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
"use client";

import { EngineConfigPage } from "@/shared/components/compression/EngineConfigPage";

export default function HeadroomPage() {
return <EngineConfigPage engineId="headroom" />;
}
7 changes: 7 additions & 0 deletions src/app/(dashboard)/dashboard/context/llmlingua/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
"use client";

import { EngineConfigPage } from "@/shared/components/compression/EngineConfigPage";

export default function LlmlinguaPage() {
return <EngineConfigPage engineId="llmlingua" />;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
"use client";

import { EngineConfigPage } from "@/shared/components/compression/EngineConfigPage";

export default function SessionDedupPage() {
return <EngineConfigPage engineId="session-dedup" />;
}
11 changes: 11 additions & 0 deletions src/app/(dashboard)/dashboard/context/settings/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
"use client";

import CompressionSettingsTab from "@/app/(dashboard)/dashboard/settings/components/CompressionSettingsTab";

export default function CompressionSettingsPage() {
return (
<div className="p-4">
<CompressionSettingsTab />
</div>
);
}
26 changes: 26 additions & 0 deletions src/app/api/compression/engines/route.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { NextResponse } from "next/server";
import { requireManagementAuth } from "@/lib/api/requireManagementAuth";
import { buildErrorBody } from "@omniroute/open-sse/utils/error";
import { registerBuiltinCompressionEngines } from "@omniroute/open-sse/services/compression/engines/index.ts";
import { listCompressionEngines } from "@omniroute/open-sse/services/compression/engines/registry.ts";

export async function GET(req: Request) {
const authError = await requireManagementAuth(req);
if (authError) return authError;
try {
registerBuiltinCompressionEngines();
const engines = listCompressionEngines().map((e) => ({
id: e.id,
name: e.name,
description: e.description,
icon: e.icon,
stackable: e.stackable,
stackPriority: e.stackPriority,
metadata: e.metadata,
configSchema: e.getConfigSchema(),
}));
return NextResponse.json({ engines });
} catch {
return NextResponse.json(buildErrorBody(500, "Failed to list engines"), { status: 500 });
}
}
Loading