Skip to content

feat(build-env): resolve build metadata with a non-Vercel runtime fallback - #64

Merged
RedStar071 merged 11 commits into
mainfrom
claude/dashboard-vercel-deploy-fix-78jniq
Aug 23, 2026
Merged

feat(build-env): resolve build metadata with a non-Vercel runtime fallback#64
RedStar071 merged 11 commits into
mainfrom
claude/dashboard-vercel-deploy-fix-78jniq

Conversation

@RedStar071

@RedStar071 RedStar071 commented Aug 22, 2026

Copy link
Copy Markdown
Member

Adds packages/build-env, resolving version/commit/branch/deploy-channel
from the hosting provider first and the checkout second (matching the
npmx.dev and wolfstar.rocks pattern), and registers it as a Nuxt module
in the dashboard and marketing apps.

Vercel resolves everything at build time. Every other target — a
container image built in CI, a self-hosted node .output/server/index.mjs
— resolves what it can from the checkout and completes the rest from
AGENT_ZERO_BUILD_* at server start, so a non-Vercel deployment still
reports the commit it is actually serving.

Note

Add @agent-zero/build-env package for multi-provider build metadata resolution

  • Introduces a new @agent-zero/build-env package that resolves build metadata (version, commit, branch, env, deploy URLs) from Vercel, Netlify, Cloudflare Pages, GitHub Actions, or self-hosted overrides, with a git-checkout fallback for branch/commit.
  • Adds a Nuxt module (nuxt.ts) that writes resolved metadata to runtimeConfig.public.buildInfo at build time, completes missing fields at server startup via runtimeBuildInfo(), and auto-imports a useBuildInfo() composable.
  • Replaces the static package.json version row in the dashboard sidebar with a new <BuildEnvironment /> component (BuildEnvironment.vue) that renders build time, deploy channel or release version, and an optional commit link.
  • Updates docs and .env.example files for both dashboard and marketing apps with the AGENT_ZERO_BUILD_* override variables and the two-pass resolution model.
  • Risk: removes the old i18n key system.version.label (replaced by system.build group with label, releaseAria, commitAria in en/common.json and it/common.json); any out-of-tree consumers of the old key will break.

Macroscope summarized bd5b087.

RedStar071 and others added 10 commits August 21, 2026 15:38
…lback

Adds packages/build-env, resolving version/commit/branch/deploy-channel
from the hosting provider first and the checkout second (matching the
npmx.dev and wolfstar.rocks pattern), and registers it as a Nuxt module
in the dashboard and marketing apps.

Vercel resolves everything at build time. Every other target — a
container image built in CI, a self-hosted `node .output/server/index.mjs`
— resolves what it can from the checkout and completes the rest from
AGENT_ZERO_BUILD_* at server start, so a non-Vercel deployment still
reports the commit it is actually serving.
Adds BuildEnvironment.vue (mirroring wolfstar.rocks' component of the
same name), rendered in the sidebar below UserMenu: build date, the
release version or deploy channel, and a linked short commit.

Replaces the sidebar's package.json-sourced version with useBuildInfo(),
so version, deploy channel, and commit come from one resolved source
instead of two that could drift. common.version.label becomes
common.build.{label,releaseAria,commitAria} in en/it, with the schema
regenerated.
• Replace unknownRevision sentinel with null for commit and branch fields
• Remove nullable() helper and update BuildInfo type
• Simplify runtime field completion with consistent null coalescing
- Remove absoluteUrlPattern regex and its comment
- No longer needed after recent metadata handling refactor
- Use ufo's withHttps for URL normalization instead of manual regex
- Pass deployment configuration to providers via ProviderOptions
- Support defaultBranch configuration for production branch detection
- Remove `shortCommit` from `BuildInfo` type; compute via `shortenCommit()` function
- Complete null-based revision field handling throughout
- Improve `defaultBranch` parameter passing to providers
- Simplify `package.json` reading with `pkg-types`
- Add normalizeBuildInfo to convert Nuxt's empty string serialization back to null
- Clear stale preview/production URLs when environment classification changes
- Preserve explicit URL schemes instead of always upgrading to https
- Update Turbo cache inputs to include git refs for proper build cache busting
- Remove shortCommit field references; derive via shortenCommit() on-demand
Signed-off-by: RedStar <redstar071@proton.me>
…shot

The dashboard's Vercel build failed in Nitro's `node-externals` pass with
`ENOENT: realpath` on
`node_modules/.aube/@better-auth+drizzle-adapter@1.6.26_.../node_modules/drizzle-orm`.

