mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-15 14:03:49 +00:00
Fix ConsoleRuntimeProvider hanging by calling respond()
- ConsoleRuntimeProvider.handleMessage() was not calling respond() - This caused sendRuntimeMessage() to hang waiting for response (30s timeout) - Now properly acknowledges console, execution-complete, and execution-error messages - Fixes javascript_repl hanging on simple console.log() calls
This commit is contained in:
parent
33418d9dea
commit
bb138307b1
1 changed files with 5 additions and 1 deletions
|
|
@ -146,7 +146,7 @@ export class ConsoleRuntimeProvider implements SandboxRuntimeProvider {
|
|||
};
|
||||
}
|
||||
|
||||
async handleMessage(message: any, _respond: (response: any) => void): Promise<boolean> {
|
||||
async handleMessage(message: any, respond: (response: any) => void): Promise<boolean> {
|
||||
if (message.type === "console") {
|
||||
// Collect console output
|
||||
this.logs.push({
|
||||
|
|
@ -161,17 +161,21 @@ export class ConsoleRuntimeProvider implements SandboxRuntimeProvider {
|
|||
text: message.text,
|
||||
args: message.args,
|
||||
});
|
||||
// Acknowledge receipt
|
||||
respond({ success: true });
|
||||
return true;
|
||||
}
|
||||
|
||||
if (message.type === "execution-complete") {
|
||||
this.completed = true;
|
||||
respond({ success: true });
|
||||
return true;
|
||||
}
|
||||
|
||||
if (message.type === "execution-error") {
|
||||
this.completed = true;
|
||||
this.completionError = message.error;
|
||||
respond({ success: true });
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue