Summary
pkg/runtime/runtime.go:307 onToolsChanged is written at :1431 and read at :1449/:1459 from MCP change-notification goroutines with no lock. The sibling onBackgroundEvent IS mutex-guarded (backgroundEventMu) with a comment explaining exactly this hazard.
Fix
Guard onToolsChanged identically (or make both atomic.Pointer).
Acceptance
-race clean; consistent with the onBackgroundEvent precedent.
Summary
pkg/runtime/runtime.go:307onToolsChangedis written at :1431 and read at :1449/:1459 from MCP change-notification goroutines with no lock. The siblingonBackgroundEventIS mutex-guarded (backgroundEventMu) with a comment explaining exactly this hazard.Fix
Guard
onToolsChangedidentically (or make bothatomic.Pointer).Acceptance
-raceclean; consistent with the onBackgroundEvent precedent.