Repository navigation
fix(command): insert the /init project path verbatim - #761
Merged
Ishaan Gangwani (ishaan1124) merged 1 commit intoSep 28, 2026
Conversation
ANIRUDDHA ADAK (aniruddhaadak80)
requested review from
Aayam Bansal (aayambansal) and
Ishaan Gangwani (ishaan1124)
as code owners
September 27, 2026 19:17
|
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. |
The path was spliced in with a string replacement, so replacement patterns in a
directory name were expanded: `$$` became `$`, `$&` pasted the `${path}`
placeholder back, and `$'` pasted the rest of the prompt into the path. Use a
function replacement.
Ishaan Gangwani (ishaan1124)
force-pushed
the
fix/init-prompt-path-verbatim
branch
from
September 28, 2026 05:12
a0fd6c6 to
59f7627
Compare
Ishaan Gangwani (ishaan1124)
merged commit Sep 28, 2026
971a8d2
into
synthetic-sciences:main
1 check failed
3 of 8 tasks
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?
/initbuilds its prompt by splicing the project directory into a templatewith a string replacement:
A string replacement expands the replacement patterns inside the text it
inserts, so a directory name that legally contains
$$,$&or$'produced acorrupted prompt — and that prompt is the only thing telling the agent which
directory it is working in:
3e94875c…/openscience-init-prices$$…at …/openscience-init-prices$: the file ……/openscience-init-a$&b…at …/openscience-init-a${path}b: the file ……/openscience-init-x$'y$$collapses to$,$&pastes the matched${path}back, and$'pasteseverything after the match. The last row leaves the agent pointed at a directory
that does not exist.
A function replacement inserts the path literally, which is the same fix
applied to
{file:…}config references in ba152a6.I swept the rest of the tree for the same idiom and this is the last live
instance: the other
${…}string-pattern replacements aretool/bash.ts(static description text and two numbers) and twotooling/reporelease helpers (fixed replacements), none of which carry usertext.
Linked issue
Fixes #760
How did you verify it?
backend/cli/test/session/command-init-template.test.tscreates a real projectdirectory for each of the three sequences and asserts the
/inittemplatecontains
Instance.worktree— the path the runtime actually resolved, not ahard-coded string.
On unmodified
3e94875call three fail:Commands run:
bun test --timeout 15000 ./test/session/command-init-template.test.ts→ 3 passbun test --timeout 20000 ./test/session/command-init-template.test.ts ./test/session/command-shell.test.ts→ 4 pass, 1 fail — the failure is
trusted command shell interpolation uses the governed shell boundary, whichI reproduced on unmodified
mainwith my change stashed, so it is not fromthis diff
bun run --cwd backend/cli typecheck→ exit 0Pre-existing reds on this Windows checkout, not from this diff:
bun run format:checkcannot pass here: git materializes the LF blobs asCRLF, so Prettier flags hundreds of untouched files, including
tsconfig.jsonand
turbo.json. I verified all three changed files are formatted per therepo config with line endings normalized.
bun run typecheck: backend is clean;@synsci/workspacefails becausefrontend/workspace/src/custom-elements.d.tsis a symlink (mode120000) thatWindows checked out as a text file containing
../../ui/src/custom-elements.d.ts,which TypeScript then parses as source →
TS1128.Checklist
bun run checkis green (format, typecheck, backend + frontend/ui + SDK tests) — blocked on this Windows checkout by the CRLF and symlink artifacts described above; backend typecheck is clean and the new tests are greenbun 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 touchedfrontend/docs/src/content/openscience/is updated if behavior changed — no doc change needed:/inithas always been documented as operating on the project directory, so this restores the documented behaviorpackage.jsonversions and tags are written by the release workflow)installandfrontend/landing/public/installare still byte-identical if I touched either — not touched