Skip to content

[codex] Fix hosted channel bootstrap#2613

Merged
juliusmarminge merged 2 commits intomainfrom
codex/fix-hosted-channel-bootstrap
May 9, 2026
Merged

[codex] Fix hosted channel bootstrap#2613
juliusmarminge merged 2 commits intomainfrom
codex/fix-hosted-channel-bootstrap

Conversation

@juliusmarminge
Copy link
Copy Markdown
Member

@juliusmarminge juliusmarminge commented May 9, 2026

What changed

  • Treat release builds with VITE_HOSTED_APP_CHANNEL=latest|nightly as hosted static apps when no backend URL is configured.
  • Add coverage for direct channel aliases such as https://nightly.app.t3.codes.

Why

The hosted-static guard only recognized the router origin from VITE_HOSTED_APP_URL (https://app.t3.codes). Direct channel aliases like nightly.app.t3.codes fell through to the primary/local environment bootstrap path, which fetched /.well-known/t3/environment from Vercel. Vercel served index.html, and the client tried to parse it as JSON, causing Unexpected token '<', "<!doctype"... is not valid JSON.

Validation

  • bun --filter=@t3tools/web run test -- hostedPairing.test.ts
  • bun fmt
  • bun lint
  • bun typecheck
  • bun run release:smoke

Note

Fix hosted channel bootstrap to support nightly and latest release channels

  • Adds configuredHostedAppChannel in hostedPairing.ts to read VITE_HOSTED_APP_CHANNEL from env; returns "latest" or "nightly" if set, otherwise null.
  • Updates isHostedStaticApp to return true when a valid hosted channel is configured and no backend URL is set, instead of relying solely on URL origin matching.
  • Introduces resolveWebAssetBrandForChannel in brand-assets.ts mapping "nightly""nightly" brand and "latest""production", with nightly-specific favicon and icon paths.
  • Updates the Vercel build command in vercel.ts to pass --channel (defaulting to "latest") to apply-web-brand-assets, so the correct brand assets are applied per channel.

Macroscope summarized 0422aff.


Note

Medium Risk
Changes the hosted/static bootstrap decision and Vercel build-time asset selection, which could affect how hosted deployments initialize and display branding across channels. Scope is limited and covered by new unit tests for channel alias handling and asset mapping.

Overview
Fixes hosted-static detection to treat builds with VITE_HOSTED_APP_CHANNEL (latest/nightly) as hosted static apps when no backend URL is configured, so channel alias domains (e.g. nightly.app.t3.codes) don’t fall into the primary/local bootstrap path.

Updates the Vercel build to pass the release channel into apply-web-brand-assets, expands branding assets to include a nightly web icon set, and adds tests for the new channel-to-brand mapping and nightly icon overrides.

Reviewed by Cursor Bugbot for commit 0422aff. Bugbot is set up for automated code reviews on this repo. Configure here.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 9, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 35f27ab9-b93a-46c1-8fe4-6329bf8e7568

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/fix-hosted-channel-bootstrap

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

@github-actions github-actions Bot added size:XS 0-9 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. labels May 9, 2026
@juliusmarminge juliusmarminge marked this pull request as ready for review May 9, 2026 05:29
macroscopeapp[bot]
macroscopeapp Bot previously approved these changes May 9, 2026
@macroscopeapp
Copy link
Copy Markdown
Contributor

macroscopeapp Bot commented May 9, 2026

Approvability

Verdict: Approved

This is a targeted fix ensuring hosted channel deployments (nightly/latest) are properly detected as static apps, with corresponding nightly brand assets support. The changes are well-tested, limited in scope, and authored by a repository admin.

You can customize Macroscope's approvability policy. Learn more.

@macroscopeapp macroscopeapp Bot dismissed their stale review May 9, 2026 05:38

Dismissing prior approval to re-evaluate 0422aff

@github-actions github-actions Bot added size:M 30-99 changed lines (additions + deletions). and removed size:XS 0-9 changed lines (additions + deletions). labels May 9, 2026
@juliusmarminge juliusmarminge merged commit 3c32bc8 into main May 9, 2026
12 checks passed
@juliusmarminge juliusmarminge deleted the codex/fix-hosted-channel-bootstrap branch May 9, 2026 05:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant