Repository navigation
fix(config): let openscience.json win over openscience.jsonc globally - #821
Merged
Ishaan Gangwani (ishaan1124) merged 4 commits intoSep 29, 2026
Conversation
ANIRUDDHA ADAK (aniruddhaadak80)
requested review from
Aayam Bansal (aayambansal) and
Ishaan Gangwani (ishaan1124)
as code owners
September 28, 2026 23:48
|
ANIRUDDHA ADAK (@aniruddhaadak80) is attempting to deploy a commit to the InkVell Team on Vercel. A member of the Team first needs to authorize it. |
ANIRUDDHA ADAK (aniruddhaadak80)
force-pushed
the
fix/config-global-precedence
branch
from
September 29, 2026 04:42
2030d14 to
7f64d1f
Compare
CONFIG_FILES documents the order as oldest first with later merges winning, and the project-config path follows that list, but the global loader merged openscience.json before openscience.jsonc. A leftover commented-out file therefore shadowed the one the app writes. The legacy TOML migration re-read the same list, so it is reordered too.
ANIRUDDHA ADAK (aniruddhaadak80)
force-pushed
the
fix/config-global-precedence
branch
from
September 29, 2026 11:11
7f64d1f to
0c812d9
Compare
… read `Config.global` is a lazy singleton shared by every test file in the worker, so a file earlier in the same shard can resolve it against an empty config directory and the read below then returns that cached value instead of the files just written — CI saw `global.model` come back undefined. Reset before the read and again in the teardown, the same way the global-writes block in config.test.ts does, so a later file in the shard is not handed this file's fixture either.
The loaders merge openscience.json after openscience.jsonc, but both writers picked the jsonc first when both existed. With the new global read order that shadowed every global save, and at project level it already shadowed Config.update, setMcp and setProvider on main. Writers now prefer the plain json file; a lone jsonc is still written in place and a fresh config is still created as jsonc.
Member
|
I pushed one commit (28c9c5e) on top of yours. The app writes to |
# Conflicts: # CHANGELOG.md
Ishaan Gangwani (ishaan1124)
merged commit Sep 29, 2026
a46ac3b
into
synthetic-sciences:main
8 of 9 checks passed
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
Config.global()merged the two global config files in the reverse of the documented order:mergeDeepis later-wins, so the jsonc file had the final say. The filename list at the top of the same file documents the opposite:and the project-config loader iterates exactly that list — so a project already resolved
openscience.jsonoveropenscience.jsonc. The global loader was the only place that disagreed. The legacy TOML migration below it re-read the same list in the same wrong order.Why it matters
openscience.jsonis what the app writes when you change a setting;openscience.jsoncis the hand-maintained, comment-friendly variant. Someone who keeps a commentedopenscience.jsonc— the entire point of the format — and lets the app manageopenscience.jsongets their stale jsonc value silently winning, and the setting they just changed in the UI appears not to have applied.Same "global and project disagree" class as the
.opensciencedirectory precedence, and the two disagree in the same direction.Verification
New test — it writes both files into the test-isolated
Global.Path.configand cleans up after itself. Fails before, passes after:test/config/config.test.tsandtest/config/synced-merge.test.tsare unchanged by this: the same 4 pre-existing Windows failures before and after (loads agents from .openscience/agents (plural),loads commands from .openscience/command (singular),loads commands from .openscience/commands (plural),resolves scoped npm plugins in config) — 63 pass / 4 fail either way.The change
and in the legacy TOML migration, so a migration that rewrites
config.jsoncarries the same values the live loader would pick:Left alone on purpose
global()usesmergeDeepwhere the rest of the loader usesmergeConfigConcatArrays(which unionspluginandinstructionsrather than replacing them). That inconsistency is real, but it is a separate behaviour change, so it is not folded into a precedence fix.bun run typecheckclean; touched files are Prettier-clean (checked on LF-normalized copies — this checkout hascore.autocrlf=true, which makes Prettier flag every file in the repo).Fixes #820