From e9ef58b1597da6957bfe87fb075fa40f21e7b13b Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Mon, 19 Oct 2026 18:15:03 +0000 Subject: [PATCH 1/2] =?UTF-8?q?=E2=9A=A1=20Bolt:=20Replace=20Math.max=20wi?= =?UTF-8?q?th=20reduce=20to=20prevent=20call=20stack=20errors?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Mihir-Rabari <169349389+Mihir-Rabari@users.noreply.github.com> --- apps/console/src/app/(console)/dashboard/page.tsx | 6 ++++-- apps/console/src/components/console/charts.tsx | 9 ++++++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/apps/console/src/app/(console)/dashboard/page.tsx b/apps/console/src/app/(console)/dashboard/page.tsx index 174e3f92..daeafed5 100644 --- a/apps/console/src/app/(console)/dashboard/page.tsx +++ b/apps/console/src/app/(console)/dashboard/page.tsx @@ -10,7 +10,8 @@ function TrendChart({ values, labels }: { values: number[]; labels?: string[] }) return
; } - const max = Math.max(...values, 1); + // ⚡ Bolt: Avoid spread operator overhead which can cause call stack issues with large arrays. + const max = values.reduce((m, v) => (v > m ? v : m), 1); const linePoints = values .map((value, index) => { const x = (index / Math.max(values.length - 1, 1)) * 100; @@ -44,7 +45,8 @@ function TrendChart({ values, labels }: { values: number[]; labels?: string[] }) } function MeterList({ items }: { items: Array<{ label: string; value: number; hint?: string }> }) { - const max = Math.max(...items.map((i) => i.value), 1); + // ⚡ Bolt: Avoid O(N) intermediate array allocation and spread operator overhead by using a single reduce pass. + const max = items.reduce((currentMax, item) => (item.value > currentMax ? item.value : currentMax), 1); return (
{items.map((item) => ( diff --git a/apps/console/src/components/console/charts.tsx b/apps/console/src/components/console/charts.tsx index c7503339..da17cb96 100644 --- a/apps/console/src/components/console/charts.tsx +++ b/apps/console/src/components/console/charts.tsx @@ -9,7 +9,8 @@ export function MiniBarChart({ values: number[]; className?: string; }) { - const max = Math.max(...values, 1); + // ⚡ Bolt: Avoid spread operator overhead which can cause call stack issues with large arrays. + const max = values.reduce((m, v) => (v > m ? v : m), 1); return (
@@ -36,7 +37,8 @@ export function LinePulse({ return
; } - const max = Math.max(...values, 1); + // ⚡ Bolt: Avoid spread operator overhead which can cause call stack issues with large arrays. + const max = values.reduce((m, v) => (v > m ? v : m), 1); const points = values .map((value, index) => { const x = (index / Math.max(values.length - 1, 1)) * 100; @@ -79,7 +81,8 @@ export function TrendAreaChart({ return
; } - const max = Math.max(...values, 1); + // ⚡ Bolt: Avoid spread operator overhead which can cause call stack issues with large arrays. + const max = values.reduce((m, v) => (v > m ? v : m), 1); const linePoints = values .map((value, index) => { const x = (index / Math.max(values.length - 1, 1)) * 100; From 296addbe29593c848957faf239774367b13aceab Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Mon, 19 Oct 2026 18:24:13 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=E2=9A=A1=20Bolt:=20Replace=20Math.max=20wi?= =?UTF-8?q?th=20reduce=20to=20prevent=20call=20stack=20errors?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Mihir-Rabari <169349389+Mihir-Rabari@users.noreply.github.com> --- apps/web/src/app/page.tsx | 8 ++++---- apps/web/src/app/terms/page.tsx | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/web/src/app/page.tsx b/apps/web/src/app/page.tsx index 30dbfe55..39892cfb 100644 --- a/apps/web/src/app/page.tsx +++ b/apps/web/src/app/page.tsx @@ -179,7 +179,7 @@ export default function LandingPage() {
{/* Code body */}
-
// One endpoint — any model
+
{"// One endpoint — any model"}
const res = await fetch(
@@ -215,12 +215,12 @@ export default function LandingPage() { {/* Response */}
-
// ↳ Auto-routed to cheapest provider
+
{"// ↳ Auto-routed to cheapest provider"}
- model: "gpt-4o" // via OpenAI + model: "gpt-4o" {"// via OpenAI"}
- tokens: 42 // 1 credit deducted + tokens: 42 {"// 1 credit deducted"}
latency: 842ms diff --git a/apps/web/src/app/terms/page.tsx b/apps/web/src/app/terms/page.tsx index c2d9142e..fd13d4b6 100644 --- a/apps/web/src/app/terms/page.tsx +++ b/apps/web/src/app/terms/page.tsx @@ -36,7 +36,7 @@ export default function TermsPage() {

5. Limitation of Liability

-

AI Gateway is provided "as is" without warranties of any kind. We are not liable for indirect, incidental, or consequential damages arising from service use.

+

AI Gateway is provided "as is" without warranties of any kind. We are not liable for indirect, incidental, or consequential damages arising from service use.

6. Contact