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

stacklok / toolhive / 18968926888

31 Oct 2025 09:51AM UTC coverage: 47.368% (-0.06%) from 47.423%
18968926888

push

github

web-flow
Handle partial flushes in tool config middleware (#2404)

Tool config middleware implicitly assumed that `Flush()` was only
called once a full SSE event was received by the proxy. While testing
remote servers we encountered a scenario in which a very long
`tools/list` (~80kb) caused golang reverse proxy implementation to run
`Flush()` more than once on partial SSE payloads.

Golang standard library code that triggered the bug is here
https://github.com/golang/go/blob/go1.25.0/src/net/http/httputil/reverseproxy.go#L708-L711

This change checks whether the SSE event is fully buffered, and keeps
buffering otherwise. It also ships an `testkit` enhancement that lets
the test developer wrap the test MCP server in a reverse
proxy. Ideally, we would use the same reverse proxy used by ToolHive
itself, but it's tightly coupled with container orchestrator and
requires refactoring.

Fixes #2403

69 of 157 new or added lines in 4 files covered. (43.95%)

6 existing lines in 3 files now uncovered.

20625 of 43542 relevant lines covered (47.37%)

22.21 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

55.59
/test/testkit/streamable_server.go


Source Not Available

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