fix(coding-agent): treat uppercase config values as literals

closes #5661
This commit is contained in:
Armin Ronacher
2026-06-13 21:24:22 +02:00
parent f315d81491
commit 9e9fc79478
9 changed files with 226 additions and 303 deletions

View File

@@ -161,13 +161,11 @@ The `apiKey` and `headers` fields support command execution, environment interpo
"apiKey": "$$literal-dollar-prefix"
"apiKey": "$!literal-bang-prefix"
```
- **Literal value:** Used directly
- **Literal value:** Used directly. Plain uppercase strings such as `MY_API_KEY` are literals; use `$MY_API_KEY` for environment variables.
```json
"apiKey": "sk-..."
```
Legacy uppercase env-var-like values such as `MY_API_KEY` are migrated to `$MY_API_KEY` on startup.
For `models.json`, shell commands are resolved at request time. pi intentionally does not apply built-in TTL, stale reuse, or recovery logic for arbitrary commands. Different commands need different caching and failure strategies, and pi cannot infer the right one.
If your command is slow, expensive, rate-limited, or should keep using a previous value on transient failures, wrap it in your own script or command that implements the caching or TTL behavior you want.