Skip to content

fix(streaming): skip retry when stream health is Healthy#377

Merged
Bahtya merged 2 commits into
mainfrom
fix/stream-healthy-retry
May 14, 2026
Merged

fix(streaming): skip retry when stream health is Healthy#377
Bahtya merged 2 commits into
mainfrom
fix/stream-healthy-retry

Conversation

@Bahtya

@Bahtya Bahtya commented May 14, 2026

Copy link
Copy Markdown
Owner

Summary

  • Fix premature stream retry when HealthState::Healthy — a 5s poll timeout during a reasoning model's thinking phase no longer tears down the entire stream
  • Only retry on Stale or Dead health states; Healthy gaps are just slow token flow

Closes #376

Test plan

  • Send a message to Telegram using glm-5-turbo (reasoning model) — should no longer timeout after 90s
  • Verify that actual dead streams (no data for absolute_max) still fail with appropriate error
  • Verify that stale streams (no content beyond effective_stale) still retry with backoff

Bahtya

Bahtya added 2 commits May 14, 2026 13:02
When a poll timeout fires during SSE streaming, the old code retried
the entire provider call regardless of the stream health state. This
caused reasoning models (e.g. glm-5-turbo) to be killed after a
single 5-second gap between tokens during their thinking phase.

Now the poll-timeout handler checks health state first:
- Healthy → continue waiting (just a slow token gap)
- Dead → fail immediately
- Stale → retry with backoff (existing behavior)

Closes #376

Bahtya
Chocolatey installs protoc but the binary may not be on PATH for
subsequent steps. Explicitly append the install directory to
GITHUB_PATH so protoc is findable by cargo.

Bahtya
@Bahtya Bahtya merged commit a2daeb5 into main May 14, 2026
9 checks passed
@Bahtya Bahtya deleted the fix/stream-healthy-retry branch May 14, 2026 05:22
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.

fix(streaming): Healthy-state poll timeout incorrectly triggers full stream retry

1 participant