Skip to content

Commit ffd048b

Browse files
committed
🤖 refactor: use isWorkflowRunTaskId helper for drift check
#3565 reintroduced a hardcoded startsWith("wfr_") in WorkflowRunner's nested-step drift detection. taskId.ts already exports the canonical WORKFLOW_RUN_TASK_ID_PREFIX and isWorkflowRunTaskId() predicate as the single source of truth for that prefix. Use the helper instead of the duplicated literal; behavior is identical (both are falsy for a missing taskId inside the find() predicate).
1 parent e3f5192 commit ffd048b

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/node/services/workflows/WorkflowRunner.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import assert from "@/common/utils/assert";
1515
import { getErrorMessage } from "@/common/utils/errors";
1616
import { validateJsonSchemaSubset } from "@/common/utils/jsonSchemaSubset";
1717
import type { IJSRuntime, IJSRuntimeFactory } from "@/node/services/ptc/runtime";
18+
import { isWorkflowRunTaskId } from "@/node/services/tools/taskId";
1819
import { AsyncMutex } from "@/node/utils/concurrency/asyncMutex";
1920
import { AsyncSemaphore } from "@/node/utils/concurrency/asyncSemaphore";
2021
import type { ResolvedWorkflowAction, WorkflowActionRegistry } from "./WorkflowActionRegistry";
@@ -857,7 +858,7 @@ export class WorkflowRunner {
857858
const run = await this.runStore.getRun(runId);
858859
const driftedStep = run.steps.find(
859860
(step) =>
860-
step.stepId === spec.id && step.inputHash !== inputHash && step.taskId?.startsWith("wfr_")
861+
step.stepId === spec.id && step.inputHash !== inputHash && isWorkflowRunTaskId(step.taskId)
861862
);
862863
if (driftedStep != null) {
863864
throw new Error(

0 commit comments

Comments
 (0)