Skip to content

Fix Iroh relay policy Vercel deployment - #8118

Merged
azooz2003-bit merged 7 commits into
mainfrom
feat-iroh-staging-deploy-fix
Jul 15, 2026
Merged

azooz2003-bit merged 7 commits into
mainfrom
feat-iroh-staging-deploy-fix

Conversation

@azooz2003-bit

@azooz2003-bit azooz2003-bit commented Jul 15, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • keep relay-catalog validation inside the Vercel web project
  • make the generator portable across Bun and Next.js type checking
  • reconcile the Swift line budget after the Iroh merge

Testing

  • regression commit fails before the fix
  • bun test tests/vercel-build-inputs.test.ts tests/relay-policy.test.ts tests/relay-token-route.test.ts tests/relay-preferences-route.test.ts
  • SKIP_ENV_VALIDATION=1 bun run vercel-build
  • python3 scripts/swift_file_length_budget.py --base-ref origin/main

View with Codesmith Autofix with Codesmith
Need help on this PR? Tag /codesmith with what you need. Autofix is disabled.


Summary by cubic

Fixes Vercel deploys for the Iroh relay policy by validating the relay catalog inside the web app and making the generator Node-compatible so Bun/Next.js type checks and builds pass. Also updates CI/Presence workflows and adds a regression test to keep validation inside the Vercel project.

  • Bug Fixes
    • Moved the generator to web/tools/generate-managed-iroh-relay-catalog.ts; run --check from web in root, web, and workers/presence scripts and CI.
    • Made the generator Node-compatible (replaced Bun-only APIs, switched to process.argv, fixed repo root resolution, preserved --check).
    • Added web/tests/vercel-build-inputs.test.ts to ensure vercel-build calls the in-web script.
    • Updated CI and Presence workflow triggers to the new generator path.
    • Made the relay retry test deterministic and fixed Iroh test import in MobileHostAuthorizationTests.swift.

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

Review in cubic

Summary by CodeRabbit

  • Build & Tooling
    • Updated managed relay catalog generation/check commands to use the new in-repo generator path across root, web, and presence scripts.
    • Switched the generator to run on Node.js for consistent handling during builds.
    • Updated CI/deployment validation to call the new generator path and adjusted workflow triggers to watch the new file location.
  • Tests
    • Added a Bun test ensuring the deployment build includes an embedded relay catalog validation step.
    • Improved a Swift test’s sleep timing assertion and updated its imports.

@cursor

cursor Bot commented Jul 15, 2026

Copy link
Copy Markdown

Bugbot is paused — on-demand spend limit reached

Bugbot uses usage-based billing for this team and has hit its on-demand spend limit.

A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue.

@vercel

vercel Bot commented Jul 15, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
cmux Ready Ready Preview, Comment Jul 15, 2026 7:28am
cmux-staging Building Building Preview, Comment Jul 15, 2026 7:28am

@coderabbitai

coderabbitai Bot commented Jul 15, 2026 •

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The relay catalog generator moved from scripts/ to web/tools/, switched Bun-specific file and argument handling to Node.js APIs, and updated root, web, presence, and CI references. A Vercel build-path test was added, and Swift test coverage was adjusted.

Changes

Relay catalog generation

Layer / File(s) Summary
Relocated generator runtime
web/tools/generate-managed-iroh-relay-catalog.ts
The generator resolves the repository root from its new location and uses Node.js APIs for reading, checking, and writing catalog files.
Build and validation wiring
package.json, web/package.json, workers/presence/package.json, .github/workflows/ci.yml, .github/workflows/presence.yml, web/tests/vercel-build-inputs.test.ts
Build scripts and CI references use the relocated generator, workflow filters track its new path, and a test validates the Vercel build path and target file.

Swift test adjustments

Layer / File(s) Summary
Timing assertion and transport import
Packages/Shared/CmuxIrohTransport/Tests/CmuxIrohTransportTests/CmxIrohRelayCredentialCoordinatorTests.swift, cmuxTests/MobileHostAuthorizationTests.swift
The relay credential test separately validates the scheduled sleep deadline, and the mobile authorization tests import CmuxIrohTransport.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • manaflow-ai/cmux#8119: Updates the same relay credential timing test with equivalent .sleep(deadline) pattern matching.
  • manaflow-ai/cmux#8114: Contains overlapping Swift test updates for relay timing and CmuxIrohTransport imports.
  • manaflow-ai/cmux#8029: Also modifies path-filtered GitHub Actions workflow configuration.

Suggested reviewers: lawrencecchen