Both `@better-auth/drizzle-adapter` snapshots in `pnpm-lock.yaml` listed their
`drizzle-orm` peer as

    drizzle-orm@0.45.2(...)(prisma@7.9.1)(sql.js@1.14.2)

while the only `drizzle-orm@0.45.2` snapshot the lockfile defines — and the one
already embedded in each adapter's own snapshot key — is

    drizzle-orm@0.45.2(...)(prisma@7.9.1(better-sqlite3@12.11.1))(sql.js@1.14.2)

The referenced peer variant has no snapshot entry, so the installer linked the
adapter's `drizzle-orm` at a store path it never materialized. `packages/auth`
imports `drizzleAdapter`, so Nitro traces into it and the dangling link aborts
the build; `apps/marketing` never reaches better-auth, which is why only the
dashboard deploy failed while marketing stayed green on the same commits.

Both references now name the snapshot that exists, matching the peer id each
adapter's snapshot key already carries. After the change the set of unresolved
snapshot references in the lockfile is identical to `main`'s.

Verified with a frozen install followed by
`NITRO_PRESET=vercel turbo run build --filter=@agent-zero/dashboard`, which now
completes and writes `.vercel/output`.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SjNmQ7vt3nXuoeyAbrF7Nj
@vercel

vercel Bot commented Aug 22, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
agent-zero-dashboard Ready Ready Preview Aug 22, 2026 5:49pm
agent-zero-docs Error Error Aug 22, 2026 5:49pm
agent-zero-marketing Ready Ready Preview Aug 22, 2026 5:49pm

@socket-security

socket-security Bot commented Aug 22, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Added@​agent-zero/​build-env@​0.4.0N/AN/AN/AN/AN/A

View full report

@macroscopeapp

macroscopeapp Bot commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Not approved

Macroscope's review found this PR not approvable — This PR adds a new cross-provider build-metadata system with server-side fallback, SSR serialization, deployment classification, cache-key changes, and dashboard UI integration. Its effects span build, deployment, and user-visible runtime behavior, making human validation appropriate.

You can add or adjust custom eligibility rules. Learn more.

Four CI jobs were red on this branch — lint, typecheck, unit tests and the
unused-code check — plus the dashboard's sidebar navigation. Three causes:

`packages/build-env/src/resolve.ts` was left half-refactored. `packageVersion`
called `readPackageJSON` without importing it (TS2304, and the two `node:`
imports it replaced went unused, which is what oxlint reported), so the body no
longer matched the imports at the top of the file.

Restoring the direct read is the fix rather than adding the missing import:
`readPackageJSON` ascends to the *nearest* manifest, so in this workspace an app
without its own `package.json` resolves to the repository root's and reports
that version as the app's — the drift between two version sources this package
exists to remove. `src/resolve.test.ts` already pinned that contract and has
been failing since the refactor landed. `pkg-types` has no other consumer, so it
goes with it.

`aube run knip` pre-builds only `@agent-zero/i18n` and `@agent-zero/auth`. This
branch adds `@agent-zero/build-env`, which both Nuxt apps' `vitest.config.ts`
import as `@agent-zero/build-env/nuxt`, so with its `dist/` absent knip could
not load either config: 30 test files looked unreferenced and `@nuxt/schema`
looked unused. Building it alongside the other two resolves both, which is why
no `ignoreDependencies` entry is needed.

`Sidebar.vue` lost `import { NuxtLink } from '#components'` when the
`package.json` version import beside it was replaced by `<BuildEnvironment />`.
The template still uses `NuxtLink` as a value in `<component :is>`, so this was
a typecheck error and, unchecked, would have rendered every nav item with a
route as nothing.

Verified against a frozen install: typecheck, lint, test (26/26) and build all
pass, `oxfmt --check` is clean over 482 files, and knip exits 0 with only the 13
configuration hints `main` already carries. `@agent-zero/i18n` is excluded
locally — its `@lunariajs/core` dependency is served from `pkg.pr.new`, which
this sandbox's egress policy denies; its CI job was already green.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SjNmQ7vt3nXuoeyAbrF7Nj
@RedStar071
RedStar071 merged commit 7ad2759 into main Aug 23, 2026
19 of 20 checks passed
@RedStar071
RedStar071 deleted the claude/dashboard-vercel-deploy-fix-78jniq branch August 23, 2026 10:44
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.

2 participants