fix(ai): stop recurring Search-box-AI drift popup with reliable Win11 keys#35
Merged
Merged
Conversation
… keys User report: on a fresh Win11 PC, "Search box AI suggestions + taskbar companion" keeps firing the drift popup every cycle even with the toggle set to Off + Auto-apply silently. Root cause (the real one this time). Both the drift signal and the write keyed on HKCU\SOFTWARE\Policies\Microsoft\Windows\Explorer\ DisableSearchBoxSuggestions plus a non-existent TaskbarCompanion Advanced value. On most Win11 builds neither is reliable: the Explorer policy often doesn't take effect (and on managed/MDM machines the Policies hive can be locked, so the write throws and is swallowed), and TaskbarCompanion is not a real value name so it never persists. When the written value doesn't read back, ChangeApplier's verify pass keeps reporting drift -> MonitorService applies the 15-min auto-apply backoff -> the drift item is promoted to the notification queue -> the popup recurs every cycle. Commit 3202e9c only loosened the *read* heuristic (companion != 1), so it never changed the unreliable mechanism and the loop survived on other PCs. The real fix. Switch the authoritative mechanism to the values Windows 11 actually honors and that reliably read back: - HKCU\...\CurrentVersion\Search\BingSearchEnabled = 0 (authoritative drift signal; ordinary user setting, always user-writable, persists) - HKCU\...\CurrentVersion\SearchSettings\IsDynamicSearchBoxEnabled = 0 (search highlights / the companion content) - DisableSearchBoxSuggestions = 1 kept as best-effort only, NOT read. ReadCurrent is keyed solely on BingSearchEnabled so a Windows-ignored value can never re-trigger the verify-fail/backoff/popup loop again. Per- value best-effort writes mean a locked Policies hive no longer aborts the authoritative write. Docs (SettingDocs mechanism/apply/verify, SettingDocsCatalog, SETTINGS- REFERENCE.md) updated to the new keys. Tests: regression guard asserting the surfaces use BingSearchEnabled and no longer reference the bogus TaskbarCompanion, plus a live-read no-drift invariant test. 162/162 pass; build clean (warnings = errors). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
| using var key = Registry.CurrentUser.CreateSubKey(subKey, writable: true); | ||
| key?.SetValue(name, value, RegistryValueKind.DWord); | ||
| } | ||
| catch { } |
| using var key = Registry.CurrentUser.CreateSubKey(subKey, writable: true); | ||
| key?.SetValue(name, value, RegistryValueKind.DWord); | ||
| } | ||
| catch { } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On a fresh Win11 PC, "Search box AI suggestions + taskbar companion" keeps firing the drift popup every cycle even with the toggle set to Off + Auto-apply silently.
Root cause
Both the drift signal and the write keyed on
HKCU\...\Policies\Microsoft\Windows\Explorer\DisableSearchBoxSuggestionsplus a non-existentTaskbarCompanionAdvanced value. On most Win11 builds neither is reliable: the Explorer policy often doesn't persist/take effect (and on managed/MDM machines the Policies hive can be locked, so the write throws and is swallowed), andTaskbarCompanionis not a real value name. When the written value doesn't read back,ChangeApplier's verify pass keeps reporting drift →MonitorServiceapplies the 15-min auto-apply backoff → the drift item is promoted to the notification queue → popup recurs every cycle.Commit
3202e9conly loosened the read heuristic, so it never changed the unreliable mechanism and the loop survived on other PCs.The real fix
Switch the authoritative mechanism to the values Windows 11 actually honors and that reliably read back:
HKCU\...\CurrentVersion\Search\BingSearchEnabled = 0— authoritative drift signal (ordinary user setting, always user-writable, persists)HKCU\...\CurrentVersion\SearchSettings\IsDynamicSearchBoxEnabled = 0— search highlights / companion contentDisableSearchBoxSuggestions = 1kept best-effort only, not readReadCurrentis keyed solely onBingSearchEnabledso a Windows-ignored value can never re-trigger the verify-fail/backoff/popup loop again. Per-value best-effort writes mean a locked Policies hive no longer aborts the authoritative write.Docs (SettingDocs mechanism/apply/verify, SettingDocsCatalog, SETTINGS-REFERENCE.md) updated. Tests: regression guard + live-read no-drift invariant.
Verification
dotnet buildclean (warnings = errors)dotnet test— all green🤖 Generated with Claude Code