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