Merge pull request #101 from phj1081/codex/owner/ejclaw

Remove queued paired follow-up wrapper
This commit is contained in:
Eyejoker
2026-04-29 12:14:38 +09:00
committed by GitHub
2 changed files with 7 additions and 42 deletions

View File

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

View File

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