Skip to content

feat(cli): stamp global.agent.version from the image tag on helm deploys - #504

Open
max-parke-scale wants to merge 4 commits into
nextfrom
mparke/agent-version-cli-deploy
Open

max-parke-scale wants to merge 4 commits into
nextfrom
mparke/agent-version-cli-deploy

Conversation

@max-parke-scale

@max-parke-scale max-parke-scale commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

CLI (classic helm) deploys now set global.agent.version to the resolved image tag in the rendered helm values. With agentex-agent chart ≥ 0.6.0 (scaleapi/sgp#5466) that lands as the pod's AGENT_VERSION env var, which the SGP tracing processor (agentex-sdk ≥ 0.25.0, #469) stamps onto every span as __agent_version__ — build provenance on traces, keyed by the same image identity the lineage build/deploy graph uses.

Ordering is free in both directions: old charts ignore the key; the new chart omits the env var when the key is absent. Siblings: chart = scaleapi/sgp#5466; agentex cloud deploy = scaleapi/scaleapi#158940. Set the version via the image tag here or an explicit AGENT_VERSION in manifest env, not both — repeating a chart-generated name renders duplicate env entries.

🧑‍💻🤖 — posted via Claude Code

RetriggerConfidence Score: 5/5

The PR appears safe to merge.

Summary

Classic Helm deploys now copy the resolved image tag into global.agent.version, so supported charts can expose the same build identity to tracing. Explicit AGENT_VERSION settings still take priority to avoid duplicate environment entries.

  • Stamps the resolved image tag into rendered Helm values.
  • Preserves explicit version overrides and environment declarations.
  • Adds coverage for image tags, overrides, and duplicate-prevention paths.
Diagram
sequenceDiagram
    participant User
    participant CLI
    participant Values as Helm values
    participant Helm
    User->>CLI: Deploy manifest and overrides
    CLI->>Values: Build image and agent values
    CLI->>Values: Merge environment Helm overrides
    alt AGENT_VERSION is declared
        CLI->>Values: Keep the declared environment value
    else No AGENT_VERSION is declared
        CLI->>Values: Set global.agent.version from final image tag
    end
    CLI->>Helm: Install or upgrade with merged values
Loading

Reviews (3) · Last reviewed commit: "fix(cli): derive agent version after ove..."

stainless-app Bot and others added 2 commits August 27, 2026 02:57
With agentex-agent chart >=0.6.0 (sgp#5466) the value lands as the pod's
AGENT_VERSION, which the SGP tracing processor stamps onto every span as
__agent_version__. Old charts ignore the key, so ordering is free.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Takes next's .stats.yml (Stainless codegen metadata from release #506); no source conflicts.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Comment thread src/agentex/lib/cli/handlers/deploy_handlers.py Outdated
Comment thread src/agentex/lib/cli/handlers/deploy_handlers.py Outdated
global.agent.version was set from the pre-merge tag, so a helm_overrides
entry that replaced global.image.tag alone shipped the override image
stamped with the earlier tag. It is now derived from the merged tag, via
setdefault so an explicit global.agent.version override still wins.

Chart >=0.6.0 renders global.agent.version as its own AGENT_VERSION env
entry, so a deployment that already declares AGENT_VERSION (manifest
agent.env, environments.yaml env, or a credential mapping) received two
entries, the operator's winning only by template order. The generated
value is skipped in that case: an explicit AGENT_VERSION is a deliberate
pin, and skipping rather than rejecting keeps existing manifests that
pin it deploying unchanged.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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.

1 participant