-
Notifications
You must be signed in to change notification settings - Fork 4.7k
feature: {env:MY_VAR} support in the frontmatter of agent/command markdown files (resolves #5054, #5082) #5092
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
feature: {env:MY_VAR} support in the frontmatter of agent/command markdown files (resolves #5054, #5082) #5092
Conversation
- Add {env:VAR} interpolation to ConfigMarkdown.parse() for frontmatter fields only
- Enables dynamic model selection via environment variables in markdown agents
- Gracefully handles missing environment variables with empty string fallback
- Add comprehensive test coverage for interpolation functionality
- Resolves GitHub issue anomalyco#5054
Example usage:
---
description: "My agent"
model: "{env:MODEL}"
mode: primary
---
- Move interpolateData function to module level to avoid recreation on each parse call - Reduces code churn while maintaining identical behavior - Improves performance slightly by avoiding function recreation
- Extract parseMarkdownWithEnv helper to eliminate repetitive test code - Reduces test file from 194 to 168 lines (-26 lines) - Maintains identical test coverage and behavior - Improves maintainability by centralizing temp file handling
…or clarity - Improve function name to better describe its purpose - Maintains identical behavior and test coverage - Enhances code readability and maintainability
|
Do y'all think the tests are overkill? I'm undecided, myself. Feature itself appears to be functioning correctly. |
…atter-interpolation
…atter-interpolation
…atter-interpolation
…atter-interpolation
…atter-interpolation
…atter-interpolation
…atter-interpolation
…atter-interpolation
…atter-interpolation
…atter-interpolation
…ter-interpolation
|
Hey! Your PR title Please update it to start with one of:
Where See CONTRIBUTING.md for details. |
Resolves #5054. Resolves #5082.
feat: add {env:VAR} interpolation support to markdown frontmatter
Example usage:
description: "My agent"
model: "{env:MODEL}"
mode: primary
commit b9c1f10 (upstream/dev, upstream/HEAD, origin/dev, origin/HEAD, dev)