feat(custom-blocks): add deploy_custom_block copilot tool#5532
feat(custom-blocks): add deploy_custom_block copilot tool#5532TheodoreSpeaks wants to merge 2 commits into
Conversation
The dependency was pinned to a direct tarball on cdn.sheetjs.com, which now returns 403 (Cloudflare bot-challenge) to automated clients, breaking bun install in CI. npm's own xlsx is frozen at 0.18.5, so switch to the @e965/xlsx mirror which republishes the identical 0.20.3 CDN build to the npm registry. No code changes needed — all imports use bare 'xlsx'.
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview The new Generated copilot catalog/schemas gain Also switches the Reviewed by Cursor Bugbot for commit 8f9771b. Bugbot is set up for automated code reviews on this repo. Configure here. |
Greptile SummaryThis PR adds copilot support for deploying workflows as custom blocks. The main changes are:
Confidence Score: 4/5The custom-block deploy path needs a validation fix before merging.
apps/sim/lib/copilot/tools/handlers/deployment/custom-block.ts Important Files Changed
Reviews (1): Last reviewed commit: "feat(custom-blocks): add deploy_custom_b..." | Re-trigger Greptile |
| if (existing) { | ||
| await updateCustomBlock(existing.id, { | ||
| name, | ||
| description, | ||
| iconUrl, | ||
| inputs: params.inputs, | ||
| exposedOutputs: params.exposedOutputs, |
There was a problem hiding this comment.
When a tool call sends a large inputs or exposedOutputs array, this path passes it directly into the custom-block row. The REST custom-block contract caps these arrays, but this new copilot path skips that bound, so one call can persist an oversized block definition that slows or breaks org-wide block loading.
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 8f9771b. Configure here.
| iconUrl, | ||
| inputs: params.inputs, | ||
| exposedOutputs: params.exposedOutputs, | ||
| }) |
There was a problem hiding this comment.
Whitespace name clears block title
Medium Severity
On republish, name is trimmed and passed to updateCustomBlock even when the result is empty. updateCustomBlock only skips fields that are undefined, so an empty string overwrites the stored display name. The REST update contract rejects empty names with min(1); this handler does not.
Reviewed by Cursor Bugbot for commit 8f9771b. Configure here.


Summary
deploy_custom_blockcopilot tool handler: the deploy agent can publish a deployed workflow as an org-wide custom block, update it in place (re-deploy upserts), or unpublish withaction: undeployensureWorkflowAccess,deploy-as-blockflag, enterprise plan; audit events recorded withsource: copiloticonUrlaccepts a workspace file VFS path (files/icon.png) — bytes are copied into the publicworkspace-logoscontext (key prefixed so the serve route treats it as public) so the icon renders org-wide; external URLs pass throughDeployCustomBlock, regen formatting churn intool-schemas-v1.tsis from the current generator)getCustomBlockWithInputsByWorkflowIdoperation + shared row-hydration helperCompanion PR on the copilot repo adds the tool definition, deploy agent wiring, prompts, and skill — this handler is inert until that ships.
Type of Change
Testing
Tested manually end-to-end via Chat (published a block with a generated icon, verified render + upsert). 13 unit tests on the handler incl. icon ingestion paths. lint, type-check, and check:api-validation:strict pass.
Checklist