mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-17 06:04:51 +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") {
|
if (message.type === "console") {
|
||||||
// Collect console output
|
// Collect console output
|
||||||
this.logs.push({
|
this.logs.push({
|
||||||
|
|
@ -161,17 +161,21 @@ export class ConsoleRuntimeProvider implements SandboxRuntimeProvider {
|
||||||
text: message.text,
|
text: message.text,
|
||||||
args: message.args,
|
args: message.args,
|
||||||
});
|
});
|
||||||
|
// Acknowledge receipt
|
||||||
|
respond({ success: true });
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (message.type === "execution-complete") {
|
if (message.type === "execution-complete") {
|
||||||
this.completed = true;
|
this.completed = true;
|
||||||
|
respond({ success: true });
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (message.type === "execution-error") {
|
if (message.type === "execution-error") {
|
||||||
this.completed = true;
|
this.completed = true;
|
||||||
this.completionError = message.error;
|
this.completionError = message.error;
|
||||||
|
respond({ success: true });
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue