mirror of
https://github.com/Bijit-Mondal/VoiceAgent.git
synced 2026-03-02 18:36:39 +00:00
WIP
This commit is contained in:
@@ -116,10 +116,16 @@ Use tools when needed to provide accurate information.`,
|
||||
console.log(`[ws-server] 🔊 Queued speech chunk #${id}: ${text.substring(0, 50)}...`);
|
||||
});
|
||||
|
||||
agent.on("history_trimmed", ({ removedCount, reason }: { removedCount: number; reason: string }) => {
|
||||
console.log(`[ws-server] 🧹 History trimmed: removed ${removedCount} messages (${reason})`);
|
||||
});
|
||||
|
||||
agent.on("error", (err: Error) => console.error("[ws-server] ❌ Error:", err.message));
|
||||
|
||||
agent.on("disconnected", () => {
|
||||
console.log("[ws-server] ✗ client disconnected\n");
|
||||
// Permanently release all agent resources for this connection
|
||||
agent.destroy();
|
||||
console.log("[ws-server] ✗ client disconnected (agent destroyed)\n");
|
||||
});
|
||||
|
||||
// Hand the accepted socket to the agent – this is the key line.
|
||||
|
||||
Reference in New Issue
Block a user