Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure
TypeScript
fix(wrc): requeue the SDK-only failed pass when a policy retry is pending
Alfredo Lopez0ea8422a4532
diff --git a/workflow-recipes/package-lock.json b/workflow-recipes/package-lock.jsonindex c9c0dff6f..5dba8d261 100644--- a/workflow-recipes/package-lock.json+++ b/workflow-recipes/package-lock.json@@ -1,12 +1,12 @@{"name": "workload-recipes-controller",- "version": "0.1.388",+ "version": "0.1.389","lockfileVersion": 3,"requires": true,"packages": {"": {"name": "workload-recipes-controller",- "version": "0.1.388",+ "version": "0.1.389","license": "SEE LICENSE IN LICENSE","dependencies": {"@aws-sdk/client-s3": "^3.1009.0",diff --git a/workflow-recipes/package.json b/workflow-recipes/package.jsonindex 3e12d42bc..f77334832 100644--- a/workflow-recipes/package.json+++ b/workflow-recipes/package.json@@ -1,6 +1,6 @@{"name": "workload-recipes-controller",- "version": "0.1.388",+ "version": "0.1.389","description": "Workload Recipes Controller (WRC) - WorkloadRecipe lifecycle management and MCP server interface","main": "dist/main.js","engines": {diff --git a/workflow-recipes/src/reconciler/reconciler.test.ts b/workflow-recipes/src/reconciler/reconciler.test.tsindex 456559168..b5f352972 100644--- a/workflow-recipes/src/reconciler/reconciler.test.ts+++ b/workflow-recipes/src/reconciler/reconciler.test.ts@@ -1630,6 +1630,42 @@ describe('WorkflowRecipeReconciler', () => {expect(steady.phase).toBe('active')expect(steady.requeueAfterMs).toBeUndefined()})++ // The mcp-host pod failed after an apply that left a policy being deleted.+ // The `failed` return must still requeue, or nothing rewrites the policy+ // until the next CR event. The twin with retryPending false shows the+ // `failed` return sets no requeue of its own, so the first one can only+ // come from the pending retry.+ it('requeues a failed pass on the transient path while a policy is being deleted', async () => {+ const pending = stubSdkOnly({+ phase: 'failed',+ message: 'Plugin Workload SDK mcp-host could not start',+ networkPolicies: { conflicts: [], retryPending: true },+ })++ const retrying = await reconciler.reconcile(sdkOnlyRecipe())++ expect(pending).toHaveBeenCalledTimes(1)+ expect(retrying.phase).toBe('failed')+ expect(retrying.message).toBe('Plugin Workload SDK mcp-host could not start')+ expect(retrying.requeueAfterMs).toBe(TRANSIENT_REQUEUE_BASE_MS)+ expect(retrying.requeueFixedInterval).toBe(false)+ expect(retrying.networkPolicyOwnershipConditions).toEqual([])++ const settled = stubSdkOnly({+ phase: 'failed',+ message: 'Plugin Workload SDK mcp-host could not start',+ networkPolicies: { conflicts: [], retryPending: false },+ })++ const terminal = await reconciler.reconcile(sdkOnlyRecipe())++ expect(settled).toHaveBeenCalledTimes(1)+ expect(terminal.phase).toBe('failed')+ expect(terminal.message).toBe('Plugin Workload SDK mcp-host could not start')+ expect(terminal.networkPolicyOwnershipConditions).toEqual([])+ expect(terminal.requeueAfterMs).toBeUndefined()+ })})// awaiting_policy waits for an operator grant. The grant arrives by eventdiff --git a/workflow-recipes/src/reconciler/workflowRecipeReconciler.ts b/workflow-recipes/src/reconciler/workflowRecipeReconciler.tsindex 9215fe06a..0f5d6d3a4 100644--- a/workflow-recipes/src/reconciler/workflowRecipeReconciler.ts+++ b/workflow-recipes/src/reconciler/workflowRecipeReconciler.ts@@ -2928,6 +2928,12 @@ export class WorkflowRecipeReconciler {),}: {}),+ // A policy the apply left pending a retry is requeued on the backoff+ // path, as the workflow lane does for its eager `failed` return.+ // `failed` itself sets no requeue.+ ...(sdkOnlyRuntime.networkPolicies?.retryPending+ ? { requeueAfterMs: TRANSIENT_REQUEUE_BASE_MS, requeueFixedInterval: false }+ : {}),}}