mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-19 13:01:41 +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 ((window as any).sendRuntimeMessage) {
|
||||||
if (finalError) {
|
if (finalError) {
|
||||||
|
console.log("Reporting execution error:", finalError);
|
||||||
await (window as any).sendRuntimeMessage({
|
await (window as any).sendRuntimeMessage({
|
||||||
type: "execution-error",
|
type: "execution-error",
|
||||||
error: finalError,
|
error: finalError,
|
||||||
});
|
});
|
||||||
|
console.log("Execution completed");
|
||||||
} else {
|
} else {
|
||||||
|
console.log("Reporting execution complete");
|
||||||
await (window as any).sendRuntimeMessage({
|
await (window as any).sendRuntimeMessage({
|
||||||
type: "execution-complete",
|
type: "execution-complete",
|
||||||
});
|
});
|
||||||
|
console.log("Execution completed");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
@ -162,17 +166,11 @@ export class ConsoleRuntimeProvider implements SandboxRuntimeProvider {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (message.type === "execution-complete") {
|
// Don't handle execution-complete/error - let executionConsumer handle those
|
||||||
this.completed = true;
|
// We just need to respond to allow the message to proceed
|
||||||
|
if (message.type === "execution-complete" || message.type === "execution-error") {
|
||||||
respond({ success: true });
|
respond({ success: true });
|
||||||
return true;
|
return false; // Don't stop propagation
|
||||||
}
|
|
||||||
|
|
||||||
if (message.type === "execution-error") {
|
|
||||||
this.completed = true;
|
|
||||||
this.completionError = message.error;
|
|
||||||
respond({ success: true });
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue