Fix projectConfig.projectId containing project name instead of ID#999
Fix projectConfig.projectId containing project name instead of ID#999TooTallNate wants to merge 1 commit intonate/encryptor-interfacefrom
Conversation
🧪 E2E Test Results❌ Some tests failed Summary
❌ Failed Tests🌍 Community Worlds (41 failed)turso (41 failed):
Details by Category✅ ▲ Vercel Production
✅ 💻 Local Development
✅ 📦 Local Production
✅ 🐘 Local Postgres
✅ 🪟 Windows
❌ 🌍 Community Worlds
✅ 📋 Other
|
|
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
There was a problem hiding this comment.
Pull request overview
This PR fixes inconsistent handling of Vercel project identity by separating the project ID (used for API/auth/encryption contexts) from the project slug/name (used for dashboard URLs and display), and wires the new env var through CLI, core runtime, and the web server’s Vercel world creation path.
Changes:
- Added
WORKFLOW_VERCEL_PROJECT_NAME(project slug/name) alongsideWORKFLOW_VERCEL_PROJECT(realprj_…id). - Updated CLI env inference to set
WORKFLOW_VERCEL_PROJECTto the true project ID and populate the new project-name env var. - Plumbed
projectNamethrough core/runtime world creation and web server env allowlists / Vercel world instantiation.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/world-vercel/src/utils.ts | Extends Vercel world config typing to include both project ID and project slug/name. |
| packages/web/src/server/workflow-server-actions.ts | Allows the new env var to reach the client and passes it into createVercelWorld(). |
| packages/core/src/runtime/world.ts | Adds WORKFLOW_VERCEL_PROJECT_NAME into the runtime’s Vercel world config. |
| packages/cli/src/lib/inspect/web.ts | Uses project slug/name (when available) for dashboard URL generation. |
| packages/cli/src/lib/inspect/env.ts | Adds the new env var and updates Vercel env inference to distinguish ID vs name. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| 'WORKFLOW_TARGET_WORLD', | ||
| 'WORKFLOW_VERCEL_ENV', | ||
| 'WORKFLOW_VERCEL_TEAM', | ||
| 'WORKFLOW_VERCEL_PROJECT', | ||
| 'WORKFLOW_VERCEL_PROJECT_NAME', |
There was a problem hiding this comment.
PR description says the web UI was updated to prefer the Vercel project name/slug when available, but the only consumer updated here appears to be the CLI dashboard URL logic. The web UI still appears to read/display WORKFLOW_VERCEL_PROJECT (now intended to be the prj_… id), so the UI may show IDs instead of friendly slugs unless the client-side components are updated to use WORKFLOW_VERCEL_PROJECT_NAME.
| // WORKFLOW_VERCEL_PROJECT is the real project ID (e.g., prj_xxx) | ||
| envVars.WORKFLOW_VERCEL_PROJECT = projectId; | ||
| // WORKFLOW_VERCEL_PROJECT_NAME is the project slug (e.g., my-app) | ||
| envVars.WORKFLOW_VERCEL_PROJECT_NAME = projectName || projectId; |
There was a problem hiding this comment.
inferVercelEnvVars() only populates WORKFLOW_VERCEL_PROJECT_NAME (and normalizes WORKFLOW_VERCEL_PROJECT to a real prj_… id) when either WORKFLOW_VERCEL_PROJECT or WORKFLOW_VERCEL_TEAM is missing. If the CLI flag/env already sets WORKFLOW_VERCEL_PROJECT to a project slug/name (which the --project flag description currently implies), this block won’t run, and the world will continue sending the slug in the x-vercel-project-id header—reintroducing the exact bug this PR is fixing and potentially breaking auth/encryption context. Consider expanding the guard to also run when WORKFLOW_VERCEL_PROJECT_NAME is missing and/or when WORKFLOW_VERCEL_PROJECT doesn’t look like a Vercel project id (e.g. not prj_…), so the env vars are consistently normalized.
a4be5e8 to
53d573e
Compare
30fc9e5 to
fc25b9c
Compare

Added support for Vercel project name/slug separate from project ID to improve dashboard URLs and environment variable handling.
What changed?
WORKFLOW_VERCEL_PROJECT_NAMEenvironment variable to store the project slug/nameinferVercelEnvVars()to properly set both project ID and project nameWORKFLOW_VERCEL_PROJECTto consistently store the real project ID (e.g., prj_xxx)How to test?
WORKFLOW_VERCEL_PROJECTandWORKFLOW_VERCEL_PROJECT_NAMEare set correctlyWhy make this change?
This change improves the clarity of the codebase by distinguishing between the Vercel project ID (used for API calls and encryption) and the project name/slug (used for dashboard URLs and display purposes). Previously, the code was inconsistently using project names and IDs, which could lead to confusion and potential issues with encryption key derivation contexts.