Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
4cbbe1e
fix: alias/systemPrompt delete, disabled models, alias bare names, pr…
elan40213-eng Jul 25, 2026
1119fc6
fix(deps): move @tailwindcss/oxide-wasm32-wasi to optionalDependencies
elan40213-eng Jul 26, 2026
1222e3d
fix(config): make allowedDevOrigins env-driven
elan40213-eng Jul 26, 2026
1389526
fix(gemini-cli): eliminate privileged-user-id race and body mutation
elan40213-eng Jul 26, 2026
6dde3ae
refactor: remove dead webSearchInject module + dead bodyHasReasoning …
elan40213-eng Jul 26, 2026
3b5b0ed
refactor(combos): DRY up duplicated name-validation regex
elan40213-eng Jul 26, 2026
eeb5692
chore(api): route console.log errors to stderr and drop debug leak
elan40213-eng Jul 26, 2026
6568588
fix(acl): fail closed on malformed allowed* fields
elan40213-eng Jul 26, 2026
57f6bb7
fix(profile): surface system-prompt save errors and drop unused isDark
elan40213-eng Jul 26, 2026
fff85b6
fix(zcode): replace hardcoded Playwright path with env override
elan40213-eng Jul 26, 2026
444df31
fix(prewarm): require explicit password instead of weak 123456 default
elan40213-eng Jul 26, 2026
831a4a4
fix(headroom): expose cache invalidation for runtime installs
elan40213-eng Jul 26, 2026
f18b77c
refactor(combos): DRY up name-validation regex in remaining components
elan40213-eng Jul 26, 2026
78e8dfa
fix(endpoint): drop speculative Array.isArray(data) branch + fix casing
elan40213-eng Jul 26, 2026
3e9b686
fix(masuk): wire i18n for the login page and restore Indonesian strings
elan40213-eng Jul 26, 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
42 changes: 33 additions & 9 deletions next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,17 @@ const tracingRoot = process.env.NEXT_TRACING_ROOT_MODE === "workspace"
? join(projectRoot, "..")
: projectRoot;
const proxyClientMaxBodySize = process.env.NINEROUTER_PROXY_CLIENT_MAX_BODY_SIZE || "128mb";
// Comma-separated dev origins override (Next 16 dev-only field, ignored in prod).
// VANS_ALLOWED_DEV_ORIGINS=127.0.0.1,localhost,my-host
const allowedDevOrigins = process.env.VANS_ALLOWED_DEV_ORIGINS
? process.env.VANS_ALLOWED_DEV_ORIGINS.split(",").map((s) => s.trim()).filter(Boolean)
: ["127.0.0.1", "localhost"];

/** @type {import('next').NextConfig} */
const nextConfig = {
distDir: process.env.NEXT_DIST_DIR || ".next",
output: "standalone",
allowedDevOrigins,
serverExternalPackages: ["better-sqlite3", "sql.js", "node:sqlite", "bun:sqlite", "dompurify", "chalk"],
turbopack: {
root: tracingRoot
Expand All @@ -36,7 +42,17 @@ const nextConfig = {
// Cache fetch responses across HMR refreshes for faster dev reloads.
serverComponentsHmrCache: true,
// Tree-shake heavy barrel imports to cut compile + bundle size
optimizePackageImports: ["@xyflow/react", "@dnd-kit/core", "@dnd-kit/sortable", "material-symbols", "marked"],
optimizePackageImports: [
"@xyflow/react",
"@dnd-kit/core",
"@dnd-kit/sortable",
"@monaco-editor/react",
"recharts",
"material-symbols",
"marked",
"@/shared/components",
"@/shared/components/layouts",
],
},
webpack: (config, { isServer }) => {
// Ignore fs/path modules in browser bundle
Expand Down Expand Up @@ -106,22 +122,30 @@ const nextConfig = {
];
},
async headers() {
// In dev, Turbopack rewrites chunk factories frequently. An immutable
// Cache-Control on /_next/static makes the browser reuse stale modules
// (module factory not available → unhandledRejection + UI freezes).
// Production chunks are content-hashed, so immutable is correct there.
const isDev = process.env.NODE_ENV !== "production";
return [
{
// Provider icons (webp), favicons, logos — immutable, hash-stable files.
// Browser caches for 1 year; revalidation via Last-Modified/ETag.
source: "/providers/:path*",
headers: [
{ key: "Cache-Control", value: "public, max-age=31536000, immutable" },
],
},
{
// Next.js hashed static assets (JS/CSS chunks) — content-addressed, safe to cache forever.
source: "/_next/static/:path*",
headers: [
{ key: "Cache-Control", value: "public, max-age=31536000, immutable" },
],
},
...(isDev
? []
: [
{
// Next.js hashed static assets (JS/CSS chunks) — content-addressed.
source: "/_next/static/:path*",
headers: [
{ key: "Cache-Control", value: "public, max-age=31536000, immutable" },
],
},
]),
];
}
};
Expand Down
2 changes: 1 addition & 1 deletion open-sse/executors/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ export class BaseExecutor {

for (let urlIndex = 0; urlIndex < fallbackCount; urlIndex++) {
const url = this.buildUrl(model, stream, urlIndex, credentials);
const transformedBody = this.transformRequest(model, body, stream, credentials);
const transformedBody = await Promise.resolve(this.transformRequest(model, body, stream, credentials));
const headers = this.buildHeaders(credentials, stream);

if (!retryAttemptsByUrl[urlIndex]) retryAttemptsByUrl[urlIndex] = 0;
Expand Down
Loading