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

dcdpr / jp / 25887922763 / 1
65%
main: 65%

Build:
DEFAULT BRANCH: main
Ran 14 May 2026 09:58PM UTC
Files 302
Run time 7s
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

14 May 2026 09:55PM UTC coverage: 66.724% (+0.03%) from 66.696%
25887922763.1

push

github

web-flow
fix(cli, llm): Prevent duplicate tool-call dispatch on spurious flush (#639)

Two related bugs combined to cause tool calls to be dispatched twice.

On the provider side, both the `cerebras` and `llamacpp` SSE parsers
emitted `Event::flush(1)` twice per stream: once from the
`finish_reason` chunk and again from the `[DONE]` sentinel. A
`message_flushed` boolean gate now ensures the message/structured index
is flushed at most once. A drain of `tool_call_indices` on the `[DONE]`
sentinel is also added as a safety net for streams where the
`finish_reason` chunk never arrives.

On the shell side, tool-call dispatch was inferred by inspecting the
conversation stream's tail after every `Flush` event. Because the stream
tail continued to point at the prior `ToolCallRequest`, any duplicate
flush would re-trigger the preparation pipeline. The fix drives dispatch
off `EventBuilder::handle_flush` directly:
`TurnCoordinator::handle_event` now returns a `HandleEventOutcome`
carrying both the state-machine `action` and a `CommittedEvent`.
`CommittedEvent::ToolCallRequest` is populated only when `handle_flush`
actually commits a new tool call; a no-op flush returns
`CommittedEvent::None`, making the dispatch unambiguous regardless of
provider behaviour.

`handle_llm_event` in `signals.rs` is updated to surface the
`CommittedEvent` alongside the `LoopAction`, and the turn loop switches
from the stream-tail inspection to a direct pattern match on the
committed event. Raw provider events are now captured in test snapshots
so that provider-level misbehaviour such as duplicate flushes remains
visible even when `EventBuilder` filters them out.

---------

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

26179 of 39235 relevant lines covered (66.72%)

184.0 hits per line

Source Files on job 25887922763.1
  • Tree
  • List 302
  • Changed 6
  • Source Changed 6
  • Coverage Changed 6
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 25887922763
  • c3d8dfd1 on github
  • Prev Job for on main (#25827631389.1)
  • Next Job for on main (#25942533772.1)
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