Skip to content

Discard stale throttled pending content when NewEntry re-sends fresh entries - #109

Merged
lukemarsden merged 4 commits into
mainfrom
feature/003677-fix-text-truncation
Oct 9, 2026
Merged

lukemarsden merged 4 commits into
mainfrom
feature/003677-fix-text-truncation

Conversation

@lukemarsden

Copy link
Copy Markdown

Problem

The text block immediately before a long-running tool call renders truncated in Helix (e.g. "The board" instead of the full paragraph) for the entire duration of the tool call, while Zed shows the full sentence. Fourth recurrence of this bug (prior attempts: spec tasks 001655, 001694, 002552, 003117).

Root cause

A regression introduced by 73f9af2162 (the previous fix attempt): the NewEntry handler re-reads and sends every current-turn entry with complete content, but no longer clears the streaming throttle's pending_content for the preceding text entry. The stale mid-sentence snapshot is then sent after the fresh full content — by the trailing flush timer or by the next entry's flush-others step — and Helix's last-write-wins per message_id keeps the truncated text until the end-of-turn flush.

Fix

  • discard_pending_for_thread() drops pending throttle state (and defuses the armed trailing flush timer) right before the NewEntry handler's fresh re-send.
  • Deletes the dead flush_stale_pending_for_thread left behind by 73f9af2162.
  • Regression test pinning the ordering, plus a control test proving the clobber occurs without the discard.
  • go mod tidy for the e2e test-server module (needed against current helix deps).

Testing

  • cargo test -p external_websocket_sync: 81 passed, 0 failed.
  • Live in a helix-in-helix stack built from this branch: 14+ text→tool_call boundaries across 3 spec tasks — every pre-tool-call paragraph rendered complete mid-turn, with a 1s DOM sampler showing zero regressions over a 5-minute window.
  • NOT run: the dockerized e2e LLM rounds (no Anthropic credential available in the dev sandbox).

Release Notes:

  • N/A

🤖 Generated with Claude Code


🔗 Open in Helix

📋 Spec:

🚀 Built with Helix

…ries

The NewEntry handler re-sends every current-turn entry with complete
content read from the thread model, but left the streaming throttle's
pending snapshot (and its armed trailing flush timer) in place. The
stale mid-sentence snapshot was then sent after the fresh content —
by the timer or by the next entry's flush-others step — and Helix's
last-write-wins per message_id kept the truncated text on screen for
the whole duration of the tool call.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

Spec-Ref: helix-specs@fa17f6a0d:003677_observe-how-the-text
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

Spec-Ref: helix-specs@fa17f6a0d:003677_observe-how-the-text
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

Spec-Ref: helix-specs@fa17f6a0d:003677_observe-how-the-text
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

Spec-Ref: helix-specs@0016105c3:003677_observe-how-the-text
@lukemarsden
lukemarsden merged commit 9a03893 into main Oct 9, 2026
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant