feat(migration): migrate codeTools Redux slice to v2 preference with layered preset#13340
Open
feat(migration): migrate codeTools Redux slice to v2 preference with layered preset#13340
Conversation
…layered preset
- Add PRESETS_CODE_TOOLS preset defining CLI tools with defaults
- Add CodeToolOverrides type for per-tool user customizations
- Add preference keys: feature.code_tools.{overrides,selected_cli_tool,selected_terminal}
- Add complex mapping to transform selectedModels (full Model -> ID) + envVars + dirs into overrides
- Add 'codeTools' to ReduxExporter SLICES_TO_EXPORT
- Fix original design flaw: directories/currentDirectory now per-tool (via overrides) instead of global
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…nal in overrides Remove global `selected_cli_tool` and `selected_terminal` preference keys. All per-tool config (enabled, model, envVars, terminal, directories) is now stored in the single `feature.code_tools.overrides` key. Migration strategy for legacy global fields: - selectedCliTool → that tool gets `enabled: true` - selectedTerminal → assigned to the selected tool (non-default only) - directories/currentDirectory → assigned to the selected tool Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
What this PR does
Before this PR:
The
codeToolsRedux slice stored per-tool settings (selected models, environment variables, directories) in separateRecord<toolId, value>maps with a design flaw —directoriesandcurrentDirectorywere global instead of per-tool.After this PR:
codeToolsdata to v2 Preference using the Layered Preset patternpackages/shared/data/presets/code-tools.tsFixes #
Why we need it and why it was done in this way
The following tradeoffs were made:
ComplexMappinginstead of simple 1:1 mappings because multiple Redux maps need to be merged into a singleoverridespreference keyThe following alternatives were considered:
feature.code_tools.qwen_code.model_id) — rejected due to key explosion (8 tools × 4 fields = 32 keys)Breaking changes
None
Special notes for your reviewer
ComplexPreferenceMappingsfor a real migration (was empty before)packages/shared/data/presets/ReduxExporter.SLICES_TO_EXPORTupdated to includecodeToolsChecklist
/gh-pr-review,gh pr diff, or GitHub UI) before requesting review from othersRelease note