test: Persist the agentMessageQueue preview flag in its flag-off test - #539
Merged
Merged
Conversation
"hides the message queue when the agentMessageQueue preview is off" only set the in-memory feature preview store. Rendering the Dashboard hydrates settings, and hydrateFlags rebuilds every flag from defaults (all on in test mode) plus persisted settings, so whenever hydration resolved after the setState the flag flipped back on and the queue button rendered. Persist the setting through setSetting, as feature-preview.test.tsx does, and restore it when the test finishes.
This was referenced Sep 27, 2026
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
workspace/terminal-pane.test.tsx > hides the message queue when the agentMessageQueue preview is off(added in #530) fails intermittently onmain: 1 of 3 local runs, and on #532's CI. The failure is that theagent-message-queuebutton is still rendered.The test only sets the in-memory
useFeaturePreviewStore. Rendering<Dashboard />triggers settings hydration, andhydrateFlagsrebuilds every flag from the defaults (all on in test mode) plus the persisted settings. When hydration finishes after the test'ssetState, the flag flips back on.Fix
Persist the setting with
setSetting(previewSettingKey("agentMessageQueue"), "false"), the same wayfeature-preview.test.tsxdoes, and restore it inonTestFinishedso it can't leak into the other tests in the file, which expect the queue to be shown.Verification
lintandcheckare clean.Generated by Claude Code