Description
The expandEnvVarsInRecord function in packages/providers/src/claude/provider.ts (line 222) uses a regex that only matches $VAR syntax but not the more explicit ${VAR} brace syntax.
Current regex:
val.replace(/\$([A-Z_][A-Z0-9_]*)/g, ...)
Problem: MCP config files commonly use ${VAR} notation (standard in shell, Docker, and most templating systems). When users write:
{
"my-server": {
"env": {
"API_KEY": "${MY_API_KEY}"
}
}
}
The braces are left in the expanded value, producing {actual_value} instead of actual_value.
Proposed Fix
Update the regex to handle both forms:
val.replace(/\$(?:\{([A-Z_][A-Z0-9_]*)\}|([A-Z_][A-Z0-9_]*))/g, (_, braced, bare) => {
const varName = braced ?? bare;
const envVal = process.env[varName];
if (envVal === undefined) {
missingVars.push(varName);
}
return envVal ?? '';
});
Environment
- OS: Windows 11
- Archon: v0.3.10 (dev branch)
- Node: via Bun runtime
Description
The
expandEnvVarsInRecordfunction inpackages/providers/src/claude/provider.ts(line 222) uses a regex that only matches$VARsyntax but not the more explicit${VAR}brace syntax.Current regex:
Problem: MCP config files commonly use
${VAR}notation (standard in shell, Docker, and most templating systems). When users write:{ "my-server": { "env": { "API_KEY": "${MY_API_KEY}" } } }The braces are left in the expanded value, producing
{actual_value}instead ofactual_value.Proposed Fix
Update the regex to handle both forms:
Environment