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

dcdpr / jp / 24366146360
67%

Build:
DEFAULT BRANCH: main
Ran 13 Apr 2026 08:53PM UTC
Jobs 1
Files 268
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

13 Apr 2026 08:49PM UTC coverage: 65.329% (-0.04%) from 65.371%
24366146360

push

github

web-flow
fix(llm, anthropic): Add forced-tool fallback for reasoning models (#549)

Anthropic's API does not allow forced `tool_choice` when extended
thinking is enabled. The previous behaviour silently downgraded to
`auto` + a system prompt nudge, but offered no guarantee that the model
would actually call the required tool.

This commit adds a `ForcedToolFallback` mechanism. When a reasoning
model is asked to call a specific tool, `create_request` still
downgrades `tool_choice` to `auto` for the initial request, but now
captures the original forced choice in a `ForcedToolFallback` value. The
`call()` function tracks which tool names were invoked during streaming.
If the model finishes without satisfying the constraint,
`force_tool_retry` is invoked: it appends the assistant's response as a
message, adds a user message instructing the model to call the required
tool, then re-issues the request with thinking disabled and the original
forced `tool_choice` restored.

The retry path passes `None` as its own fallback to prevent infinite
retry loops. Reasoning content emitted by a (unexpected) thinking block
in the retry response is silently dropped.

---------

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

65 of 121 new or added lines in 1 file covered. (53.72%)

21663 of 33160 relevant lines covered (65.33%)

197.65 hits per line

Uncovered Changes

Lines Coverage ∆ File
56
82.16
-3.27% crates/jp_llm/src/provider/anthropic.rs
Jobs
ID Job ID Ran Files Coverage
1 24366146360.1 13 Apr 2026 08:53PM UTC 268
65.33
GitHub Action Run
Source Files on build 24366146360
  • Tree
  • List 268
  • Changed 2
  • Source Changed 1
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #24366146360
  • 86a82589 on github
  • Prev Build on main (#24364592702)
  • Next Build on main (#24383308914)
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