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

stacklok / toolhive / 22907831911

10 Mar 2026 02:35PM UTC coverage: 63.851% (-0.07%) from 63.924%
22907831911

push

github

web-flow
Fix SSE/JSON race condition in session capability injection (#4075)

Bypass the mcp-go SDK notification mechanism during session registration
to prevent stale notifications from corrupting HTTP responses. During
OnRegisterSession, the notification-listening goroutine from the
initialize request has already exited, so notifications sent by
AddSessionTools/AddSessionResources accumulate in the channel and race
with the next request's response writer.

Replace AddSessionTools/AddSessionResources calls with direct
SetSessionTools/SetSessionResources on the session object, which sets
capabilities without triggering notifications. Also register resource
capabilities explicitly at server creation since the implicit
registration in AddSessionResources is now bypassed.

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>

41 of 53 new or added lines in 1 file covered. (77.36%)

518 existing lines in 4 files now uncovered.

47407 of 74246 relevant lines covered (63.85%)

74.33 hits per line

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

64.9
/cmd/thv-operator/controllers/virtualmcpserver_controller.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