You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
KeybindingManager.SetChords can split one batch across two profiles if the active profile changes mid-call #149
ProfileactiveProfile=Profiles.GetActiveProfile()??thrownewInvalidOperationException("No active profile is set");returnOperationHelper.ExecuteWithCount(chords,Keybindings.BindChord);
activeProfile is fetched only to check that an active profile exists, and is never used afterwards. Each entry goes through the two-argument IKeybindingService.BindChord(commandId, chord), which looks up the active profile again for every entry.
Failure scenario
Profile a is active, and thread 1 calls SetChords with N entries.
SetChords reports N bindings set. They are split across two profiles, and neither profile has the batch the caller asked for.
CLAUDE.md promises thread-safe services, and recent fixes (#142 and the lookup-overload guards) close this kind of gap elsewhere.
Suggested fix
Bind against the profile the method already resolved, using the existing three-argument overload (IKeybindingService.BindChord(string profileId, string commandId, Chord chord)):
Priority: Low. It needs a SetActiveProfile racing a SetChords batch, which is unlikely in practice. The fix is one line using the existing three-argument BindChord overload.
Area / suggested assignment:Keybinding/KeybindingManager.csSetChords and any sibling batch helpers
Activity
matt-edmondson commentedon Sep 29, 2026
Triage
SetActiveProfileracing aSetChordsbatch, which is unlikely in practice. The fix is one line using the existing three-argumentBindChordoverload.Keybinding/KeybindingManager.csSetChordsand any sibling batch helpersSetActiveProfilerace) and Lock a profile's chords so concurrent binds cannot corrupt them [minor] #142 (chord locking). The same pattern could be audited in one pass.Generated by Claude Code