Remove queued paired follow-up wrapper

This commit is contained in:
ejclaw
2026-04-29 12:07:43 +09:00
parent 94f44a5d97
commit 3d35feb6f3
2 changed files with 7 additions and 42 deletions

View File

@@ -11,15 +11,10 @@ import {
getProcessableMessages,
} from './message-runtime-rules.js';
import { SERVICE_SESSION_SCOPE } from './config.js';
import type { schedulePairedFollowUpWithMessageCheck } from './message-runtime-follow-up.js';
import type { ExecuteTurnFn } from './message-runtime-types.js';
import type { ScheduledPairedFollowUpIntentKind } from './paired-follow-up-scheduler.js';
import { findChannel, formatMessages } from './router.js';
import type {
Channel,
NewMessage,
PairedTask,
RegisteredGroup,
} from './types.js';
import type { Channel, NewMessage, RegisteredGroup } from './types.js';
export async function processMessageLoopTick(args: {
assistantName: string;
@@ -38,13 +33,7 @@ export async function processMessageLoopTick(args: {
) => boolean;
executeTurn: ExecuteTurnFn;
enqueuePendingHandoffs: () => void;
scheduleQueuedPairedFollowUp: (args: {
chatJid: string;
runId: string;
task: PairedTask | null | undefined;
intentKind: ScheduledPairedFollowUpIntentKind;
enqueue: () => void;
}) => boolean;
schedulePairedFollowUpWithMessageCheck: typeof schedulePairedFollowUpWithMessageCheck;
enqueueScopedGroupMessageCheck: (
chatJid: string,
groupFolder: string,
@@ -104,12 +93,12 @@ export async function processMessageLoopTick(args: {
timezone: args.timezone,
executeTurn: args.executeTurn,
schedulePairedFollowUp: (task, intentKind, followUpRunId) =>
args.scheduleQueuedPairedFollowUp({
args.schedulePairedFollowUpWithMessageCheck({
chatJid,
runId: followUpRunId,
task,
intentKind,
enqueue: () =>
enqueueMessageCheck: () =>
args.enqueueScopedGroupMessageCheck(chatJid, group.folder),
}),
enqueueMessageCheck: () =>

View File

@@ -35,15 +35,8 @@ import {
} from './message-runtime-rules.js';
import { resolveOwnerTaskForHumanMessage } from './paired-execution-context.js';
import { schedulePairedFollowUpWithMessageCheck } from './message-runtime-follow-up.js';
import { type ScheduledPairedFollowUpIntentKind } from './paired-follow-up-scheduler.js';
import { transitionPairedTaskStatus } from './paired-task-status.js';
import {
Channel,
NewMessage,
type PairedRoomRole,
RegisteredGroup,
type PairedTask,
} from './types.js';
import { Channel, NewMessage, RegisteredGroup } from './types.js';
import { createScopedLogger, logger } from './logger.js';
import { hasReviewerLease } from './service-routing.js';
export {
@@ -124,23 +117,6 @@ export function createMessageRuntime(deps: MessageRuntimeDeps): {
deps.queue,
);
const scheduleQueuedPairedFollowUp = (args: {
chatJid: string;
runId: string;
task: PairedTask | null | undefined;
intentKind: ScheduledPairedFollowUpIntentKind;
enqueue: () => void;
fallbackLastTurnOutputRole?: PairedRoomRole | null;
}): boolean =>
schedulePairedFollowUpWithMessageCheck({
chatJid: args.chatJid,
runId: args.runId,
task: args.task,
intentKind: args.intentKind,
enqueueMessageCheck: args.enqueue,
fallbackLastTurnOutputRole: args.fallbackLastTurnOutputRole,
});
/**
* Check if a message is a duplicate of the last bot final message in a paired room.
* Returns true if duplicate (should be suppressed).
@@ -559,7 +535,7 @@ export function createMessageRuntime(deps: MessageRuntimeDeps): {
hasImplicitContinuationWindow: continuationTracker.has,
executeTurn,
enqueuePendingHandoffs,
scheduleQueuedPairedFollowUp,
schedulePairedFollowUpWithMessageCheck,
enqueueScopedGroupMessageCheck,
sendQueuedMessage: deps.queue.sendMessage.bind(deps.queue),
closeStdin: (chatJid, reason) =>