fix: keep review requests pending without owner workspace

This commit is contained in:
Eyejoker
2026-03-29 00:21:29 +09:00
parent 29053d3273
commit b0c833fd70
7 changed files with 318 additions and 25 deletions

View File

@@ -91,6 +91,22 @@ describe('isSessionCommandControlMessage', () => {
).toBe(true);
});
it('matches multiline review-updated output', () => {
expect(
isSessionCommandControlMessage(
'Review snapshot updated.\n- Task: paired-task-1',
),
).toBe(true);
});
it('matches pending review output', () => {
expect(
isSessionCommandControlMessage(
'Review request recorded, but the owner workspace is not ready yet.\n- Task: paired-task-1\nThe task stays review_pending until the owner workspace is prepared.',
),
).toBe(true);
});
it('does not match regular bot conversation', () => {
expect(
isSessionCommandControlMessage(
@@ -237,6 +253,31 @@ describe('handleSessionCommand', () => {
);
});
it('sends a pending review message when owner workspace is not ready yet', async () => {
const deps = makeDeps({
markReviewReady: vi
.fn()
.mockResolvedValue(
'Review request recorded, but the owner workspace is not ready yet.\n- Task: paired-task-1\nThe task stays review_pending until the owner workspace is prepared.',
),
});
const result = await handleSessionCommand({
missedMessages: [makeMsg('/review')],
isMainGroup: true,
groupName: 'test',
triggerPattern: trigger,
timezone: 'UTC',
deps,
});
expect(result).toEqual({ handled: true, success: true });
expect(deps.markReviewReady).toHaveBeenCalledTimes(1);
expect(deps.sendMessage).toHaveBeenCalledWith(
'Review request recorded, but the owner workspace is not ready yet.\n- Task: paired-task-1\nThe task stays review_pending until the owner workspace is prepared.',
);
});
it('sends denial to interactable sender in non-main group', async () => {
const deps = makeDeps();
const result = await handleSessionCommand({