style: sync high-risk plan gate formatting
This commit is contained in:
@@ -344,10 +344,9 @@ describe('createMessageRuntime', () => {
|
|||||||
is_from_me: true,
|
is_from_me: true,
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
const actualSessionCommands =
|
const actualSessionCommands = await vi.importActual<
|
||||||
await vi.importActual<typeof import('./session-commands.js')>(
|
typeof import('./session-commands.js')
|
||||||
'./session-commands.js',
|
>('./session-commands.js');
|
||||||
);
|
|
||||||
vi.mocked(sessionCommands.handleSessionCommand).mockImplementation((opts) =>
|
vi.mocked(sessionCommands.handleSessionCommand).mockImplementation((opts) =>
|
||||||
actualSessionCommands.handleSessionCommand(opts),
|
actualSessionCommands.handleSessionCommand(opts),
|
||||||
);
|
);
|
||||||
@@ -428,10 +427,9 @@ describe('createMessageRuntime', () => {
|
|||||||
is_from_me: true,
|
is_from_me: true,
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
const actualSessionCommands =
|
const actualSessionCommands = await vi.importActual<
|
||||||
await vi.importActual<typeof import('./session-commands.js')>(
|
typeof import('./session-commands.js')
|
||||||
'./session-commands.js',
|
>('./session-commands.js');
|
||||||
);
|
|
||||||
vi.mocked(sessionCommands.handleSessionCommand).mockImplementation((opts) =>
|
vi.mocked(sessionCommands.handleSessionCommand).mockImplementation((opts) =>
|
||||||
actualSessionCommands.handleSessionCommand(opts),
|
actualSessionCommands.handleSessionCommand(opts),
|
||||||
);
|
);
|
||||||
@@ -504,10 +502,9 @@ describe('createMessageRuntime', () => {
|
|||||||
is_from_me: true,
|
is_from_me: true,
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
const actualSessionCommands =
|
const actualSessionCommands = await vi.importActual<
|
||||||
await vi.importActual<typeof import('./session-commands.js')>(
|
typeof import('./session-commands.js')
|
||||||
'./session-commands.js',
|
>('./session-commands.js');
|
||||||
);
|
|
||||||
vi.mocked(sessionCommands.handleSessionCommand).mockImplementation((opts) =>
|
vi.mocked(sessionCommands.handleSessionCommand).mockImplementation((opts) =>
|
||||||
actualSessionCommands.handleSessionCommand(opts),
|
actualSessionCommands.handleSessionCommand(opts),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -442,7 +442,9 @@ describe('paired execution context', () => {
|
|||||||
roomRoleContext: ownerContext,
|
roomRoleContext: ownerContext,
|
||||||
});
|
});
|
||||||
|
|
||||||
expect(pairedWorkspaceManager.markPairedTaskReviewReady).not.toHaveBeenCalled();
|
expect(
|
||||||
|
pairedWorkspaceManager.markPairedTaskReviewReady,
|
||||||
|
).not.toHaveBeenCalled();
|
||||||
expect(result).toEqual({
|
expect(result).toEqual({
|
||||||
status: 'blocked',
|
status: 'blocked',
|
||||||
task: expect.objectContaining({
|
task: expect.objectContaining({
|
||||||
|
|||||||
@@ -407,7 +407,9 @@ export function setRoomTaskRiskLevel(args: {
|
|||||||
if (riskLevel === 'high') {
|
if (riskLevel === 'high') {
|
||||||
updatePairedTask(task.id, {
|
updatePairedTask(task.id, {
|
||||||
risk_level: 'high',
|
risk_level: 'high',
|
||||||
plan_status: hasCompletePlanArtifacts(task.id) ? 'pending' : 'not_requested',
|
plan_status: hasCompletePlanArtifacts(task.id)
|
||||||
|
? 'pending'
|
||||||
|
: 'not_requested',
|
||||||
status: 'plan_review_pending',
|
status: 'plan_review_pending',
|
||||||
updated_at: now,
|
updated_at: now,
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -141,9 +141,9 @@ describe('isSessionCommandControlMessage', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('matches plan artifact control output', () => {
|
it('matches plan artifact control output', () => {
|
||||||
expect(isSessionCommandControlMessage('Plan recorded.\n- Task: task-1')).toBe(
|
expect(
|
||||||
true,
|
isSessionCommandControlMessage('Plan recorded.\n- Task: task-1'),
|
||||||
);
|
).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('does not match regular bot conversation', () => {
|
it('does not match regular bot conversation', () => {
|
||||||
|
|||||||
@@ -198,14 +198,17 @@ export async function handleSessionCommand(opts: {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (command === '/risk') {
|
if (command === '/risk') {
|
||||||
const riskArg = normalizedCommandText.slice('/risk'.length).trim().toLowerCase();
|
const riskArg = normalizedCommandText
|
||||||
|
.slice('/risk'.length)
|
||||||
|
.trim()
|
||||||
|
.toLowerCase();
|
||||||
const riskLevel =
|
const riskLevel =
|
||||||
riskArg === 'high' ? 'high' : riskArg === 'low' ? 'low' : null;
|
riskArg === 'high' ? 'high' : riskArg === 'low' ? 'low' : null;
|
||||||
deps.advanceCursor(cmdMsg.timestamp);
|
deps.advanceCursor(cmdMsg.timestamp);
|
||||||
await deps.sendMessage(
|
await deps.sendMessage(
|
||||||
riskLevel
|
riskLevel
|
||||||
? (await deps.setTaskRiskLevel(riskLevel)) ??
|
? ((await deps.setTaskRiskLevel(riskLevel)) ??
|
||||||
'Risk is unavailable for this room.'
|
'Risk is unavailable for this room.')
|
||||||
: 'Usage: /risk <low|high>',
|
: 'Usage: /risk <low|high>',
|
||||||
);
|
);
|
||||||
return { handled: true, success: true };
|
return { handled: true, success: true };
|
||||||
@@ -234,7 +237,8 @@ export async function handleSessionCommand(opts: {
|
|||||||
if (command === '/approve-plan') {
|
if (command === '/approve-plan') {
|
||||||
deps.advanceCursor(cmdMsg.timestamp);
|
deps.advanceCursor(cmdMsg.timestamp);
|
||||||
await deps.sendMessage(
|
await deps.sendMessage(
|
||||||
(await deps.approvePlan()) ?? 'Plan approval is unavailable for this room.',
|
(await deps.approvePlan()) ??
|
||||||
|
'Plan approval is unavailable for this room.',
|
||||||
);
|
);
|
||||||
return { handled: true, success: true };
|
return { handled: true, success: true };
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user