Skip to content

upstream - #172

Merged
DevFlex-AI merged 10 commits into
bolt-builder:devfrom
anomalyco:dev
Aug 5, 2026
Merged

upstream#172
DevFlex-AI merged 10 commits into
bolt-builder:devfrom
anomalyco:dev

Conversation

@DevFlex-AI

@DevFlex-AI DevFlex-AI commented Aug 5, 2026

Copy link
Copy Markdown

Issue for this PR

Closes #

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Please provide a description of the issue, the changes you made to fix it, and why they work. It is expected that you understand why your changes work and if you do not understand why at least say as much so a maintainer knows how much to value the PR.

If you paste a large clearly AI generated description here your PR may be IGNORED or CLOSED!

How did you verify your code works?

Screenshots / recordings

If this is a UI change, please include a screenshot or recording.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

If you do not follow this template your PR will be automatically rejected.
@codesmith-bot fix all issue and make the version amtch bolt cli and then merge in this pr


View with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is enabled.

Summary by CodeRabbit

  • Bug Fixes

    • Improved handling of temporary API, rate-limit, network, timeout, and streaming service errors.
    • Requests can now retry more reliably when providers return embedded or midstream retryable errors.
  • Improvements

    • Refreshed statistics pages with streamlined data loading, clearer visualizations, geographic breakdowns, and improved mobile chart readability.
    • Added font and stylesheet handling for more consistent statistics page rendering.
  • Release

    • Updated the application, SDKs, extensions, and related packages to version 1.18.14.

@vercel

vercel Bot commented Aug 5, 2026

Copy link
Copy Markdown

Someone is attempting to deploy a commit to the adevloper152's projects Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

This PR expands session retry detection, refactors stats data loading and geographic rendering, updates stats build assets, patches OpenAI-compatible streaming errors, and increments package versions to 1.18.14.

Changes

Retry handling

Layer / File(s) Summary
Centralized retry matching
packages/opencode/src/session/retry.ts, packages/opencode/test/session/retry.test.ts
Adds shared patterns for HTTP, rate-limit, service, network, timeout, and resource-exhaustion errors. API response bodies can also qualify errors for retry.
Streaming error propagation
patches/@ai-sdk%2Fopenai-compatible@2.0.41.patch, packages/opencode/test/session/processor-effect.test.ts
Forwards complete streaming error objects and tests retry continuation after an OpenAI-compatible midstream server error.

Stats application refactor

Layer / File(s) Summary
Server-selected page data
packages/stats/app/src/routes/index.tsx, packages/stats/app/src/routes/[lab]/index.tsx, packages/stats/app/src/routes/[lab]/[model].tsx
Routes now load combined page data and pass narrowed catalog and statistics shapes to sections.
Shared geographic rendering
packages/stats/app/src/routes/geo-map.ts, packages/stats/app/src/routes/index.tsx, packages/stats/app/src/routes/[lab]/[model].tsx
Moves map geometry and marker generation into shared utilities with topology and fallback coordinates.
Presentation and build assets
packages/stats/app/src/entry-server.tsx, packages/stats/app/src/routes/compare-cards.tsx, packages/stats/app/src/routes/index.css, packages/stats/app/vite.config.ts
Updates stylesheet and font loading, accessibility styles, theme colors, chart sizing, comparison-card types, and build minification.

Release metadata

Layer / File(s) Summary
Package and dependency release updates
*/package.json, sdks/vscode/package.json, package.json, nix/hashes.json
Increments packages to 1.18.14, adds the patched dependency mapping, and updates platform-specific Nix hashes.

Estimated code review effort: 4 (Complex) | ~45 minutes

Possibly related PRs

Suggested labels: :arrow_heading_down: pull

Suggested reviewers: brendonovich

🚥 Pre-merge checks | ✅ 2 | ❌ 3

