Skip to content

fix(images): pin the agent CLIs, and rebuild Cursor and Kiro when a release ships - #303

Merged
artempartos merged 3 commits into
developfrom
fix/agent-cli-cache-bust
Sep 24, 2026
Merged

artempartos merged 3 commits into
developfrom
fix/agent-cli-cache-bust

Conversation

@artempartos

@artempartos artempartos commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Why

Claude, Cursor, Kiro, Codex and Grok were installed without a pinned version, while images.yml builds against a registry buildcache. BuildKit keys the install layer on the Dockerfile text and the layers above it, so a rebuild with an unchanged docker/ reused the cached layer and shipped the old CLI. A CLI only moved when node:22-slim happened to move under docker/base. We hit this in prod: the Claude CLI in the agent image was too old for new models, and neither a rerun nor an empty push would have fixed it.

Always installing the newest release fixes the staleness, but then an untried vendor release reaches the next deploy on its own. So a CLI is pinned wherever its vendor lets us pin, and follows the vendor's latest release only where it doesn't.

What

Image Install
claude-code ARG CLAUDE_CODE_VERSION=2.1.281. install.sh takes the release as its argument; the build asserts claude --version matches.
codex ARG CODEX_VERSION=0.156.1 → npm install -g @openai/codex@<pin>
grok ARG GROK_VERSION=1.0.41 → npm install -g @xai-official/grok@<pin>
cursor-cli Unpinnable, because the installer embeds the one release it downloads. The script is ADDed and run (BuildKit checksums an ADDed URL on every build), so the layer rebuilds exactly when a release ships. This also removes the curl | bash pipe.
kiro-cli Unpinnable, because the installer only installs the channel's latest. stable/latest/manifest.json (what the installer reads) is ADDed before the install, with the same effect.

Gemini (0.57.0) and Antigravity (1.1.27) were already pinned and are unchanged.

Canary. The weekly scheduled build resolves the newest release of every pinned CLI (the npm registry latest, and downloads.claude.ai/claude-code-releases/latest) and passes it as the build-arg instead of the pin. A green Monday run therefore says a pin can be raised. The "Report Shipped CLI Version" summary shows what the canary actually installed. Release builds install exactly the pin.

Canary tags. A scheduled run happens on develop, so it used to get the branch and commit tags and overwrite :develop and :<sha> of every image each Monday. With this PR those images carry the newest CLIs rather than the pins, so the canary now publishes only canary-YYYYMMDD (latest still moves only on main-images). A canary image can be tried on staging before a pin is raised (AGENT_IMAGE_TAG=canary-YYYYMMDD).

Verified locally

  • Built with the pins: Claude 2.1.281 (Claude Code), Codex codex-cli 0.156.1, Grok grok 1.0.41, read back from /etc/aixle-cli-version.
  • The canary resolver run by hand today returns Claude 2.1.281, Codex 0.156.1, Grok 1.0.41, and Gemini 0.60.0 (pinned 0.57.0). Cursor, Kiro and Antigravity get no override.
  • From the first commit: all five images build; with no new release the install layer is reported CACHED; a Claude release published between two builds was picked up without a Dockerfile change. A file ADDed from a URL is root-owned with mode 0600, hence --chmod on the Cursor script.
  • actionlint is clean apart from an existing SC2086 info at images.yml:144.

Raising a pin is a one-line change per image, and Dependabot does not see these versions.

🤖 Generated with Claude Code

artempartos and others added 2 commits September 24, 2026 03:33
Claude, Cursor, Kiro, Codex and Grok install without a pinned version, but
the registry build cache keys the install layer on the Dockerfile text, so
builds kept shipping whichever release first filled the cache. A CLI only
moved when node:22-slim happened to move under the base image, and the
weekly canary rebuilt cached layers instead of testing the current CLI.

