test: align message runtime mocks with reviewer session flag

This commit is contained in:
ejclaw
2026-04-22 06:50:56 +09:00
parent 2b32b72119
commit fa30124b46
3 changed files with 18 additions and 5 deletions

View File

@@ -118,7 +118,11 @@ export function buildPendingPairedTurn(args: {
const cursor = lastRaw?.seq ?? lastRaw?.timestamp ?? null; const cursor = lastRaw?.seq ?? lastRaw?.timestamp ?? null;
const taskStatus = task.status; const taskStatus = task.status;
const turnOutputs = getPairedTurnOutputs(task.id); const turnOutputs = getPairedTurnOutputs(task.id);
const priorTaskContext = resolvePriorTaskPromptContext(chatJid, task, turnOutputs); const priorTaskContext = resolvePriorTaskPromptContext(
chatJid,
task,
turnOutputs,
);
const lastTurnOutput = turnOutputs[turnOutputs.length - 1]; const lastTurnOutput = turnOutputs[turnOutputs.length - 1];
const nextTurnAction = resolveNextTurnAction({ const nextTurnAction = resolveNextTurnAction({
taskStatus, taskStatus,

View File

@@ -124,7 +124,9 @@ describe('message-runtime-prompts carry-forward guidance', () => {
}, },
}); });
expect(prompt).toContain('Background from the previous completed paired task:'); expect(prompt).toContain(
'Background from the previous completed paired task:',
);
expect(prompt).toContain('Previous task owner final:'); expect(prompt).toContain('Previous task owner final:');
expect(prompt).toContain('이전 owner 결론'); expect(prompt).toContain('이전 owner 결론');
expect(prompt).toContain('Previous task reviewer final:'); expect(prompt).toContain('Previous task reviewer final:');
@@ -144,7 +146,9 @@ describe('message-runtime-prompts carry-forward guidance', () => {
}, },
}); });
expect(prompt).toContain('Background from the previous completed paired task:'); expect(prompt).toContain(
'Background from the previous completed paired task:',
);
expect(prompt).toContain('Previous task owner final:'); expect(prompt).toContain('Previous task owner final:');
expect(prompt).toContain('Previous task reviewer final:'); expect(prompt).toContain('Previous task reviewer final:');
expect(prompt).toContain('추가 owner 질문'); expect(prompt).toContain('추가 owner 질문');

View File

@@ -35,6 +35,7 @@ vi.mock('./config.js', () => ({
CODEX_REVIEW_SERVICE_ID: 'codex-review', CODEX_REVIEW_SERVICE_ID: 'codex-review',
REVIEWER_AGENT_TYPE: 'claude-code', REVIEWER_AGENT_TYPE: 'claude-code',
ARBITER_AGENT_TYPE: undefined, ARBITER_AGENT_TYPE: undefined,
shouldForceFreshClaudeReviewerSessionInUnsafeHostMode: vi.fn(() => false),
normalizeServiceId: vi.fn((serviceId: string) => serviceId), normalizeServiceId: vi.fn((serviceId: string) => serviceId),
isClaudeService: vi.fn(() => true), isClaudeService: vi.fn(() => true),
isReviewService: vi.fn(() => false), isReviewService: vi.fn(() => false),
@@ -1952,7 +1953,9 @@ If your first line is DONE_WITH_CONCERNS, the system will reopen review instead
updated_at: '2026-03-30T00:00:09.000Z', updated_at: '2026-03-30T00:00:09.000Z',
} as any; } as any;
vi.mocked(db.getLatestPreviousPairedTaskForChat).mockReturnValue(previousTask); vi.mocked(db.getLatestPreviousPairedTaskForChat).mockReturnValue(
previousTask,
);
vi.mocked(db.getPairedTurnOutputs).mockImplementation((taskId: string) => { vi.mocked(db.getPairedTurnOutputs).mockImplementation((taskId: string) => {
if (taskId === currentTask.id) { if (taskId === currentTask.id) {
return []; return [];
@@ -1992,7 +1995,9 @@ If your first line is DONE_WITH_CONCERNS, the system will reopen review instead
}); });
expect(pending).not.toBeNull(); expect(pending).not.toBeNull();
expect(pending?.prompt).toContain('Background from the previous completed paired task:'); expect(pending?.prompt).toContain(
'Background from the previous completed paired task:',
);
expect(pending?.prompt).toContain('Previous task owner final:'); expect(pending?.prompt).toContain('Previous task owner final:');
expect(pending?.prompt).toContain('이전 owner 답변'); expect(pending?.prompt).toContain('이전 owner 답변');
expect(pending?.prompt).toContain('Previous task reviewer final:'); expect(pending?.prompt).toContain('Previous task reviewer final:');