🚥 Pre-merge checks | ✅ 25
✅ Passed checks (25 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
Cmux Swift Actor Isolation ✅ Passed PASS: The Swift edits are test-only; the MainActor file is a test suite and the other change is just an assertion/import update, so no new actor-isolation debt.
Cmux Swift Blocking Runtime ✅ Passed PASS: The Swift edits are test-only/assertion or UI layout/comment changes; no new semaphores, sleeps, locks, or blocking waits were added.
Cmux Browser Automation Off-Main ✅ Passed No browser-automation scope files changed, and the diff contains no browser.*, socketWorkerMethods, or processV2Command references.
Cmux Expensive Synchronous Load ✅ Passed Swift changes are test-only; no production file adds/moves RestorableAgentSessionIndex.load() or similar main-actor sync loads.
Cmux Cache Substitution Correctness ✅ Passed No cache-for-authoritative-read swap in persistence/history/undo/snapshot paths; the only changed value is transient UI layout.
Cmux No Hacky Sleeps ✅ Passed PASS: Diff only updates script paths, a Node-compatible generator, and a test; no new sleep/timer/polling logic in non-Swift runtime code. Workflow YAML waits are out of scope.
Cmux Algorithmic Complexity ✅ Passed Touched runtime code is the relay-catalog generator, which validates relays in one linear pass with Set uniqueness checks; the rest is scripts/tests/workflows.
Cmux Swift Concurrency ✅ Passed The Swift edits are layout/comment-only plus a test assertion; they add no new DispatchQueue/Combine/completion-handler/Task lifecycle patterns.
Cmux Swift @Concurrent ✅ Passed The Swift diffs only change comments/layout constants and add no invalid or missing @concurrent/nonisolated async boundaries.
Cmux Swift Package Boundaries ✅ Passed Touched Swift production code is only UI/Ghostty glue in CmuxMobileTerminal; the root NotificationSoundSettings edit is comment-only, and the rest are tests.
Cmux Swiftpm Lockfiles ✅ Passed No changed .gitignore, Package.swift, Xcode project, or Package.resolved files; the workflow edits are unrelated to SwiftPM resolution, so the lockfile policy isn't violated.
Cmux Swift Logging ✅ Passed Only Swift test files changed; no production logging APIs or ad hoc logs were added or modified.
Cmux User-Facing Error Privacy ✅ Passed Changed strings are developer/CI/test-only; no user-facing errors expose vendor, provider, or secret details.
Cmux Full Internationalization ✅ Passed Touched files are scripts, tests, CI, and generated relay config; no web/messages, xcstrings, or Swift UI text changed.
Cmux Swiftui State Layout ✅ Passed Diff only touches tests and UIKit/AppKit code; no new SwiftUI state, GeometryReader, lazy-row store refs, or render-time state mutation found.
Cmux Architecture Rethink ✅ Passed Only Swift edits are test-only: an assertion refactor in Tests/ and an import add; no new timing, owner-splitting, or duplicate wiring in production code.
Cmux Swift Auxiliary Window Close Shortcuts ✅ Passed PR’s Swift changes are test-only; no NSWindow/NSPanel/WindowGroup code or cmuxAuxiliaryWindowIdentifiers changes appear in the diff.
Cmux Source Artifacts ✅ Passed Changed paths are source/config/docs or removals; no scratch dirs, build outputs, caches, or local tool artifacts were added.
Cmux No Test Or Debug Seam In Production Source ✅ Passed No test/debug seam was added in production Sources/ Swift; changed production files only adjust behavior/comments, and the sole @testable edit is in a test file.
Cmux No Ambient Global State ✅ Passed PASS: The Swift production edits are method/local changes and comments only; no new top-level funcs, mutable globals, static-only namespaces, or singletons were introduced.
Title check ✅ Passed The title clearly matches the main change: fixing Vercel deployment for Iroh relay policy.
Description check ✅ Passed Summary and Testing are specific and complete, though Demo Video, Review Trigger, and Checklist sections are missing.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat-iroh-staging-deploy-fix

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.

@greptile-apps

greptile-apps Bot commented Jul 15, 2026 •

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR fixes Vercel deployments broken by the Iroh merge by moving the relay catalog generator from scripts/ into web/tools/ so Vercel's build can reach it within the project boundary. The generator is also made Node-compatible by replacing Bun-only APIs (Bun.file, Bun.argv, Bun.write) with standard node:fs/promises equivalents, enabling Next.js type checking to pass without Bun-specific types.

  • Relocated generate-managed-iroh-relay-catalog.ts to web/tools/; updated repositoryRoot depth ("../..") and all path references across root/web/presence package.json files, CI workflows, and generated-file comments.
  • Replaced Bun-only file I/O and Bun.argv with readFile/writeFile/process.argv so the script type-checks cleanly under both Bun and Next.js.
  • Added web/tests/vercel-build-inputs.test.ts as a regression guard that parses the vercel-build script and asserts the referenced generator exists within the web project root.

Confidence Score: 5/5

Safe to merge — the change is a targeted relocation of a build-time generator with all call sites and path computations verified correct.

All changed code is build/tooling infrastructure with no production runtime logic. The repositoryRoot depth ("../.." ) is correct for the new web/tools/ location, every caller (root, web, presence, CI) has been updated consistently, and the new regression test hard-pins the invariant that the generator must live inside the Vercel project. The Swift changes are test-file-only fixes with no production impact.

No files require special attention.

Important Files Changed

Filename Overview
web/tools/generate-managed-iroh-relay-catalog.ts Renamed from scripts/ into web/tools/; replaced Bun-only APIs (Bun.file, Bun.argv, Bun.write) with Node.js equivalents and updated repositoryRoot depth from "../" to "../.." — all paths resolve correctly.
web/tests/vercel-build-inputs.test.ts New regression test that parses the vercel-build script from package.json and asserts the referenced generator exists within the web project root — solid coverage for the deploy fix.
web/package.json build and vercel-build scripts updated from bun ../scripts/... to bun tools/... to keep validation within the Vercel project directory.
workers/presence/package.json relay-catalog:check updated from ../../scripts/... to ../../web/tools/...; resolves correctly from the workers/presence/ directory.
.github/workflows/ci.yml CI "Validate managed relay catalog" step updated to bun tools/... (runs from the web/ working directory, consistent with prior ../scripts/ reference).
.github/workflows/presence.yml Path filter for the presence workflow updated from scripts/... to web/tools/... so pushes to the generator still trigger the workflow.
Packages/Shared/CmuxIrohTransport/Tests/CmuxIrohTransportTests/CmxIrohRelayCredentialCoordinatorTests.swift Test-only change: relay retry sleep assertion made deterministic by extracting the deadline via pattern matching instead of comparing the full enum value inline.
cmuxTests/MobileHostAuthorizationTests.swift Adds missing import CmuxIrohTransport needed after the Iroh merge — test-only fix.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["config/iroh/managed-relay-catalog.json"] -->|read by| B["web/tools/generate-managed-iroh-relay-catalog.ts"]
    B -->|--check or generate| C["web/services/relay/generated/managedRelayCatalog.ts"]
    B -->|--check or generate| D["workers/presence/src/generated/managedRelayCatalog.ts"]

    E["web/package.json\nbuild / vercel-build"] -->|bun tools/...| B
    F["package.json\niroh:relay-catalog:check"] -->|bun web/tools/...| B
    G["workers/presence/package.json\nrelay-catalog:check"] -->|bun ../../web/tools/...| B
    H[".github/workflows/ci.yml\nValidate managed relay catalog"] -->|bun tools/...| B

    style B fill:#c8e6c9,stroke:#388e3c
    style A fill:#fff9c4,stroke:#f9a825
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
    A["config/iroh/managed-relay-catalog.json"] -->|read by| B["web/tools/generate-managed-iroh-relay-catalog.ts"]
    B -->|--check or generate| C["web/services/relay/generated/managedRelayCatalog.ts"]
    B -->|--check or generate| D["workers/presence/src/generated/managedRelayCatalog.ts"]

    E["web/package.json\nbuild / vercel-build"] -->|bun tools/...| B
    F["package.json\niroh:relay-catalog:check"] -->|bun web/tools/...| B
    G["workers/presence/package.json\nrelay-catalog:check"] -->|bun ../../web/tools/...| B
    H[".github/workflows/ci.yml\nValidate managed relay catalog"] -->|bun tools/...| B

    style B fill:#c8e6c9,stroke:#388e3c
    style A fill:#fff9c4,stroke:#f9a825
Loading

Reviews (5): Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." | Re-trigger Greptile

@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: 1

🤖 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 `@web/package.json`:
- Around line 8-9: Update the web-typecheck command in the CI workflow to invoke
generate-managed-iroh-relay-catalog.ts through the web working directory using
the tools/generate-managed-iroh-relay-catalog.ts path, matching the package
scripts and preserving the --check flag.
🪄 Autofix (Beta)

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: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 0d566e38-9a65-4cc3-a53e-aaee2d98e9b8

📥 Commits

Reviewing files that changed from the base of the PR and between 3822f1d and 9cb5508.

⛔ Files ignored due to path filters (3)
  • .github/swift-file-length-budget.tsv is excluded by !**/*.tsv
  • web/services/relay/generated/managedRelayCatalog.ts is excluded by !**/generated/**
  • workers/presence/src/generated/managedRelayCatalog.ts is excluded by !**/generated/**
📒 Files selected for processing (5)
  • package.json
  • web/package.json
  • web/tests/vercel-build-inputs.test.ts
  • web/tools/generate-managed-iroh-relay-catalog.ts
  • workers/presence/package.json

Comment thread web/package.json
…loy-fix

# Conflicts:
#	.github/swift-file-length-budget.tsv
@azooz2003-bit
azooz2003-bit merged commit cf18c59 into main Jul 15, 2026
15 of 18 checks passed

This branch was successfully deployed

1 active deployment
Preview – cmux — d3f0da8f Deployed Jul 15, 2026 by vercel[bot]
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.

1 participant