From eaac8ed0f73c67dfe64861b4f88a87272734e7ba Mon Sep 17 00:00:00 2001 From: Devin Foley Date: Wed, 18 Nov 2026 14:27:00 -0800 Subject: [PATCH] feat(adapters): add Claude Fable 5.2 and GPT-6.2 with CLI floors, and refresh sandbox CLI pins (Nov 18 audit) (#22222) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work. > - Agents run on coding harnesses. Each adapter has a model catalog, and sandboxes contain pinned CLIs. > - Anthropic released Claude Fable 5.2 and OpenAI released GPT-6.2 Sol and GPT-6.2 Astra for Codex. Both need newer CLIs than the Paperclip Runner provider pack ships. > - A stale catalog hides valid models. A model that needs a newer CLI fails with an opaque backend error. > - This pull request adds the verified model IDs with their CLI floors, names the version gap in Paperclip Runner, and refreshes the sandbox CLI pins. > - The benefit is that operators can select current models and get a named version error instead of a backend failure. ## Linked Issues or Issue Description Refs #20774 and #21636 (both add parts of Fable 5.2 support; see "Overlap" below). Refs #18486 (adds GPT-6.1 Terra; this PR does not duplicate it). Refs #16708 (adds Claude Haiku 5.5 to `claude_local`; this PR does not duplicate it). **What happened?** Claude Fable 5.2 (`claude-fable-5-2`) and GPT-6.2 Sol / Astra (`gpt-6.2-sol`, `gpt-6.2-astra`) are generally available. The `claude_local`, `codex_local`, and OpenCode pickers do not list them. Claude Code 2.1.321 is the first release with Fable 5.2. Codex 0.169.1 is the first release whose bundled catalog lists GPT-6.2. The Paperclip Runner provider pack bundles Claude Code 2.1.286 and Codex 0.160.0. **Expected behavior** The pickers list the new models. A run on a CLI below the model minimum stops with the detected and required versions, or falls back to a compatible model with a visible message. **Proposed change** Add the models and their per-model CLI floors. Gate ACPX Claude in Paperclip Runner on the Claude Code version that its Agent SDK bundles. Refresh the sandbox CLI pins with verified digests. Record the audit. ## What Changed - Claude Code (`claude_local`): - Add `claude-fable-5-2` (label "Claude Fable 5.2") at the top of the picker. `claude-fable-5-1` stays selectable after the current-generation models. - Add Bedrock `global.anthropic.claude-fable-5-2`. Anthropic documents only this global ID for Bedrock. - Fable 5.2 offers all five efforts (`low` to `max`). - `minimumClaudeCliVersionForModel("claude-fable-5-2")` returns `2.1.321`. The existing CLI-lane Test and launch checks use this floor. On a managed sandbox, the CLI lane installs a private Claude Code at this version, as it does for the other floors. - Paperclip Runner (ACPX Codex): `resolvePaperclipRunnerProviderProfile` rejects a model whose Codex floor is above the qualified ACPX Codex runtime (`0.160.0`). The error code is `paperclip_runner_codex_cli_version_incompatible`, and the message gives both versions. - Paperclip Runner (ACPX Claude): `resolvePaperclipRunnerProviderProfile` rejects a model whose Claude Code floor is above the version that the qualified Agent SDK bundles. The error code is `paperclip_runner_claude_cli_version_incompatible`. The message gives both versions. A new helper, `claudeCodeVersionForAgentSdk`, maps SDK `0.3.N` to Claude Code `2.1.N` (the SDK's `claudeCodeVersion` field) and returns `null` for any other line. - Codex (`codex_local`): - Add `gpt-6.2-sol` and `gpt-6.2-astra` at the top of the picker, in the bundled catalog order. - Both offer Fast mode and the `low` to `ultra` efforts. - Both have a CLI floor of `0.169.1`. On the native Codex provider with the pinned Codex 0.160.0, the existing fallback moves `gpt-6.2-sol` to `gpt-6.1-sol` and `gpt-6.2-astra` to `gpt-6-astra` with a visible message. - The default stays `gpt-6.1-sol`. - OpenCode fallback catalog: add `openai/gpt-6.2-sol`, `openai/gpt-6.2-astra`, `anthropic/claude-fable-5-2`, `google/gemini-4-carbon`, and `google/gemini-4-hydrogen`. - Evaluation image sandbox layer (`docker/daytona-runner`): | CLI | Before | After | | --- | --- | --- | | Grok CLI | 1.0.70 | 1.0.89 | | Gemini CLI | 0.65.0 | 0.68.0 | | Cursor CLI | 2026.10.22-27dcf5f | 2026.11.17-f532c45 | | GitHub CLI | 2.103.3 | 2.105.0 | - Add `doc/adapter-model-audit-2026-11-18.md` with sources, compatibility findings, and deferred items. Add a note on above-window Codex floors to `doc/architecture/paperclip-runner-compatibility.md`. No saved agent changes model, effort, or spending settings. No picker entry is removed. ### Managed sandboxes On Paperclip Runner, Fable 5.2 and GPT-6.2 stay unusable until the provider pack moves to Claude Code 2.1.321 or later and Codex 0.169.1 or later. A sandbox image that carries that provider pack must also be promoted. This PR does not change the provider pack (see "Deferred items" in the audit). Native remote Codex accepts only `>=0.149.0 <0.161.0`, so GPT-6.2 also needs that window to move. ### Overlap - #21636 sets the Fable 5.2 floor to `2.1.290`. The [Claude Code changelog](https://github.com/anthropics/claude-code/blob/main/CHANGELOG.md) adds Fable 5.2 in 2.1.321. `git merge-tree` merges the two without a text conflict, but #21636's line becomes unreachable after this PR's line, and its test then fails. Rule: keep `2.1.321`. Merge this PR first. Then close #21636 or change its floor and test to `2.1.321`. - #20774 (draft) lists `claude-fable-5-2`. It conflicts in `packages/adapters/claude-local/src/index.ts` and `server/src/__tests__/adapter-models.test.ts`. Rule: keep this PR's catalog order and Bedrock ID. - #18486 adds `gpt-6.1-terra`. It conflicts in `packages/adapters/codex-local/src/index.test.ts` and `src/server/codex-args.test.ts` (the ordered ID list and the Fast-mode message). Rule: keep both sets of models in the bundled catalog order (`gpt-6.2-sol`, `gpt-6.2-astra`, `gpt-6-astra`, `gpt-6.1-sol`, `gpt-6.1-terra`, ...). Either PR can merge first; the second rebases. - #16708 adds Claude Haiku 5.5. It conflicts in `packages/adapters/claude-local/src/index.test.ts` (adjacent test cases) and `doc/DEVELOPING.md`. Rule: keep both test blocks. ## Verification Research date: November 18, 2026. Sources are listed in the audit doc. - `vitest run src/index.test.ts src/server/model-order.test.ts src/server/cli-capabilities.test.ts src/server/test.remote.test.ts` in `packages/adapters/claude-local`: 40 passed. `execute.remote.test.ts` (29), `test.probe.test.ts` (21), `sandbox-cli-version.test.ts` (15), `acp.auth.test.ts` (25), and `acp.test.ts` (47, with `--testTimeout=60000`) also passed when run one file at a time. - `vitest run src/index.test.ts src/server/codex-args.test.ts src/ui/build-config.test.ts src/server/test.remote.test.ts` in `packages/adapters/codex-local`: all passed (155). `acp.test.ts` (49), `acp.cli-version.test.ts` (4), and `execute.test.ts` (10) also passed one file at a time. - `vitest run` in `packages/adapters/opencode-local`: 94 passed. - `vitest run src/services/native-runtime/acpx-qualification.test.ts src/services/native-runtime/codex-model-fallback.test.ts src/__tests__/adapter-models.test.ts src/__tests__/heartbeat-model-fallback-warning.test.ts` in `server`: all passed. The new cases cover the ACPX Claude and ACPX Codex version errors and the native GPT-6.2 fallback on Codex 0.160.0. - `vitest run src/lib/agent-setup-fields.test.ts src/lib/codex-reasoning-effort.test.ts` in `ui`: 11 passed. - `tsc --noEmit` in the three adapters and `pnpm typecheck` in `server`: passed. - Cursor archive SHA-256 `189ed41d8963cd22dcdafbbd62f072cc55ac08374c922dbd04aee525f4018ab6` is computed from the versioned Linux x64 tarball. The extracted binary reports `2026.11.17-f532c45`, the version that `https://cursor.com/install` resolves. - GitHub CLI SHA-256 `79e7ab5db738c48777b696e374f8b428f0647debfb424f44d2f426370407fe2f` matches `gh_2.105.0_checksums.txt`. - Grok CLI 1.0.89 and Gemini CLI 0.68.0 installed from npm report those versions. The flags that Paperclip uses are in `--help` (`-m`, `--effort`, `grok models`; `-m`, `-p`, `--output-format`, `--approval-mode`, `--yolo`). - Host baseline: tests that create an AI provider need the host's empty `ANTHROPIC_BASE_URL` unset. Under full-package parallel runs, SSH and sandbox fixture tests time out at 5 seconds on this host; each file passes alone. The audit doc records both. - Not run locally: the full `pnpm -r typecheck`, `pnpm build`, browser suites, and the image build. CI runs these. No live model inference ran. ## Risks - Low risk for saved agents: no default, saved model, effort, or spending setting changes. - The new Paperclip Runner checks reject `claude-fable-5-2` on ACPX Claude and `gpt-6.2-*` on ACPX Codex (and any later model whose floor is above the bundled runtime) before launch. Without this PR, the turn would start and fail at the backend. - The `0.3.N` → `2.1.N` mapping covers only the current SDK line. Any other line returns `null`, and the check is skipped. - The sandbox CLI pins change only the evaluation image. The fleet image change is separate. - Rollback: revert this PR. No data migration. ## Model Used - Claude Opus 5.5 (`claude-opus-5-5`), Anthropic, through Claude Code with tool use (shell, web fetch, file edits). ## Checklist - [x] I have included a thinking path that traces from project context to this change - [x] I have specified the model used (with version and capability details) - [x] I have checked ROADMAP.md and confirmed this PR does not duplicate planned core work - [x] I have searched GitHub for duplicate or related PRs and linked them above - [x] I have either (a) linked existing issues with `Fixes: #` / `Closes #` / `Refs #` OR (b) described the issue in-PR following the relevant issue template - [x] I have not referenced internal/instance-local Paperclip issues or links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip` URLs) - [x] My branch name describes the change (e.g. `docs/...`, `fix/...`) and contains no internal Paperclip ticket id or instance-derived details - [x] I have run tests locally and they pass - [x] I have added or updated tests where applicable - [x] I have updated relevant documentation to reflect my changes - [x] I have considered and documented any risks above - [ ] All Paperclip CI gates are green - [ ] Greptile is 5/5 with no open P2s, recommendations, or follow-ups - [x] I will address all Greptile and reviewer comments before requesting merge 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: devinfoley <139239+devinfoley@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 --- doc/adapter-model-audit-2026-11-18.md | 107 ++++++++++++++++++ .../paperclip-runner-compatibility.md | 3 + docker/daytona-runner/Dockerfile | 12 +- docker/daytona-runner/README.md | 14 ++- .../adapters/claude-local/src/index.test.ts | 27 ++++- packages/adapters/claude-local/src/index.ts | 6 +- .../src/server/cli-capabilities.ts | 12 ++ .../adapters/claude-local/src/server/index.ts | 3 + .../claude-local/src/server/models.ts | 2 + .../adapters/codex-local/src/index.test.ts | 11 +- packages/adapters/codex-local/src/index.ts | 15 ++- .../codex-local/src/server/codex-args.test.ts | 2 +- packages/adapters/opencode-local/src/index.ts | 5 + server/src/__tests__/adapter-models.test.ts | 14 ++- .../native-runtime/acpx-qualification.test.ts | 28 +++++ .../codex-model-fallback.test.ts | 7 ++ .../native-runtime/provider-profile.ts | 33 +++++- 17 files changed, 273 insertions(+), 28 deletions(-) create mode 100644 doc/adapter-model-audit-2026-11-18.md diff --git a/doc/adapter-model-audit-2026-11-18.md b/doc/adapter-model-audit-2026-11-18.md new file mode 100644 index 00000000000..0ec5ff826fc --- /dev/null +++ b/doc/adapter-model-audit-2026-11-18.md @@ -0,0 +1,107 @@ +# Adapter model and harness audit: November 18, 2026 + +This audit follows the [October 23, 2026 audit](adapter-model-audit-2026-10-23.md). +It covers model selection in the coding-agent adapters and the CLI pins in the +evaluation sandbox image. Catalog entries identify models; provider accounts +and installed CLIs determine access. No agent defaults or saved model +selections are migrated. + +## Model changes + +| Adapter | Changes from the audit | +| --- | --- | +| Claude Code (direct and Bedrock) | Add Claude Fable 5.2 (`claude-fable-5-2`; Bedrock `global.anthropic.claude-fable-5-2`) at the top of the picker. Fable 5.1 stays selectable after the current-generation models. Fable 5.2 supports all five effort levels and needs Claude Code 2.1.321 or later. The CLI-lane Test and launch report that minimum. Paperclip Runner (ACPX Claude) now rejects a model whose minimum is above the Claude Code that its Agent SDK bundles, with a named version error. | +| Codex | Add `gpt-6.2-sol` and `gpt-6.2-astra` with Fast mode and the `low` to `ultra` efforts. Both need Codex 0.169.1 or later. On an older CLI, native Codex runs fall back to `gpt-6.1-sol` or `gpt-6-astra` and show a message. ACPX Codex in Paperclip Runner rejects them before launch with a named version error. The default stays `gpt-6.1-sol`. | +| OpenCode | Add `openai/gpt-6.2-sol`, `openai/gpt-6.2-astra`, `anthropic/claude-fable-5-2`, `google/gemini-4-carbon`, and `google/gemini-4-hydrogen` to the static fallback. All five IDs are in the OpenCode model registry (models.dev). | +| Gemini CLI | No change. Gemini CLI 0.68.0 still registers no Gemini 4 model. Deferred. | +| Grok Build, Kimi Code, Cursor, Pi, Hermes | No new verified model IDs. | + +## Harness changes + +| Harness | Before | After | +| --- | --- | --- | +| Grok CLI (`@xai-official/grok`) | 1.0.70 | 1.0.89 | +| Gemini CLI | 0.65.0 | 0.68.0 | +| Cursor CLI (sandbox layer) | 2026.10.22-27dcf5f | 2026.11.17-f532c45 | +| GitHub CLI | 2.103.3 | 2.105.0 | +| Kimi Code CLI | 2.3.3 | Unchanged; see "Deferred items" | +| Codex CLI (shared provider pack) | 0.160.0 | Unchanged; see "Deferred items" | +| Claude Agent SDK / Claude Code | 0.3.286 / 2.1.286 | Unchanged; see "Deferred items" | +| OpenCode (shared provider pack) | 1.18.34 | Unchanged; see "Deferred items" | +| Hermes | 0.19.0 | 0.19.0 (newest on PyPI) | + +These pins change only the evaluation image's sandbox layer. They must stay +aligned with the fleet sandbox image definition. Native Grok uses its separate +1.0.13 prerequisite and does not use the global Grok CLI. + +Fable 5.2 and GPT-6.2 do not run on Paperclip Runner in managed sandboxes +until a Paperclip release with newer provider-pack harnesses is rolled out and +a sandbox image that carries it is promoted. On Paperclip Runner, Fable 5.2 +fails before launch with the named Claude Code version error, and GPT-6.2 +falls back as described above. The legacy Claude CLI lane already installs a +private Claude Code at the model minimum when the sandbox can reach the npm +registry. + +## Sources and verification + +Research date: November 18, 2026. + +- [Claude Code changelog](https://github.com/anthropics/claude-code/blob/main/CHANGELOG.md), + 2.1.321: "Added Claude Fable 5.2 (`claude-fable-5-2`), now the default Fable + model". npm `latest` is 2.1.327. `@anthropic-ai/claude-agent-sdk` 0.3.N + declares `claudeCodeVersion` 2.1.N (checked for 0.3.286, 0.3.321, and 0.3.327). +- [Claude models overview](https://platform.claude.com/docs/en/about-claude/models/overview): + Fable 5.2's API ID is `claude-fable-5-2` and its Amazon Bedrock ID is + `global.anthropic.claude-fable-5-2`. Claude Mythos 5.2 has limited availability. +- [Effort](https://platform.claude.com/docs/en/build-with-claude/effort): + "Claude Fable 5.2 supports all five effort levels." +- The bundled `codex-rs/models-manager/models.json` lists `gpt-6.2-sol` and + `gpt-6.2-astra` (visibility `list`, `minimal_client_version` 0.166.0, + efforts `low` to `ultra`, `fast` tier) from + [rust-v0.169.1](https://github.com/openai/codex/releases/tag/rust-v0.169.1). + [rust-v0.169.0](https://github.com/openai/codex/releases/tag/rust-v0.169.0) + does not list them. 0.170.0 is the npm `latest`. The catalog orders + GPT-6.2 Sol before GPT-6.2 Astra. +- [models.dev](https://models.dev/api.json) lists `openai/gpt-6.2-sol`, + `openai/gpt-6.2-astra`, `anthropic/claude-fable-5-2`, + `google/gemini-4-carbon`, and `google/gemini-4-hydrogen`. +- Gemini CLI 0.68.0 `packages/core/src/config/models.ts` has no Gemini 4 + entry. The 0.66.0 to 0.68.0 release notes contain fixes only for the + `-p`, `--model`, and settings paths that Paperclip uses. +- Grok CLI 1.0.89 and Gemini CLI 0.68.0 are the npm `latest` tags. +- Cursor CLI 2026.11.17-f532c45 is the version `https://cursor.com/install` + resolves. The archive SHA-256 was computed from the versioned Linux x64 tarball. +- [GitHub CLI 2.105.0](https://github.com/cli/cli/releases/tag/v2.105.0): the + pinned digest matches the release `checksums.txt`. +- [Hermes on PyPI](https://pypi.org/project/hermes-agent/) remains at 0.19.0. + +## Deferred items + +- **Provider-pack runtimes.** Codex 0.170.0, Claude Code 2.1.327 (Agent SDK + 0.3.327), and OpenCode 1.19.6 need runner qualification. Native remote Codex + accepts only `>=0.149.0 <0.161.0`, so GPT-6.2 needs that window and the + install pin to move. The deferred Claude 2.1.286 → 2.1.308 headless-default + changes from the previous audit still apply. +- **Kimi Code 2.6.3.** The native Kimi profile binds 2.3.3 with a patched + distribution closure. A new version needs its own qualification. +- **GPT-6.1 Terra** is in the Codex catalog. [#18486](https://github.com/paperclipai/paperclip/pull/18486) + adds it; this audit does not duplicate it. +- **Claude Haiku 5.5** in the Claude Code picker is covered by + [#16708](https://github.com/paperclipai/paperclip/pull/16708). +- **Claude Mythos 5.2** has limited availability. +- **Gemini 4** (Argon, Carbon, Hydrogen) in the Gemini CLI and Cursor catalogs: + the CLI does not register them, and Cursor documents display names only. +- **GPT-6.2 API pricing.** The reviewed Codex rate card has no GPT-6.2 entry, + so direct-API receipts for it stay unpriced until the card is reviewed. + +## Host-environment baseline failures + +Recorded once for this audit, Node 25.9.0: + +- Server tests that create an AI provider fail at import with + `AI_InvalidArgumentError: baseURL must be a non-empty string.` because the + host sets `ANTHROPIC_BASE_URL` to an empty value. They pass with it unset. +- Under full-package parallel runs, Claude and Codex adapter tests that use SSH + and sandbox fixtures exceed the 5-second test timeout on this host. The + failing set differs between runs. Each file passes when run alone or with + `--testTimeout=60000`. diff --git a/doc/architecture/paperclip-runner-compatibility.md b/doc/architecture/paperclip-runner-compatibility.md index d148a7dc754..c7082cec755 100644 --- a/doc/architecture/paperclip-runner-compatibility.md +++ b/doc/architecture/paperclip-runner-compatibility.md @@ -70,6 +70,9 @@ release follows a backward-compatible protocol. startup reports the supported range and the remediation. - Runner binary contracts, required runner capabilities, artifact digests, provider-pack manifests, and runtime permission checks are unchanged. +- A model whose Codex floor is above the window (GPT-6.2 needs `0.169.1`) + cannot run natively. A selection of it falls back to the newest same-class + model that the CLI accepts and shows a visible message. This window does not relax the separate ACP provider-pack qualification. When qualifying newer Codex releases, review the upper bound in diff --git a/docker/daytona-runner/Dockerfile b/docker/daytona-runner/Dockerfile index e499138a2cc..26dfd488b61 100644 --- a/docker/daytona-runner/Dockerfile +++ b/docker/daytona-runner/Dockerfile @@ -81,8 +81,8 @@ ENV PATH=${PAPERCLIP_RUNNER_PROVIDER_PACK_ROOT}/node_modules/.bin:/usr/local/sha # Never add a second CLI version to work around a runner compatibility pin. RUN npm uninstall -g @anthropic-ai/claude-code @openai/codex opencode-ai \ && npm install -g \ - @xai-official/grok@1.0.70 \ - @google/gemini-cli@0.65.0 \ + @xai-official/grok@1.0.89 \ + @google/gemini-cli@0.68.0 \ @moonshot-ai/kimi-code@2.3.3 \ && npm cache clean --force @@ -94,8 +94,8 @@ RUN /usr/bin/python3 -m venv /opt/hermes \ && /opt/hermes/bin/pip install --no-cache-dir hermes-agent==0.19.0 \ && ln -sf /opt/hermes/bin/hermes /usr/local/bin/hermes -ARG CURSOR_VERSION=2026.10.22-27dcf5f -ARG CURSOR_SHA256_AMD64=85296944e4600a83c4b764f578d1502bf9c416db200d33a593e8f3ecabfdc294 +ARG CURSOR_VERSION=2026.11.17-f532c45 +ARG CURSOR_SHA256_AMD64=189ed41d8963cd22dcdafbbd62f072cc55ac08374c922dbd04aee525f4018ab6 RUN set -eu; \ arch="$(dpkg --print-architecture)"; \ [ "$arch" = "amd64" ] || { echo "FATAL: cursor pin only covers amd64, not $arch" >&2; exit 1; }; \ @@ -109,8 +109,8 @@ RUN set -eu; \ ln -sf /usr/local/bin/cursor-agent /usr/local/bin/agent; \ chmod -R a+rX /opt/cursor -ARG GH_VERSION=2.103.3 -ARG GH_SHA256_AMD64=4c806978ffce1cec70853302a56d70ac6da4f19bae7adca4e1a8ab00633dd91d +ARG GH_VERSION=2.105.0 +ARG GH_SHA256_AMD64=79e7ab5db738c48777b696e374f8b428f0647debfb424f44d2f426370407fe2f RUN set -eu; \ arch="$(dpkg --print-architecture)"; \ [ "$arch" = "amd64" ] || { echo "FATAL: gh pin only covers amd64, not $arch" >&2; exit 1; }; \ diff --git a/docker/daytona-runner/README.md b/docker/daytona-runner/README.md index 1b585f93f83..f5c4fc5012a 100644 --- a/docker/daytona-runner/README.md +++ b/docker/daytona-runner/README.md @@ -24,14 +24,16 @@ The October 2026 refreshes pin Codex 0.160.0, Claude Agent SDK 0.3.286 (Claude Code 2.1.286), and OpenCode 1.18.34 in the shared provider pack. Claude Code 2.1.280 is the minimum for [Opus 5.5](https://code.claude.com/docs/en/model-config) and 2.1.284 is the -minimum for Sonnet 5.5; the pinned runtime also supports Fable 5.1. Codex -0.160.0 ships bundled metadata for the current -[GPT-6.1 Sol, GPT-6 Sol, and GPT-6 Luna model IDs](https://learn.chatgpt.com/docs/models). -The sandbox layer pins Grok CLI 1.0.70, Gemini CLI 0.65.0, Kimi Code 2.3.3, -Cursor CLI 2026.10.22-27dcf5f, and GitHub CLI 2.103.3 (October 2026 +minimum for Sonnet 5.5; the pinned runtime also supports Fable 5.1. Fable 5.2 +needs Claude Code 2.1.321, so it does not run on Paperclip Runner with this +image until the provider pack moves past that version. Codex 0.160.0 ships bundled metadata for the +[GPT-6.1 Sol, GPT-6 Sol, and GPT-6 Luna model IDs](https://learn.chatgpt.com/docs/models); +GPT-6.2 Sol and Astra need Codex 0.169.1. +The sandbox layer pins Grok CLI 1.0.89, Gemini CLI 0.68.0, Kimi Code 2.3.3, +Cursor CLI 2026.11.17-f532c45, and GitHub CLI 2.105.0 (November 2026 refresh). The native Cursor provider uses its separately verified distribution, pinned to 2026.09.26-dd393fe; it does not use the sandbox layer’s global Cursor -executable. Grok CLI 1.0.70 supports the current +executable. Grok CLI 1.0.89 supports the current [Grok 4.7](https://docs.x.ai/developers/grok-4-7) model family. Hermes stays at 0.19.0, the newest release on PyPI. diff --git a/packages/adapters/claude-local/src/index.test.ts b/packages/adapters/claude-local/src/index.test.ts index 8e3446c5555..d4b610aca68 100644 --- a/packages/adapters/claude-local/src/index.test.ts +++ b/packages/adapters/claude-local/src/index.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from "vitest"; -import { claudeLocalReasoningEffortsForModel, DEFAULT_CLAUDE_LOCAL_MODEL, resolveClaudeModel } from "./index.js"; -import { minimumClaudeCliVersionForModel } from "./server/cli-capabilities.js"; +import { claudeLocalReasoningEffortsForModel, DEFAULT_CLAUDE_LOCAL_MODEL, models, resolveClaudeModel } from "./index.js"; +import { claudeCodeVersionForAgentSdk, minimumClaudeCliVersionForModel } from "./server/cli-capabilities.js"; describe("Claude model defaults", () => { it.each([ @@ -24,6 +24,21 @@ describe("Claude model defaults", () => { expect(claudeLocalReasoningEffortsForModel(model)).toEqual(["low", "medium", "high", "xhigh", "max"]); }); + it.each([ + "claude-fable-5-2", + "claude-fable-5-2[1m]", + "global.anthropic.claude-fable-5-2", + ])("requires CLI 2.1.321 and offers all efforts for %s", (model) => { + expect(minimumClaudeCliVersionForModel(model)).toBe("2.1.321"); + expect(claudeLocalReasoningEffortsForModel(model)).toEqual(["low", "medium", "high", "xhigh", "max"]); + }); + + it("lists Fable 5.2 first and keeps Fable 5.1 selectable", () => { + const ids = models.map((model) => model.id); + expect(ids[0]).toBe("claude-fable-5-2"); + expect(ids).toContain("claude-fable-5-1"); + }); + it("keeps model-specific Claude reasoning limits", () => { expect(claudeLocalReasoningEffortsForModel("claude-fable-5-1")).toContain("xhigh"); expect(claudeLocalReasoningEffortsForModel("claude-sonnet-5")).toContain("max"); @@ -33,6 +48,14 @@ describe("Claude model defaults", () => { expect(claudeLocalReasoningEffortsForModel("custom-model")).toEqual(["low", "medium", "high"]); }); + it("maps an Agent SDK 0.3.N release to the Claude Code 2.1.N it bundles", () => { + expect(claudeCodeVersionForAgentSdk("0.3.286")).toBe("2.1.286"); + expect(claudeCodeVersionForAgentSdk(" 0.3.321 ")).toBe("2.1.321"); + for (const version of ["0.4.1", "0.3.286-beta.1", "", null, undefined]) { + expect(claudeCodeVersionForAgentSdk(version)).toBeNull(); + } + }); + it.each([undefined, null, "", " "])("uses Opus 5.5 for an unset model (%j)", (model) => { expect(DEFAULT_CLAUDE_LOCAL_MODEL).toBe("claude-opus-5-5"); expect(resolveClaudeModel(model)).toBe("claude-opus-5-5"); diff --git a/packages/adapters/claude-local/src/index.ts b/packages/adapters/claude-local/src/index.ts index f81011c1cda..06a91eb4f5d 100644 --- a/packages/adapters/claude-local/src/index.ts +++ b/packages/adapters/claude-local/src/index.ts @@ -26,7 +26,7 @@ export const type = "claude_local"; export function claudeLocalReasoningEffortsForModel(model: string): readonly string[] { const id = model.trim().replace(/\[1m\]$/, "").replace(/^(?:(?:us|eu|apac|global|jp|au)\.)?anthropic\./, ""); if (/^claude-haiku-/.test(id)) return []; - if (/^claude-(?:opus-5(?:-5)?|opus-4-[78]|sonnet-5(?:-5)?|fable-5(?:-1)?)$/.test(id)) { + if (/^claude-(?:opus-5(?:-5)?|opus-4-[78]|sonnet-5(?:-5)?|fable-5(?:-[12])?)$/.test(id)) { return ["low", "medium", "high", "xhigh", "max"]; } if (/^claude-(?:opus|sonnet)-4-6(?:-v1)?$/.test(id)) return ["low", "medium", "high", "max"]; @@ -40,11 +40,12 @@ export const SANDBOX_INSTALL_COMMAND = "npm install -g @anthropic-ai/claude-code // first, by decreasing capability, then older releases grouped by family. The server applies the // same order to discovered models (server/model-order.ts); the picker keeps it. export const models = [ - { id: "claude-fable-5-1", label: "Claude Fable 5.1" }, + { id: "claude-fable-5-2", label: "Claude Fable 5.2" }, { id: "claude-mythos-5", label: "Claude Mythos 5" }, { id: "claude-opus-5-5", label: "Claude Opus 5.5" }, { id: "claude-sonnet-5-5", label: "Claude Sonnet 5.5" }, { id: "claude-haiku-4-5", label: "Claude Haiku 4.5" }, + { id: "claude-fable-5-1", label: "Claude Fable 5.1" }, { id: "claude-fable-5", label: "Claude Fable 5" }, { id: "claude-opus-5", label: "Claude Opus 5" }, { id: "claude-opus-4-8", label: "Claude Opus 4.8" }, @@ -94,6 +95,7 @@ Operational fields: - graceSec (number, optional): SIGTERM grace period in seconds Notes: +- Claude Fable 5.2 uses model ID \`claude-fable-5-2\` (Bedrock: \`global.anthropic.claude-fable-5-2\`) and requires Claude Code v2.1.321 or later. - Claude Opus 5.5 uses model ID \`claude-opus-5-5\` and requires Claude Code v2.1.280 or later. - Claude Sonnet 5.5 uses model ID \`claude-sonnet-5-5\` and requires Claude Code v2.1.284 or later. - filesystemScope and networkScope are spawn-level confinement and are orthogonal to Claude permission flags. Both require Bubblewrap on the host and explicit engine="cli"; default or explicit ACP is rejected because ACP confinement is not yet supported. networkScope="allowlist" injects HTTP_PROXY/HTTPS_PROXY for the CLI while its private network namespace blocks direct sockets, so every required provider/API hostname must be listed explicitly. diff --git a/packages/adapters/claude-local/src/server/cli-capabilities.ts b/packages/adapters/claude-local/src/server/cli-capabilities.ts index db937a69282..f2f479544e5 100644 --- a/packages/adapters/claude-local/src/server/cli-capabilities.ts +++ b/packages/adapters/claude-local/src/server/cli-capabilities.ts @@ -39,6 +39,8 @@ function cacheKeyForTarget(command: string, target: AdapterExecutionTarget | nul export function minimumClaudeCliVersionForModel(model: string): string | null { const modelId = model.trim().replace(/\[1m\]$/, "").replace(/^(?:(?:us|eu|apac|global|jp|au)\.)?anthropic\./, ""); + // Claude Code 2.1.321 changelog: "Added Claude Fable 5.2 (`claude-fable-5-2`)". + if (modelId === "claude-fable-5-2") return "2.1.321"; if (modelId === "claude-opus-5-5") return "2.1.280"; if (modelId === "claude-sonnet-5-5") return "2.1.284"; return modelId === "claude-fable-5-1" @@ -46,6 +48,16 @@ export function minimumClaudeCliVersionForModel(model: string): string | null { : null; } +/** + * The Claude Code version an Agent SDK release bundles. SDK 0.3.N ships Claude Code 2.1.N + * (its package.json `claudeCodeVersion`); any other SDK line returns null so callers skip the + * comparison rather than guess. + */ +export function claudeCodeVersionForAgentSdk(sdkVersion: string | null | undefined): string | null { + const patch = /^0\.3\.(\d+)$/.exec(sdkVersion?.trim() ?? "")?.[1]; + return patch ? `2.1.${patch}` : null; +} + export function parseClaudeCliVersion(output: string): string | null { return output.match(/\b(\d+)\.(\d+)\.(\d+)\b/)?.[0] ?? null; } diff --git a/packages/adapters/claude-local/src/server/index.ts b/packages/adapters/claude-local/src/server/index.ts index 5f962be00c6..d1ef0fa0936 100644 --- a/packages/adapters/claude-local/src/server/index.ts +++ b/packages/adapters/claude-local/src/server/index.ts @@ -5,7 +5,10 @@ export { listClaudeSkills, syncClaudeSkills } from "./skills.js"; export { listClaudeModels, refreshClaudeModels, resetClaudeModelsCacheForTests } from "./models.js"; export { testEnvironment } from "./test.js"; export { + claudeCliVersionAtLeast, + claudeCodeVersionForAgentSdk, claudeCommandSupportsEffortFlag, + minimumClaudeCliVersionForModel, resetClaudeCliCapabilitiesCacheForTests, } from "./cli-capabilities.js"; export { diff --git a/packages/adapters/claude-local/src/server/models.ts b/packages/adapters/claude-local/src/server/models.ts index 34da9f4747f..8fa20e10ebf 100644 --- a/packages/adapters/claude-local/src/server/models.ts +++ b/packages/adapters/claude-local/src/server/models.ts @@ -14,6 +14,8 @@ const ANTHROPIC_API_VERSION = "2023-06-01"; * then older releases grouped by family. */ const BEDROCK_MODELS: AdapterModel[] = [ + // Anthropic documents Fable 5.2 on Bedrock only by its global inference profile ID. + { id: "global.anthropic.claude-fable-5-2", label: "Bedrock Fable 5.2" }, // Fable 5.1's documented geo inference ID carries no -v1 suffix, unlike earlier entries. { id: "us.anthropic.claude-fable-5-1", label: "Bedrock Fable 5.1" }, { id: "us.anthropic.claude-opus-5-5", label: "Bedrock Opus 5.5" }, diff --git a/packages/adapters/codex-local/src/index.test.ts b/packages/adapters/codex-local/src/index.test.ts index 67dd4b3bfad..fdcbd80477f 100644 --- a/packages/adapters/codex-local/src/index.test.ts +++ b/packages/adapters/codex-local/src/index.test.ts @@ -19,6 +19,9 @@ describe("codex model CLI floors", () => { expect(minimumCodexCliVersionForModel(" gpt-6.1-sol ")).toBe("0.159.0"); expect(minimumCodexCliVersionForModel("gpt-6-sol")).toBe("0.157.0"); expect(minimumCodexCliVersionForModel("gpt-6-luna")).toBe("0.157.0"); + // 0.169.1 is the first stable release whose bundled catalog lists GPT-6.2. + expect(minimumCodexCliVersionForModel("gpt-6.2-sol")).toBe("0.169.1"); + expect(minimumCodexCliVersionForModel("gpt-6.2-astra")).toBe("0.169.1"); }); it("gates the default model on its CLI floor and keeps the compatibility fallback floor-free", () => { @@ -83,7 +86,9 @@ describe("codex local adapter metadata", () => { expect(DEFAULT_CODEX_LOCAL_MODEL).toBe("gpt-6.1-sol"); expect(CODEX_LOCAL_COMPATIBILITY_FALLBACK_MODEL).toBe("gpt-5.6-sol"); // Ordered like the ChatGPT app: newest version first, then by capability within a version (#14878). - expect(modelIds.slice(0, 13)).toEqual([ + expect(modelIds.slice(0, 15)).toEqual([ + "gpt-6.2-sol", + "gpt-6.2-astra", "gpt-6.1-sol", "gpt-6-astra", "gpt-6-sol", @@ -103,11 +108,13 @@ describe("codex local adapter metadata", () => { expect(isCodexLocalFastModeSupported("gpt-6-astra")).toBe(true); expect(isCodexLocalFastModeSupported("gpt-6.1-sol")).toBe(true); expect(isCodexLocalFastModeSupported("gpt-6-sol")).toBe(true); + expect(isCodexLocalFastModeSupported("gpt-6.2-sol")).toBe(true); + expect(isCodexLocalFastModeSupported("gpt-6.2-astra")).toBe(true); expect(modelIds).not.toContain("gpt-5.3-codex"); expect(modelIds).not.toContain("gpt-5.3-codex-spark"); }); - it.each(["gpt-6-astra", "gpt-6.1-sol", "gpt-6-sol", " gpt-6-sol ", "gpt-5.6-sol", "gpt-5.6-terra", "gpt-5.6"])("uses the reasoning efforts advertised for %s", (model) => { + it.each(["gpt-6.2-sol", "gpt-6.2-astra", "gpt-6-astra", "gpt-6.1-sol", "gpt-6-sol", " gpt-6-sol ", "gpt-5.6-sol", "gpt-5.6-terra", "gpt-5.6"])("uses the reasoning efforts advertised for %s", (model) => { expect(codexLocalReasoningEffortsForModel(model)).toEqual([ "low", "medium", diff --git a/packages/adapters/codex-local/src/index.ts b/packages/adapters/codex-local/src/index.ts index 11c5d42f5ec..4aafe017651 100644 --- a/packages/adapters/codex-local/src/index.ts +++ b/packages/adapters/codex-local/src/index.ts @@ -42,6 +42,8 @@ export function resolveCodexLocalCliPolicy(config: unknown, options: { networkAc } export const CODEX_LOCAL_FAST_MODE_SUPPORTED_MODELS = [ + "gpt-6.2-sol", + "gpt-6.2-astra", "gpt-6-astra", "gpt-6.1-sol", "gpt-6-sol", @@ -100,6 +102,8 @@ export function codexLocalReasoningEffortsForModel( ): readonly CodexLocalReasoningEffort[] { const normalizedModel = normalizeCodexModel(model); switch (normalizedModel) { + case "gpt-6.2-sol": + case "gpt-6.2-astra": case "gpt-6-astra": case "gpt-6.1-sol": case "gpt-6-sol": @@ -119,9 +123,14 @@ export function codexLocalReasoningEffortsForModel( // "The '' model is not supported when using Codex with a ChatGPT account.", which reads // like an account problem when it is really a stale install, typically a sandbox image baked // before the catalog gained the model. Record the oldest stable release verified to work so the -// Test and the remote runner can name the actual gap. Omit models with no verified floor; the -// install pin in the runner and images is always at or above every floor listed here. +// Test and the remote runner can name the actual gap. Omit models with no verified floor. A floor +// above the runner's install pin keeps the model usable only where a newer CLI is installed. const CODEX_LOCAL_MODEL_MINIMUM_CLI_VERSIONS: Readonly> = { + // 0.169.1 is the first release whose bundled catalog lists GPT-6.2 (0.169.0 does not), though + // the catalog entry declares minimal_client_version 0.166.0. The runner pin is still older, so + // remote runs fall back to gpt-6.1-sol / gpt-6-astra with a visible message until it moves. + "gpt-6.2-sol": "0.169.1", + "gpt-6.2-astra": "0.169.1", // 0.156.1 and older are rejected (openai/codex#49396); 0.159.0 and 0.159.2 are accepted // (openai/codex#49464). No stable release between those was verified either way. "gpt-6.1-sol": "0.159.0", @@ -220,6 +229,8 @@ export function isCodexLocalFastModeSupported(model: string | null | undefined): // then by decreasing capability inside each version, older models at the end. The server // returns this list as written and the model dropdown keeps its order. export const models = [ + { id: "gpt-6.2-sol", label: "gpt-6.2-sol" }, + { id: "gpt-6.2-astra", label: "gpt-6.2-astra" }, { id: "gpt-6.1-sol", label: "gpt-6.1-sol" }, { id: "gpt-6-astra", label: "gpt-6-astra" }, { id: "gpt-6-sol", label: "gpt-6-sol" }, diff --git a/packages/adapters/codex-local/src/server/codex-args.test.ts b/packages/adapters/codex-local/src/server/codex-args.test.ts index 1157018a661..da30a48d487 100644 --- a/packages/adapters/codex-local/src/server/codex-args.test.ts +++ b/packages/adapters/codex-local/src/server/codex-args.test.ts @@ -163,7 +163,7 @@ describe("buildCodexExecArgs", () => { expect(result.fastModeRequested).toBe(true); expect(result.fastModeApplied).toBe(false); expect(result.fastModeIgnoredReason).toContain( - "currently only supported on gpt-6-astra, gpt-6.1-sol, gpt-6-sol, gpt-6-luna, gpt-5.6-sol, gpt-5.6-terra, gpt-5.6-luna, gpt-5.5, gpt-5.4 or manually configured model IDs", + "currently only supported on gpt-6.2-sol, gpt-6.2-astra, gpt-6-astra, gpt-6.1-sol, gpt-6-sol, gpt-6-luna, gpt-5.6-sol, gpt-5.6-terra, gpt-5.6-luna, gpt-5.5, gpt-5.4 or manually configured model IDs", ); expect(result.args).toEqual([ "exec", diff --git a/packages/adapters/opencode-local/src/index.ts b/packages/adapters/opencode-local/src/index.ts index c32d9417a8d..e203416e962 100644 --- a/packages/adapters/opencode-local/src/index.ts +++ b/packages/adapters/opencode-local/src/index.ts @@ -53,6 +53,8 @@ export function isValidOpenCodeModelId(value: unknown): value is string { export const models: Array<{ id: string; label: string }> = [ { id: DEFAULT_OPENCODE_LOCAL_MODEL, label: DEFAULT_OPENCODE_LOCAL_MODEL }, + { id: "openai/gpt-6.2-sol", label: "openai/gpt-6.2-sol" }, + { id: "openai/gpt-6.2-astra", label: "openai/gpt-6.2-astra" }, { id: "openai/gpt-6-astra", label: "openai/gpt-6-astra" }, { id: "openai/gpt-6.1-sol", label: "openai/gpt-6.1-sol" }, { id: "openai/gpt-6-sol", label: "openai/gpt-6-sol" }, @@ -62,11 +64,14 @@ export const models: Array<{ id: string; label: string }> = [ { id: "openai/gpt-5.6-luna", label: "openai/gpt-5.6-luna" }, { id: "anthropic/claude-opus-5-5", label: "anthropic/claude-opus-5-5" }, { id: "anthropic/claude-opus-5", label: "anthropic/claude-opus-5" }, + { id: "anthropic/claude-fable-5-2", label: "anthropic/claude-fable-5-2" }, { id: "anthropic/claude-fable-5-1", label: "anthropic/claude-fable-5-1" }, { id: "anthropic/claude-sonnet-5-5", label: "anthropic/claude-sonnet-5-5" }, { id: "anthropic/claude-sonnet-5", label: "anthropic/claude-sonnet-5" }, { id: "anthropic/claude-haiku-5-5", label: "anthropic/claude-haiku-5-5" }, + { id: "google/gemini-4-carbon", label: "google/gemini-4-carbon" }, { id: "google/gemini-4-argon", label: "google/gemini-4-argon" }, + { id: "google/gemini-4-hydrogen", label: "google/gemini-4-hydrogen" }, { id: "google/gemini-3.8-flash", label: "google/gemini-3.8-flash" }, { id: "xai/grok-4.7", label: "xai/grok-4.7" }, { id: "openai/gpt-5.5", label: "openai/gpt-5.5" }, diff --git a/server/src/__tests__/adapter-models.test.ts b/server/src/__tests__/adapter-models.test.ts index 4ed4b8ff9a0..254933032a6 100644 --- a/server/src/__tests__/adapter-models.test.ts +++ b/server/src/__tests__/adapter-models.test.ts @@ -65,10 +65,11 @@ describe("adapter model listing", () => { expect(models).toEqual(claudeFallbackModels); expect(models.some((model) => model.id === "claude-opus-4-8")).toBe(true); // Newest release of the most capable family leads the list (#14877). - expect(models[0]?.id).toBe("claude-fable-5-1"); + expect(models[0]?.id).toBe("claude-fable-5-2"); expect(models.some((model) => model.id === "claude-sonnet-5")).toBe(true); expect(models.some((model) => model.id === "claude-opus-4-5")).toBe(true); expect(models.some((model) => model.id === "claude-fable-5-1")).toBe(true); + expect(models.some((model) => model.id === "claude-fable-5-2")).toBe(true); expect(models.some((model) => model.id === "claude-fable-5")).toBe(true); expect(models.some((model) => model.id === "claude-mythos-5")).toBe(true); // Opus 5 is a current GA flagship and must be offered even when live discovery is unavailable. @@ -101,7 +102,7 @@ describe("adapter model listing", () => { expect(first.some((model) => model.id === "claude-sonnet-5-5")).toBe(true); // Discovered models take the curated order too: the API's order is not shown as-is. const firstIds = first.map((model) => model.id); - expect(firstIds[0]).toBe("claude-fable-5-1"); + expect(firstIds[0]).toBe("claude-fable-5-2"); expect(firstIds.indexOf("claude-opus-5-5")).toBeLessThan(firstIds.indexOf("claude-opus-4-8")); expect(firstIds.indexOf("claude-opus-4-8")).toBeLessThan(firstIds.indexOf("claude-opus-4-8-20260529")); }); @@ -143,6 +144,7 @@ describe("adapter model listing", () => { }); it.each([ + ["claude-fable-5-2", "Claude Fable 5.2"], ["claude-fable-5-1", "Claude Fable 5.1"], ["claude-opus-5-5", "Claude Opus 5.5"], ["claude-sonnet-5-5", "Claude Sonnet 5.5"], @@ -163,14 +165,14 @@ describe("adapter model listing", () => { expect(models.some((model) => model.id === "claude-opus-4-8")).toBe(true); }); - it("exposes the Bedrock-native Fable 5.1 ID (never the direct ID) in Bedrock mode", async () => { + it("exposes Bedrock-native Fable IDs (never the direct IDs) in Bedrock mode", async () => { process.env.CLAUDE_CODE_USE_BEDROCK = "1"; const fetchSpy = vi.spyOn(globalThis, "fetch"); const models = await listAdapterModels("claude_local"); - // Fable 5.1 leads here too, using its documented dateless Bedrock ID. - expect(models[0]?.id).toBe("us.anthropic.claude-fable-5-1"); + // Fable 5.2 leads here too; Anthropic documents only its global inference profile ID. + expect(models[0]?.id).toBe("global.anthropic.claude-fable-5-2"); expect(models.map((model) => model.id)).toEqual(expect.arrayContaining([ "us.anthropic.claude-opus-5-5", "us.anthropic.claude-opus-5", "us.anthropic.claude-sonnet-5-5", "us.anthropic.claude-sonnet-5", "us.anthropic.claude-fable-5-1", "us.anthropic.claude-opus-4-7", @@ -178,7 +180,7 @@ describe("adapter model listing", () => { ])); expect(models.some((model) => model.id === "claude-sonnet-5-5")).toBe(false); expect(models.map((model) => model.id)).not.toEqual(expect.arrayContaining(["us.anthropic.claude-opus-4-8-v1"])); - expect(models.some((model) => model.id === "claude-fable-5-1")).toBe(false); + expect(models.some((model) => model.id === "claude-fable-5-1" || model.id === "claude-fable-5-2")).toBe(false); expect(fetchSpy).not.toHaveBeenCalled(); }); diff --git a/server/src/services/native-runtime/acpx-qualification.test.ts b/server/src/services/native-runtime/acpx-qualification.test.ts index 0611677520c..dda76180998 100644 --- a/server/src/services/native-runtime/acpx-qualification.test.ts +++ b/server/src/services/native-runtime/acpx-qualification.test.ts @@ -88,6 +88,34 @@ describe("host ACPX qualification admission", () => { expect(resolvePaperclipRunnerNativeProviderInput({ backend: "acpx_runtime", adapterConfig })) .toMatchObject({ acpxAgent, model: "explicit-new-model" }); }); + it("names the Claude Code gap when the bundled SDK predates the model's minimum", () => { + expect(QUALIFIED_ACPX_PROFILES.claude.agentRuntimeVersion).toBe("0.3.286"); + for (const model of ["claude-fable-5-2", "claude-fable-5-2[1m]"]) { + expect(() => resolvePaperclipRunnerProviderProfile({ provider: "acpx", acpxAgent: "claude", model })) + .toThrow(expect.objectContaining({ + code: "paperclip_runner_claude_cli_version_incompatible", + message: expect.stringContaining("requires Claude Code 2.1.321 or newer; this Paperclip Runner bundles Claude Code 2.1.286"), + })); + } + for (const model of ["claude-opus-5-5", "claude-sonnet-5-5", "claude-fable-5-1"]) { + expect(resolvePaperclipRunnerProviderProfile({ provider: "acpx", acpxAgent: "claude", model })) + .toMatchObject({ acpxAgent: "claude", model }); + } + }); + it("names the Codex gap when the qualified ACPX runtime predates the model's minimum", () => { + expect(QUALIFIED_ACPX_PROFILES.codex.agentRuntimeVersion).toBe("0.160.0"); + for (const model of ["gpt-6.2-sol", "gpt-6.2-astra"]) { + expect(() => resolvePaperclipRunnerProviderProfile({ provider: "acpx", acpxAgent: "codex", model })) + .toThrow(expect.objectContaining({ + code: "paperclip_runner_codex_cli_version_incompatible", + message: expect.stringContaining("requires Codex 0.169.1 or newer; this Paperclip Runner bundles Codex 0.160.0"), + })); + } + for (const model of ["gpt-6.1-sol", "gpt-6-astra"]) { + expect(resolvePaperclipRunnerProviderProfile({ provider: "acpx", acpxAgent: "codex", model })) + .toMatchObject({ acpxAgent: "codex", model }); + } + }); it("requires an explicit Codex ACP selection", () => { for (const model of [undefined, "", " "]) { expect(() => resolvePaperclipRunnerProviderProfile({ provider: "acpx", acpxAgent: "codex", model })) diff --git a/server/src/services/native-runtime/codex-model-fallback.test.ts b/server/src/services/native-runtime/codex-model-fallback.test.ts index 6967c29f6ab..71a72bca341 100644 --- a/server/src/services/native-runtime/codex-model-fallback.test.ts +++ b/server/src/services/native-runtime/codex-model-fallback.test.ts @@ -24,6 +24,13 @@ describe("bounded Codex model fallback", () => { expect(unavailable.mock.calls).toEqual([["gpt-6-sol"], ["gpt-5.6-sol"]]); }); + it("moves GPT-6.2 to the newest same-class model the pinned 0.160.0 CLI accepts", () => { + expect(codexModelFallbackCandidates("gpt-6.2-sol")).toEqual(["gpt-6.1-sol", "gpt-6-sol", "gpt-5.6-sol"]); + expect(codexModelFallbackCandidates("gpt-6.2-astra")).toEqual(["gpt-6-astra", "gpt-5.6-sol"]); + expect(compatibleCodexModel("gpt-6.2-sol", "0.160.0")).toBe("gpt-6.1-sol"); + expect(compatibleCodexModel("gpt-6.2-astra", "0.160.0")).toBe("gpt-6-astra"); + }); + it.each([ ["gpt-6.1-sol", "0.159.0"], ["gpt-6-sol", "0.157.0"], ["gpt-5.6-sol", "0.156.0"], ["team-model", "0.156.0"], [null, "0.156.0"], ["gpt-6.1-sol", null], diff --git a/server/src/services/native-runtime/provider-profile.ts b/server/src/services/native-runtime/provider-profile.ts index 892e9df808e..c908d8cb725 100644 --- a/server/src/services/native-runtime/provider-profile.ts +++ b/server/src/services/native-runtime/provider-profile.ts @@ -11,8 +11,10 @@ import { type PaperclipRunnerProvider, } from "@paperclipai/adapter-utils"; import { + codexCliVersionAtLeast, codexLocalReasoningEffortsForModel, isCodexLocalKnownModel, + minimumCodexCliVersionForModel, } from "@paperclipai/adapter-codex-local"; import { AGENTCORE_QUALIFIED_MODEL, @@ -20,6 +22,11 @@ import { } from "../provider-profile-qualification.js"; import { resolveAcpxQualification, resolveAntigravityCandidateAdmission, resolveKimiCandidateAdmission, type AcpxQualificationCandidate } from "./acpx-qualification.js"; import { compatibleCodexModel } from "./codex-model-fallback.js"; +import { + claudeCliVersionAtLeast, + claudeCodeVersionForAgentSdk, + minimumClaudeCliVersionForModel, +} from "@paperclipai/adapter-claude-local/server"; import { parseNativeCursorCloudConfig, type NativeCursorCloudConfig } from "../../vendor/paperclip-runner/index.js"; export const QUALIFIED_OPENCODE_RUNNER_VERSION = "1.18.34" as const; @@ -642,14 +649,38 @@ export function resolvePaperclipRunnerProviderProfile( const selectedModel = acpxAgent === "grok" && model === "grok-build" ? DEFAULT_ACPX_RUNNER_MODELS.grok : model || DEFAULT_ACPX_RUNNER_MODELS[acpxAgent] || ""; + let qualifiedProfile: ReturnType; try { - resolveQualifiedAcpxProfile(acpxAgent, selectedModel); + qualifiedProfile = resolveQualifiedAcpxProfile(acpxAgent, selectedModel); } catch (error) { throw new PaperclipRunnerProviderProfileError( "paperclip_runner_acpx_model_unqualified", error instanceof Error ? error.message : "Paperclip Runner ACPX requires an admitted model.", ); } + if (acpxAgent === "claude") { + // The provider pack runs the Claude Code its Agent SDK bundles; name the gap instead of + // letting an older CLI fail the turn with an opaque backend error. + const minimum = minimumClaudeCliVersionForModel(selectedModel); + const bundled = claudeCodeVersionForAgentSdk(qualifiedProfile.agentRuntimeVersion); + if (minimum && bundled && !claudeCliVersionAtLeast(bundled, minimum)) { + throw new PaperclipRunnerProviderProfileError( + "paperclip_runner_claude_cli_version_incompatible", + `${selectedModel} requires Claude Code ${minimum} or newer; this Paperclip Runner bundles Claude Code ${bundled}. Choose another model or use the legacy Claude runner until the Runner is updated.`, + ); + } + } + if (acpxAgent === "codex") { + // ACPX Codex runs the qualified runtime pin, so the backend would reject a newer model. + const minimum = minimumCodexCliVersionForModel(selectedModel); + const bundled = qualifiedProfile.agentRuntimeVersion; + if (minimum && bundled && !codexCliVersionAtLeast(bundled, minimum)) { + throw new PaperclipRunnerProviderProfileError( + "paperclip_runner_codex_cli_version_incompatible", + `${selectedModel} requires Codex ${minimum} or newer; this Paperclip Runner bundles Codex ${bundled}. Choose another model or use the legacy Codex runner until the Runner is updated.`, + ); + } + } return { provider: "acpx", backend: "acpx_runtime",