Skip to content

feat(acp): let an agent opt into the latest adapter release - #635

Open
Adam-Dalloul wants to merge 1 commit into
xintaofei:mainfrom
Adam-Dalloul:feat/adapter-latest-channel
Open

feat(acp): let an agent opt into the latest adapter release#635
Adam-Dalloul wants to merge 1 commit into
xintaofei:mainfrom
Adam-Dalloul:feat/adapter-latest-channel

Conversation

@Adam-Dalloul

Copy link
Copy Markdown
Contributor

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:

API Error: 400 Claude Code 2.1.232 does not support this model; version 2.1.251 or newer is required. Run 'claude update', or update the Claude desktop app, then try again.

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:

  • The default is unchanged. Pinned stays the default, labeled recommended, and the pinned install spec is byte-identical to today's. The copy under the control warns that the newest releases are unreviewed and can break the agent, and that one is occasionally known broken, the way Kimi Code 0.37.x was.
  • Fail safe to the pin. Latest is resolved only at install and upgrade time, with the same npm flags installs already use (--include=optional, --registry). If installing @latest fails because npm is unreachable or a mirror lags, the install log says so and the pinned spec is installed instead, so the agent still works. Launch never consults npm.
  • Honest version reporting. The installed version keeps coming from the real post-install probe, so Version Status shows what actually landed; on the latest channel the pass state keeps Upgrade available, since codeg cannot know whether npm has something newer.

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.

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.
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