fix: eliminate duplicate WebSocket messages during agent history priming
- Skip dispatching individual agent_stream events when replaying history (the snapshot is sent after priming anyway, so individual events were wasted) - Add WebSocket message logging on client (type, size, id) for debugging - Change default daemon URL from dev to localhost - Clean up unused imports in session.ts 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -707,7 +707,11 @@ export class AgentManager {
|
||||
break;
|
||||
}
|
||||
|
||||
this.dispatchStream(agent.id, event);
|
||||
// Skip dispatching individual stream events during history replay.
|
||||
// The caller will send a batched agent_stream_snapshot after priming.
|
||||
if (!options?.fromHistory) {
|
||||
this.dispatchStream(agent.id, event);
|
||||
}
|
||||
}
|
||||
|
||||
private recordTimeline(agent: ManagedAgent, item: AgentTimelineItem): void {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { v4 as uuidv4 } from "uuid";
|
||||
import { readFile, mkdir, writeFile } from "fs/promises";
|
||||
import { exec, spawn } from "child_process";
|
||||
import { exec } from "child_process";
|
||||
import { promisify, inspect } from "util";
|
||||
import { join } from "path";
|
||||
import invariant from "tiny-invariant";
|
||||
|
||||
Reference in New Issue
Block a user