mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-16 20:01:24 +00:00
Fix ConsoleRuntimeProvider blocking execution-complete from reaching executionConsumer
- ConsoleRuntimeProvider was handling execution-complete and returning true - This stopped message propagation before executionConsumer could handle it - ExecutionConsumer never got execution-complete, so promise never resolved - Now ConsoleRuntimeProvider responds but returns false to allow propagation - Fixes javascript_repl never completing (30s timeout)
This commit is contained in:
parent
5dcb5ecc89
commit
3f29ce9cb6
1 changed files with 8 additions and 10 deletions
|
|
@ -128,14 +128,18 @@ export class ConsoleRuntimeProvider implements SandboxRuntimeProvider {
|
|||
|
||||
if ((window as any).sendRuntimeMessage) {
|
||||
if (finalError) {
|
||||
console.log("Reporting execution error:", finalError);
|
||||
await (window as any).sendRuntimeMessage({
|
||||
type: "execution-error",
|
||||
error: finalError,
|
||||
});
|
||||
console.log("Execution completed");
|
||||
} else {
|
||||
console.log("Reporting execution complete");
|
||||
await (window as any).sendRuntimeMessage({
|
||||
type: "execution-complete",
|
||||
});
|
||||
console.log("Execution completed");
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
@ -162,17 +166,11 @@ export class ConsoleRuntimeProvider implements SandboxRuntimeProvider {
|
|||
return true;
|
||||
}
|
||||
|
||||
if (message.type === "execution-complete") {
|
||||
this.completed = true;
|
||||
// Don't handle execution-complete/error - let executionConsumer handle those
|
||||
// We just need to respond to allow the message to proceed
|
||||
if (message.type === "execution-complete" || message.type === "execution-error") {
|
||||
respond({ success: true });
|
||||
return true;
|
||||
}
|
||||
|
||||
if (message.type === "execution-error") {
|
||||
this.completed = true;
|
||||
this.completionError = message.error;
|
||||
respond({ success: true });
|
||||
return true;
|
||||
return false; // Don't stop propagation
|
||||
}
|
||||
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue