Skip to content

Commit 035302b

Browse files
committed
test(core): cover empty planning action batches
1 parent a843269 commit 035302b

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

packages/core/tests/unit-test/task-executor-planning-history.test.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,30 @@ describe('TaskExecutor planning history', () => {
185185
expect(appendLog).not.toHaveBeenCalled();
186186
});
187187

188+
it('does not commit a planning log when no action is executable', async () => {
189+
const appendLog = vi.spyOn(
190+
ConversationHistory.prototype,
191+
'appendHistoricalLog',
192+
);
193+
vi.mocked(standardPlan).mockResolvedValue({
194+
actions: [],
195+
log: 'No action was performed',
196+
shouldContinuePlanning: false,
197+
});
198+
vi.spyOn(taskExecutor, 'convertPlanToExecutable').mockResolvedValue({
199+
tasks: [],
200+
yamlFlow: [],
201+
} as never);
202+
203+
await taskExecutor.action(
204+
'perform the action',
205+
planningModel(),
206+
defaultModel(),
207+
);
208+
209+
expect(appendLog).not.toHaveBeenCalled();
210+
});
211+
188212
it('commits successful deepThink logs to the running sub-goal', async () => {
189213
const history = await runTwoPlanningRounds({
190214
actionExecutor: async () => undefined,

0 commit comments

Comments
 (0)