fix(guid): use effective backend type for preset agent config lookups#1711
Merged
fix(guid): use effective backend type for preset agent config lookups#1711
Conversation
When selecting a preset assistant via AssistantSelectionArea, selectedAgent was set to 'custom', causing mode loading, mode saving, and ACP model cache lookups to use 'custom' as the config key instead of the actual backend type (e.g. 'claude'). This resulted in: - Mode preference not loading from saved config - Mode changes not persisting across sessions - Model list not displaying (cache lookup under wrong key) Fix: resolve the effective backend type via currentEffectiveAgentInfo and use it for all config/cache lookups when a preset agent is selected. Move currentEffectiveAgentInfo memo before dependent effects. Add unit tests for agentSelectionUtils and hook behavior tests verifying preset agent config resolution for mode and model cache.
IceyLiu
approved these changes
Mar 25, 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.
Summary
'custom'as config key instead of the effective backend type (e.g.'claude'), causing mode preferences not loading/saving and model list not displayingcurrentEffectiveAgentInfomemo before dependent effects to resolve the lookup correctlyagentSelectionUtilsand hook behavior tests for preset agent config resolutionChanges
useGuidAgentSelection.tscurrentEffectiveAgentInfo.agentTypeas config key for preset agents instead ofselectedAgent('custom'), removing theselectedAgent !== 'custom'skip conditionacp.configpreference lookupcurrentAcpCachedModelInfomemo: look up cached models by effective backend typecurrentEffectiveAgentInfomemo: moved before the effects that depend on itTests
agentSelectionUtils.test.ts— unit tests forsavePreferredMode,savePreferredModelId,getAgentKeyguidAgentSelection.dom.test.ts— hook behavior tests verifying preset agent mode loading, mode saving, and model cache resolutionRelated Issue
Closes #1710
Test Plan
bun run testpasses (17 new tests added)