Skip to content

fix(custom-blocks): reserve system output names and hide own block from command modal#5667

Merged
TheodoreSpeaks merged 3 commits into
stagingfrom
fix/custom-block-misc
Jul 14, 2026
Merged

fix(custom-blocks): reserve system output names and hide own block from command modal#5667
TheodoreSpeaks merged 3 commits into
stagingfrom
fix/custom-block-misc

Conversation

@TheodoreSpeaks

@TheodoreSpeaks TheodoreSpeaks commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Reject reserved exposed-output names (success, error, cost) when publishing/updating a custom block — an output named cost was overwriting the billed cost in the executor's output projection. Enforced in the contract write schemas, the operations layer (covers the copilot deploy path), and inline in the publish form; auto-derived names skip reserved words. result stays allowed: it only exists as a system field when no outputs are curated, which can't co-occur with a named output
  • Executor now spreads system fields last in projectCustomBlockOutput so pre-validation rows can never clobber cost/success
  • Hide a workflow's own custom block from the cmd+K command modal on that workflow's canvas (same recursion guard as the toolbar): buildCustomBlockConfig stamps sourceWorkflowId, search items carry it, and the modal filters on the current workflow id
  • Constrain custom block image icons in subagent tool rows: the schema-read row sizes its block icon with a size class, which a custom block's uploaded image icon deliberately overrides (size-full for tiled surfaces) — the icon rendered at natural size, filling the lane. Size via inline style per the image-icon contract

Type of Change

  • Bug fix

Testing

Unit tests added for the reserved-name checks (build-config, operations) and the executor projection ordering (output named cost cannot clobber billing). Rebased onto staging; tsc --noEmit, bun run lint:check, and bun run check:api-validation:strict pass, 107 tests across the touched areas green.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel

vercel Bot commented Jul 14, 2026

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Jul 14, 2026 4:38am

Request Review

@cursor

cursor Bot commented Jul 14, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
Touches custom-block output projection and billing (cost), plus publish validation across API and executor; changes are well-tested but affect run-time billing semantics.

Overview
Fixes custom-block bugs around billing output collision, recursive placement, and icon sizing in agent tool rows.

Reserved exposed-output names (success, error, cost) are rejected on publish/update via API write schemas, server operations (including copilot paths), and the publish form. Auto-derived names skip reserved words. The executor’s projectCustomBlockOutput now spreads system fields last so legacy rows cannot overwrite billed cost/success.

Recursion guard in cmd+K: buildCustomBlockConfig sets sourceWorkflowId; search items carry it and the command modal filters out blocks/tools whose source is the current workflow (aligned with the toolbar).

Tool-call icons: custom block image icons use inline width/height because size-full on uploaded icons overrides size classes in narrow rows.

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

@greptile-apps

greptile-apps Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR tightens custom block output handling and command search behavior. The main changes are:

  • Reserved custom block output names are rejected on publish and update.
  • Executor output projection keeps system fields ahead of curated output collisions.
  • Command search hides a workflow’s own published custom block on that workflow canvas.
  • Custom block image icons are constrained in subagent tool rows.

Confidence Score: 5/5

This looks safe to merge.

  • No blocking issues found in the changed code.

Important Files Changed

Filename Overview
apps/sim/blocks/custom/build-config.ts Adds reserved output-name helpers and carries the source workflow id on custom block configs.
apps/sim/lib/api/contracts/custom-blocks.ts Adds write-time validation for reserved exposed-output names while keeping reads compatible.
apps/sim/lib/workflows/custom-blocks/operations.ts Adds the operations-layer guard so non-HTTP callers also reject reserved output names.
apps/sim/executor/handlers/workflow/workflow-handler.ts Projects curated outputs before system fields so billing and success fields keep their system values.
apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/search-modal/search-modal.tsx Filters command-search block and tool results by the current workflow id to avoid self-recursive custom block placement.
apps/sim/stores/modals/search/store.ts Copies custom block source workflow ids into search items for modal filtering.
apps/sim/app/workspace/[workspaceId]/home/components/message-content/components/agent-group/tool-call-item.tsx Uses inline icon sizing so uploaded custom block icons render at the intended tool-row size.

Reviews (2): Last reviewed commit: "improvement(custom-blocks): allow result..." | Re-trigger Greptile

@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@greptile review

@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@cursor review

@cursor cursor 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.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit ad85707. Configure here.

@TheodoreSpeaks TheodoreSpeaks merged commit 3282fd8 into staging Jul 14, 2026
19 checks passed
@TheodoreSpeaks TheodoreSpeaks deleted the fix/custom-block-misc branch July 14, 2026 04:57
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