@hexabot-ai/agentic 3.1.1-alpha.0 → 3.1.2-alpha.1
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.
package/package.json
CHANGED
|
@@ -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');
|