Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

test(cos): require preparation before idle execution counts (#12570)

[._.]/ Adam Eivy60386406e7b1
diff --git a/server/services/cosTaskGenerator.idleReviewSteal.test.js b/server/services/cosTaskGenerator.idleReviewSteal.test.js
index ccc2416696..fc5d43ac50 100644
--- a/server/services/cosTaskGenerator.idleReviewSteal.test.js
+++ b/server/services/cosTaskGenerator.idleReviewSteal.test.js
@@ -129,10 +129,14 @@ describe('idle review stealing a queued on-demand request', () => {
task: null, pendingPerpetualDispatch: null, preflightCardId: null,
});
expect(applyOnDemandRunResets).toHaveBeenCalledTimes(1);
- expect(recordExecution).toHaveBeenCalledTimes(1);
+ expect(recordExecution).not.toHaveBeenCalled();
expect(pipeline.securityPreflight).toHaveBeenCalledTimes(1);
preflightRelease.resolve();
- expect((await drains[winner]).preflightCardId).toBe('preflight-demand-1');
+ const result = await drains[winner];
+ expect(result.preflightCardId).toBe('preflight-demand-1');
+ expect(result.task).toBeNull();
+ // The security preflight found no reviewable PR; no task was executed.
+ expect(recordExecution).not.toHaveBeenCalled();
expect(progressOf()).toEqual({ boundTo: 'preflight-demand-1' });
});