Skip to content

fix: quote boolean and numeric env values in compose template - #267

Merged
edenreich merged 2 commits into
mainfrom
fix/docker-compose-env-quoting
Jul 14, 2026
Merged

edenreich merged 2 commits into
mainfrom
fix/docker-compose-env-quoting

Conversation

@inference-gateway-maintainer

@inference-gateway-maintainer inference-gateway-maintainer Bot commented Jul 14, 2026 •

Copy link
Copy Markdown
Contributor

What

The generated docker-compose.yaml template quoted some environment
values (ports, URLs) but left booleans and numbers bare:

  • agent service: A2A_ARTIFACTS_ENABLE: true, A2A_ARTIFACTS_SERVER_PORT: 8081, A2A_ARTIFACTS_RETENTION_MAX_ARTIFACTS: 10
  • infer CLI service: all 16 INFER_* toggles (...: true / ...: false)

This PR quotes every boolean/numeric env value so it renders as a string,
matching how the ports were already handled.

Why

Per Docker's own docs, values in a service environment map that YAML
would read as non-strings must be quoted:

Any boolean values; true, false, yes, no, should be enclosed in quotes
to ensure they are not converted to True or False by the YAML parser.

Left bare, the YAML parser types them as bool/int and docker compose
coerces them (e.g. true becomes "True"), so the agent and the infer
CLI receive the wrong value. docker compose config surfaces exactly
this class of issue.

Smoke test

docker/Bash were not in the action's allowed tools, so the earlier
run could not execute docker compose config. I reproduced that check
locally another way: rendered the template across every branch
combination (go agent, no-agent, artifacts, rust+redis,
rust+redis+artifacts), parsed each output with a YAML parser, and
asserted every environment value resolves to a string tag - the same
invariant docker compose config enforces. Before the fix, 16-19 values
per file were typed !!bool/!!int; after, all are !!str. The YAML
was already structurally valid, so this was the only issue found.

Tests

  • Updated TestDockerComposeTemplate_ArtifactsWiring to expect the quoted forms.
  • Added TestDockerComposeTemplate_EnvironmentValuesAreStrings, which parses the rendered compose and fails if any env value is a bare bool/number, so this cannot silently regress.
  • go test ./..., go vet ./..., and go build all pass.

Note for maintainers

If you want the Claude Code / Infer orchestrators to self-validate
compose files in future runs, docker (or a scoped
Bash(docker compose config:*)) would need to be added to their allowed
tools. That config lives centrally in inference-gateway/.github
(repos.yaml), not in this repo's thin caller workflows, so it is out of
scope here.

Docker's YAML parser coerces bare booleans and numbers in a service environment map (e.g. true becomes "True"), so the generated agent and infer CLI received the wrong values. Quote every boolean/numeric env value the way the ports already were, and add a regression test that parses the rendered compose and asserts all environment values are strings.
@inference-gateway-maintainer
inference-gateway-maintainer Bot requested a review from a team as a code owner July 14, 2026 18:32
@edenreich
edenreich merged commit 6198824 into main Jul 14, 2026
@edenreich
edenreich deleted the fix/docker-compose-env-quoting branch July 14, 2026 18:42
inference-gateway-releaser Bot added a commit that referenced this pull request Jul 14, 2026
## [0.48.0](v0.47.1...v0.48.0) (2026-07-14)

### ✨ Features

* bump Go version to 1.26.4 ([#279](#279)) ([4945a28](4945a28))
* generate OTel-aligned telemetry configuration from extended spec.telemetry ([#281](#281)) ([47c5b3d](47c5b3d))

### 🐛 Bug Fixes

* quote boolean and numeric env values in compose template ([#267](#267)) ([6198824](6198824))

### 📚 Documentation

* add missing CLI flags to README generate/init flag tables ([#275](#275)) ([db0a842](db0a842))
* document spec.telemetry OpenTelemetry generation ([#277](#277)) ([bd75c08](bd75c08)), references [#259](#259)
* fix project structure diagrams and universal files section ([#274](#274)) ([17bad1b](17bad1b)), closes [#272](#272)
* mark Service Injection code examples as illustrative with template references ([#278](#278)) ([69b9806](69b9806))
* remove missing example ref, document all examples ([#273](#273)) ([4e30aff](4e30aff)), closes [#268](#268)
* update Template System and Architecture section with accurate Context struct and file mapping ([#276](#276)) ([352d084](352d084))
@inference-gateway-releaser

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 0.48.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@inference-gateway-releaser inference-gateway-releaser Bot added the released Shipped in a release label Jul 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released Shipped in a release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant