Skip to content

web: portable entry-point guard for check-devbox-image-reachable (typecheck fix) - #12154

Merged
austinywang merged 1 commit into
mainfrom
fix-12147-web-typecheck
Sep 8, 2026
Merged

austinywang merged 1 commit into
mainfrom
fix-12147-web-typecheck

Conversation

@austinywang

@austinywang austinywang commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

Closes #12147

Problem

web/scripts/check-devbox-image-reachable.ts (added by #12132) ends with if (import.meta.main) await main();. import.meta.main is Bun-only and not part of TypeScript's ImportMeta type, so bun run typecheck (tsgo --noEmit) fails on main:

scripts/check-devbox-image-reachable.ts(148,17): error TS2339: Property 'main' does not exist on type 'ImportMeta'.

ci.yml is path-gated for pull requests, so main's own PR checks never ran this job; every PR that touches ci.yml (which forces all CI areas) now fails web-typecheck, linux-preflight, tests, and ci-status (#12140, #12141, and the #12100 dispatch).

Fix

Replace the guard with the portable entry-point check the sibling devbox scripts already use (fileURLToPath(import.meta.url) compared with path.resolve(process.argv[1])). No Bun ambient types are added to the web typecheck config.

Verification

Run in a sparse clone of current main with this patch, using an installed web/node_modules:

$ ./node_modules/.bin/tsgo --noEmit          # clean (was: TS2339 at scripts/check-devbox-image-reachable.ts:148)
$ bun test tests/vm-image-reachability.test.ts
 4 pass / 0 fail                             # importing reachabilityKey does not run main()
$ bun scripts/check-devbox-image-reachable.ts --print-key
dd571d4dbdd25c0fa011260e3304b3441ef8e1a4957b1547476ee68973f8d7a1   # entry-point path still runs main()

A manual ci.yml dispatch on this branch runs the web-typecheck job as CI evidence.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Qiy38q5XFYQU3CeccDENty


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


Note

Low Risk
Typecheck-only guard change with no logic or security impact; entry-point behavior is preserved.

Overview
Fixes web typecheck by replacing Bun-only import.meta.main at the bottom of check-devbox-image-reachable.ts with a portable entry-point guard that compares path.resolve(process.argv[1]) to fileURLToPath(import.meta.url), matching the approach used by other devbox scripts.

Adds node:path and node:url imports only to support that guard. Runtime behavior is unchanged: direct script execution still runs main(), while importing the module (e.g. reachabilityKey in tests) does not.

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


Summary by cubic

Fixes the web typecheck failure by replacing the Bun-only import.meta.main guard in web/scripts/check-devbox-image-reachable.ts with the portable entry-point check the sibling devbox scripts already use.

import.meta.main is not part of TypeScript's ImportMeta type, so bun run typecheck errored with TS2339. The new check compares fileURLToPath(import.meta.url) with path.resolve(process.argv[1]); running the script directly still calls main(), and importing reachabilityKey from tests still does not. Closes #12147.

Written for commit de39d89. Summary will update on new commits.

Review in cubic

`import.meta.main` is Bun-only and is not part of TypeScript's ImportMeta
type, so `bun run typecheck` has failed on main since #12132:

  scripts/check-devbox-image-reachable.ts(148,17): error TS2339:
  Property 'main' does not exist on type 'ImportMeta'.

Use the portable `fileURLToPath(import.meta.url)` vs `process.argv[1]`
check that the sibling devbox scripts already rely on. Behavior is
unchanged: `bun scripts/check-devbox-image-reachable.ts --print-key`
still runs main, and importing `reachabilityKey` from the test does not.

Closes #12147

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Qiy38q5XFYQU3CeccDENty
@austinywang
austinywang temporarily deployed to cloud-vm-image-checks September 8, 2026 11:21 — with GitHub Actions Inactive
@vercel

vercel Bot commented Sep 8, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated
cmux166 Building Building Preview Sep 8, 2026 11:21am UTC
cmux41 Building Building Preview Sep 8, 2026 11:21am UTC

@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@coderabbitai

coderabbitai Bot commented Sep 8, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 29 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 10 included reviews currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: f46878b3-b461-4c9c-819b-b684c417c6fd

📥 Commits

Reviewing files that changed from the base of the PR and between 5054c81 and de39d89.

📒 Files selected for processing (1)
  • web/scripts/check-devbox-image-reachable.ts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@austinywang
austinywang merged commit 76802d5 into main Sep 8, 2026
40 of 52 checks passed
@austinywang
austinywang deleted the fix-12147-web-typecheck branch September 8, 2026 11:28
austinywang added a commit that referenced this pull request Sep 8, 2026
Brings in #12131 (cmux notify inside a machine), #12154, #12144 (cmux cr
bootstrap), #12112 (cloud notifications with per-client acks), #10623,
#11358, #12118.

Conflicts resolved:
- cmux.xcodeproj/project.pbxproj: cmuxTests group children — kept both
  sides (CloudFileDeliveryTests from this branch, CloudNotificationSyncTests
  from main); normalized, test-wiring lint ok (813 test files).
- web/scripts/check-devbox-image-reachable.ts: took main's portable
  entry-point guard over this branch's typed import.meta.main fix.

Checks on the merged tree: 18 web suites 372 pass / 0 fail, tsc clean, shim
image copy byte-identical, sh -n clean, swiftc -parse on every file both
sides touched, VMClientError switch still exhaustive, no duplicate
definitions introduced.

Claude-Session: https://claude.ai/code/session_01QBDetMeke87gUWzvok9LWr
austinywang added a commit that referenced this pull request Sep 8, 2026
Takes main's portable entry-point guard for check-devbox-image-reachable.ts
(#12154), which supersedes the equivalent fix this branch carried.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
aerickson pushed a commit to aerickson/cmux that referenced this pull request Sep 13, 2026
…aflow-ai#12154)

`import.meta.main` is Bun-only and is not part of TypeScript's ImportMeta
type, so `bun run typecheck` has failed on main since manaflow-ai#12132:

  scripts/check-devbox-image-reachable.ts(148,17): error TS2339:
  Property 'main' does not exist on type 'ImportMeta'.

Use the portable `fileURLToPath(import.meta.url)` vs `process.argv[1]`
check that the sibling devbox scripts already rely on. Behavior is
unchanged: `bun scripts/check-devbox-image-reachable.ts --print-key`
still runs main, and importing `reachabilityKey` from the test does not.

Closes manaflow-ai#12147


Claude-Session: https://claude.ai/code/session_01Qiy38q5XFYQU3CeccDENty

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>

This branch was successfully deployed

2 active and 1 inactive deployments
Preview – cmux166 — de39d891 Deployed Sep 8, 2026 by vercel[bot]
Preview – cmux41 — de39d891 Deployed Sep 8, 2026 by vercel[bot]
cloud-vm-image-checks — de39d891 Deployed Sep 8, 2026 by austinywang via reachable #13
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.

web-typecheck fails on main since #12132: import.meta.main in web/scripts/check-devbox-image-reachable.ts

1 participant