fix: harden paired runtime turn coordination

This commit is contained in:
ejclaw
2026-04-09 13:52:42 +09:00
parent e7a7b538b2
commit 0f994ab2ce
27 changed files with 2108 additions and 295 deletions

View File

@@ -82,6 +82,8 @@ export type NextTurnAction =
| { kind: 'owner-follow-up' }
| { kind: 'finalize-owner-turn' };
export type ScheduledNextTurnActionKind = Exclude<NextTurnAction['kind'], 'none'>;
export type FollowUpDispatch =
| { kind: 'none' }
| { kind: 'inline' }
@@ -116,6 +118,19 @@ export function resolveNextTurnAction(args: {
}
}
export function matchesExpectedPairedFollowUpIntent(args: {
taskStatus?: PairedTaskStatus | null;
lastTurnOutputRole?: PairedRoomRole | null;
intentKind: ScheduledNextTurnActionKind;
}): boolean {
return (
resolveNextTurnAction({
taskStatus: args.taskStatus,
lastTurnOutputRole: args.lastTurnOutputRole,
}).kind === args.intentKind
);
}
export function resolveFollowUpDispatch(args: {
source:
| 'delivery-success'