style: apply prettier formatting
This commit is contained in:
@@ -619,13 +619,7 @@ export function refreshPairedTaskExecutionLeaseInDatabase(
|
||||
AND expires_at >= ?
|
||||
`,
|
||||
)
|
||||
.run(
|
||||
now,
|
||||
computeExecutionLeaseExpiry(now),
|
||||
args.taskId,
|
||||
args.runId,
|
||||
now,
|
||||
);
|
||||
.run(now, computeExecutionLeaseExpiry(now), args.taskId, args.runId, now);
|
||||
return result.changes > 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -57,12 +57,7 @@ vi.mock('./db.js', () => {
|
||||
taskUpdatedAt: string;
|
||||
intentKind: string;
|
||||
}) =>
|
||||
[
|
||||
args.chatJid,
|
||||
args.taskId,
|
||||
args.taskUpdatedAt,
|
||||
args.intentKind,
|
||||
].join(':');
|
||||
[args.chatJid, args.taskId, args.taskUpdatedAt, args.intentKind].join(':');
|
||||
|
||||
return {
|
||||
createServiceHandoff: vi.fn(),
|
||||
|
||||
@@ -84,10 +84,10 @@ export function resolvePairedFollowUpDecision(args: {
|
||||
export function schedulePairedFollowUpIntent(args: {
|
||||
chatJid: string;
|
||||
runId: string;
|
||||
task: Pick<
|
||||
PairedTask,
|
||||
'id' | 'status' | 'round_trip_count' | 'updated_at'
|
||||
> | null | undefined;
|
||||
task:
|
||||
| Pick<PairedTask, 'id' | 'status' | 'round_trip_count' | 'updated_at'>
|
||||
| null
|
||||
| undefined;
|
||||
intentKind: ScheduledPairedFollowUpIntentKind;
|
||||
enqueue: () => void;
|
||||
fallbackLastTurnOutputRole?: PairedRoomRole | null;
|
||||
@@ -126,10 +126,10 @@ export function schedulePairedFollowUpIntent(args: {
|
||||
export function schedulePairedFollowUpWithMessageCheck(args: {
|
||||
chatJid: string;
|
||||
runId: string;
|
||||
task: Pick<
|
||||
PairedTask,
|
||||
'id' | 'status' | 'round_trip_count' | 'updated_at'
|
||||
> | null | undefined;
|
||||
task:
|
||||
| Pick<PairedTask, 'id' | 'status' | 'round_trip_count' | 'updated_at'>
|
||||
| null
|
||||
| undefined;
|
||||
intentKind: ScheduledPairedFollowUpIntentKind;
|
||||
enqueueMessageCheck: () => void;
|
||||
fallbackLastTurnOutputRole?: PairedRoomRole | null;
|
||||
@@ -149,10 +149,10 @@ export function schedulePairedFollowUpWithMessageCheck(args: {
|
||||
export function dispatchPairedFollowUpForEvent(args: {
|
||||
chatJid: string;
|
||||
runId: string;
|
||||
task: Pick<
|
||||
PairedTask,
|
||||
'id' | 'status' | 'round_trip_count' | 'updated_at'
|
||||
> | null | undefined;
|
||||
task:
|
||||
| Pick<PairedTask, 'id' | 'status' | 'round_trip_count' | 'updated_at'>
|
||||
| null
|
||||
| undefined;
|
||||
source: PairedFollowUpSource;
|
||||
completedRole?: PairedRoomRole;
|
||||
executionStatus?: 'succeeded' | 'failed';
|
||||
@@ -212,10 +212,10 @@ export function dispatchPairedFollowUpForEvent(args: {
|
||||
export function enqueuePairedFollowUpAfterEvent(args: {
|
||||
chatJid: string;
|
||||
runId: string;
|
||||
task: Pick<
|
||||
PairedTask,
|
||||
'id' | 'status' | 'round_trip_count' | 'updated_at'
|
||||
> | null | undefined;
|
||||
task:
|
||||
| Pick<PairedTask, 'id' | 'status' | 'round_trip_count' | 'updated_at'>
|
||||
| null
|
||||
| undefined;
|
||||
source: PairedFollowUpSource;
|
||||
completedRole?: PairedRoomRole;
|
||||
executionStatus?: 'succeeded' | 'failed';
|
||||
|
||||
@@ -82,7 +82,10 @@ export type NextTurnAction =
|
||||
| { kind: 'owner-follow-up' }
|
||||
| { kind: 'finalize-owner-turn' };
|
||||
|
||||
export type ScheduledNextTurnActionKind = Exclude<NextTurnAction['kind'], 'none'>;
|
||||
export type ScheduledNextTurnActionKind = Exclude<
|
||||
NextTurnAction['kind'],
|
||||
'none'
|
||||
>;
|
||||
|
||||
export type FollowUpDispatch =
|
||||
| { kind: 'none' }
|
||||
|
||||
@@ -73,12 +73,7 @@ vi.mock('./db.js', () => {
|
||||
taskUpdatedAt: string;
|
||||
intentKind: string;
|
||||
}) =>
|
||||
[
|
||||
args.chatJid,
|
||||
args.taskId,
|
||||
args.taskUpdatedAt,
|
||||
args.intentKind,
|
||||
].join(':');
|
||||
[args.chatJid, args.taskId, args.taskUpdatedAt, args.intentKind].join(':');
|
||||
|
||||
return {
|
||||
claimServiceHandoff: vi.fn(() => true),
|
||||
@@ -2012,21 +2007,22 @@ If your first line is DONE_WITH_CONCERNS, the system will reopen review instead
|
||||
vi.mocked(db.getLatestOpenPairedTaskForChat).mockImplementation(
|
||||
() => pairedTask,
|
||||
);
|
||||
vi.mocked(db.getMessagesSince).mockImplementation((_chatJid, sinceCursor) =>
|
||||
sinceCursor && sinceCursor !== '0'
|
||||
? []
|
||||
: ([
|
||||
{
|
||||
id: 'human-dedup-1',
|
||||
chat_jid: chatJid,
|
||||
sender: 'user@test',
|
||||
sender_name: 'User',
|
||||
content: '이 구현 진행해줘',
|
||||
timestamp: '2026-03-30T00:00:00.000Z',
|
||||
seq: 1,
|
||||
is_bot_message: false,
|
||||
},
|
||||
] as any),
|
||||
vi.mocked(db.getMessagesSince).mockImplementation(
|
||||
(_chatJid, sinceCursor) =>
|
||||
sinceCursor && sinceCursor !== '0'
|
||||
? []
|
||||
: ([
|
||||
{
|
||||
id: 'human-dedup-1',
|
||||
chat_jid: chatJid,
|
||||
sender: 'user@test',
|
||||
sender_name: 'User',
|
||||
content: '이 구현 진행해줘',
|
||||
timestamp: '2026-03-30T00:00:00.000Z',
|
||||
seq: 1,
|
||||
is_bot_message: false,
|
||||
},
|
||||
] as any),
|
||||
);
|
||||
vi.mocked(agentRunner.runAgentProcess).mockImplementation(
|
||||
async (_group, _input, _onProcess, onOutput) => {
|
||||
@@ -2513,21 +2509,22 @@ If your first line is DONE_WITH_CONCERNS, the system will reopen review instead
|
||||
vi.mocked(db.getLatestOpenPairedTaskForChat).mockImplementation(
|
||||
() => pairedTask,
|
||||
);
|
||||
vi.mocked(db.getMessagesSince).mockImplementation((_chatJid, sinceCursor) =>
|
||||
sinceCursor && sinceCursor !== '0'
|
||||
? []
|
||||
: ([
|
||||
{
|
||||
id: 'human-dedup-across-runs-1',
|
||||
chat_jid: chatJid,
|
||||
sender: 'user@test',
|
||||
sender_name: 'User',
|
||||
content: '이 구현 진행해줘',
|
||||
timestamp: '2026-03-30T00:00:00.000Z',
|
||||
seq: 1,
|
||||
is_bot_message: false,
|
||||
},
|
||||
] as any),
|
||||
vi.mocked(db.getMessagesSince).mockImplementation(
|
||||
(_chatJid, sinceCursor) =>
|
||||
sinceCursor && sinceCursor !== '0'
|
||||
? []
|
||||
: ([
|
||||
{
|
||||
id: 'human-dedup-across-runs-1',
|
||||
chat_jid: chatJid,
|
||||
sender: 'user@test',
|
||||
sender_name: 'User',
|
||||
content: '이 구현 진행해줘',
|
||||
timestamp: '2026-03-30T00:00:00.000Z',
|
||||
seq: 1,
|
||||
is_bot_message: false,
|
||||
},
|
||||
] as any),
|
||||
);
|
||||
vi.mocked(agentRunner.runAgentProcess).mockImplementation(
|
||||
async (_group, _input, _onProcess, onOutput) => {
|
||||
|
||||
@@ -195,9 +195,7 @@ describe('paired follow-up scheduler', () => {
|
||||
intentKind: 'reviewer-turn',
|
||||
});
|
||||
|
||||
expect(first).toMatch(
|
||||
/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/,
|
||||
);
|
||||
expect(first).toMatch(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/);
|
||||
expect(second).toBeNull();
|
||||
expect(getPairedTaskById(task.id)?.updated_at).toBe(first);
|
||||
});
|
||||
@@ -238,9 +236,7 @@ describe('paired follow-up scheduler', () => {
|
||||
task,
|
||||
intentKind: 'reviewer-turn',
|
||||
});
|
||||
expect(first).toMatch(
|
||||
/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/,
|
||||
);
|
||||
expect(first).toMatch(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/);
|
||||
|
||||
_initTestDatabaseFromFile(dbPath);
|
||||
const freshTask = getPairedTaskById(task.id);
|
||||
@@ -272,11 +268,7 @@ describe('paired follow-up scheduler', () => {
|
||||
WHERE task_id = ?
|
||||
`,
|
||||
)
|
||||
.run(
|
||||
'2020-01-01T00:00:00.000Z',
|
||||
'2020-01-01T00:00:00.000Z',
|
||||
task.id,
|
||||
);
|
||||
.run('2020-01-01T00:00:00.000Z', '2020-01-01T00:00:00.000Z', task.id);
|
||||
rawDatabase.close();
|
||||
|
||||
_initTestDatabaseFromFile(dbPath);
|
||||
|
||||
Reference in New Issue
Block a user