feat(config): add {file:...} interpolation to agent markdown prompts - #38379
daryltucker wants to merge 1 commit into
Conversation
|
The following comment was made by an LLM, it may be inaccurate: Potential Duplicate FoundPR #34964: feat(opencode): inject file in markdown agents This PR appears to be addressing the same feature—injecting file contents into markdown agent prompts. It may be an earlier attempt or related work for the same functionality that PR #38379 is implementing with |
6f66a91 to
9b0350a
Compare
|
Tested this for a few weeks and everything seemed to work nicely. |
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
9b0350a to
5bc64db
Compare
bc92afd to
bf31230
Compare
bf31230 to
c869a8a
Compare
|
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
Closes # (no issue — feat PR is exempt from issue requirement per check-standards logic)
Type of change
What does this PR do?
Support
{file:path}syntax in agent markdown config files to include external file contents at load time. File paths resolve relative to the referencing file; absolute paths and~expansion also work.This was originally implemented in the
feat/file-interpolationbranch (commitf34366bec7) and has been cleaned up, rebased ontodev, and scoped to only the interpolation feature for this PR.Before: agent and mode prompt fields could only contain literal markdown text. Referencing external content required duplication or separate loading logic.
After:
{file:./path/to/file.md}references are resolved at config load time — frontmatter is stripped, circular references and max depth (5) are detected, and errors are reported via HTML comment placeholders +console.warn()without crashing the load.How did you verify your code works?
bun test config/— 194 passed, 3 skipped (pre-existing), 0 failedbun typecheckfrompackages/opencode— cleaninterpolate-files.test.tscovering: simple refs, missing files, frontmatter stripping, relative paths, circular references, max depth, same-file branches, recursive inclusion, empty files, multiple distinct refsScreenshots / recordings
N/A — config/interpolation change, no UI.
Checklist