Repository navigation
fix(config): keep dollar signs in {file:} reference contents - #754
Merged
Aayam Bansal (aayambansal) merged 1 commit intoSep 27, 2026
Conversation
The file text was spliced in with a string replacement, so replacement patterns in the file were expanded: $$ became $, and $&, $` and $' pasted parts of the config value. Use a function replacement.
breken (breken-ai)
requested review from
Aayam Bansal (aayambansal) and
Ishaan Gangwani (ishaan1124)
as code owners
September 26, 2026 23:25
|
breken (@breken-ai) is attempting to deploy a commit to the InkVell Team on Vercel. A member of the Team first needs to authorize it. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Aayam Bansal (aayambansal)
merged commit Sep 27, 2026
ba152a6
into
synthetic-sciences:main
9 of 10 checks passed
This branch was successfully 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.
What does this PR do, and why?
What: A config value that uses
{file:…}does not get the file's text as written. An agent prompt loaded from{file:prompt.md}that contains display math$$E = mc^2$$reaches the model as$E = mc^2$.Why:
resolveReferencesinbackend/cli/src/config/config.tssplices the file in withresolved.replace(reference, contents.trim()). When the replacement argument is a string,$$,$&,$`and$'in it are expanded as patterns.Small example: a file containing
$$x$$ and $&comes back as$x$ and {file:prompt.md}.Why the existing test missed it: "handles file inclusion substitution" includes
test_theme, which has no$.Fix: pass a function,
() => contents.trim(), which inserts the text verbatim. The{env:…}substitution just above already uses a function replacement.Linked issue
Fixes #753
How did you verify it?
New test in
backend/cli/test/config/config.test.ts: "file inclusion keeps dollar signs in the included text". It writes a realopenscience.jsonwithagent.physicist.prompt: "{file:prompt.md}"and reads it back throughConfig.get()."Energy: $E = mc^2$ … Keep {file:prompt.md} and and as written."bun test --timeout 15000 ./test/config: 119 pass, 0 failbun run typecheck(tsgo): cleanprettier --checkon the changed files: cleanOther affected paths: the same class exists in
$ARGUMENTSsubstitution for slash commands (session/prompt.ts). I kept that as a separate change so each fix stays reviewable on its own.Checklist
bun run checkis green (format, typecheck, backend + frontend/ui + SDK tests). I ran format, typecheck and the config suite. I did not run the full ten-minute backend suite; this change touches onlyresolveReferences.bun run --cwd frontend/workspace buildsucceeds if I touchedfrontend/workspaceorfrontend/ui(not touched)./tooling/repo/generate.tswas run and thetooling/sdkoutput committed if I changedbackend/cli/src/server(not touched)frontend/docs/src/content/openscience/is updated if behavior changed (documented behavior now holds, so there is no docs change)package.jsonversions and tags are written by the release workflow)installandfrontend/landing/public/installare still byte-identical if I touched either (not touched)AI disclosure: an AI agent (breken-ai) found this bug, wrote the fix and test, and ran the checks above.