Skip to content

fix(i18n,build): /home route provider + pack-artifact bun execution (#16321) - #16323

Merged
diegosouzapw merged 3 commits into
cheaper-inference:release/v3.8.52from
opensource-elearning:fix/i18n-home-route-and-pack-artifact-bun
Oct 15, 2026
Merged

diegosouzapw merged 3 commits into
cheaper-inference:release/v3.8.52from
opensource-elearning:fix/i18n-home-route-and-pack-artifact-bun

Conversation

@opensource-elearning

Copy link
Copy Markdown
Contributor

Summary

Two production-only defects reported together in #16321, each with a regression test.

Fix Symptom Root cause
Mount the /home route i18n provider Dashboard home and its sponsor banners log MISSING_MESSAGE: cheaperInferenceSponsorBanner / vscodeCopilotBanner / home (en) on every visit /dashboard redirects to /home, but only (dashboard)/dashboard/layout.tsx mounted SectionI18nProvider; (dashboard)/home/ had no layout, so the route inherited the chrome-only provider. Nested next-intl providers replace the message set, they do not merge
Resolve npm-cli.js before spawning npm bun run check:pack-artifact fails with ... /home/temp/.bun/bin/bun:1 followed by raw ELF bytes The validator treated process.env.npm_execpath as a JS entry point, but bun run sets it to the bare bun binary, so it executed node /path/to/bun … and Node dumped the executable

Issues addressed

What was happening

1. /home had no catalog of its own

src/app/(dashboard)/dashboard/page.tsx only redirect("/home"); the real page is
src/app/(dashboard)/home/page.tsx, which renders HomePageClient, KimiSponsorBanner,
CheaperInferenceSponsorBanner, VscodeCopilotBanner, NewsBanner, FirstRunReadinessCard.

The generated map already had a complete home namespace set — but only
(dashboard)/dashboard/layout.tsx (the redirect route) mounted it. The /home route fell
through to the dashboard root layout (routeNamespaces.chrome), and chrome deliberately
excludes home and every banner namespace. Since nested NextIntlClientProviders replace the
message set, those namespaces were simply absent at render time.

The key-completeness check still passed because the messages exist in the catalogs — they were
never serialized into the /home flight payload.

2. The validator ran node <bun>

const npmExecPath = process.env.npm_execpath;
const isBunRuntime = "Bun" in globalThis;
const command = npmExecPath && !isBunRuntime ? process.execPath : npmCommand;
const commandArgs = npmExecPath && !isBunRuntime ? [npmExecPath, ...args] : args;

isBunRuntime is evaluated in the script's process. The npm script is
node --import tsx scripts/build/validate-pack-artifact.ts, so even under bun run the script
runs on Node — "Bun" in globalThis is false — while npm_execpath points at the Bun binary.
The result was node /home/temp/.bun/bin/bun run build:cli, and Node printed the ELF header into
the validator's error message.

Changes

Commit 1 — fix(i18n): mount /home route provider …

  • scripts/i18n/lib/routeNamespacesAnalyzer.mjs — the home set is now the union of the
    dashboard/ companion files and the real (dashboard)/home/ route directory.
  • scripts/i18n/generate-route-namespaces.mjs — also emits the /home provider layout.
  • src/app/(dashboard)/home/layout.tsx — new generated SectionI18nProvider for /home.
  • src/i18n/routeNamespaces.generated.json — regenerated (usage added to home).
  • tests/unit/i18n-route-namespaces.test.ts — asserts the /home layout exists and mounts the
    provider, and documents that the home namespaces are intentionally absent from chrome.

Commit 2 — fix(build): resolve npm-cli.js …

  • scripts/build/resolveNpmEntry.ts — new resolveNpmInvocation(): prefers
    process.execPath <npm-cli.js> (via the existing resolveBundledNpmEntry, [v3.8.50] fix(build): prepublish no longer spawns .cmd shims on Windows #8858) and falls
    back to the plain npm command. It never trusts npm_execpath as a JS entry.
  • scripts/build/validate-pack-artifact.ts — runNpm() uses it instead of the isBunRuntime
    heuristic.
  • tests/unit/build/resolve-npm-invocation.test.ts — 5 cases, including "the bun binary must
    never be passed to node as a script".

Testing

node --import tsx/esm --test tests/unit/i18n-route-namespaces.test.ts      # 7 pass
node --import tsx/esm --test tests/unit/build/resolve-npm-invocation.test.ts \
  tests/unit/build/resolve-npm-entry.test.ts tests/unit/pack-artifact-policy.test.ts  # pass

Real reproduction of the reported failure path (bun runtime, policy-only path):

$ bun run check:pack-policy
📦 npm pack artifact summary
   File:          omniroute-3.8.52.tgz
   Entry count:   4188
   MCP closure:   1578 source files checked
✅ Pack artifact policy check passed.

Before the fix the same invocation reached node <bun-binary> and emitted the …:1 + ELF …
dump from the issue.

Also checked: prettier --check clean on all changed files, check:changelog-integrity OK, and
tsc -p tsconfig.typecheck-dashboard.json reports no errors in the new file (the errors it does
report are pre-existing under src/shared/*).

Notes

  • ⚠️ base-red inherited: 🔴 Release branch not green: release/v3.8.52 #15306 — the release/v3.8.52 tip is currently red for unrelated
    reasons (hung unit/integration gates, MCP audit Vitest shutdown, pack-artifact gate timeout).
    This branch does not touch those surfaces.
  • No authentication or credential files are included in the diff.

diegosouzapw pushed a commit that referenced this pull request Oct 15, 2026
perf(sse): defer two conditional chatCore imports to first use.

Boarded with #16342, #16324, and #16323 on detached `62049e9cb8` (each PR head is an ancestor). Local gates on that tree: file-size OK (chatCore 3932/3938), changelog integrity OK, eslint on the changed files exit 0, focused tests 23/23, typecheck:core exit 0, complexity OK (3038/3218), cognitive complexity OK (1400/1437), docs-counts exit 0 on retry. The open-sse typecheck red is on `copilotAutoModel.ts` and `openai-responses.ts`, byte-identical to the board base. CI Lint is the inherited `executeTargetAttempt.ts` ceiling (1288/1284), a file this PR does not touch, and Build was cancelled. Thanks @opensource-elearning.

⚠️ base-red inherited: #15306
diegosouzapw pushed a commit that referenced this pull request Oct 15, 2026
…16342)

perf(build): enable incremental TypeScript on the four typecheck configs. Build-info files stay gitignored.

Boarded with #16346, #16324, and #16323 on detached `62049e9cb8`. Local gates: file-size OK, changelog integrity OK, eslint on the changed files exit 0, focused tests 23/23, typecheck:core exit 0, complexity OK (3038/3218), cognitive complexity OK (1400/1437), docs-counts exit 0 on retry. CI Lint is the inherited `executeTargetAttempt.ts` ceiling, a file this PR does not touch, and Build was cancelled. Thanks @opensource-elearning.

⚠️ base-red inherited: #15306
diegosouzapw pushed a commit that referenced this pull request Oct 15, 2026
… JWT FATAL (#16320) (#16324)

fix(build,docs): document the expected production-build warnings and suppress the JWT_SECRET FATAL log only during `next build`. POST /api/auth/login still fail-closes when the secret is missing.

Closes #16320

Boarded with #16346, #16342, and #16323 on detached `62049e9cb8`. Focused tests: tests/unit/16320-build-warnings.test.ts 4 pass, tests/unit/build/known-build-warnings.test.ts 7 pass (23/23 across the batch). File-size, changelog integrity, eslint, typecheck:core, complexity (3038/3218), cognitive complexity (1400/1437), and docs-counts (retry) passed. CI Lint is the inherited `executeTargetAttempt.ts` ceiling, a file this PR does not touch, and Build was cancelled. Thanks @opensource-elearning.

⚠️ base-red inherited: #15306
@diegosouzapw
diegosouzapw merged commit a12a0e7 into cheaper-inference:release/v3.8.52 Oct 15, 2026
30 of 51 checks passed
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.

fix(backend): resolve home i18n and Bun packaging failures

2 participants