Continue runtime and scheduler cleanup

This commit is contained in:
ejclaw
2026-04-08 01:06:47 +09:00
parent 6ea833c18a
commit 90baf7847f
13 changed files with 525 additions and 384 deletions

View File

@@ -16,37 +16,16 @@ import {
resolveQueuedTurnRole,
} from './message-runtime-rules.js';
import type {
AgentType,
ExecuteTurnFn,
RoleToChannelMap,
} from './message-runtime-types.js';
import type {
Channel,
NewMessage,
PairedRoomRole,
PairedTask,
RegisteredGroup,
} from './types.js';
type ExecuteTurnFn = (args: {
group: RegisteredGroup;
prompt: string;
chatJid: string;
runId: string;
channel: Channel;
startSeq: number | null;
endSeq: number | null;
deliveryRole?: PairedRoomRole;
hasHumanMessage?: boolean;
forcedRole?: PairedRoomRole;
forcedAgentType?: AgentType;
}) => Promise<{
outputStatus: 'success' | 'error';
deliverySucceeded: boolean;
visiblePhase: unknown;
}>;
type RoleToChannelMap = Record<
'owner' | 'reviewer' | 'arbiter',
Channel | null
>;
export async function runPendingPairedTurnIfNeeded(args: {
chatJid: string;
group: RegisteredGroup;