Skip to content

docs: make ${env.X} the canonical variable-expansion syntax (+ fixes)#3325

Merged
Sayt-0 merged 3 commits into
docker:mainfrom
dgageot:worktree-board-991ecbb08075ed5a
Jun 30, 2026
Merged

docs: make ${env.X} the canonical variable-expansion syntax (+ fixes)#3325
Sayt-0 merged 3 commits into
docker:mainfrom
dgageot:worktree-board-991ecbb08075ed5a

Conversation

@dgageot

@dgageot dgageot commented Jun 30, 2026

Copy link
Copy Markdown
Member

Several fields in the agent config (command arguments, HTTP headers, filesystem paths) expand variables at runtime, but the docs and examples were inconsistent about which syntax actually works. In JavaScript-expanded fields only ${env.X} is resolved; shell-style $VAR and ${VAR} are silently ignored at runtime. This made many examples misleading and caused real user confusion.

This change makes ${env.X} the single canonical form across all documentation and example YAML files. Occurrences of $VAR / ${VAR} in fields where only ${env.X} is resolved have been corrected, and the central "Variable Expansion in Config Fields" reference in docs/configuration/overview/index.md now clearly documents this. Per-tool docs for mcp, a2a, filesystem, shell, and the Anthropic provider have been updated to match.

Two accompanying fixes close related gaps. First, the filesystem allow_list / deny_list path tokens now correctly resolve ${env.VAR} (the path-expansion helper now normalises that form before calling os.ExpandEnv, matching how pkg/path.ExpandPath and pkg/environment.Expand work), with new test coverage added. Second, a concurrency bug in the sandbox kit promote() function is fixed: when two builds for the same agent raced, one could fail because the destination directory was transiently moved aside by the other; the publish step now retries in that case.

@dgageot dgageot requested a review from a team as a code owner June 30, 2026 14:14
gtardif
gtardif previously approved these changes Jun 30, 2026
dgageot added 3 commits June 30, 2026 16:20
…nsion

os.ExpandEnv doesn't understand the ${env.VAR} alias form, so it would
silently expand to an empty string. Normalize via pathx.NormalizeEnvRefs
first, matching the behavior of pkg/path.ExpandPath and pkg/environment.Expand.

Assisted-By: Claude
Between a failed rename and the recovery Stat, a third concurrent build
can retire finalDir, leaving it momentarily gone. Wrap publishing in a
bounded retry loop so the transient gap is claimed rather than errored.

Assisted-By: Claude
@dgageot dgageot force-pushed the worktree-board-991ecbb08075ed5a branch from 1e869e3 to a170b97 Compare June 30, 2026 14:20
@aheritier aheritier added area/docs Documentation changes area/tools For features/issues/fixes related to the usage of built-in and MCP tools kind/docs Documentation-only changes labels Jun 30, 2026
@Sayt-0 Sayt-0 merged commit 87d0027 into docker:main Jun 30, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/docs Documentation changes area/tools For features/issues/fixes related to the usage of built-in and MCP tools kind/docs Documentation-only changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants