Updates
Rolling release / release (push) Successful in 15m15s

This commit is contained in:
2026-09-11 20:34:36 -04:00
parent 9b1ceda01f
commit 06c9a23e19
2 changed files with 33 additions and 1 deletions
+18 -1
View File
@@ -42,7 +42,24 @@ export class HarnessBridge extends EventEmitter {
async ask(text) {
if (!this.session) await this.start();
return this.session.prompt(text);
// Some QVAC runs deliver the final assistant text through the stream but
// omit it from the final envelope after a tool call. Keep the current
// post-tool stream as a fallback so the daemon can still speak the reply.
let streamed = '';
const onChunk = (payload) => { streamed += String(payload?.text || payload?.delta || ''); };
const onToolCall = () => { streamed = ''; };
const chunkSubscription = this.session.on('agent_message_chunk', onChunk);
const toolSubscription = this.session.on('tool_call', onToolCall);
const offChunk = typeof chunkSubscription === 'function' ? chunkSubscription : () => this.session.off?.('agent_message_chunk', onChunk);
const offToolCall = typeof toolSubscription === 'function' ? toolSubscription : () => this.session.off?.('tool_call', onToolCall);
try {
const reply = await this.session.prompt(text);
if (reply && !reply.text && streamed.trim()) return { ...reply, text: streamed };
return reply;
} finally {
offChunk?.();
offToolCall?.();
}
}
cancel() { this.session?.cancel(); }