Repository navigation
Conversation
|
The following comment was made by an LLM, it may be inaccurate: |
There was a problem hiding this comment.
Looks good. I ran the two updated test files against the base and both new cases failed: the file test$&.md was never formatted, and the /init and /review prompts got a mangled project path. With this PR both test files pass (28/28), and bun run typecheck in packages/core is clean. These were the only places in the repo where a file or directory path is filled into a template with a plain-string replace.
Public API is unchanged.
No blocking concerns.
4d5202b to
9718801
Compare
|
The CI workflow runs on this fork PR are still waiting for approval — could a maintainer approve them? I also extended the regression tests to cover |
|
Automated PR Cleanup Thank you for contributing to opencode. Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions. This PR was closed because it matched the following cleanup criteria:
PRs created within the last month are not affected by this cleanup. If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate. Thanks again for taking the time to contribute. |
Issue for this PR
Fixes #52314
Type of change
What does this PR do?
String.prototype.replaceexpands$-sequences in the replacement string, so a file or directory whose name contains$&(or$',$`,$$) was corrupted when substituted into the formatter argv ($FILE) and the/initand/reviewprompt templates (${path}). The formatter then ran on a nonexistent path and silently skipped the file.Switched those sites to function replacers, which insert the value verbatim (the same pattern already used elsewhere in the codebase):
packages/core/src/formatter.ts—$FILEsubstitutionpackages/core/src/plugin/command.ts—${path}in the init and review templatesHow did you verify your code works?
Extended
packages/core/test/formatter.test.tswith a case that formats a file namedtest$&.mdand asserts its content is written; updatedpackages/core/test/plugin/command.test.tsto run the init/review commands with a project directory containing$&and assert the prompt text contains the literal path.Ran in
packages/core:bun test test/formatter.test.ts test/plugin/command.test.ts→ 28 pass, 0 failbun typecheck→ cleanScreenshots / recordings
N/A (no UI change)
Checklist