feat: add edit-json CLI command and fix custom JSON key preservation#157
Open
52dyd wants to merge 3 commits intoSaladDay:mainfrom
Open
feat: add edit-json CLI command and fix custom JSON key preservation#15752dyd wants to merge 3 commits intoSaladDay:mainfrom
52dyd wants to merge 3 commits intoSaladDay:mainfrom
Conversation
Add `cc-switch edit-json provider <id> --app-type <type>` command for editing provider settings_config via external editor with `--force` flag for full replacement (default: incremental merge). Fix custom JSON keys disappearing after TUI switch/edit operations: - DB layer: save_provider and update_provider_settings_config now merge incoming settings_config with existing DB row to preserve custom keys - Live snapshots: Codex/Gemini build_effective_live_snapshot and refresh_provider_snapshot functions now clone provider.settings_config and update in-place instead of rebuilding from scratch Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- Inline useless passthrough function apply_settings_config_update - Fix dead assertion in no_change_detection test - Simplify make_provider to use Provider::with_id() - Extract duplicate merge logic into merge_settings_config helper - Combine redundant DB round-trips in save_provider into single SELECT - Remove redundant auth/config re-inserts in Codex build_effective_live_snapshot Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Open
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
edit-json providerCLI command to edit provider settings_config in an external editor--forceflag for full settings_config replacement (skip merge)Changes
edit-jsonCLI subcommand with external editor integrationsave_provider,update_provider_settings_config,build_effective_live_snapshot, andwrite_live_snapshotnow merge into existing settings instead of overwritingmerge_settings_confighelper uses deep-merge to preserve custom keys in the DB layerjson_deep_merge,is_codex_official_provider,codex_config_has_base_urlmadepub(crate)for cross-module reuseTest plan