mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-16 20:01:24 +00:00
Unify completion callback pattern across browser-javascript and javascript-repl
- Remove fallback timeout from ConsoleRuntimeProvider (was causing 2s delays) - Add completion callback support to SandboxedIframe REPL wrapper - Call completion callbacks before window.complete() in both success/error paths - Both browser-javascript and javascript-repl now use identical completion pattern - Ensures console logs are batched and sent before execution completes
This commit is contained in:
parent
6983ad4eaa
commit
33418d9dea
2 changed files with 20 additions and 9 deletions
|
|
@ -143,15 +143,6 @@ export class ConsoleRuntimeProvider implements SandboxRuntimeProvider {
|
|||
}
|
||||
}
|
||||
};
|
||||
|
||||
// Fallback timeout for HTML artifacts that don't call complete()
|
||||
if (document.readyState === "complete" || document.readyState === "interactive") {
|
||||
setTimeout(() => (window as any).complete(), 2000);
|
||||
} else {
|
||||
window.addEventListener("load", () => {
|
||||
setTimeout(() => (window as any).complete(), 2000);
|
||||
});
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue