@hexabot-ai/agentic 3.1.1-alpha.0 → 3.1.2-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -226,7 +226,7 @@ function buildSuspensionForPath(deps, steps, state, targetPath, pathPrefix, iter
226
226
  if (next) {
227
227
  return next;
228
228
  }
229
- return undefined;
229
+ return deps.executeFlow(steps, state, pathPrefix, current + 1);
230
230
  },
231
231
  };
232
232
  }
@@ -221,7 +221,7 @@ export function buildSuspensionForPath(deps, steps, state, targetPath, pathPrefi
221
221
  if (next) {
222
222
  return next;
223
223
  }
224
- return undefined;
224
+ return deps.executeFlow(steps, state, pathPrefix, current + 1);
225
225
  },
226
226
  };
227
227
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hexabot-ai/agentic",
3
- "version": "3.1.1-alpha.0",
3
+ "version": "3.1.2-alpha.0",
4
4
  "description": "Schemas and utilities for the Hexabot agentic workflow DSL.",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -220,6 +220,54 @@ describe('rebuildSuspension', () => {
220
220
  expect(deps.executeFlow).toHaveBeenCalledWith(compiled.flow, state, [], 1);
221
221
  });
222
222
 
223
+ it('continues outer flow after resuming a suspension inside a conditional branch', async () => {
224
+ const branchTask = createTask('branch_task');
225
+ const afterTask = createTask('after_task');
226
+ const branchStep: CompiledStep = {
227
+ type: StepType.Task,
228
+ id: '0.branch.0.0:branch_task',
229
+ label: 'branch_task',
230
+ taskName: 'branch_task',
231
+ };
232
+ const conditionalStep: CompiledStep = {
233
+ type: StepType.Conditional,
234
+ id: '0:conditional',
235
+ label: 'conditional',
236
+ branches: [{ id: '0:branch_0', steps: [branchStep] }],
237
+ };
238
+ const outerStep: CompiledStep = {
239
+ type: StepType.Task,
240
+ id: '1:after_task',
241
+ label: 'after_task',
242
+ taskName: 'after_task',
243
+ };
244
+ const compiled = createCompiledWorkflow([conditionalStep, outerStep], {
245
+ branch_task: branchTask,
246
+ after_task: afterTask,
247
+ });
248
+ const state: ExecutionState = {
249
+ input: {},
250
+ output: {},
251
+ iterationStack: [],
252
+ };
253
+ const deps = createDeps(compiled);
254
+ deps.executeFlow = jest
255
+ .fn()
256
+ .mockResolvedValue(undefined) as SuspensionRebuilderDeps['executeFlow'];
257
+
258
+ const suspension = rebuildSuspension(deps, {
259
+ state,
260
+ stepId: '0.branch.0.0:branch_task',
261
+ });
262
+
263
+ await suspension?.continue({ reply: 'ok' });
264
+
265
+ expect(deps.captureTaskOutput).toHaveBeenCalledWith(branchTask, state, {
266
+ reply: 'ok',
267
+ });
268
+ expect(deps.executeFlow).toHaveBeenCalledWith(compiled.flow, state, [], 1);
269
+ });
270
+
223
271
  it('rebuilds a parallel suspension and continues remaining siblings when needed', async () => {
224
272
  const firstTask = createTask('child_a');
225
273
  const secondTask = createTask('child_b');
@@ -390,7 +390,7 @@ export function buildSuspensionForPath(
390
390
  return next;
391
391
  }
392
392
 
393
- return undefined;
393
+ return deps.executeFlow(steps, state, pathPrefix, current + 1);
394
394
  },
395
395
  };
396
396
  }