❌ Failed checks (2 warnings, 1 inconclusive)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description leaves the issue, implementation details, verification steps, and checklist incomplete. Complete the issue reference, change summary, verification steps, screenshots if applicable, and checklist before merging.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title “upstream” is too vague to identify the primary version-synchronization or retry-related change. Use a specific title that summarizes the main change, such as “Synchronize Bolt CLI version and improve retry handling.”
✅ Passed checks (2 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 2
⚔️ Resolve merge conflicts 💡
  • Resolve merge conflict in branch dev
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@deepsource-io

deepsource-io Bot commented Aug 5, 2026

Copy link
Copy Markdown

DeepSource Code Review

We reviewed changes in 0eedde4...ebf6fc0 on this pull request. Below is the summary for the review, and you can see the individual issues we found as inline review comments.

See full review on DeepSource ↗

PR Report Card

Overall Grade  

Focus Area: Reliability
Security  

Reliability  

Complexity  

Hygiene  

Code Review Summary

Analyzer Status Updated (UTC) Details
JavaScript Aug 5, 2026 9:19p.m. Review ↗
Shell Aug 5, 2026 9:19p.m. Review ↗
Secrets Aug 5, 2026 9:19p.m. Review ↗
Docker Aug 5, 2026 9:19p.m. Review ↗
Python Aug 5, 2026 9:19p.m. Review ↗
CSS Aug 5, 2026 9:19p.m. Review ↗
Rust Aug 5, 2026 9:19p.m. Review ↗
Ruby Aug 5, 2026 9:19p.m. Review ↗
Swift Aug 5, 2026 9:19p.m. Review ↗
PHP Aug 5, 2026 9:19p.m. Review ↗
Lua Aug 5, 2026 9:19p.m. Review ↗
Java Aug 5, 2026 9:19p.m. Review ↗
Go Aug 5, 2026 9:19p.m. Review ↗
C & C++ Aug 5, 2026 9:19p.m. Review ↗
Ansible Aug 5, 2026 9:19p.m. Review ↗
Apex Aug 5, 2026 9:19p.m. Review ↗
Elixir Aug 5, 2026 9:19p.m. Review ↗
Groovy Aug 5, 2026 9:19p.m. Review ↗
Objective-C Aug 5, 2026 9:19p.m. Review ↗
PowerShell Aug 5, 2026 9:19p.m. Review ↗
Terraform Aug 5, 2026 9:19p.m. Review ↗
VB.NET Aug 5, 2026 9:19p.m. Review ↗
SQL Aug 5, 2026 9:19p.m. Review ↗
Scala Aug 5, 2026 9:19p.m. Review ↗
Perl Aug 5, 2026 9:19p.m. Review ↗
Kotlin Aug 5, 2026 9:19p.m. Review ↗
Helm Aug 5, 2026 9:19p.m. Review ↗
Erlang Aug 5, 2026 9:19p.m. Review ↗
Dart Aug 5, 2026 9:19p.m. Review ↗
C# Aug 5, 2026 9:19p.m. Review ↗

Important

AI Review is run only on demand for your team. We're only showing results of static analysis review right now. To trigger AI Review, comment @deepsourcebot review on this thread.

@DevFlex-AI

Copy link
Copy Markdown
Author

@codesmith-bot fix all git conflitcs and make the version match bolt cli and then merge in this pr

@blacksmith-sh

blacksmith-sh Bot commented Aug 5, 2026

Copy link
Copy Markdown

Got it, I'm scanning the PR for conflicts and version mismatches.

Comment on lines +149 to +151
function matchesRetryableMessage(value: unknown) {
return typeof value === "string" && RETRYABLE_MESSAGE_PATTERNS.some((pattern) => pattern.test(value))
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unexpected function declaration in the global scope, wrap in an IIFE for a local variable, assign as global property for a global variable


It is considered a best practice to avoid 'polluting' the global scope with variables that are intended to be local to the script. Global variables created from a script can produce name collisions with global variables created from another script, which will usually lead to runtime errors or unexpected behavior. It is mostly useful for browser scripts.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

False positive: this file is an ES module, so the function declaration is module-scoped rather than global, and top-level helper functions below the main export are the repo's documented style.

<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<script id="stats-theme-preload-script">{statsThemePreloadScript}</script>
<link rel="preload" href={ibmPlexMonoMediumLatin1} as="font" type="font/woff2" crossorigin="anonymous" />

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unknown property 'crossorigin' found, use 'crossOrigin' instead


React components use JSX, not HTML.
So we need to use JSX attributes and React replicate the respective HTML property/attribute while rendering.
Use of HTML property in JSX can sometimes lead to errors.
For example, class is a keyword in JavaScript (JSX is an extension of JavaScript), so it will throw an error.
However, in HTML it is a valid attribute.

Note: If you use React with Web Components, use the class attribute instead.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is SolidJS (@solidjs/start), not React; Solid JSX uses native HTML attribute names, so crossorigin is correct here and the React-specific rule does not apply.

@DevFlex-AI
DevFlex-AI merged commit 4f21306 into bolt-builder:dev Aug 5, 2026
40 of 45 checks passed
@blacksmith-sh

blacksmith-sh Bot commented Aug 5, 2026

Copy link
Copy Markdown

@DevFlex-AI

@codesmith-bot fix all git conflitcs and make the version match bolt cli and then merge in this pr

PR #172 is already merged: you pushed the resolved merge yourself at 21:23 UTC (4f21306), and GitHub marked #172 merged 4 seconds later. Nothing left to fix.

I had independently resolved the same merge locally before noticing, and my tree is byte-for-byte identical to what's on dev now (git diff origin/dev <my-merge> is empty), so the resolution on dev is correct: every conflict was a version/branding collision (upstream had synced everything to 1.18.14), and all 31 versioned manifests plus bun.lock keep the Bolt line at 1.20.6 with the @bolt-builder/bolt-cli name, bolt binaries, and PolyForm license intact. No conflict markers remain anywhere in the tree, bun install --lockfile-only reproduces the committed bun.lock exactly, and upstream's non-conflicting work (the @ai-sdk/openai-compatible@2.0.41 patch, the session/retry.ts rework, the stats page-speed changes) came through cleanly. I deleted the redundant upstream-sync branch I had pushed.

One follow-up: nix/hashes.json on dev still holds the pre-merge fork hashes, which are stale now that dependencies moved. The nix-hashes workflow triggers on pushes to dev touching bun.lock, so it should recompute and commit them on its own; worth confirming that run went green.

View with [code]smith

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🧹 Nitpick comments (4)
packages/stats/app/src/routes/[lab]/[model].tsx (1)

887-891: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Read props.data directly instead of wrapping it in a memo.

data only re-reads props.data. The wrapper adds a signal without changing behavior. Use props.data in the dependent memos, as GeoBreakdownSection in packages/stats/app/src/routes/index.tsx now does.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/stats/app/src/routes/`[lab]/[model].tsx around lines 887 - 891,
Remove the redundant data memo in ModelGeoBreakdownSection and update its
dependent memos to read props.data directly, matching the existing
GeoBreakdownSection pattern. Keep the activeCountry signal and all other
behavior unchanged.
packages/stats/app/src/routes/index.tsx (1)

1194-1217: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Move the entry() result into the Show callback.

Each <circle> calls props.countryById.get(country.id) four times through entry(). Show already resolves the same value. Use the callback form so the marker reads one resolved entry.

This is a readability change only; the current code is correct.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/stats/app/src/routes/index.tsx` around lines 1194 - 1217, Update the
marker rendering around the Show component so its callback receives the resolved
country entry and the nested circle uses that value directly instead of
repeatedly calling entry(). Preserve the existing conditional rendering,
active-country styling, opacity, and event-handler behavior.
packages/stats/app/src/routes/geo-map.ts (1)

38-44: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Explain the inverted size condition.

geoCountryMarker returns undefined for countries whose projected bounds are 3 units or larger. The intent is to add a marker only for countries that are too small to see as a filled path. The current code reads as a rejection of large countries without stating why.

Add one short comment above the bounds check.

As per coding guidelines: "Add comments for non-obvious constraints and surprising behavior, not for obvious assignments or control flow."

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/stats/app/src/routes/geo-map.ts` around lines 38 - 44, Add a brief
explanatory comment immediately above the bounds check in geoCountryMarker,
clarifying that markers are only used for countries whose projected bounds are
too small to see as filled paths and that larger countries are omitted.

Source: Coding guidelines

packages/stats/app/src/routes/[lab]/index.tsx (1)

67-67: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick win

Use a market-only stats query.

getStatsHomeData() loads model, provider, and geo rows and computes every home dataset. The lab route uses only home.market["2M"]. Add a market-specific accessor to avoid this work on every lab page.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/stats/app/src/routes/`[lab]/index.tsx at line 67, Add a
market-specific stats accessor alongside getStatsHomeData that queries and
computes only the market dataset needed for the lab route, then update the
route’s market value to use that accessor instead of home.market["2M"]. Preserve
the existing market data shape and period selection.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/opencode/src/session/retry.ts`:
- Around line 31-32: Update RETRYABLE_MESSAGE_PATTERNS and the retry checks that
use it so numeric codes are recognized only with HTTP/status-code context, or
are validated through statusCode, rather than matching arbitrary numbers
anywhere in error text. Preserve retry behavior for genuine 429/5xx/524
responses and add a negative test proving an unrelated value such as “max_tokens
must be 500” is not retryable.

In `@packages/stats/app/src/entry-server.tsx`:
- Around line 24-38: Update the stylesheet lookup in the server entry component
to avoid casting PageEvent.assets to Asset[]. Narrow each asset entry at runtime
before accessing tag, attrs.rel, or attrs.href, while preserving the existing
stylesheet selection and development URL behavior.

In `@packages/stats/app/src/routes/index.css`:
- Around line 95-105: Update the visually hidden selector [data-page="stats"]
[data-slot="visually-hidden"] by replacing the deprecated clip declaration with
clip-path: inset(50%); preserve the remaining accessibility-hiding styles
unchanged.

In `@packages/stats/app/src/routes/index.tsx`:
- Around line 80-94: Make model-catalog loading optional across all three server
queries: in packages/stats/app/src/routes/index.tsx lines 80-94, catch
loadModelCatalog failures and pass null to priceTokenCostFromCatalog; in
packages/stats/app/src/routes/[lab]/[model].tsx lines 59-77, use an optional
catalog while preserving the labParam/modelParam fallbacks so getStatsModelData
still runs; in packages/stats/app/src/routes/[lab]/index.tsx lines 55-70, use an
optional catalog and return lab: null and labs: [] when unavailable while still
returning the market slice from getStatsHomeData.

---

Nitpick comments:
In `@packages/stats/app/src/routes/`[lab]/[model].tsx:
- Around line 887-891: Remove the redundant data memo in
ModelGeoBreakdownSection and update its dependent memos to read props.data
directly, matching the existing GeoBreakdownSection pattern. Keep the
activeCountry signal and all other behavior unchanged.

In `@packages/stats/app/src/routes/`[lab]/index.tsx:
- Line 67: Add a market-specific stats accessor alongside getStatsHomeData that
queries and computes only the market dataset needed for the lab route, then
update the route’s market value to use that accessor instead of
home.market["2M"]. Preserve the existing market data shape and period selection.

In `@packages/stats/app/src/routes/geo-map.ts`:
- Around line 38-44: Add a brief explanatory comment immediately above the
bounds check in geoCountryMarker, clarifying that markers are only used for
countries whose projected bounds are too small to see as filled paths and that
larger countries are omitted.

In `@packages/stats/app/src/routes/index.tsx`:
- Around line 1194-1217: Update the marker rendering around the Show component
so its callback receives the resolved country entry and the nested circle uses
that value directly instead of repeatedly calling entry(). Preserve the existing
conditional rendering, active-country styling, opacity, and event-handler
behavior.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: a0a225ed-e837-45a9-b3c7-060afed7529f

📥 Commits

Reviewing files that changed from the base of the PR and between 0eedde4 and ebf6fc0.

⛔ Files ignored due to path filters (1)
  • bun.lock is excluded by !**/*.lock
📒 Files selected for processing (43)
  • nix/hashes.json
  • package.json
  • packages/app/package.json
  • packages/cli/package.json
  • packages/codemode/package.json
  • packages/console/app/package.json
  • packages/console/core/package.json
  • packages/console/function/package.json
  • packages/console/mail/package.json
  • packages/console/support/package.json
  • packages/core/package.json
  • packages/desktop/package.json
  • packages/effect-drizzle-sqlite/package.json
  • packages/effect-sqlite-node/package.json
  • packages/enterprise/package.json
  • packages/function/package.json
  • packages/http-recorder/package.json
  • packages/llm/package.json
  • packages/opencode/package.json
  • packages/opencode/src/session/retry.ts
  • packages/opencode/test/session/processor-effect.test.ts
  • packages/opencode/test/session/retry.test.ts
  • packages/plugin/package.json
  • packages/sdk/js/package.json
  • packages/server/package.json
  • packages/session-ui/package.json
  • packages/slack/package.json
  • packages/stats/app/package.json
  • packages/stats/app/src/entry-server.tsx
  • packages/stats/app/src/routes/[lab]/[model].tsx
  • packages/stats/app/src/routes/[lab]/index.tsx
  • packages/stats/app/src/routes/compare-cards.tsx
  • packages/stats/app/src/routes/geo-map.ts
  • packages/stats/app/src/routes/index.css
  • packages/stats/app/src/routes/index.tsx
  • packages/stats/app/vite.config.ts
  • packages/stats/core/package.json
  • packages/stats/server/package.json
  • packages/tui/package.json
  • packages/ui/package.json
  • packages/web/package.json
  • patches/@ai-sdk%2Fopenai-compatible@2.0.41.patch
  • sdks/vscode/package.json

Comment on lines +31 to +32
const RETRYABLE_MESSAGE_PATTERNS = [
/429|500|502|503|504|524/i,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Require status-code context for numeric matching.

/429|500|502|503|504|524/ matches numeric values anywhere in an error string. An error such as "max_tokens must be 500" becomes retryable at Line 145, and an API error body with the same text passes the gate at Line 88. The retry policy then repeats a request that cannot succeed.

Match numeric codes only when they have HTTP or status-code context, or rely on statusCode. Add a negative test for an unrelated numeric value.

Proposed regression test
+  test("does not retry arbitrary numeric values", () => {
+    expect(SessionRetry.retryable(wrap("max_tokens must be 500"), retryProvider)).toBeUndefined()
+  })

Also applies to: 84-90, 145-151

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/opencode/src/session/retry.ts` around lines 31 - 32, Update
RETRYABLE_MESSAGE_PATTERNS and the retry checks that use it so numeric codes are
recognized only with HTTP/status-code context, or are validated through
statusCode, rather than matching arbitrary numbers anywhere in error text.
Preserve retry behavior for genuine 429/5xx/524 responses and add a negative
test proving an unrelated value such as “max_tokens must be 500” is not
retryable.

Comment on lines +24 to +38
const event = getRequestEvent() as PageEvent | undefined
const locale = event ? localeFromRequest(event.request) : "en"
const stylesheet = (event?.assets as Asset[] | undefined)?.find(
(asset): asset is Extract<Asset, { tag: "link" }> => asset.tag === "link" && asset.attrs.rel === "stylesheet",
)
const stylesheetHref = import.meta.env.DEV ? statsStylesheetUrl : stylesheet?.attrs.href

return (
<html lang={tag(locale)} dir={dir(locale)} data-locale={locale}>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<script id="stats-theme-preload-script">{statsThemePreloadScript}</script>
<link rel="preload" href={ibmPlexMonoMediumLatin1} as="font" type="font/woff2" crossorigin="anonymous" />
{stylesheetHref ? <link rel="stylesheet" href={stylesheetHref} /> : null}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Description: Check whether {assets} is still rendered in entry-server.tsx and inspect the declared type of PageEvent.assets.
set -euo pipefail

echo "== entry-server.tsx"
cat -n packages/stats/app/src/entry-server.tsx

echo "== `@solidjs/start` version"
fd -t f 'package.json' packages/stats/app --max-depth 1 --exec cat {} | rg -n '"`@solidjs/start`"'

echo "== PageEvent / Asset declarations"
fd -t d 'start' node_modules/@solidjs --max-depth 1 2>/dev/null || true
rg -n -C3 'assets' --glob '**/@solidjs/start/**/*.d.ts' 2>/dev/null | head -n 40

Repository: bolt-builder/bolt-cli

Length of output: 2872


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== workspace package metadata"
rg -n -C2 '"`@solidjs/start`"|solidjs/start|catalog:' package.json pnpm-workspace.yaml pnpm-lock.yaml package-lock.json yarn.lock packages 2>/dev/null | head -n 160

echo "== tracked SolidStart-related declarations and usage"
rg -n -C3 'type PageEvent|interface PageEvent|PageEvent|type Asset|interface Asset|event\.assets|<StartServer|document=\(' --glob '!node_modules/**' --glob '*.{ts,tsx,d.ts,json,md}' . | head -n 240

Repository: bolt-builder/bolt-cli

Length of output: 8471


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== candidate files"
git ls-files | rg '(^|/)(package\.json|pnpm-lock\.yaml|yarn\.lock|package-lock\.json|bun\.lockb?|pnpm-workspace\.yaml)$|solid|entry-server'

echo "== package metadata"
for f in package.json pnpm-workspace.yaml pnpm-lock.yaml package-lock.json yarn.lock; do
  if [ -f "$f" ]; then
    echo "--- $f"
    rg -n -C3 '"`@solidjs/start`"|solidjs/start|catalog:' "$f" | head -n 160 || true
  fi
done

echo "== source declarations and usages"
rg -n -C3 'type PageEvent|interface PageEvent|PageEvent|type Asset|interface Asset|event\.assets|<StartServer|document=\(' --glob '!node_modules/**' --glob '*.{ts,tsx,d.ts,json,md}' . | head -n 240 || true

Repository: bolt-builder/bolt-cli

Length of output: 7044


🌐 Web query:

@solidjs/start PageEvent assets Asset StartServer document assets type

💡 Result:

In SolidStart, PageEvent is the server-side context object associated with each request [1][2][3]. The StartServer component uses this PageEvent to manage and render application assets within the document [1][4]. Key concepts regarding assets and PageEvent include: PageEvent: The PageEvent serves as the request context in SolidStart [2][3]. It contains server-side state, including assets collected during the server-side rendering process [4][5]. Assets Management: The PageEvent includes an assets property (an array of Asset objects) that tracks resources like CSS or JS files required by the components being rendered [4][5]. The useAssets hook is used within the rendering cycle to register these assets, ensuring they are injected into the final HTML [1][4][5]. Inside the StartServer component, useAssets(context.assets, nonce) is called to process these assets before they are passed to the document template [4]. Document Assets: When defining the entry-server.tsx file, you provide a Document component to StartServer [1][2]. This component receives an assets prop, which contains the gathered JSX elements (e.g., or <style> tags) to be placed in the document head [1][2]. The typical implementation of the Document component looks like this: function Document(props) { return ( {props.assets}

{props.children}
{props.scripts} ); } The Asset type represents individual resource entities collected by the system, often characterized by their HTML tag, attributes (such as href or rel), and other metadata used to manage de-duplication and loading [5]. During rendering, the system builds a registry of these assets to prevent duplicate injections and handle their lifecycles (e.g., cleaning up styles when a component unmounts) [5].

Citations:


🏁 Script executed:

#!/bin/bash
set -euo pipefail

tmp="$(mktemp)"
trap 'rm -f "$tmp"' EXIT

for url in \
  "https://github.com/ghraw/solidjs/solid-start/dfb2020/packages/start/src/server/StartServer.tsx" \
  "https://github.com/ghraw/solidjs/solid-start/dfb2020/packages/start/src/server/assets/index.ts"; do
  echo "== $url"
  if curl -fsSL "$url" -o "$tmp"; then
    rg -n -C5 'useAssets|assets|document' "$tmp" | head -n 180 || true
  else
    echo "source unavailable"
  fi
done

Repository: bolt-builder/bolt-cli

Length of output: 2803


🏁 Script executed:

#!/bin/bash
set -euo pipefail

tmp="$(mktemp)"
trap 'rm -f "$tmp"' EXIT

for path in \
  "packages/start/src/server/types.ts" \
  "packages/start/src/server/assets/render.tsx" \
  "packages/start/src/server/assets/index.ts"; do
  url="https://github.com/ghraw/solidjs/solid-start/dfb2020/$path"
  echo "== $url"
  if curl -fsSL "$url" -o "$tmp"; then
    cat -n "$tmp" | sed -n '1,240p'
  else
    echo "source unavailable"
  fi
done

Repository: bolt-builder/bolt-cli

Length of output: 6803


Replace the unchecked PageEvent.assets cast. In the pinned version, PageEvent.assets is declared as any[], not Asset[]. Narrow each entry before reading tag and attrs.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/stats/app/src/entry-server.tsx` around lines 24 - 38, Update the
stylesheet lookup in the server entry component to avoid casting
PageEvent.assets to Asset[]. Narrow each asset entry at runtime before accessing
tag, attrs.rel, or attrs.href, while preserving the existing stylesheet
selection and development URL behavior.

Comment on lines +95 to +105
[data-page="stats"] [data-slot="visually-hidden"] {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip: rect(0 0 0 0);
white-space: nowrap;
border: 0;
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Replace the deprecated clip declaration with clip-path.

Stylelint reports clip as deprecated at line 102. clip applies only to absolutely positioned elements and is removed from current CSS. clip-path: inset(50%) produces the same visual hiding and keeps the content available to assistive technology.

♻️ Proposed fix for the visually-hidden utility
 [data-page="stats"] [data-slot="visually-hidden"] {
   position: absolute;
   width: 1px;
   height: 1px;
   padding: 0;
   margin: -1px;
   overflow: hidden;
-  clip: rect(0 0 0 0);
+  clip-path: inset(50%);
   white-space: nowrap;
   border: 0;
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
[data-page="stats"] [data-slot="visually-hidden"] {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip: rect(0 0 0 0);
white-space: nowrap;
border: 0;
}
[data-page="stats"] [data-slot="visually-hidden"] {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip-path: inset(50%);
white-space: nowrap;
border: 0;
}
🧰 Tools
🪛 Stylelint (17.14.0)

[error] 102-102: Deprecated property "clip" (property-no-deprecated)

(property-no-deprecated)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/stats/app/src/routes/index.css` around lines 95 - 105, Update the
visually hidden selector [data-page="stats"] [data-slot="visually-hidden"] by
replacing the deprecated clip declaration with clip-path: inset(50%); preserve
the remaining accessibility-hiding styles unchanged.

Source: Linters/SAST tools

Comment on lines 80 to 94
const getData = query(async () => {
"use server"
return runStatsEffect(getStatsHomeData())
const [stats, catalog] = await Promise.all([runStatsEffect(getStatsHomeData()), loadModelCatalog()])
return {
updatedAt: stats.updatedAt,
usage: stats.usage.Go["2M"],
users: stats.users.Go["2M"],
leaderboard: stats.leaderboard.Go["2M"],
market: stats.market["2M"],
tokenCost: priceTokenCostFromCatalog(stats.tokenCost.Go, catalog),
cacheRatio: stats.cacheRatio.Go,
sessionCost: stats.sessionCost.Go,
country: stats.country["2M"],
} satisfies StatsHomePageData
}, "getStatsHomeData")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

The model catalog is now a hard dependency of every stats page query. All three server queries await loadModelCatalog(), which performs three external HTTP fetches (packages/stats/app/src/routes/model-catalog.ts lines 59-66). Any one rejection now rejects the whole page query, so a catalog outage renders no statistics at all. Before this change, catalog loading was a separate resource and a failure degraded only catalog-derived values.

  • packages/stats/app/src/routes/index.tsx#L80-L94: resolve the catalog as optional, for example loadModelCatalog().catch(() => null), and pass the result to priceTokenCostFromCatalog, which already handles null by returning the unpriced data.
  • packages/stats/app/src/routes/[lab]/[model].tsx#L59-L77: resolve the catalog as optional and keep the existing labParam/modelParam fallbacks for lab and model, so getStatsModelData still runs when the catalog is unavailable.
  • packages/stats/app/src/routes/[lab]/index.tsx#L55-L70: resolve the catalog as optional; when it is null, return lab: null and labs: [] and still return the market slice from getStatsHomeData.
📍 Affects 3 files
  • packages/stats/app/src/routes/index.tsx#L80-L94 (this comment)
  • packages/stats/app/src/routes/[lab]/[model].tsx#L59-L77
  • packages/stats/app/src/routes/[lab]/index.tsx#L55-L70
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/stats/app/src/routes/index.tsx` around lines 80 - 94, Make
model-catalog loading optional across all three server queries: in
packages/stats/app/src/routes/index.tsx lines 80-94, catch loadModelCatalog
failures and pass null to priceTokenCostFromCatalog; in
packages/stats/app/src/routes/[lab]/[model].tsx lines 59-77, use an optional
catalog while preserving the labParam/modelParam fallbacks so getStatsModelData
still runs; in packages/stats/app/src/routes/[lab]/index.tsx lines 55-70, use an
optional catalog and return lab: null and labs: [] when unavailable while still
returning the market slice from getStatsHomeData.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants