From 3e51bd74b7f70bd767b1a789a2e5d712d619d769 Mon Sep 17 00:00:00 2001 From: Peter Wielander Date: Fri, 3 Apr 2026 14:06:10 -0700 Subject: [PATCH] fix(swc-plugin): remove __builtin special-case step ID generation The SWC plugin had a hardcoded special case that generated bare function names (no step// prefix, no module specifier) for any function whose name starts with "__builtin". This was originally intended to produce stable, version-independent IDs for the workflow VM. With the introduction of builtinStepId() in @workflow/core, the VM now constructs fully-qualified step IDs (step//workflow/internal/builtins@{version}//name). The bare-name special case causes a mismatch: the VM requests a qualified ID but only a bare name is registered, causing StepNotRegisteredError. Remove the special case so __builtin functions follow the standard step ID generation path, receiving proper step//moduleSpecifier//name IDs like all other step functions. Co-Authored-By: Claude Opus 4.6 (1M context) --- packages/swc-plugin-workflow/transform/src/lib.rs | 7 ------- 1 file changed, 7 deletions(-) diff --git a/packages/swc-plugin-workflow/transform/src/lib.rs b/packages/swc-plugin-workflow/transform/src/lib.rs index b43b941f90..9b424934d5 100644 --- a/packages/swc-plugin-workflow/transform/src/lib.rs +++ b/packages/swc-plugin-workflow/transform/src/lib.rs @@ -1578,13 +1578,6 @@ impl StepTransform { is_workflow: bool, ) -> String { match fn_name { - Some(name) if name.starts_with("__builtin") => { - // Special case for __builtin functions: use only the function name. - // These are internal SDK functions that are referenced by name in the - // workflow VM runtime (packages/core/src/workflow.ts), so they need - // stable, version-independent IDs. - name.to_string() - } Some(name) => { let prefix = if is_workflow { "workflow" } else { "step" }; naming::format_name(prefix, &self.get_module_path(), name)