Helix forked the Zed code editor to run fleets of headless coding agents inside Docker containers, controlled via a WebSocket protocol connecting a central Go API to each Zed instance and an LLM via the Agent Control Protocol (ACP). The post details three bugs encountered: multi-message accumulation (overwrite vs. append semantics), a completion hang caused by session-level event rejection logic, and garbled text from byte vs. UTF-16 offset mismatches in patch-based streaming. It also covers a streaming performance optimization that reduced wire traffic from O(N) full-payload sends to O(delta) patches, achieving roughly a 5000x reduction per update for long responses, plus throttling on both the Go and Rust sides to reduce redundant events.
Table of contents
What We Needed From the ForkThe WebSocket Sync ProtocolArchitectureBug 1: The Multi-Message Accumulation ProblemBug 2: The Completion HangShared Protocol Code: Eliminating Test DriftStreaming Performance: O(N²) to O(delta)Bug 3: The UTF-16 Offset1 Comment
Sort: