• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

dcdpr / jp / 25073170659
66%

Build:
DEFAULT BRANCH: main
Ran 28 Apr 2026 07:37PM UTC
Jobs 1
Files 292
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

28 Apr 2026 07:26PM UTC coverage: 64.197% (+0.008%) from 64.189%
25073170659

push

github

web-flow
fix(llm): Drop incomplete tool-call buffers on stream drain (#584)

When a stream ends abnormally (e.g. the provider closes the connection
before emitting a `ContentBlockStop`), the `EventBuilder::drain` method
was forwarding every buffered index through `handle_flush`. For
tool-call buffers, this produced an orphaned `tool_use` block in the
conversation — a block with no matching `tool_result`. Providers
(Anthropic included) reject the next request when they encounter this
inconsistency.

Tool-call buffers that reach `drain` are structurally incomplete by
definition: a normally-completed tool call always emits an explicit
`Flush` event before the stream ends. Reaching `drain` without one means
the stream was cut short. The safest recovery is to drop the buffer and
emit a warning, rather than persist a half-formed tool call that will
break the next conversation turn.

Text-producing buffers (`Reasoning`, `Message`, `Structured`) are
unaffected — partial output from those is still surfaced on drain so
that content isn't silently lost.

Signed-off-by: Jean Mertz <git@jeanmertz.com>

9 of 9 new or added lines in 1 file covered. (100.0%)

23435 of 36505 relevant lines covered (64.2%)

205.68 hits per line

Jobs
ID Job ID Ran Files Coverage
1 25073170659.1 28 Apr 2026 07:37PM UTC 292
64.2
GitHub Action Run
Source Files on build 25073170659
  • Tree
  • List 292
  • Changed 1
  • Source Changed 1
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #25073170659
  • 29f81185 on github
  • Prev Build on main (#25073111287)
  • Next Build on main (#25076211620)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc