Avoid redundant memory enable notice (#18580)

## Summary

Fixes #18554.

The `/experimental` menu can submit the full experimental feature state
even when the user presses Enter without toggling anything. Previously,
Codex showed `Memories will be enabled in the next session.` whenever
the submitted updates included `Feature::MemoryTool = true`, so sessions
where Memories were already enabled could show a redundant warning on a
no-op save.

This change records whether `Feature::MemoryTool` was enabled before
applying feature updates and only emits the next-session notice when
Memories actually transitions from disabled to enabled.
This commit is contained in:
Eric Traut
2026-04-19 13:48:15 -07:00
committed by GitHub
Unverified
parent 95dafbc7b5
commit ce0e28ea6f
+5 -3
View File
@@ -1423,10 +1423,12 @@ impl App {
return;
}
let memory_tool_was_enabled = self.config.features.enabled(Feature::MemoryTool);
self.config = next_config;
let show_memory_enable_notice = feature_updates_to_apply
.iter()
.any(|(feature, enabled)| *feature == Feature::MemoryTool && *enabled);
let show_memory_enable_notice =
feature_updates_to_apply.iter().any(|(feature, enabled)| {
*feature == Feature::MemoryTool && *enabled && !memory_tool_was_enabled
});
for (feature, effective_enabled) in feature_updates_to_apply {
self.chat_widget
.set_feature_enabled(feature, effective_enabled);