diff --git a/packages/client/ui-agent-preset/src/client/AgentPresetSeat.tsx b/packages/client/ui-agent-preset/src/client/AgentPresetSeat.tsx
index 41f22e12c0..c2036be0d6 100644
--- a/packages/client/ui-agent-preset/src/client/AgentPresetSeat.tsx
+++ b/packages/client/ui-agent-preset/src/client/AgentPresetSeat.tsx
@@ -93,12 +93,12 @@ export function AgentPresetSeat({
void load()
}, [load])
+ const options = state.options.filter(option => developerTools || !requiresCodingTools(option))
+
// Close a menu whose available choices just changed.
useEffect(() => {
setOpen(false)
- }, [developerTools])
-
- const options = state.options.filter(option => developerTools || !requiresCodingTools(option))
+ }, [developerTools, options.length])
const chosen = state.options.find(option => option.id === state.current)
const chosenText = chosen === undefined ? undefined : presetDisplayText(chosen, t)
@@ -152,7 +152,7 @@ export function AgentPresetSeat({
return (
<>