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

christophevg / yoker / 28653731816
85%

Build:
DEFAULT BRANCH: master
Ran 03 Jul 2026 10:10AM UTC
Jobs 1
Files 93
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

03 Jul 2026 10:09AM UTC coverage: 83.61% (+0.08%) from 83.535%
28653731816

push

github

christophevg
fix(backends): prevent LiteLLM backend from mutating caller messages

LitellmBackend.chat_stream converted tool-call arguments from dict to
JSON string in place, corrupting the shared context dicts. After the
first LiteLLM turn with tool calls, the context's argument dicts were
permanently replaced with JSON strings, breaking the generic-format
invariant and corrupting saved context/replays. Cross-backend session
resumption would also fail (Ollama requires dict arguments).

Fix: deep-copy messages before the dict→JSON conversion, so only the
local copy passed to litellm.acompletion is affected.

Investigation confirmed:
- Ollama backend requires dict arguments (Message.model_validate
  rejects strings), so standardizing on JSON everywhere is not viable
- Ollama backend does not mutate input messages at all
- The generic-format invariant (context stores dicts) is preserved

Tests:
- test_chat_stream_does_not_mutate_caller_messages
- test_chat_stream_passes_json_string_arguments_to_litellm

Fixes #38

🤖 Implemented together with a coding agent.

912 of 1052 branches covered (86.69%)

Branch coverage included in aggregate %.

5092 of 6129 relevant lines covered (83.08%)

0.83 hits per line

Coverage Regressions

Lines Coverage ∆ File
11
86.71
3.38% yoker/backends/litellm.py
Jobs
ID Job ID Ran Files Coverage
1 28653731816.1 03 Jul 2026 10:10AM UTC 93
83.61
GitHub Action Run
Source Files on build 28653731816
  • Tree
  • List 93
  • Changed 1
  • Source Changed 0
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #28653731816
  • c17fb81f on github
  • Prev Build on master (#28646968515)
  • Next Build on master (#28658452249)
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