fix(settings): defer global settings validation until after merge#1014
Merged
Conversation
Global settings were validated standalone with the strict no-defaults schema, while project and local settings deliberately defer schema validation until after the merge so partial configs are not rejected prematurely. This caused valid global configs (e.g. a shared Linear apiToken with teamId set per-project) to be dropped with a confusing "Settings validation failed at global settings" warning. Align loadGlobalSettingsFile with loadSettingsFile: only enforce that the file is a JSON object, and let post-merge validation in loadSettings() be the single source of truth.
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
Settings validation failed at global settings ... Ignoring global settings.loadGlobalSettingsFilewithloadSettingsFile: only enforce that the file is a JSON object, and letloadSettings()be the single source of truth for schema validation after merging.Test plan
pnpm vitest run src/lib/SettingsManager.test.ts(261 passing)pnpm build~/.config/iloom-ai/settings.jsoncontaining only a LinearapiToken(withteamIdset per-project) loads without the warning