feat(acp): let an agent opt into the latest adapter release - #635
Open
Adam-Dalloul wants to merge 1 commit into
Open
feat(acp): let an agent opt into the latest adapter release#635Adam-Dalloul wants to merge 1 commit into
Adam-Dalloul wants to merge 1 commit into
Conversation
New models ship inside an adapter's bundled runtime, so a pinned adapter can trail what the vendor already serves: claude-fable-5-1 is live, but through the pinned claude-agent-acp (whose SDK bundles Claude Code 2.1.232) every request answers "API Error: 400 Claude Code 2.1.232 does not support this model; version 2.1.251 or newer is required." The model cannot appear in codeg until the pin moves. A user who accepts the risk should be able to follow the newest release themselves, per agent, without waiting. "Adapter version" is a per-agent control in Agent Settings, npx agents only (a binary or uvx install has no npm dist-tag to track). It rides the same `env_json` store as pi's runtime override and the host-tools knob — a `CODEG_ADAPTER_CHANNEL=latest` reserved key, edited into the env draft and persisted by the same Save button — so both runtimes and both readers resolve it through layers that already exist. Pinned stays the default and is labeled recommended; the copy under the control says plainly that new releases are unreviewed and can break the agent, and that the newest release is occasionally known broken (Kimi Code 0.37.x took every session down while it was the newest). The channel is consulted at install and upgrade time only. On `latest` the prepare path tries `<package>@latest` first, with the same npm flags every agent install already gets (`--include=optional` for platform optional deps, `--registry` past lagging mirrors); if that fails — npm unreachable, a mirror not yet carrying the tag's target — it says so in the install log and retries the reviewed pinned spec, so the agent still installs rather than not at all. A launch never consults npm: it runs whatever is installed, and nothing polls in the background. The recorded installed version keeps coming from the real post-install probe, so Version Status reports what actually landed, never what was asked for — and on the latest channel the pass state keeps the Upgrade action available, because the compare-to-pin flow cannot know whether npm has something newer. An explicit Custom install version wins on either channel and never falls back: the user asked for that exact version, and quietly installing a different one would relabel their choice.
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.
New Anthropic models ship inside the adapter's bundled runtime, so they can sit behind the pin. claude-fable-5-1 is live today, but through the pinned claude-agent-acp 0.69.0 (bundled runtime 2.1.232) every request to it answers:
The 0.73.0 adapter bundles 2.1.257 and the model just works. Until a pin moves, a user who wants such a model has no supported way to get it.
This adds an opt-in, per-agent "Adapter version" control in Agent Settings: Pinned (recommended) or Latest (unreviewed). It is generic across every npx-distributed agent and hidden for binary/uvx agents, and it holds three properties:
Storage follows the pi runtime-override pattern: a reserved env_json key (CODEG_ADAPTER_CHANNEL=latest) behind a structured control, saved through the existing env save path, so it works in desktop and server modes with no schema change. Background update checks, prompts and telemetry were deliberately left out; nothing polls npm. An explicit Custom install version still wins on either channel and never falls back.
Orthogonal to #634: this changes no pins.
Rust helpers are unit-tested (pinned default, latest mapping, override wins, the env sentinel), the frontend helpers and version-check states too, and the strings are translated in all ten locales. tsc, eslint, prettier and the full vitest suite pass locally.