Skip to content

feat(eval): pin injected docker-agent image to host CLI version by default - #4176

Open
aheritier wants to merge 2 commits into
mainfrom
eval-pin-agent-image
Open

feat(eval): pin injected docker-agent image to host CLI version by default#4176
aheritier wants to merge 2 commits into
mainfrom
eval-pin-agent-image

Conversation

@aheritier

@aheritier aheritier commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

🤖 Automated implementer agentthis comment was posted by the implementer bot from Docker Agentic Platform, not by a human developer

Fixes part 2 of #4175 (full diagnosis: #4175 (comment)).

docker agent eval always injected the docker-agent binary from the rolling docker/docker-agent:edge tag, so eval results tested against a moving main-HEAD binary regardless of the host CLI's own version or a supplied --base-image.

Changes

  • Default the injected image to docker/docker-agent:<version>, matching the host CLI's own release version (pkg/version.Version), falling back to docker/docker-agent:edge for dev/main builds (non-semver version.Version).
  • Add --agent-image <ref> to docker agent eval to override the default explicitly.
  • --agent-image none skips binary injection entirely and trusts whatever /docker-agent is already present in the base image (addresses the issue's optional suggested fix too).
  • Saved run JSON now records the resolved agent image (config.agent_image), always present (even empty for none) for reproducibility auditing.
  • Updated docs/features/evaluation/index.md and docs/features/cli/index.md.

Testing

  • task build, go test ./pkg/evaluation/... ./cmd/root/..., task lint, go mod tidy --diff all pass.
  • Full task test has one pre-existing, unrelated failure in pkg/rag/treesitter (requires CGO_ENABLED=1 / a C compiler unavailable in this sandbox); untouched by this change.

Reviewed by an internal reviewer sub-agent (2 passes); all findings addressed except one non-blocking doc-placement nit (the --agent-image injection note lives under "Custom Base Images" though it applies to every eval run — deliberately left as a very minor, low-risk follow-up rather than restructuring the doc section).

…fault

Previously the eval harness always injected the docker-agent binary from
the rolling docker/docker-agent:edge tag, so `docker agent eval` tested
against a moving main-HEAD binary regardless of the host CLI's own
version. Default the injected image to docker/docker-agent:<version>,
matching this CLI's release version, falling back to :edge for dev/main
builds where version.Version isn't a valid semver.

Add --agent-image to override the default explicitly, including a
"none" value that skips binary injection entirely and trusts whatever
/docker-agent is already present in the base image.

Fixes part 2 of #4175.
RunOutputConfig.AgentImage previously used omitempty on the *resolved*
image (ResolvedAgentImage), which is empty precisely when
--agent-image none was passed to skip binary injection. That made an
explicit opt-out indistinguishable from a run predating this field.
Drop omitempty so the field is always present, with an empty string
now unambiguously meaning injection was skipped.

Also clarifies that binary injection applies to every eval run, not
just --base-image ones, and adds save_test.go coverage for all three
--agent-image outcomes.
@aheritier aheritier added area/cli CLI commands, flags, output formatting area/docs Documentation changes labels Sep 4, 2026
@aheritier
aheritier marked this pull request as ready for review September 4, 2026 19:34
@aheritier
aheritier requested a review from a team as a code owner September 4, 2026 19:34
@aheritier aheritier added the kind/feat PR adds a new feature (maps to feat:). Use on PRs only. label Sep 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/cli CLI commands, flags, output formatting area/docs Documentation changes kind/feat PR adds a new feature (maps to feat:). Use on PRs only.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant