perf: remove raw field from timeline items to reduce payload size

Remove the `raw` field that was duplicating provider data in timeline
items, reducing WebSocket payload sizes by 64-85%:
- session_state: ~320KB → ~48KB
- agent_stream_snapshot: ~320KB → ~114KB

Changes:
- Remove raw from AgentTimelineItem, AgentStreamEvent, AgentPermissionRequest
- Remove raw assignments from claude-agent.ts and codex-agent.ts
- Remove provider_event handling from stream.ts (only used for Codex raw)
- Update tests to reflect new behavior

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Mohamed Boudra
2025-11-28 18:20:33 +00:00
co-authored by Claude
parent ae4678bca8
commit e80989ea78
11 changed files with 65 additions and 590 deletions
@@ -352,14 +352,13 @@ export class AgentManager {
recordUserMessage(
agentId: string,
text: string,
options?: { messageId?: string; raw?: unknown }
options?: { messageId?: string }
): void {
const agent = this.requireAgent(agentId);
const item: AgentTimelineItem = {
type: "user_message",
text,
messageId: options?.messageId,
raw: options?.raw,
};
agent.updatedAt = new Date();
agent.lastUserMessageAt = agent.updatedAt;