Skip to content

agents: resolve ${VAR} env references in --spec manifests locally - #1898

Merged
SSharma-10 merged 1 commit into
digitalocean:feat/agents-subcommandsfrom
adilhafeez:feat/agents-spec-env-expansion
Jul 31, 2026
Merged

agents: resolve ${VAR} env references in --spec manifests locally#1898
SSharma-10 merged 1 commit into
digitalocean:feat/agents-subcommandsfrom
adilhafeez:feat/agents-spec-env-expansion

Conversation

@adilhafeez

Copy link
Copy Markdown

Summary

  • doctl agents start --spec (and agents triggers create/update --spec) now resolve ${VAR} references in the manifest from the local environment before uploading, so specs like OPENAI_API_KEY: ${OPENAI_API_KEY} work instead of shipping the literal string into the sandbox.
  • Only the strict braced form ${NAME} expands; bare $VAR, $(...), and other shell-isms embedded in manifests (skills instructions, prompts) pass through untouched. $${VAR} escapes to a literal ${VAR}.
  • Referencing a variable that is not set locally is a hard error listing the missing names, rather than a silent empty substitution.
  • Help text for agents start and the trigger --spec flags documents the behavior, including that fresh-trigger manifests are stored expanded server-side.

Based on #1853 (feat/agents-subcommands), which this PR targets as its base.

Test plan

  • New TestExpandManifestEnv table tests: set/empty/unset variables, missing-name error de-dup, $${VAR} escape, bare-dollar passthrough
  • New TestReadManifest/expands_env_references integration case
  • go test ./commands/ passes (except pre-existing keychain-dependent TestRegistryLogin/TestRegistryLogout failures, unrelated)
  • go vet ./commands/ clean

Made with Cursor

@adilhafeez
adilhafeez marked this pull request as ready for review July 30, 2026 22:54

@SSharma-10 SSharma-10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@SSharma-10
SSharma-10 merged commit ca00ee4 into digitalocean:feat/agents-subcommands Jul 31, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants