Repository navigation
ci(release): build an agent's image only when its folder changes - #309
Merged
Merged
Conversation
The release pinned the protocol in each shipped agent's requirements.txt, so every bump changed the agent's sources and its src-<digest> tag, and a new Claude Code image was built and published each release. Agents now keep their protocol floor (pi's stale ==0.1.305 becomes >=0.1.305); only the shipped envs' and artifacts' requirements are pinned. An agent's image is then built when its folder changes and skipped as published otherwise, and each wheel still records its digest. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This was referenced Oct 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why. Every release publishes a new Claude Code image, even when nothing in the agent changed. There were four on 2026-10-22 alone, one each for v0.9.1344 to v0.9.1347. Each costs a build on two platforms.
The cause is the release itself. Before it computes tags, it rewrites each shipped agent's
agentenv-framework-protocolrequirement to an exact pin on the protocol version it ships (shipped_bundles.py pin). Everybump-versionalso bumps the protocol, so the agent'srequirements.txtchanges, itssrc-<digest>tag changes, and the image is built again.Change
shipped_bundles.py pinnow pins only the shipped envs' and artifacts'requirements.txt. An agent keeps its floor, so its image is built only when its folder changes. It's built at the first release after the change and skipped after that, because its tag is already published.echo-mcpexample env stays pinned. It isn't a published image, so the pin costs nothing.requirements.txthard-coded==0.1.305, which every release overwrote until now. It becomes>=0.1.305, the version Pi was written against; the protocol classes it uses date from 0.1.267.agent-buildstill runs after the protocol is published, because an agent that raises its floor can name the protocol the same release ships.infra_images.py writereads each image under its current tag.Trade-off. An agent image now runs the newest protocol at or above its floor as of the build, not the protocol of each release that ships it. When an agent needs a newer protocol, raise its floor; that change rebuilds its image.
Verified
Two simulated releases, protocol 0.1.400 then 0.1.401, with each image's source tag computed after the release's pin:
main's scriptTests:
After merge: the release that ships this builds one Claude Code image, since this PR edits its
requirements.txtcomment. The release after it should skipagent-build("published already") and record the same digest.🤖 Generated with Claude Code


Confidence Score: 5/5
The PR appears safe to merge.Summary
Agent requirements now keep their protocol floors instead of changing on every release.
Intentional trade-off acknowledged by
earakely-scale: agents keep the protocol installed when their image was built. Authors must raise an agent’s floor when it needs a newer protocol.No actionable issues found. Tests were inspected but not run.
Diagram
%%{init: {'theme': 'neutral'}}%% flowchart TD A[Release checkout] --> B[Pin env and artifact requirements] B --> C[Compute agent source tag] C --> D{Tag already published?} D -->|Yes| E[Reuse image] D -->|No| F[Build after protocol publish] F --> G[Publish image] E --> H[Record every image digest] G --> H H --> I[Include digest record in wheel]Reviews (1) · Last reviewed commit: "ci(release): build an agent's image only..." · Reviewed by Greptile