Files
PaperClipAI/tests/runner-e2e/interaction-response-gate.ts
T
DottaandPaperclip cd34aaee0c Fix native Claude question bridging and runner behavioral regressions
Validate completion revisions in-turn, clarify text questions and approved handoffs, and make continuation and approval-overlap fixtures deterministic. Add native Claude question round-trip coverage.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-09-18 22:05:48 -05:00

18 lines
695 B
TypeScript

/** Test-only transport barrier: the card is committed, but its creation response
* stays in flight until the browser answers. No provider instructions change. */
export async function holdInteractionResponse(input: {
loadStatus(): Promise<string>;
deadlineAt: number;
now?: () => number;
pause?: () => Promise<void>;
}) {
const now = input.now ?? Date.now;
const pause = input.pause ?? (() => new Promise<void>((r) => setTimeout(r, 50)));
while (now() < input.deadlineAt) {
const status = await input.loadStatus();
if (status !== "pending") return status;
await pause();
}
throw new Error("Approval overlap fixture timed out waiting for the browser response");
}