Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/provider/rotation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ export function registerExhaustionRotation(
'info',
);
awaitingContinuation = true;
pi.sendUserMessage(ROTATION_CONTINUATION);
pi.sendUserMessage(ROTATION_CONTINUATION, { deliverAs: 'followUp' });
return;
}

Expand Down
8 changes: 6 additions & 2 deletions tests/provider/rotation.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,9 @@ describe('Grok CLI exhaustion rotation', () => {
});
expect((await getAccountVault()).activeAccountId).toBe('account-1');
expect(test.setModel).not.toHaveBeenCalled();
expect(test.sendUserMessage).toHaveBeenCalledWith(ROTATION_CONTINUATION);
expect(test.sendUserMessage).toHaveBeenCalledWith(ROTATION_CONTINUATION, {
deliverAs: 'followUp',
});
Comment on lines +139 to +141

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Follow-up lifecycle remains untested

These assertions only check the arguments passed to a bare vi.fn(). They do not reproduce an active turn, the previous already-processing error, or follow-up delivery while streaming and idle. A regression in the queueing lifecycle could therefore pass these tests. The same concern applies to the assertion at lines 265–267; add a lifecycle-level test that models active-turn queueing and the subsequent continuation delivery.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Fix in Codex Fix in Claude Code

expect(test.notify).toHaveBeenCalledWith(
'Grok CLI: “Account 1” exhausted; switched to “Work” and continuing.',
'info',
Expand Down Expand Up @@ -260,6 +262,8 @@ describe('Grok CLI exhaustion rotation', () => {
await expect(pending).resolves.toBeUndefined();
expect(test.selection.accountId('session-a')).toBe('account-3');
expect((await getAccountVault()).activeAccountId).toBe('account-1');
expect(test.sendUserMessage).toHaveBeenCalledWith(ROTATION_CONTINUATION);
expect(test.sendUserMessage).toHaveBeenCalledWith(ROTATION_CONTINUATION, {
deliverAs: 'followUp',
});
});
});
Loading