fix(copilot): don't surface custom blocks whose definition was deleted#5498
Conversation
…e so a deleted definition doesn't linger
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryLow Risk Overview Workspace VFS now tracks the workspace’s current custom block types (enabled and disabled) during Reviewed by Cursor Bugbot for commit 366e9d4. Bugbot is set up for automated code reviews on this repo. Configure here. |
… state so the copilot can't see unrenderable blocks
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit a8b7c24. Configure here.
…ad fails (null vs empty set)
The VFS static cache is only ever built by materialize(), which runs outside any custom-block overlay (the overlay is scoped to edit_workflow / get_blocks_metadata, neither of which materializes the VFS). So getAllBlocks() there always returns first-party blocks only and no custom block can be frozen into the cache. Removed the dead guard.

Summary
state.json/lint.jsoncome from the raw normalized blocks, so a custom block placed in a workflow survived deletion of its definition and the copilot still read it.loadNormalizednow drops any placedcustom_block_*whose definition no longer exists (plus edges touching it), keyed off the workspace's current definitions. A live definition — enabled or disabled — is kept; only a deleted one is removed.getStaticComponentFilesis per-process and built from the overlay-awaregetAllBlocks(), so a first build inside a custom-block overlay could freeze that org's blocks in and let a later-deleted definition linger. Custom blocks are now excluded from the static cache — they're per-org/dynamic and materialized fresh every request.Type of Change
Testing
Deleted a published custom block still placed in a workflow → the copilot no longer resolves or reads it (state.json omits the block + its edges).
bun run lintandcheck:api-validation:strictpass; existing VFS tests pass (41).Checklist