fix: carry paired turn attachments into review context (#201)

This commit is contained in:
Eyejoker
2026-05-31 14:49:56 +09:00
committed by GitHub
parent 37b57b20bb
commit 6eca648c47
22 changed files with 615 additions and 67 deletions

View File

@@ -0,0 +1,49 @@
import { Database } from 'bun:sqlite';
import { describe, expect, it } from 'vitest';
import { applyBaseSchema } from './db/base-schema.js';
import {
getPairedTurnOutputsFromDatabase,
insertPairedTurnOutputInDatabase,
} from './db/paired-turn-outputs.js';
describe('paired turn output attachments', () => {
it('preserves attachments for reviewer evidence prompts', () => {
const database = new Database(':memory:');
try {
applyBaseSchema(database);
insertPairedTurnOutputInDatabase(
database,
'paired-task-turn-output-attachments',
1,
'owner',
'TASK_DONE\n새 스크린샷 첨부',
{
attachments: [
{
path: '/tmp/settings-v0.1.92-deployed-390.png',
name: 'settings-v0.1.92-deployed-390.png',
mime: 'image/png',
},
],
},
);
const outputs = getPairedTurnOutputsFromDatabase(
database,
'paired-task-turn-output-attachments',
);
expect(outputs[0].attachments).toEqual([
{
path: '/tmp/settings-v0.1.92-deployed-390.png',
name: 'settings-v0.1.92-deployed-390.png',
mime: 'image/png',
},
]);
} finally {
database.close();
}
});
});