ADD each vendor's release-channel file ahead of the install. BuildKit
checksums an ADD'd URL on every build, so the install layer is rebuilt
exactly when a release ships and stays cached otherwise. Where the file
names the version, install that version, so the layer cannot drift from
the file that keyed it.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Signed-off-by: Artem Petrov <[email protected]>
…ewest

With the cache-busting ADDs every image build picked up the vendor's latest
release, so a release nobody had tried reached the next deploy on its own.
Claude (through install.sh's version argument), Codex and Grok are now pinned
like Gemini and Antigravity: a release arrives by raising the pin. Cursor and
Kiro keep the ADD, because their installers install only the latest release.

The weekly canary resolves the newest release of every pinned CLI and builds
with it, so a green Monday run says a pin can be raised.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Signed-off-by: Artem Petrov <[email protected]>
@artempartos artempartos changed the title fix(images): pick up new agent CLI releases on every image build fix(images): pin the agent CLIs, and rebuild Cursor and Kiro when a release ships Sep 23, 2026
A scheduled run happens on develop, so metadata-action gave it the branch and
commit tags. Every Monday the canary overwrote `:develop` and `:<sha>` of all
images, and those images now carry the newest CLIs instead of the pins. It now
publishes only `canary-YYYYMMDD`, which is what the workflow comment always
said it did. The version report reads from that same tag.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Signed-off-by: Artem Petrov <[email protected]>
@artempartos
artempartos merged commit ca5cbf7 into develop Sep 24, 2026
7 checks passed
artempartos added a commit that referenced this pull request Sep 24, 2026
…nd (#310)

* fix(codex): claim the image's CLI version so gpt-6 models show up

The Codex models endpoint hides every model whose minimal_client_version
is above the client_version we send. CLIENT_VERSION stayed at 0.147.0
when #303 pinned the image to 0.156.1, so the picker never offered the
gpt-6 family (astra needs 0.153.0, sol/luna 0.155.0) even though sessions
run a CLI that supports it. Verified against prod with a real token:
0.147.0 returns only gpt-5.x, 0.156.1 adds gpt-6-astra/sol/luna.

Replace the fixed 0.144.0 floor test with a parity test against
CODEX_VERSION in docker/codex/Dockerfile, so an image bump that forgets
CLIENT_VERSION fails CI instead of hiding models.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Signed-off-by: Artem Petrov <[email protected]>

* feat(mcp): offer a Codex install command for the personal MCP token

Codex reads a streamable-HTTP bearer token only from an environment
variable (`--bearer-token-env-var`), so the Profile -> MCP snippet
exports FLOW_MCP_TOKEN and then runs `codex mcp add`.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Signed-off-by: Artem Petrov <[email protected]>

---------

Signed-off-by: Artem Petrov <[email protected]>
Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
artempartos added a commit that referenced this pull request Oct 8, 2026
…or (#446)

Codex 0.156.0 replaced "Do you trust the contents of this directory?" /
"Yes, continue" / "No, quit" with a "Folder access" dialog: "Trust this
folder?", "1. Trust and continue", "2. Quit" (or "Back to Agent Command
Center" when the TUI runs on the background server) and the hint
"enter continue · esc quit|back". The codex_workspace_trust signature
still keyed on the old text, so a non_interactive session parked on the
dialog was never failed. The images have pinned 0.156.1 or newer since
#303, so the old wording is dropped rather than kept alongside.

Markers are the question and the first option label, which stay on one
line at any pane width; the footer is the key hint or the final option.
Fixtures come from a real 0.161.0 tmux capture and the CLI's insta
snapshots.

Signed-off-by: Artem Petrov <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
artempartos added a commit that referenced this pull request Nov 23, 2026
The `chat.message` contract has a `url`, and Teams fills it; Slack never
did. The run page showed no link for Slack runs, and an agent that had to
cite the message (the feedback triage) rebuilt the permalink itself and
got a thread reply wrong (board #303). The link is built from the channel
and ts, with the thread params for a reply, and the trigger message hands
it to the agent.

Signed-off-by: Artem Petrov <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
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