Repository navigation
fix(config): keep legacy settings when creating the global file - #176
Draft
cursor[bot] wants to merge 1 commit into
Draft
cursor[bot] wants to merge 1 commit into
cursor[bot] wants to merge 1 commit into
Conversation
lich profile use wrote {profile} into a new ~/.lich/config.json, which
stopped ~/.config/lich/config.json from being read and dropped tool
restrictions. Copy that legacy file forward. lich init --global refuses
while the legacy file is still the live config.
Co-authored-by: moikapy <[email protected]>
This branch has not been deployed
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.
Bug and impact
lich profile use <name>andlich init --globalcreate~/.lich/config.jsonwithout copying~/.config/lich/config.json. Once the global file exists, the legacy file is never read again.A user whose only config is the legacy file (providers,
tools_enabled, gateway allowlists) runslich profile use coder. The new global file is{ "profile": "coder" }. Tool restrictions disappear and the agent falls back totools_enabled: "all".lich init --globaldoes the same with a starter config, replacing a working model with the placeholder.Root cause
use_profilewrote{ ...read_global(), profile }, andread_globalonly reads~/.lich/config.json.run_init --globalwrote a starter into that path.load_layered_configtreats an existing global file as the whole user config and skips the legacy path.Fix
global_config_seed()copies the legacy file (plugin paths resolved,work_dir/session_dirstripped) when the global file does not exist yet.profile usewrites that seed plusprofile, and keeps the legacy file mode.lich init --globalrefuses while the legacy file is still the live config, so a starter cannot hide it.Validation
./node_modules/.bin/tsc --noEmitpassed.node node_modules/vitest/vitest.mjs run test/first_run.test.ts test/cli_config.test.tspassed (61 tests), including the new cases for the refuse and the copy.bunmissing,dist/cli.jsnot built).