fix: /clear resets paired task to prevent reviewer auto-triggering after session clear

This commit is contained in:
Eyejoker
2026-03-29 21:07:34 +09:00
parent d8cb4b691e
commit 9127841359
3 changed files with 24 additions and 2 deletions

View File

@@ -80,6 +80,8 @@ export interface SessionCommandDeps {
/** Whether the denied sender would normally be allowed to interact (for denial messages). */
canSenderInteract: (msg: NewMessage) => boolean;
markReviewReady: () => Promise<string | null>;
/** Reset/complete the active paired task so ping-pong stops. */
resetPairedTask?: () => void;
/** Kill the currently running agent process for this group. Returns true if a process was killed. */
killProcess: () => boolean;
}
@@ -159,6 +161,7 @@ export async function handleSessionCommand(opts: {
if (command === '/clear') {
deps.closeStdin();
deps.clearSession({ allRoles: true });
deps.resetPairedTask?.();
deps.advanceCursor(cmdMsg.timestamp);
await deps.sendMessage(
'Current session cleared. The next message will start a new conversation.',