Skip to content

Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure

TypeScript

fix: force sdk infrastructure retries

Alfredo Lopez7887f7838428
diff --git a/workflow-recipes/package-lock.json b/workflow-recipes/package-lock.json
index 1bb3e51a4..5b304d323 100644
--- a/workflow-recipes/package-lock.json
+++ b/workflow-recipes/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "workload-recipes-controller",
- "version": "0.1.267",
+ "version": "0.1.268",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "workload-recipes-controller",
- "version": "0.1.267",
+ "version": "0.1.268",
"license": "SEE LICENSE IN LICENSE",
"dependencies": {
"@aws-sdk/client-s3": "^3.1009.0",
diff --git a/workflow-recipes/package.json b/workflow-recipes/package.json
index da6f9c460..0226b60f2 100644
--- a/workflow-recipes/package.json
+++ b/workflow-recipes/package.json
@@ -1,6 +1,6 @@
{
"name": "workload-recipes-controller",
- "version": "0.1.267",
+ "version": "0.1.268",
"description": "Workload Recipes Controller (WRC) - WorkloadRecipe lifecycle management and MCP server interface",
"main": "dist/main.js",
"engines": {
diff --git a/workflow-recipes/src/k8sClient.test.ts b/workflow-recipes/src/k8sClient.test.ts
index d2287b2cc..4d650ded5 100644
--- a/workflow-recipes/src/k8sClient.test.ts
+++ b/workflow-recipes/src/k8sClient.test.ts
@@ -483,6 +483,40 @@ describe('runtime credential refresh loop helpers', () => {
).toBe(false)
})
+ it('forces timer-driven infrastructure retries past the status-only generation guard', async () => {
+ const enqueue = vi.fn((_key: string, task: () => Promise<void>) => task())
+ const handleRecipeEvent = vi.fn().mockResolvedValue(undefined)
+ const sdkOnly = makeWorkflowRecipe({
+ metadata: { name: 'sdk-only', namespace: 'sandbox-recipes' },
+ spec: {
+ steps: [],
+ workloads: [{ id: 'api', type: 'deployment', image: 'clerum/api:test' }],
+ pluginWorkloadSdk: { promptBridge: {} },
+ },
+ status: { phase: 'active' },
+ })
+
+ type InternalWatcher = {
+ recipes: Map<string, WorkflowRecipeCRD>
+ eventQueue: { enqueue: typeof enqueue }
+ handleRecipeEvent: typeof handleRecipeEvent
+ refreshRuntimeCredentialsForInProgressRecipes: () => Promise<void>
+ stopped: boolean
+ }
+ const internal = Object.create(WorkflowRecipeWatcher.prototype) as InternalWatcher
+ internal.recipes = new Map([[sdkOnly.metadata.name, sdkOnly]])
+ internal.eventQueue = { enqueue }
+ internal.handleRecipeEvent = handleRecipeEvent
+ internal.stopped = false
+
+ await internal.refreshRuntimeCredentialsForInProgressRecipes()
+
+ expect(enqueue).toHaveBeenCalledWith(sdkOnly.metadata.name, expect.any(Function))
+ expect(handleRecipeEvent).toHaveBeenCalledWith('MODIFIED', sdkOnly, {
+ forceReconcile: true,
+ })
+ })
+
it('keeps reconciling a promptBridge SDK recipe with no run so the eager mcp-host stays configured', () => {
// phase=active, workflowExecution cleared (eager SDK path) — must still requeue.
expect(
@@ -609,7 +643,9 @@ describe('runtime credential refresh loop helpers', () => {
expect(refreshInProgressWorkflowRuntimeCredentials).toHaveBeenCalledWith(initializing)
expect(enqueue).toHaveBeenCalledWith(initializing.metadata.name, expect.any(Function))
- expect(handleRecipeEvent).toHaveBeenCalledWith('MODIFIED', initializing)
+ expect(handleRecipeEvent).toHaveBeenCalledWith('MODIFIED', initializing, {
+ forceReconcile: true,
+ })
})
})
diff --git a/workflow-recipes/src/k8sClient.ts b/workflow-recipes/src/k8sClient.ts
index 559f6d45f..d97309593 100644
--- a/workflow-recipes/src/k8sClient.ts
+++ b/workflow-recipes/src/k8sClient.ts
@@ -969,7 +969,11 @@ export class WorkflowRecipeWatcher implements WorkflowRecipeProvider {
}
if (workflowNeedsInfrastructureReconcile(latest)) {
await this.eventQueue.enqueue(recipeName, () =>
- this.handleRecipeEvent('MODIFIED', latest)
+ // Infrastructure retries are timer-driven with an unchanged CRD
+ // generation. Force the full reconcile; otherwise the watcher
+ // classifies this synthetic MODIFIED event as status-only and
+ // returns before re-running the eager SDK bootstrap lane.
+ this.handleRecipeEvent('MODIFIED', latest, { forceReconcile: true })
)
}
} catch (error) {