diff --git a/doc/adapter-model-audit-2026-10-02.md b/doc/adapter-model-audit-2026-10-02.md new file mode 100644 index 00000000000..5c86e25bd68 --- /dev/null +++ b/doc/adapter-model-audit-2026-10-02.md @@ -0,0 +1,93 @@ +# Adapter model and harness audit: October 2, 2026 + +This audit follows the [September 22, 2026 audit](adapter-model-audit-2026-09-22.md). +It covers model selection in the coding-agent adapters and the shared harness +pins in the runner, the provider pack, and the evaluation 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 | +| --- | --- | +| Codex and the Codex runner catalog | Add GPT-6.1 Sol (`gpt-6.1-sol`). Expose efforts through Ultra and Fast mode, as documented. Keep `gpt-5.6-sol` as the default. | +| Claude on Bedrock | Add Sonnet 5.5 (`us.anthropic.claude-sonnet-5-5`), using the catalog's existing US inference-profile convention. Sonnet 5.5 IDs (direct or Bedrock-qualified) get the documented `xhigh` and `max` efforts and require Claude Code 2.1.284 or later on the CLI lane. | +| OpenCode | Add `openai/gpt-6.1-sol` and `anthropic/claude-sonnet-5-5` to the static fallback used by remote environments. Both IDs are present in the OpenCode model registry. | +| Claude Code (direct) | No change in this audit. [#14993](https://github.com/paperclipai/paperclip/pull/14993) (merged October 5, 2026, superseding #14816) adds Sonnet 5.5 (`claude-sonnet-5-5`, Claude Code 2.1.284 or later) and refreshes the Claude runtime. | +| Grok Build, Gemini CLI, Kimi Code, Cursor | No new verified model IDs. Grok 4.7, Gemini 3.8 Flash, and Kimi K3 remain the newest documented models. | + +## Harness changes + +| Harness | Before | After | +| --- | --- | --- | +| Codex CLI (shared provider pack) | 0.156.0 | 0.160.0 | +| OpenCode (shared provider pack) | 1.18.32 | 1.18.34 | +| Grok CLI (`@xai-official/grok`) | 1.0.41 | 1.0.46 | +| Gemini CLI | 0.60.0 | 0.62.0 | +| Kimi Code CLI | 2.0.2 | 2.1.1 | +| Cursor CLI | 2026.09.18-9a7762b | 2026.10.01-e373342 | +| GitHub CLI | 2.101.0 | 2.102.0 | +| Claude Agent SDK / Claude Code | 0.3.280 / 2.1.280 | 0.3.286 / 2.1.286 via #14993 (merged); this branch keeps that pin | +| Hermes | 0.19.0 | 0.19.0 (current) | +| ACPX, `claude-agent-acp`, `codex-acp` bridges | 0.13.1 / 0.73.0 / 1.6.2 | Unchanged; separately qualified | +| Pi (`@earendil-works/pi-coding-agent`) | 0.87.1 (fleet image) | Unchanged; Pi 1.0 is qualified upstream in the Pi runner stack | + +The remote Codex compatibility window moves to `>=0.149.0 <0.161.0`. The +minimum stays fixed. See +[paperclip-runner-compatibility.md](architecture/paperclip-runner-compatibility.md). + +## Sources and verification + +- [OpenAI's Codex model guide](https://learn.chatgpt.com/docs/models) lists + GPT-6.1 Sol (`gpt-6.1-sol`) with reasoning efforts from Light to Ultra and + Standard and Fast modes at launch. The bundled Codex 0.160.0 model metadata + also contains `gpt-6.1-sol`. The same page records that `gpt-5.4` and + `gpt-5.4-mini` retired from Codex with ChatGPT sign-in on August 31, 2026, + and that `gpt-5.5` retires from Codex with ChatGPT sign-in on October 14, + 2026. Neither retirement applies to the OpenAI API, so the picker keeps + those IDs for API-key users; see "Deferred items". +- [Codex CLI releases](https://github.com/openai/codex/releases) 0.157.0 + through 0.160.0 add GPT-6 Sol and Luna metadata, app-server pagination, and + authoritative provider catalogs. The Linux x64 executable digest comes from + the integrity-verified `@openai/codex@0.160.0-linux-x64` archive. +- [Claude Sonnet 5.5](https://platform.claude.com/docs/en/models/sonnet-5-5/overview) + documents the Bedrock ID `anthropic.claude-sonnet-5-5` and the September 28, + 2026 release. The [Claude Code changelog](https://github.com/anthropics/claude-code/blob/main/CHANGELOG.md) + entry for 2.1.284 adds `claude-sonnet-5-5`, so that version is the CLI minimum. [Models overview](https://platform.claude.com/docs/en/about-claude/models/overview) + lists `xhigh` and `max` effort support for the 5.5 generation. +- [OpenCode releases](https://github.com/anomalyco/opencode/releases) + 1.18.33 and 1.18.34 contain fixes only. The OpenCode model registry at + models.dev lists both added provider-qualified IDs. +- Grok CLI 1.0.46 is the `latest` tag on npm. [xAI's model list](https://docs.x.ai/docs/models) + still ends at Grok 4.7. Gemini CLI 0.62.0 and Kimi Code 2.1.1 are the + `latest` tags on npm; [Google's model catalog](https://ai.google.dev/gemini-api/docs/models) + and [Kimi's model page](https://www.kimi.com/code/docs/en/kimi-code/models.html) + list no newer coding models. +- Cursor CLI 2026.10.01-e373342 is the version the official installer + resolves; the pinned archive digest comes from the versioned tarball, and + the extracted binary reports that version. [Cursor's catalog](https://cursor.com/docs/models-and-pricing) + shows new Grok 4.7 500k and Kimi K3 rows without exact CLI IDs, so no + fallback IDs were added. +- [GitHub CLI 2.102.0](https://github.com/cli/cli/releases/tag/v2.102.0) + contains security fixes for download commands. The pinned digest matches the + release `checksums.txt`. +- [Hermes on PyPI](https://pypi.org/project/hermes-agent/) remains at 0.19.0. + +## Deferred items + +- `gpt-5.4` and `gpt-5.4-mini` stay in the Codex picker because the OpenAI API + still serves them. A later audit can remove them once API retirement is + published or operators confirm no API-key agents depend on them. `gpt-5.5` + needs the same review after October 14, 2026. +- The ACP bridges (ACPX 0.19.4, `claude-agent-acp` 0.85.1, `codex-acp` 2.1.1) + are newer upstream. They carry reviewed patches and qualified executable + digests, so they need a separate qualification campaign rather than a pin + bump. ACPX 0.15.1 and 0.17.0 also change message limits and session + journal records. +- Pi 1.0.0 is published, but the runner's Pi profile and the fleet image stay + on the qualified 0.84.2 / 0.87.1 pins until the Pi 1.0 runner stack lands. +- The native Grok runtime (`native:grok` 1.0.13) is bound by a qualified + profile digest and is not refreshed by this audit. +- Claude Mythos 5.1 remains invitation-only with no public selectable ID. +- Cursor's exact IDs for Grok 4.7 500k, Kimi K3, and GLM 5.3 are not shown + in the documentation and the unauthenticated CLI returns no list. diff --git a/doc/architecture/paperclip-runner-compatibility.md b/doc/architecture/paperclip-runner-compatibility.md index effabc1eba4..d148a7dc754 100644 --- a/doc/architecture/paperclip-runner-compatibility.md +++ b/doc/architecture/paperclip-runner-compatibility.md @@ -46,15 +46,15 @@ would hide the runtime that executed the task. ## Remote Codex version window -Remote native Codex runs accept stable CLI versions **`>=0.149.0 <0.157.0`**. -The install pin remains `0.156.0`. A sandbox image can therefore use an older +Remote native Codex runs accept stable CLI versions **`>=0.149.0 <0.161.0`**. +The install pin is `0.160.0`. A sandbox image can therefore use an older compatible Codex without failing startup or installing another copy. The minimum is fixed at **`0.149.0`** until maintainers deliberately change it. It is not a rolling one-month support window. The official [`@openai/codex` publication history](https://registry.npmjs.org/@openai/codex) -records `0.149.0` on 2026-08-20, `0.153.4` on 2026-09-04, and `0.156.0` on -2026-09-22. See also the [Codex changelog](https://learn.chatgpt.com/docs/changelog). +records `0.149.0` on 2026-08-20, `0.153.4` on 2026-09-04, `0.156.0` on +2026-09-22, and `0.160.0` on 2026-10-01. See also the [Codex changelog](https://learn.chatgpt.com/docs/changelog). This is an explicit compatibility window, not a claim that every Codex minor release follows a backward-compatible protocol. @@ -65,7 +65,7 @@ release follows a backward-compatible protocol. - The same check applies to discovered, explicitly staged, and npm-installed remote Codex executables, including the final executable after linking. - For an incompatible image, the existing - `PAPERCLIP_RUNNER_REMOTE_CODEX_NPM_SPEC=@openai/codex@0.156.0` configuration + `PAPERCLIP_RUNNER_REMOTE_CODEX_NPM_SPEC=@openai/codex@0.160.0` configuration allows installation of the pinned runtime. Without that configuration, startup reports the supported range and the remediation. - Runner binary contracts, required runner capabilities, artifact digests, @@ -85,6 +85,12 @@ app-server binaries with a local deterministic Responses API fixture. Both passed initialization, thread creation with a dynamic tool, a tool-call/result round trip, turn completion, and thread resume. This verifies the tested protocol path; it is not a live model, Linux sandbox, or exhaustive feature test. +The 2026-10-02 refresh moved the install pin and the upper bound to `0.160.0` +after verifying the integrity-checked Linux x64 `0.160.0` executable digest and +the installed ACP package contract. Codex `0.157.0` through `0.160.0` add the +GPT-6.1 Sol catalog entry and app-server pagination without a documented +app-server protocol break; the Linux CI qualification workflow covers the real +startup and session-resume probes for the new pin. Version-boundary and remote artifact-preparation regressions are covered by `codex-runtime-compatibility.test.ts` and `native-session-executor.test.ts`. diff --git a/docker/daytona-runner/Dockerfile b/docker/daytona-runner/Dockerfile index 851d5132654..d0de6c14b7c 100644 --- a/docker/daytona-runner/Dockerfile +++ b/docker/daytona-runner/Dockerfile @@ -28,7 +28,7 @@ COPY cli/package.json ./cli/package.json # The complete resolved lock (including transitive integrity hashes) is reviewed. # Reject registry-time drift BEFORE installing packages or running lifecycle code. # Refresh this digest together with source/provider dependency changes. -ARG PAPERCLIP_RUNNER_LOCK_SHA256=2c46a68811ba1d504a41b6f4d3f642bc93f4a1c615097754c9c6486881dba8e6 +ARG PAPERCLIP_RUNNER_LOCK_SHA256=e1856797158f7d0bdb728b9d6c6dda3d65ad5f7896e68216883174de508431a7 RUN printf '%s pnpm-lock.yaml\n' "${PAPERCLIP_RUNNER_LOCK_SHA256}" > /tmp/provider-lock.sha256 \ && sha256sum -c /tmp/provider-lock.sha256 \ && pnpm install --frozen-lockfile --filter '@paperclipai/paperclip-runner...' @@ -56,9 +56,9 @@ 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.41 \ - @google/gemini-cli@0.60.0 \ - @moonshot-ai/kimi-code@2.0.2 \ + @xai-official/grok@1.0.46 \ + @google/gemini-cli@0.62.0 \ + @moonshot-ai/kimi-code@2.1.1 \ && npm cache clean --force # Hermes requires Python >=3.11,<3.14; the image's default Python is newer. @@ -69,8 +69,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.09.18-9a7762b -ARG CURSOR_SHA256_AMD64=b1308f5a2fc05458b9d8966752986bb23a971bbcc67c842c1df94c4b8132bad9 +ARG CURSOR_VERSION=2026.10.01-e373342 +ARG CURSOR_SHA256_AMD64=a79726c6e644520e993970be4c45775a6889802b67abe461a677a53219ae28e8 RUN set -eu; \ arch="$(dpkg --print-architecture)"; \ [ "$arch" = "amd64" ] || { echo "FATAL: cursor pin only covers amd64, not $arch" >&2; exit 1; }; \ @@ -84,8 +84,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.101.0 -ARG GH_SHA256_AMD64=9bca2d1c16825f109907a23307628a2f0698fbf99662b73a5cf0b020293072b8 +ARG GH_VERSION=2.102.0 +ARG GH_SHA256_AMD64=bb766f710eef8ede859c18578c72c327597cd4c8a85b06001b1f3843c6019386 RUN set -eu; \ arch="$(dpkg --print-architecture)"; \ [ "$arch" = "amd64" ] || { echo "FATAL: gh pin only covers amd64, not $arch" >&2; exit 1; }; \ @@ -139,9 +139,9 @@ RUN /bin/sh -lc 'set -eu; \ for command_name in acpx claude-agent-acp codex-acp; do \ command -v "$command_name" >/dev/null || { echo "FATAL: $command_name not on PATH for daytona user" >&2; exit 1; }; \ done; \ - test "$(codex --version)" = "codex-cli 0.156.0"; \ + test "$(codex --version)" = "codex-cli 0.160.0"; \ test "$(claude --version)" = "2.1.286 (Claude Code)"; \ - test "$(opencode --version)" = "1.18.32"; \ + test "$(opencode --version)" = "1.18.34"; \ test "$(acpx --version)" = "0.13.1"; \ test "$(claude-agent-acp --version)" = "0.73.0"; \ test "$(codex-acp --version)" = "@agentclientprotocol/codex-acp 1.6.2"' diff --git a/docker/daytona-runner/README.md b/docker/daytona-runner/README.md index 950553197fa..8b48d4c1bea 100644 --- a/docker/daytona-runner/README.md +++ b/docker/daytona-runner/README.md @@ -2,7 +2,7 @@ This image is the Paperclip Cloud fleet sandbox image plus a source-built `paperclip-runnerd` and immutable provider pack. The pack contains Node 24.11, -OpenCode 1.18.32, the compiled OpenCode proxy, ACPX 0.13.1 sidecar, qualified ACP +OpenCode 1.18.34, the compiled OpenCode proxy, ACPX 0.13.1 sidecar, qualified ACP agents, and the production lockfile. Its manifest digests each executable bridge and binds the pack to the runner source revision, avoiding artifact upload and npm installation on every fresh lease. @@ -14,14 +14,18 @@ image that this Dockerfile can extend directly. ## Harness versions -The October 1, 2026 refresh pins Codex 0.156.0, Claude Agent SDK -0.3.286 (Claude Code 2.1.286), and OpenCode 1.18.32 in the shared provider +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 uses -the current [GPT-6 Sol and Luna model IDs](https://learn.chatgpt.com/docs/models). -Grok CLI 1.0.41 supports the current -[Grok 4.7](https://docs.x.ai/developers/grok-4-7) model family. +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 same refresh pins Grok CLI 1.0.46, Gemini CLI 0.62.0, Kimi Code 2.1.1, +Cursor CLI 2026.10.01-e373342, and GitHub CLI 2.102.0 in the sandbox layer. +Grok CLI 1.0.46 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. Keep the patched ACP bridge versions separate from their CLI runtime pins. Their executable digests do not change when only the runtime dependency diff --git a/docs/deploy/environment-variables.md b/docs/deploy/environment-variables.md index a663f1f0e80..eb60708a670 100644 --- a/docs/deploy/environment-variables.md +++ b/docs/deploy/environment-variables.md @@ -24,7 +24,7 @@ All environment variables that Paperclip uses for server configuration. | `PAPERCLIP_RUNNER_CA_BUNDLE_PATH` | (unset) | Optional PEM CA bundle for direct runner WSS. Platform roots remain enabled. There is no insecure TLS bypass. | | `PAPERCLIP_RUNNER_REMOTE_BINARY_PATH` | (host build) | Host-local path to a `paperclip-runnerd` artifact built for the remote target OS and architecture. Required when Paperclip and the remote sandbox do not share a compatible platform; build metadata and the required transport mode are verified before launch. | | `PAPERCLIP_RUNNER_REMOTE_CODEX_PATH` | (unset) | Optional host-local path to a Codex executable built for the remote target OS and architecture. For remote Codex-backed runners, Paperclip stages and verifies this executable beside `paperclip-runnerd`. | -| `PAPERCLIP_RUNNER_REMOTE_CODEX_NPM_SPEC` | (unset) | Optional pinned npm package spec (for example, `@openai/codex@0.156.0`) installed inside each fresh remote lease when its Codex harness is not baked into the sandbox image. Mutually exclusive with `PAPERCLIP_RUNNER_REMOTE_CODEX_PATH`; Paperclip verifies the installed executable before starting `runnerd`. | +| `PAPERCLIP_RUNNER_REMOTE_CODEX_NPM_SPEC` | (unset) | Optional pinned npm package spec (for example, `@openai/codex@0.160.0`) installed inside each fresh remote lease when its Codex harness is not baked into the sandbox image. Mutually exclusive with `PAPERCLIP_RUNNER_REMOTE_CODEX_PATH`; Paperclip verifies the installed executable before starting `runnerd`. | | `PAPERCLIP_RUNNER_REMOTE_PROVIDER_PACK_PATH` | `/opt/paperclip-runner/provider-pack` in Docker; otherwise unset | Host-local path to the immutable provider pack built by `pnpm --filter @paperclipai/paperclip-runner build:provider-pack`. Stamped standard Docker images include the pack; downstream compositions and the `cloud` target inherit it. Unstamped local Docker builds skip pack generation. The pack includes its target-built Node 24.11+ runtime, locked production dependencies, OpenCode proxy/executable, and ACPX sidecar. Remote OpenCode and ACPX fail closed without it. A preinstalled pack is accepted only when its complete digested manifest matches this build-owned pack; otherwise Paperclip stages this pack into the sandbox. | | `PAPERCLIP_HIDDEN_SETTINGS` | (unset) | Comma-separated settings surfaces to hide from the UI and floor at the API, for operators hosting Paperclip for others (managed cloud, internal shared server). See [Hiding settings surfaces](#hiding-settings-surfaces). | | `PAPERCLIP_SETTING_DEFAULTS` | (unset) | JSON object replacing the schema default of selected instance settings, for hosting operators. See [Operator setting defaults](#operator-setting-defaults). | diff --git a/package.json b/package.json index a7fe131e308..1d7fe58f88d 100644 --- a/package.json +++ b/package.json @@ -121,7 +121,7 @@ "postgres@3.4.9": "patches/postgres@3.4.9.patch" }, "overrides": { - "@agentclientprotocol/codex-acp@1.6.2>@openai/codex": "0.156.0", + "@agentclientprotocol/codex-acp@1.6.2>@openai/codex": "0.160.0", "@agentclientprotocol/claude-agent-acp@0.73.0>@anthropic-ai/claude-agent-sdk": "0.3.286", "rollup": ">=4.59.0", "react": "^19.2.8", diff --git a/packages/adapters/claude-local/src/index.test.ts b/packages/adapters/claude-local/src/index.test.ts index ff5342c0282..ef67c309a55 100644 --- a/packages/adapters/claude-local/src/index.test.ts +++ b/packages/adapters/claude-local/src/index.test.ts @@ -8,7 +8,12 @@ describe("Claude model defaults", () => { expect(claudeLocalReasoningEffortsForModel(model)).toEqual(["low", "medium", "high", "xhigh", "max"]); }); - it.each(["claude-sonnet-5-5", "claude-sonnet-5-5[1m]"])("requires CLI 2.1.284 and offers all efforts for %s", (model) => { + it.each([ + "claude-sonnet-5-5", + "claude-sonnet-5-5[1m]", + "us.anthropic.claude-sonnet-5-5", + "global.anthropic.claude-sonnet-5-5[1m]", + ])("requires CLI 2.1.284 and offers all efforts for %s", (model) => { expect(minimumClaudeCliVersionForModel(model)).toBe("2.1.284"); expect(claudeLocalReasoningEffortsForModel(model)).toEqual(["low", "medium", "high", "xhigh", "max"]); }); diff --git a/packages/adapters/claude-local/src/server/models.ts b/packages/adapters/claude-local/src/server/models.ts index fe066585e4b..34da9f4747f 100644 --- a/packages/adapters/claude-local/src/server/models.ts +++ b/packages/adapters/claude-local/src/server/models.ts @@ -17,13 +17,15 @@ const BEDROCK_MODELS: AdapterModel[] = [ // 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" }, - { id: "us.anthropic.claude-sonnet-5", label: "Bedrock Sonnet 5" }, + // Sonnet 5.5's documented Bedrock ID is dateless, like Fable 5.1 and Opus 5.5. + { id: "us.anthropic.claude-sonnet-5-5", label: "Bedrock Sonnet 5.5" }, { id: "us.anthropic.claude-haiku-4-5-20251001-v1:0", label: "Bedrock Haiku 4.5" }, { id: "us.anthropic.claude-fable-5", label: "Bedrock Fable 5" }, { id: "us.anthropic.claude-opus-5", label: "Bedrock Opus 5" }, { id: "us.anthropic.claude-opus-4-8", label: "Bedrock Opus 4.8" }, { id: "us.anthropic.claude-opus-4-7", label: "Bedrock Opus 4.7" }, { id: "us.anthropic.claude-opus-4-6-v1", label: "Bedrock Opus 4.6" }, + { id: "us.anthropic.claude-sonnet-5", label: "Bedrock Sonnet 5" }, { id: "us.anthropic.claude-sonnet-4-6", label: "Bedrock Sonnet 4.6" }, { id: "us.anthropic.claude-sonnet-4-5-20250929-v2:0", label: "Bedrock Sonnet 4.5" }, ]; diff --git a/packages/adapters/codex-local/src/index.test.ts b/packages/adapters/codex-local/src/index.test.ts index 5671557c5a5..5269c9b0174 100644 --- a/packages/adapters/codex-local/src/index.test.ts +++ b/packages/adapters/codex-local/src/index.test.ts @@ -15,7 +15,8 @@ describe("codex local adapter metadata", () => { // alias, so it must not be advertised or used as the default (it triggers a fallback warning). expect(DEFAULT_CODEX_LOCAL_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, 12)).toEqual([ + expect(modelIds.slice(0, 13)).toEqual([ + "gpt-6.1-sol", "gpt-6-astra", "gpt-6-sol", "gpt-6-luna", @@ -32,12 +33,13 @@ describe("codex local adapter metadata", () => { expect(modelIds).not.toContain("gpt-5.6"); expect(isCodexLocalFastModeSupported(DEFAULT_CODEX_LOCAL_MODEL)).toBe(true); expect(isCodexLocalFastModeSupported("gpt-6-astra")).toBe(true); + expect(isCodexLocalFastModeSupported("gpt-6.1-sol")).toBe(true); expect(isCodexLocalFastModeSupported("gpt-6-sol")).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-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-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 61512939a92..f1036a67828 100644 --- a/packages/adapters/codex-local/src/index.ts +++ b/packages/adapters/codex-local/src/index.ts @@ -14,6 +14,7 @@ export const DEFAULT_CODEX_LOCAL_MODEL = PAPERCLIP_RUNNER_DEFAULT_MODELS.codex; export const DEFAULT_CODEX_LOCAL_BYPASS_APPROVALS_AND_SANDBOX = true; export const CODEX_LOCAL_FAST_MODE_SUPPORTED_MODELS = [ "gpt-6-astra", + "gpt-6.1-sol", "gpt-6-sol", "gpt-6-luna", "gpt-5.6-sol", @@ -71,6 +72,7 @@ export function codexLocalReasoningEffortsForModel( const normalizedModel = normalizeCodexModel(model); switch (normalizedModel) { case "gpt-6-astra": + case "gpt-6.1-sol": case "gpt-6-sol": case "gpt-5.6-sol": case "gpt-5.6-terra": @@ -110,6 +112,7 @@ 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.1-sol", label: "gpt-6.1-sol" }, { id: "gpt-6-astra", label: "gpt-6-astra" }, { id: "gpt-6-sol", label: "gpt-6-sol" }, { id: "gpt-6-luna", label: "gpt-6-luna" }, @@ -138,10 +141,10 @@ Core fields: - cwd (string, optional): default absolute working directory fallback for the agent process (created if missing when possible) - instructionsFilePath (string, optional): absolute path to a markdown instructions file prepended to stdin prompt at runtime - model (string, optional): Codex model id -- modelReasoningEffort (string, optional): reasoning effort override passed via -c model_reasoning_effort=...; GPT-6 Astra/Sol and GPT-5.6 Sol/Terra support low|medium|high|xhigh|max|ultra; GPT-6 Luna and GPT-5.6 Luna support low|medium|high|xhigh|max +- modelReasoningEffort (string, optional): reasoning effort override passed via -c model_reasoning_effort=...; GPT-6 Astra, GPT-6.1 Sol, GPT-6 Sol, and GPT-5.6 Sol/Terra support low|medium|high|xhigh|max|ultra; GPT-6 Luna and GPT-5.6 Luna support low|medium|high|xhigh|max - promptTemplate (string, optional): run prompt template - search (boolean, optional): run codex with --search -- fastMode (boolean, optional): enable Codex Fast mode; supported on GPT-6 (astra/sol/luna), GPT-5.6 (sol/terra/luna), GPT-5.5, GPT-5.4 and passed through for manual model IDs +- fastMode (boolean, optional): enable Codex Fast mode; supported on GPT-6 (astra/sol/luna), GPT-6.1 Sol, GPT-5.6 (sol/terra/luna), GPT-5.5, GPT-5.4 and passed through for manual model IDs - dangerouslyBypassApprovalsAndSandbox (boolean, optional): run with bypass flag - command (string, optional): defaults to "codex" - extraArgs (string[], optional): additional CLI args @@ -172,7 +175,7 @@ Notes: - Paperclip injects desired local skills into the effective CODEX_HOME/skills/ directory at execution time so Codex can discover "$paperclip" and related skills without polluting the project working directory. For new and updated agents, Paperclip assigns an isolated managed home at ~/.paperclip/instances//companies//agents//codex-home/skills/; when CODEX_HOME is explicitly overridden in adapter config, that override is used instead. - New and updated codex_local agents persist an empty OPENAI_API_KEY override by default so a host-level OPENAI_API_KEY cannot leak into Codex runs through process inheritance. Explicit CODEX_HOME overrides must not point at the shared company codex-home, $CODEX_HOME, or ~/.codex. - Some model/tool combinations reject certain effort levels (for example minimal with web search enabled). -- Fast mode is supported on GPT-6 (astra/sol/luna), GPT-5.6 (sol/terra/luna), GPT-5.5, GPT-5.4 and manual model IDs. When enabled for those models, Paperclip applies \`service_tier="fast"\` and \`features.fast_mode=true\`. +- Fast mode is supported on GPT-6 (astra/sol/luna), GPT-6.1 Sol, GPT-5.6 (sol/terra/luna), GPT-5.5, GPT-5.4 and manual model IDs. When enabled for those models, Paperclip applies \`service_tier="fast"\` and \`features.fast_mode=true\`. - When Paperclip realizes a workspace/runtime for a run, it injects PAPERCLIP_WORKSPACE_* and PAPERCLIP_RUNTIME_* env vars for agent-side tooling. - The ACP engine keeps its workspace sandbox and enables network access on each turn. Explicit sandbox_workspace_write.network_access overrides in extraArgs (or env.PAPERCLIP_CODEX_ACP_NETWORK_ACCESS="false") disable it; execution-target network denial wins. The bundled ACP patch is needed because upstream mode presets override Codex config.toml on every turn. - The CLI engine defaults to a writable workspace sandbox with network access for unattended work and Paperclip API calls. It does not enable the dangerous bypass flag. Explicit sandbox modes/profiles and network overrides in extraArgs retain their meaning. An execution-target network denial remains enforced. diff --git a/packages/adapters/codex-local/src/server/acp.test.ts b/packages/adapters/codex-local/src/server/acp.test.ts index b31dafcb9ff..a1391bf6982 100644 --- a/packages/adapters/codex-local/src/server/acp.test.ts +++ b/packages/adapters/codex-local/src/server/acp.test.ts @@ -508,7 +508,7 @@ describe("codex_local ACP lane", () => { }); }); - it.each([["gpt-6-astra", "ultra"], ["gpt-6-sol", "ultra"], ["gpt-6-luna", "max"], ["gpt-5.6-sol", "ultra"], ["gpt-5.6-terra", "ultra"], ["gpt-5.6-luna", "max"]])("forwards %s controls to the ACPX Codex target", (model, effort) => { + it.each([["gpt-6-astra", "ultra"], ["gpt-6.1-sol", "ultra"], ["gpt-6-sol", "ultra"], ["gpt-6-luna", "max"], ["gpt-5.6-sol", "ultra"], ["gpt-5.6-terra", "ultra"], ["gpt-5.6-luna", "max"]])("forwards %s controls to the ACPX Codex target", (model, effort) => { expect(buildCodexAcpConfig({ engine: "acp", model, 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 266f987dc86..e75a17ebee8 100644 --- a/packages/adapters/codex-local/src/server/codex-args.test.ts +++ b/packages/adapters/codex-local/src/server/codex-args.test.ts @@ -9,7 +9,7 @@ describe("buildCodexExecArgs", () => { if (resumeSessionId) expect(args.slice(-3)).toEqual(["resume", resumeSessionId, "-"]); }); - it.each([["gpt-6-astra", "ultra"], ["gpt-6-sol", "ultra"], ["gpt-6-luna", "max"], ["gpt-5.6-sol", "ultra"], ["gpt-5.6-terra", "ultra"], ["gpt-5.6-luna", "max"]])("forwards %s, its supported reasoning effort, and fast mode", (model, effort) => { + it.each([["gpt-6-astra", "ultra"], ["gpt-6.1-sol", "ultra"], ["gpt-6-sol", "ultra"], ["gpt-6-luna", "max"], ["gpt-5.6-sol", "ultra"], ["gpt-5.6-terra", "ultra"], ["gpt-5.6-luna", "max"]])("forwards %s, its supported reasoning effort, and fast mode", (model, effort) => { const result = buildCodexExecArgs({ model, modelReasoningEffort: effort, @@ -148,7 +148,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-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-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/codex-local/src/ui/build-config.test.ts b/packages/adapters/codex-local/src/ui/build-config.test.ts index a431aea47a0..615f189be34 100644 --- a/packages/adapters/codex-local/src/ui/build-config.test.ts +++ b/packages/adapters/codex-local/src/ui/build-config.test.ts @@ -94,7 +94,7 @@ describe("buildCodexLocalConfig", () => { }); }); - it.each([["gpt-6-astra", "ultra"], ["gpt-6-sol", "ultra"], ["gpt-6-luna", "max"], ["gpt-5.6-sol", "ultra"], ["gpt-5.6-terra", "ultra"], ["gpt-5.6-luna", "max"]])("persists the exact %s model and supported controls", (model, effort) => { + it.each([["gpt-6-astra", "ultra"], ["gpt-6.1-sol", "ultra"], ["gpt-6-sol", "ultra"], ["gpt-6-luna", "max"], ["gpt-5.6-sol", "ultra"], ["gpt-5.6-terra", "ultra"], ["gpt-5.6-luna", "max"]])("persists the exact %s model and supported controls", (model, effort) => { const config = buildCodexLocalConfig( makeValues({ model, diff --git a/packages/adapters/opencode-local/src/index.ts b/packages/adapters/opencode-local/src/index.ts index 0c02ab9ba18..6d4d08a89c0 100644 --- a/packages/adapters/opencode-local/src/index.ts +++ b/packages/adapters/opencode-local/src/index.ts @@ -54,6 +54,7 @@ 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-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" }, { id: "openai/gpt-6-luna", label: "openai/gpt-6-luna" }, { id: "openai/gpt-5.6-sol", label: "openai/gpt-5.6-sol" }, @@ -62,6 +63,7 @@ export const models: Array<{ id: string; label: string }> = [ { 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-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: "google/gemini-3.8-flash", label: "google/gemini-3.8-flash" }, { id: "xai/grok-4.7", label: "xai/grok-4.7" }, diff --git a/packages/paperclip-runner/package.json b/packages/paperclip-runner/package.json index ba17795dd00..f6990e3ca4e 100644 --- a/packages/paperclip-runner/package.json +++ b/packages/paperclip-runner/package.json @@ -165,11 +165,11 @@ "dependencies": { "@agentclientprotocol/claude-agent-acp": "0.73.0", "@agentclientprotocol/codex-acp": "1.6.2", - "@openai/codex": "0.156.0", + "@openai/codex": "0.160.0", "acpx": "0.13.1", "ajv": "^8.20.0", "json-schema-to-ts": "^3.1.1", - "opencode-ai": "1.18.32", + "opencode-ai": "1.18.34", "react-markdown": "^10.1.0", "remark-gfm": "^4.0.1", "smol-toml": "^1.4.2" diff --git a/packages/paperclip-runner/runner/crates/runner-core/src/acpx_provider_backend.rs b/packages/paperclip-runner/runner/crates/runner-core/src/acpx_provider_backend.rs index eb25c8310a0..6903dc7ed97 100644 --- a/packages/paperclip-runner/runner/crates/runner-core/src/acpx_provider_backend.rs +++ b/packages/paperclip-runner/runner/crates/runner-core/src/acpx_provider_backend.rs @@ -161,7 +161,7 @@ impl AcpxProviderDescriptor { "@agentclientprotocol/codex-acp", "1.6.2", Some("@openai/codex"), - Some("0.156.0"), + Some("0.160.0"), "sha256:c4538599d1ab767db5dff50934f13bb5ba313a59d9c4a83e993fac4617ea63d3", ), "pi" => ( @@ -2266,7 +2266,7 @@ mod tests { "@agentclientprotocol/codex-acp", "1.6.2", json!("@openai/codex"), - json!("0.156.0"), + json!("0.160.0"), "sha256:c4538599d1ab767db5dff50934f13bb5ba313a59d9c4a83e993fac4617ea63d3", ) }; diff --git a/packages/paperclip-runner/runner/crates/runner-core/src/codex_provider.rs b/packages/paperclip-runner/runner/crates/runner-core/src/codex_provider.rs index 95bc8579d52..bf6d79a874e 100644 --- a/packages/paperclip-runner/runner/crates/runner-core/src/codex_provider.rs +++ b/packages/paperclip-runner/runner/crates/runner-core/src/codex_provider.rs @@ -24,7 +24,7 @@ use crate::qualified_launch::verify_launch_artifact; use crate::question_response::validate_question_response; pub const CODEX_APP_SERVER_MAX_FRAME_BYTES: usize = 4 * 1024 * 1024; -const QUALIFIED_OPENCODE_VERSION: &str = "1.18.32"; +const QUALIFIED_OPENCODE_VERSION: &str = "1.18.34"; const DEFAULT_PROVIDER_TRACE_MAX_BYTES: usize = 64 * 1024 * 1024; const MAX_BUFFERED_MESSAGES: usize = 1_024; const MAX_BUFFERED_MESSAGE_BYTES: usize = 16 * 1024 * 1024; diff --git a/packages/paperclip-runner/runner/crates/runner-core/src/provider_backend.rs b/packages/paperclip-runner/runner/crates/runner-core/src/provider_backend.rs index a3456d8437f..545544c73eb 100644 --- a/packages/paperclip-runner/runner/crates/runner-core/src/provider_backend.rs +++ b/packages/paperclip-runner/runner/crates/runner-core/src/provider_backend.rs @@ -4933,7 +4933,7 @@ mod tests { CodexProviderConfig { provider: "opencode".to_owned(), driver: "opencode_server".to_owned(), - provider_version: "1.18.32".to_owned(), + provider_version: "1.18.34".to_owned(), command: PathBuf::from("node"), args: Vec::new(), cwd: std::env::current_dir() @@ -5295,7 +5295,7 @@ mod tests { CodexProviderConfig { provider: "opencode".to_owned(), driver: "opencode_server".to_owned(), - provider_version: "1.18.32".to_owned(), + provider_version: "1.18.34".to_owned(), command: PathBuf::from("node"), args: Vec::new(), cwd: std::env::current_dir() diff --git a/packages/paperclip-runner/runner/crates/runner-core/tests/acpx_warm_attachment.rs b/packages/paperclip-runner/runner/crates/runner-core/tests/acpx_warm_attachment.rs index 252953d7d6a..0df7ba1c34c 100644 --- a/packages/paperclip-runner/runner/crates/runner-core/tests/acpx_warm_attachment.rs +++ b/packages/paperclip-runner/runner/crates/runner-core/tests/acpx_warm_attachment.rs @@ -83,7 +83,7 @@ fn checkpoints_the_sidecar_and_rebinds_consecutive_warm_runs_before_accepting_wo "providerVersion": "0.13.1", "agent": "codex", "model": "gpt-5.6-sol", "acpxVersion": "0.13.1", "agentServerPackage": "@agentclientprotocol/codex-acp", "agentServerVersion": "1.6.2", "agentRuntimePackage": "@openai/codex", - "agentRuntimeVersion": "0.156.0", "commandDigest": PROFILE_DIGEST, + "agentRuntimeVersion": "0.160.0", "commandDigest": PROFILE_DIGEST, "sidecarCommand": sidecar, "sidecarArgs": args, "runtimeDirectory": fixture.0, "normalizedSessionId": "session-1", "runId": "run-1", "cwd": fixture.0, "instructions": "Complete the supplied work.", diff --git a/packages/paperclip-runner/runner/crates/runner-core/tests/native_provider_backend.rs b/packages/paperclip-runner/runner/crates/runner-core/tests/native_provider_backend.rs index 493e413d99e..b6fad6fe060 100644 --- a/packages/paperclip-runner/runner/crates/runner-core/tests/native_provider_backend.rs +++ b/packages/paperclip-runner/runner/crates/runner-core/tests/native_provider_backend.rs @@ -182,7 +182,7 @@ fn prepare_payload(directory: &Path, agent: &str) -> Value { fn prepare_payload_with_mode(directory: &Path, agent: &str, mode: &str) -> Value { let operations = Vec::new(); let (runtime_package, runtime_version) = if agent == "codex" { - (json!("@openai/codex"), json!("0.156.0")) + (json!("@openai/codex"), json!("0.160.0")) } else { (Value::Null, Value::Null) }; @@ -800,7 +800,7 @@ fn opencode_prepare_payload(directory: &Path) -> Value { "kind": "opencode", "provider": "opencode", "driver": "opencode_server", - "providerVersion": "1.18.32", + "providerVersion": "1.18.34", "command": directory.join("qualified-opencode-proxy-command"), "args": [directory.join("qualified-opencode-proxy-script")], "cwd": directory, diff --git a/packages/paperclip-runner/scripts/build-provider-pack.mjs b/packages/paperclip-runner/scripts/build-provider-pack.mjs index 0e6e036bf9e..c6a2d690f18 100644 --- a/packages/paperclip-runner/scripts/build-provider-pack.mjs +++ b/packages/paperclip-runner/scripts/build-provider-pack.mjs @@ -309,8 +309,8 @@ try { const payload = { pins: { nodeMinimum: minimumNodeVersion.join("."), - codex: "0.156.0", - opencode: "1.18.32", + codex: "0.160.0", + opencode: "1.18.34", acpx: "0.13.1", grok: "1.0.13", claudeAcp: "0.73.0", diff --git a/packages/paperclip-runner/scripts/materialize-opencode-binary.mjs b/packages/paperclip-runner/scripts/materialize-opencode-binary.mjs index ef984a02924..120c5b48c3c 100644 --- a/packages/paperclip-runner/scripts/materialize-opencode-binary.mjs +++ b/packages/paperclip-runner/scripts/materialize-opencode-binary.mjs @@ -13,7 +13,7 @@ import { import { dirname, join, resolve } from "node:path"; import { pathToFileURL } from "node:url"; -const OPENCODE_VERSION = "1.18.32"; +const OPENCODE_VERSION = "1.18.34"; const BASELINE_PACKAGE = "opencode-linux-x64-baseline"; function readPackage(path) { diff --git a/packages/paperclip-runner/scripts/materialize-opencode-binary.test.mjs b/packages/paperclip-runner/scripts/materialize-opencode-binary.test.mjs index 789fa62af7b..a25c13e1309 100644 --- a/packages/paperclip-runner/scripts/materialize-opencode-binary.test.mjs +++ b/packages/paperclip-runner/scripts/materialize-opencode-binary.test.mjs @@ -35,14 +35,14 @@ async function fixture(options = {}) { join(packageRoot, "package.json"), JSON.stringify({ name: "opencode-ai", - version: options.packageVersion ?? "1.18.32", + version: options.packageVersion ?? "1.18.34", }), ), writeFile( join(baselineRoot, "package.json"), JSON.stringify({ name: "opencode-linux-x64-baseline", - version: options.baselineVersion ?? "1.18.32", + version: options.baselineVersion ?? "1.18.34", }), ), writeFile(join(packageRoot, "bin", "opencode.exe"), "sentinel\n"), @@ -50,11 +50,11 @@ async function fixture(options = {}) { const source = join(baselineRoot, "bin", "opencode"); if (options.symlinkSource) { const realSource = join(root, "real-opencode"); - await writeFile(realSource, "#!/bin/sh\necho 1.18.32\n"); + await writeFile(realSource, "#!/bin/sh\necho 1.18.34\n"); await chmod(realSource, 0o755); await symlink(realSource, source); } else { - await writeFile(source, "#!/bin/sh\necho 1.18.32\n"); + await writeFile(source, "#!/bin/sh\necho 1.18.34\n"); await chmod(source, 0o755); } return packageRoot; @@ -67,7 +67,7 @@ test("materializes the pinned baseline executable with a verified version", asyn platform: "linux", architecture: "x64", }); - assert.equal(result.version, "1.18.32"); + assert.equal(result.version, "1.18.34"); assert.match(result.sourceDigest, /^[0-9a-f]{64}$/); }); @@ -80,7 +80,7 @@ test("refuses version, file-type, and platform drift", async () => { platform: "linux", architecture: "x64", }), - /Expected opencode-linux-x64-baseline@1\.18\.32/, + /Expected opencode-linux-x64-baseline@1\.18\.34/, ); const symlinkSource = await fixture({ symlinkSource: true }); diff --git a/packages/paperclip-runner/scripts/runner-protocol-eval-campaign.test.mjs b/packages/paperclip-runner/scripts/runner-protocol-eval-campaign.test.mjs index 6814929debd..459f1fa3aa0 100644 --- a/packages/paperclip-runner/scripts/runner-protocol-eval-campaign.test.mjs +++ b/packages/paperclip-runner/scripts/runner-protocol-eval-campaign.test.mjs @@ -34,7 +34,7 @@ async function fixture() { provider: "opencode", driver: "opencode_server", model: "openrouter/example/model", - opencodeVersion: "1.18.32", + opencodeVersion: "1.18.34", }; const evalCase = { schema: "paperclip-runner/eval-case/v1", diff --git a/packages/paperclip-runner/src/backends/codex-native-backend.ts b/packages/paperclip-runner/src/backends/codex-native-backend.ts index 2b3f2a44a20..eb6c12db40e 100644 --- a/packages/paperclip-runner/src/backends/codex-native-backend.ts +++ b/packages/paperclip-runner/src/backends/codex-native-backend.ts @@ -72,7 +72,7 @@ function transportDriverIdentity(input: NativeExecutionInput): { return { kind: "opencode_server", displayName: "OpenCode server", - version: "1.18.32", + version: "1.18.34", }; case "claude_managed": return { diff --git a/packages/paperclip-runner/src/backends/native-backend-factory.test.ts b/packages/paperclip-runner/src/backends/native-backend-factory.test.ts index ca17d003e3d..419a176dfeb 100644 --- a/packages/paperclip-runner/src/backends/native-backend-factory.test.ts +++ b/packages/paperclip-runner/src/backends/native-backend-factory.test.ts @@ -127,7 +127,7 @@ function acpxExecution( ? "@openai/codex" : "@anthropic-ai/claude-agent-sdk", agentRuntimeVersion: - agent === "pi" ? "0.84.2" : agent === "codex" ? "0.156.0" : "0.3.286", + agent === "pi" ? "0.84.2" : agent === "codex" ? "0.160.0" : "0.3.286", commandDigest: agent === "codex" ? "sha256:c4538599d1ab767db5dff50934f13bb5ba313a59d9c4a83e993fac4617ea63d3" @@ -292,7 +292,7 @@ describe("native backend factory", () => { await expect(backend.descriptor()).resolves.toMatchObject({ kind: "runner", name: "opencode_server", - version: "1.18.32", + version: "1.18.34", capabilities: { steering: false, resume: true, @@ -445,7 +445,7 @@ describe("native backend factory", () => { await expect(backend.descriptor()).resolves.toMatchObject({ kind: "runner", name: "opencode_server", - version: "1.18.32", + version: "1.18.34", capabilities: { resume: true, interruption: true, diff --git a/packages/paperclip-runner/src/cli/eval-session.ts b/packages/paperclip-runner/src/cli/eval-session.ts index 19153159445..e621eeff0e0 100644 --- a/packages/paperclip-runner/src/cli/eval-session.ts +++ b/packages/paperclip-runner/src/cli/eval-session.ts @@ -171,9 +171,9 @@ export function evalSessionProviderVersion( request: EvalSessionRequest, ): string | null { if (request.provider === "opencode") { - const version = request.opencodeVersion ?? "1.18.32"; - if (version !== "1.18.32") { - throw new Error(`OpenCode evals require exact version 1.18.32; received ${version}`); + const version = request.opencodeVersion ?? "1.18.34"; + if (version !== "1.18.34") { + throw new Error(`OpenCode evals require exact version 1.18.34; received ${version}`); } return version; } diff --git a/packages/paperclip-runner/src/cli/opencode-app-server-proxy.ts b/packages/paperclip-runner/src/cli/opencode-app-server-proxy.ts index 9b436ab8505..d46406d159f 100644 --- a/packages/paperclip-runner/src/cli/opencode-app-server-proxy.ts +++ b/packages/paperclip-runner/src/cli/opencode-app-server-proxy.ts @@ -336,7 +336,7 @@ async function handle(message: RpcMessage): Promise { case "initialize": result = { user: { sessionId: "opencode" }, - serverInfo: { name: "opencode", version: "1.18.32" }, + serverInfo: { name: "opencode", version: "1.18.34" }, }; break; case "thread/start": diff --git a/packages/paperclip-runner/src/drivers/acpx/installation-integrity.ts b/packages/paperclip-runner/src/drivers/acpx/installation-integrity.ts index 1c17f6d67e6..f015d60799d 100644 --- a/packages/paperclip-runner/src/drivers/acpx/installation-integrity.ts +++ b/packages/paperclip-runner/src/drivers/acpx/installation-integrity.ts @@ -73,13 +73,13 @@ const QUALIFIED_CLAUDE_DARWIN_RUNTIMES = { const QUALIFIED_CODEX_LINUX_X64_RUNTIME = Object.freeze({ runtimePackageName: "@openai/codex", - runtimePackageVersion: "0.156.0", + runtimePackageVersion: "0.160.0", packageName: "@openai/codex-linux-x64", - packageVersion: "0.156.0-linux-x64", - dependencyDeclaration: "npm:@openai/codex@0.156.0-linux-x64", + packageVersion: "0.160.0-linux-x64", + dependencyDeclaration: "npm:@openai/codex@0.160.0-linux-x64", relativeExecutable: "vendor/x86_64-unknown-linux-musl/bin/codex", executableDigest: - "sha256:78a11f06e0a2dda42d13fba1d50dc62e8cbdb2d5f69789722f4d4d99b5cdbe30", + "sha256:12eb3e81114588aca3b7998f4f19e8997b056aca08e57a7ca7c8a3ec8c652aad", environmentVariable: "CODEX_PATH", }); diff --git a/packages/paperclip-runner/src/drivers/acpx/qualified-profiles.test.ts b/packages/paperclip-runner/src/drivers/acpx/qualified-profiles.test.ts index f4bab678e43..4cecab32a8b 100644 --- a/packages/paperclip-runner/src/drivers/acpx/qualified-profiles.test.ts +++ b/packages/paperclip-runner/src/drivers/acpx/qualified-profiles.test.ts @@ -34,7 +34,7 @@ describe("qualified ACPX profiles", () => { it("binds Codex ACP to the CLI runtime it launches", () => { expect(QUALIFIED_ACPX_PROFILES.codex).toMatchObject({ agentRuntimePackage: "@openai/codex", - agentRuntimeVersion: "0.156.0", + agentRuntimeVersion: "0.160.0", }); }); diff --git a/packages/paperclip-runner/src/drivers/acpx/qualified-profiles.ts b/packages/paperclip-runner/src/drivers/acpx/qualified-profiles.ts index 52329911398..29838f9beae 100644 --- a/packages/paperclip-runner/src/drivers/acpx/qualified-profiles.ts +++ b/packages/paperclip-runner/src/drivers/acpx/qualified-profiles.ts @@ -105,7 +105,7 @@ export const QUALIFIED_ACPX_PROFILES: Readonly< agentServerPackage: "@agentclientprotocol/codex-acp", agentServerVersion: "1.6.2", agentRuntimePackage: "@openai/codex", - agentRuntimeVersion: "0.156.0", + agentRuntimeVersion: "0.160.0", commandDigest: "sha256:c4538599d1ab767db5dff50934f13bb5ba313a59d9c4a83e993fac4617ea63d3", qualificationModel: "gpt-5.6-sol", diff --git a/packages/paperclip-runner/src/drivers/opencode/opencode-server-driver.test.ts b/packages/paperclip-runner/src/drivers/opencode/opencode-server-driver.test.ts index d66b56c1786..315de038759 100644 --- a/packages/paperclip-runner/src/drivers/opencode/opencode-server-driver.test.ts +++ b/packages/paperclip-runner/src/drivers/opencode/opencode-server-driver.test.ts @@ -333,7 +333,7 @@ describe("OpenCodeServerDriver", () => { headers: { "Content-Type": "application/json" }, }); if (url.pathname === "/global/health") - return json({ healthy: true, version: "1.18.32" }); + return json({ healthy: true, version: "1.18.34" }); if (url.pathname === "/event") { return new Response( new ReadableStream({ @@ -705,7 +705,7 @@ describe("OpenCodeServerDriver", () => { output: 2, costUsd: 0.001, provider: "openrouter", - driverVersion: "1.18.32", + driverVersion: "1.18.34", }); await session.interrupt?.({ turnId: turn.turnId }); const snapshot = await session.snapshot(); diff --git a/packages/paperclip-runner/src/drivers/opencode/opencode-server-driver.ts b/packages/paperclip-runner/src/drivers/opencode/opencode-server-driver.ts index 1a23087af29..ab72e2cc4a1 100644 --- a/packages/paperclip-runner/src/drivers/opencode/opencode-server-driver.ts +++ b/packages/paperclip-runner/src/drivers/opencode/opencode-server-driver.ts @@ -73,7 +73,7 @@ import { nativeMcpLaunchBinding } from "../native-mcp.js"; import { materializeNativeRuntimeSkills } from "../runtime-context-materializer.js"; export const OPENCODE_SERVER_DRIVER_KIND = "opencode_server" as const; -export const QUALIFIED_OPENCODE_VERSION = "1.18.32" as const; +export const QUALIFIED_OPENCODE_VERSION = "1.18.34" as const; export const QUALIFIED_OPENCODE_MODEL = "openrouter/deepseek/deepseek-v4-flash-0731" as const; diff --git a/packages/paperclip-runner/src/live/live-session.test.ts b/packages/paperclip-runner/src/live/live-session.test.ts index e99da299374..9d0d80feae5 100644 --- a/packages/paperclip-runner/src/live/live-session.test.ts +++ b/packages/paperclip-runner/src/live/live-session.test.ts @@ -897,7 +897,7 @@ describe("Capability live runnerd and Codex session", () => { expect(session.snapshot().config).toMatchObject({ provider: "opencode", driver: "opencode_server", - providerVersion: "1.18.32", + providerVersion: "1.18.34", requestedModel: "openrouter/deepseek/deepseek-v4-flash-0731", }); await service.shutdown(session.id); diff --git a/packages/paperclip-runner/src/live/live-session.ts b/packages/paperclip-runner/src/live/live-session.ts index 28ec49d172d..6042ba77a2f 100644 --- a/packages/paperclip-runner/src/live/live-session.ts +++ b/packages/paperclip-runner/src/live/live-session.ts @@ -965,7 +965,7 @@ export class CapabilityLiveSessionService { ? "aws_agentcore_harness_api" : input.provider === "acpx" ? "acpx_runtime" : "codex_app_server", providerVersion: input.provider === "opencode" - ? "1.18.32" + ? "1.18.34" : input.provider === "claude_managed" ? input.managedProfile!.agentVersion : input.provider === "aws_agentcore" diff --git a/packages/paperclip-runner/src/live/runnerd-codex-transport.ts b/packages/paperclip-runner/src/live/runnerd-codex-transport.ts index c067f2a541e..5fbca7d8fd4 100644 --- a/packages/paperclip-runner/src/live/runnerd-codex-transport.ts +++ b/packages/paperclip-runner/src/live/runnerd-codex-transport.ts @@ -4672,7 +4672,7 @@ class DurablePrpCodexTransport implements CodexAppServerTransport { ? "opencode_server" : "codex_app_server", providerVersion: - provider === "opencode" ? "1.18.32" : "codex-app-server-v1", + provider === "opencode" ? "1.18.34" : "codex-app-server-v1", command: provider === "opencode" ? providerNodeCommand diff --git a/packages/paperclip-runner/test/acpx-codex-package-contract.test.mjs b/packages/paperclip-runner/test/acpx-codex-package-contract.test.mjs index 37e317f92a3..c17aa4243d0 100644 --- a/packages/paperclip-runner/test/acpx-codex-package-contract.test.mjs +++ b/packages/paperclip-runner/test/acpx-codex-package-contract.test.mjs @@ -57,7 +57,7 @@ const nativeSessionExecutor = await readFile( ); test("the runner pins every qualified ACPX production dependency", () => { - assert.equal(runnerPackage.dependencies["@openai/codex"], "0.156.0"); + assert.equal(runnerPackage.dependencies["@openai/codex"], "0.160.0"); assert.equal(runnerPackage.dependencies["@anthropic-ai/claude-agent-sdk"], undefined); assert.equal(rootPackage.pnpm.overrides["@agentclientprotocol/codex-acp@1.6.2>@openai/codex"], runnerPackage.dependencies["@openai/codex"]); assert.equal(rootPackage.pnpm.overrides["@agentclientprotocol/claude-agent-acp@0.73.0>@anthropic-ai/claude-agent-sdk"], "0.3.286"); @@ -142,7 +142,7 @@ test("old and new pnpm configuration both apply the exact runtime patches", () = providerPackBuilder, /copyFileSync\(process\.execPath, stableNodeCommand\)/, ); - assert.match(codexPatch, /\+ "@openai\/codex": "0\.156\.0"/); + assert.match(codexPatch, /\+ "@openai\/codex": "0\.160\.0"/); }); test("the ACPX patch preserves launch-only state and verified spawning", () => { diff --git a/packages/paperclip-runner/test/fixtures/fake-opencode-server.mjs b/packages/paperclip-runner/test/fixtures/fake-opencode-server.mjs index 41c6fff8b17..83284fdfec3 100644 --- a/packages/paperclip-runner/test/fixtures/fake-opencode-server.mjs +++ b/packages/paperclip-runner/test/fixtures/fake-opencode-server.mjs @@ -258,7 +258,7 @@ const server = createServer(async (request, response) => { if (request.headers.authorization !== expectedAuth) return json(response, 401, { error: "unauthorized" }); if (request.url === "/global/health") - return json(response, 200, { healthy: true, version: "1.18.32" }); + return json(response, 200, { healthy: true, version: "1.18.34" }); if (request.url === "/event") { eventConnections += 1; response.writeHead(200, { diff --git a/patches/@agentclientprotocol__codex-acp@1.6.2.patch b/patches/@agentclientprotocol__codex-acp@1.6.2.patch index 36becec2b8b..5ca63721d76 100644 --- a/patches/@agentclientprotocol__codex-acp@1.6.2.patch +++ b/patches/@agentclientprotocol__codex-acp@1.6.2.patch @@ -6,7 +6,7 @@ diff --git a/package.json b/package.json "dependencies": { "@agentclientprotocol/sdk": "^1.3.0", - "@openai/codex": "^0.148.0", -+ "@openai/codex": "0.156.0", ++ "@openai/codex": "0.160.0", "diff": "^9.0.0", "open": "^11.0.0", "vscode-jsonrpc": "^9.0.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 5046a1c754d..5a07ed69e93 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -6,7 +6,7 @@ settings: overrides: '@agentclientprotocol/codex-acp@1.6.2>@openai/codex': 0.156.0 - '@agentclientprotocol/claude-agent-acp@0.73.0>@anthropic-ai/claude-agent-sdk': 0.3.286 + '@agentclientprotocol/claude-agent-acp@0.73.0>@anthropic-ai/claude-agent-sdk': 0.3.280 rollup: '>=4.59.0' react: ^19.2.8 react-dom: ^19.2.8 @@ -1291,48 +1291,48 @@ packages: '@antfu/install-pkg@1.1.0': resolution: {integrity: sha512-MGQsmw10ZyI+EJo45CdSER4zEb+p31LpDAFp2Z3gkSd1yqVZGi0Ebx++YTEMonJy4oChEMLsxZ64j8FH6sSqtQ==} - '@anthropic-ai/claude-agent-sdk-darwin-arm64@0.3.286': - resolution: {integrity: sha512-gkxWcJ+Z23UxwghI1V3dL09PkELIZmB2vPelR8XsdfhS+yP1KvoW7FThvRLojcxXb3fj0ddYawjQSQYIkXFbxw==} + '@anthropic-ai/claude-agent-sdk-darwin-arm64@0.3.280': + resolution: {integrity: sha512-Yws14X5g5hgDtF565Tld/+dILAhH9QZpundjKMyO3dFasq9miXZlhU0NwXqwTO2xP0jDjJ54zduIiJwkcfcvGw==} cpu: [arm64] os: [darwin] - '@anthropic-ai/claude-agent-sdk-darwin-x64@0.3.286': - resolution: {integrity: sha512-eMdni7sy1ud2IISI4QSsfVBCxotzSe62zCGdXISejL9MxDIwcRgEGZpO5OV+j7t8mNGMTe6Opl1t/3Z/1RUJaQ==} + '@anthropic-ai/claude-agent-sdk-darwin-x64@0.3.280': + resolution: {integrity: sha512-B1eLx/oZ5RL1c3a13nQ4cRUksWyhGcVNS5vbCHnOVu4Pz+dH0moZ+iY8VaE6FvikVAQwFEW6VDU00b6m3tYdsQ==} cpu: [x64] os: [darwin] - '@anthropic-ai/claude-agent-sdk-linux-arm64-musl@0.3.286': - resolution: {integrity: sha512-fG8Cqx53jkFyEL86ETA0tdLH3p06yFQKHcoxnMpiU+VmJ5g6uGFhsUZbJ6gFvuT3EgyMcNI2kZwhCCDF/DTnpQ==} + '@anthropic-ai/claude-agent-sdk-linux-arm64-musl@0.3.280': + resolution: {integrity: sha512-uDh+Ggjb36l+jcVgaYxSziGHmBSSR3clqvGlQ0Bgc1v5dLF4igwqZ6ZPW/hS9dArG27fislIOetH1waEgIr+GA==} cpu: [arm64] os: [linux] - '@anthropic-ai/claude-agent-sdk-linux-arm64@0.3.286': - resolution: {integrity: sha512-3h+WWGek9beZ6i1qbIjjwYEFbs46D6qumjSBc6cLsEvnufcoi7mc0iBwbFSh9yRb3upxoi4ZTJdl53T3gLTdUQ==} + '@anthropic-ai/claude-agent-sdk-linux-arm64@0.3.280': + resolution: {integrity: sha512-6s96OIvBHT2817hCFLIZ421JBpQnvrmZucpjlWsyCODKmwGsSxiEhlWqK2h5Q7lwS6F7bzeAhqjGvC7FzDl9Rw==} cpu: [arm64] os: [linux] - '@anthropic-ai/claude-agent-sdk-linux-x64-musl@0.3.286': - resolution: {integrity: sha512-WeO/wG2uPh95BhOQi1IsIECdW5gJgC1Q9xtGw4RjV04it1fBMAbUe7aVwP4DQgH8PHnmduA7dRnLtbnZnrGsjg==} + '@anthropic-ai/claude-agent-sdk-linux-x64-musl@0.3.280': + resolution: {integrity: sha512-IVbIgvi5C0sdLg/p9hpiVvAQ/ikvTKwOOEy5C1aT7w8XLqBgfpJbzzVuk06df1Q0HlILUmf63EKPmq48lbxtqA==} cpu: [x64] os: [linux] - '@anthropic-ai/claude-agent-sdk-linux-x64@0.3.286': - resolution: {integrity: sha512-kNczbWhWJ1G8sPRZd4Nsx/Ozr/kx16lT2NGp/EEmTV4Hn732xfLkUOlg+tFcS78i6lOPBknjDB/cz/J5Ha4wDQ==} + '@anthropic-ai/claude-agent-sdk-linux-x64@0.3.280': + resolution: {integrity: sha512-vpPyxYLy+zNc7LwQDWsZf0GZtTYa0PJLxzuv2vK9iV2dG+hrbRNTl35NSKKRR9rMj6RpKz0i2NLyVQ+D4mREgw==} cpu: [x64] os: [linux] - '@anthropic-ai/claude-agent-sdk-win32-arm64@0.3.286': - resolution: {integrity: sha512-N4p7Gw5Qg3q9+Y5sEht1cIHHZkmBAUfWXJnqfmDD7N8twqF3XNVK3w65hDLqli4i0ttuZu79bGmRGkgNGm9Imw==} + '@anthropic-ai/claude-agent-sdk-win32-arm64@0.3.280': + resolution: {integrity: sha512-heTflHwciJF+Hrf7v0J53QBzD+9mxN9gt2VVmEJAN0+ejbPcOcqnGGZHvyc9aZUuGh5INN0ECaiL4Fn1X2vXQQ==} cpu: [arm64] os: [win32] - '@anthropic-ai/claude-agent-sdk-win32-x64@0.3.286': - resolution: {integrity: sha512-pg35GRPBKyviod0i8Z3EVMzDnTiiiucuWUbyH1bVIFFN0UWCQQ+PRUJ15qrPKjL6+vlFxOX2ei9FfsWYjGYZwA==} + '@anthropic-ai/claude-agent-sdk-win32-x64@0.3.280': + resolution: {integrity: sha512-N+Y1zJb19nx0oPTvzkl/E3ng9AtWGW+K4hySmSHCgYSsgIwfs1YzDj/F5eHDMrxgklTuzFp76TvL3S75z5ge+g==} cpu: [x64] os: [win32] - '@anthropic-ai/claude-agent-sdk@0.3.286': - resolution: {integrity: sha512-InL/UNmRGSwBM/81PME0J0TZDsDBBlweWqRZgq2XSViSIg2hBi8nIL8j9Hm6MHRH85wgDJQE5n6Vo/r9hIO0NQ==} + '@anthropic-ai/claude-agent-sdk@0.3.280': + resolution: {integrity: sha512-aIQSTKcCJcOgi125GAGQaNZUYgxbEBQwV2Ac+Utp0+gGUjIEWjTqz4B8kXr9XjkcCTYiRUMTDsXPAUfIcBDjnw==} engines: {node: '>=18.0.0'} peerDependencies: '@anthropic-ai/sdk': '>=0.93.0' @@ -7628,6 +7628,7 @@ packages: opencode-ai@1.18.32: resolution: {integrity: sha512-SCrZWdq44y/EoH2+fE4HLcXS+DzpVqHPzmXk3p2RrufYy8LWvpfhRhKtijb5ktvx8r94ScqToqwHxR0BwS65OQ==} + cpu: [arm64, x64] os: [darwin, linux, win32] hasBin: true @@ -8987,7 +8988,7 @@ snapshots: '@agentclientprotocol/claude-agent-acp@0.73.0(patch_hash=riqgguivxjxydoydnzpedjy5au)(@anthropic-ai/sdk@0.129.0(zod@4.6.5))(@modelcontextprotocol/sdk@1.30.0(zod@4.6.5))': dependencies: '@agentclientprotocol/sdk': 1.4.0(zod@4.4.3) - '@anthropic-ai/claude-agent-sdk': 0.3.286(@anthropic-ai/sdk@0.129.0(zod@4.6.5))(@modelcontextprotocol/sdk@1.30.0(zod@4.6.5))(zod@4.4.3) + '@anthropic-ai/claude-agent-sdk': 0.3.280(@anthropic-ai/sdk@0.129.0(zod@4.6.5))(@modelcontextprotocol/sdk@1.30.0(zod@4.6.5))(zod@4.4.3) zod: 4.4.3 transitivePeerDependencies: - '@anthropic-ai/sdk' @@ -9015,44 +9016,44 @@ snapshots: package-manager-detector: 1.8.0 tinyexec: 1.3.1 - '@anthropic-ai/claude-agent-sdk-darwin-arm64@0.3.286': + '@anthropic-ai/claude-agent-sdk-darwin-arm64@0.3.280': optional: true - '@anthropic-ai/claude-agent-sdk-darwin-x64@0.3.286': + '@anthropic-ai/claude-agent-sdk-darwin-x64@0.3.280': optional: true - '@anthropic-ai/claude-agent-sdk-linux-arm64-musl@0.3.286': + '@anthropic-ai/claude-agent-sdk-linux-arm64-musl@0.3.280': optional: true - '@anthropic-ai/claude-agent-sdk-linux-arm64@0.3.286': + '@anthropic-ai/claude-agent-sdk-linux-arm64@0.3.280': optional: true - '@anthropic-ai/claude-agent-sdk-linux-x64-musl@0.3.286': + '@anthropic-ai/claude-agent-sdk-linux-x64-musl@0.3.280': optional: true - '@anthropic-ai/claude-agent-sdk-linux-x64@0.3.286': + '@anthropic-ai/claude-agent-sdk-linux-x64@0.3.280': optional: true - '@anthropic-ai/claude-agent-sdk-win32-arm64@0.3.286': + '@anthropic-ai/claude-agent-sdk-win32-arm64@0.3.280': optional: true - '@anthropic-ai/claude-agent-sdk-win32-x64@0.3.286': + '@anthropic-ai/claude-agent-sdk-win32-x64@0.3.280': optional: true - '@anthropic-ai/claude-agent-sdk@0.3.286(@anthropic-ai/sdk@0.129.0(zod@4.6.5))(@modelcontextprotocol/sdk@1.30.0(zod@4.6.5))(zod@4.4.3)': + '@anthropic-ai/claude-agent-sdk@0.3.280(@anthropic-ai/sdk@0.129.0(zod@4.6.5))(@modelcontextprotocol/sdk@1.30.0(zod@4.6.5))(zod@4.4.3)': dependencies: '@anthropic-ai/sdk': 0.129.0(zod@4.6.5) '@modelcontextprotocol/sdk': 1.30.0(zod@4.6.5) zod: 4.4.3 optionalDependencies: - '@anthropic-ai/claude-agent-sdk-darwin-arm64': 0.3.286 - '@anthropic-ai/claude-agent-sdk-darwin-x64': 0.3.286 - '@anthropic-ai/claude-agent-sdk-linux-arm64': 0.3.286 - '@anthropic-ai/claude-agent-sdk-linux-arm64-musl': 0.3.286 - '@anthropic-ai/claude-agent-sdk-linux-x64': 0.3.286 - '@anthropic-ai/claude-agent-sdk-linux-x64-musl': 0.3.286 - '@anthropic-ai/claude-agent-sdk-win32-arm64': 0.3.286 - '@anthropic-ai/claude-agent-sdk-win32-x64': 0.3.286 + '@anthropic-ai/claude-agent-sdk-darwin-arm64': 0.3.280 + '@anthropic-ai/claude-agent-sdk-darwin-x64': 0.3.280 + '@anthropic-ai/claude-agent-sdk-linux-arm64': 0.3.280 + '@anthropic-ai/claude-agent-sdk-linux-arm64-musl': 0.3.280 + '@anthropic-ai/claude-agent-sdk-linux-x64': 0.3.280 + '@anthropic-ai/claude-agent-sdk-linux-x64-musl': 0.3.280 + '@anthropic-ai/claude-agent-sdk-win32-arm64': 0.3.280 + '@anthropic-ai/claude-agent-sdk-win32-x64': 0.3.280 '@anthropic-ai/sdk@0.129.0(zod@4.6.5)': dependencies: diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index f5c8f084bc7..a20325bff3a 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -32,7 +32,7 @@ patchedDependencies: # Agent CLIs share the current runtime used by the native provider pack. # pnpm patches change package files, but overrides control dependency resolution. overrides: - "@agentclientprotocol/codex-acp@1.6.2>@openai/codex": "0.156.0" + "@agentclientprotocol/codex-acp@1.6.2>@openai/codex": "0.160.0" "@agentclientprotocol/claude-agent-acp@0.73.0>@anthropic-ai/claude-agent-sdk": "0.3.286" rollup: ">=4.59.0" react: "^19.2.8" diff --git a/releases/beta/v2026.1002.0-beta.0.md b/releases/beta/v2026.1002.0-beta.0.md index 8aa7b07e985..7c4ce8bf735 100644 --- a/releases/beta/v2026.1002.0-beta.0.md +++ b/releases/beta/v2026.1002.0-beta.0.md @@ -26,14 +26,14 @@ Paperclip v2026.1005.0 carries 179 commits, promoted from `2026.1002.0-beta.0`. - **Native runner and sessions** — Tool outcomes survive shutdown and restart instead of recording a false failure ([#14734](https://github.com/paperclipai/paperclip/pull/14734)); failed warm sessions are retired before their sandbox stops ([#14747](https://github.com/paperclipai/paperclip/pull/14747)) and recovered cleanup honors the run's terminal outcome ([#14767](https://github.com/paperclipai/paperclip/pull/14767)); switching a task to a warm lifecycle acquires a reusable lease ([#14187](https://github.com/paperclipai/paperclip/pull/14187)); the OpenCode event stream stays open across turns ([#14582](https://github.com/paperclipai/paperclip/pull/14582)) and delivers its shutdown settlement ([#14668](https://github.com/paperclipai/paperclip/pull/14668)); Codex account notifications no longer abort a turn ([#13902](https://github.com/paperclipai/paperclip/pull/13902)); Claude and Codex quota exhaustion is classified for the proper backoff ([#13831](https://github.com/paperclipai/paperclip/pull/13831), [#13945](https://github.com/paperclipai/paperclip/pull/13945)); ACP terminal failures keep their redacted provider diagnostics ([#14573](https://github.com/paperclipai/paperclip/pull/14573)) and identity guards name the failed check ([#14481](https://github.com/paperclipai/paperclip/pull/14481)); the native journal read limit is 256 MiB everywhere ([#14711](https://github.com/paperclipai/paperclip/pull/14711)); pending finalization of an accepted result is protected from the stale-lock sweep ([#14219](https://github.com/paperclipai/paperclip/pull/14219)); adapters expose a verified provider stop before workspace restoration ([#14311](https://github.com/paperclipai/paperclip/pull/14311)); warm sessions keep running under managed GitHub access ([#13815](https://github.com/paperclipai/paperclip/pull/13815)); and a run that hits a provider authentication failure offers an inline connection card in the task so the user can repair and continue ([#14629](https://github.com/paperclipai/paperclip/pull/14629)). - **Sandboxes and workspaces** — Daytona commands stay alive after the log socket closes ([#14799](https://github.com/paperclipai/paperclip/pull/14799)), confirmed container loss is recognized when resuming leases ([1f3ff75d](https://github.com/paperclipai/paperclip/commit/1f3ff75d334ddfbb06d49c1033ec2b89be594e20)), failed allocations are cleaned up ([#13979](https://github.com/paperclipai/paperclip/pull/13979)), and provider acquisition timeouts honor the driver's default ([#14097](https://github.com/paperclipai/paperclip/pull/14097)). ACP input delivery retries after a gateway 502 without duplicating input ([#14485](https://github.com/paperclipai/paperclip/pull/14485)), oversized launch payloads and duplicated wake context no longer fail with `E2BIG` ([#13793](https://github.com/paperclipai/paperclip/pull/13793), [#13891](https://github.com/paperclipai/paperclip/pull/13891)), process proxies close after remote exit ([#13777](https://github.com/paperclipai/paperclip/pull/13777)), and relative symlinks in secondary repositories are preserved ([#13953](https://github.com/paperclipai/paperclip/pull/13953)). Workspace exports finalize and recover safely ([#14402](https://github.com/paperclipai/paperclip/pull/14402)), restore failures keep the adapter's result and record what failed ([#14035](https://github.com/paperclipai/paperclip/pull/14035), [#14064](https://github.com/paperclipai/paperclip/pull/14064)), large Git snapshots stream through disk manifests instead of hitting a 1 MiB output limit ([#14194](https://github.com/paperclipai/paperclip/pull/14194), [#14253](https://github.com/paperclipai/paperclip/pull/14253)), readiness checks accept larger status output ([#14414](https://github.com/paperclipai/paperclip/pull/14414)), background scans stop refreshing the Git index ([#14666](https://github.com/paperclipai/paperclip/pull/14666)), partial task overrides retain project setup commands ([#14502](https://github.com/paperclipai/paperclip/pull/14502)), and repository-free low-trust tasks get a private directory ([#14766](https://github.com/paperclipai/paperclip/pull/14766)). -- **Scheduler and recovery** — A queued run whose claim is permanently rejected is cancelled instead of crash-looping the server ([#14738](https://github.com/paperclipai/paperclip/pull/14738)); wakes that arrive during a drain stay queued and interrupted corrective runs get a transient retry ([#14028](https://github.com/paperclipai/paperclip/pull/14028)); an issue whose run has spent its retry budget is escalated to a visible blocked state rather than skipped forever ([#14046](https://github.com/paperclipai/paperclip/pull/14046)); continuation and retry budgets use persisted state ([#13888](https://github.com/paperclipai/paperclip/pull/13888)); task ownership is claimed atomically with queued runs ([#13973](https://github.com/paperclipai/paperclip/pull/13973)); obsolete continuations are cancelled before dispatch ([#13761](https://github.com/paperclipai/paperclip/pull/13761)); a status reply that still lists blocking work keeps the task moving ([#14626](https://github.com/paperclipai/paperclip/pull/14626)); Done and Cancelled tasks keep their assignee on release ([#14561](https://github.com/paperclipai/paperclip/pull/14561)); interaction continuations stay scoped to their task ([ded156a9](https://github.com/paperclipai/paperclip/commit/ded156a9045d59cf8705847271c8c03b1b58c8b2)) and question recipients are derived and validated ([#14742](https://github.com/paperclipai/paperclip/pull/14742)); remote Grok runs stop before queued messages continue ([#14100](https://github.com/paperclipai/paperclip/pull/14100)); run-identity locks no longer deadlock with audit inserts ([#14478](https://github.com/paperclipai/paperclip/pull/14478)); and ambiguous database disconnects are no longer replayed ([#14773](https://github.com/paperclipai/paperclip/pull/14773)). +- **Scheduler and recovery** — A queued run whose claim is permanently rejected is cancelled instead of crash-looping the server ([#14738](https://github.com/paperclipai/paperclip/pull/14738)); wakes that arrive during a drain stay queued and interrupted corrective runs get a transient retry ([#14028](https://github.com/paperclipai/paperclip/pull/14028)); an issue whose run has spent its retry budget is escalated to a visible blocked state rather than skipped forever ([#14046](https://github.com/paperclipai/paperclip/pull/14046)); continuation and retry budgets use persisted state ([#13888](https://github.com/paperclipai/paperclip/pull/13888)); task ownership is claimed atomically with queued runs ([#13973](https://github.com/paperclipai/paperclip/pull/13973)); obsolete continuations are cancelled before dispatch ([#13761](https://github.com/paperclipai/paperclip/pull/13761)); a status reply that still lists blocking work keeps the task moving ([#14626](https://github.com/paperclipai/paperclip/pull/14626)); Done and Cancelled tasks keep their assignee on release ([#14561](https://github.com/paperclipai/paperclip/pull/14561)); interaction continuations stay scoped to their task ([ded156a9](https://github.com/paperclipai/paperclip/commit/ded156a9045d59cf8705847271c8c03b1b58c8b2)) and question recipients are derived and validated ([#14742](https://github.com/paperclipai/paperclip/pull/14742)); Slack- and Discord-origin tasks that lose their review path recover with their message bindings intact instead of failing the recovery authorization check ([#13818](https://github.com/paperclipai/paperclip/pull/13818)); remote Grok runs stop before queued messages continue ([#14100](https://github.com/paperclipai/paperclip/pull/14100)); run-identity locks no longer deadlock with audit inserts ([#14478](https://github.com/paperclipai/paperclip/pull/14478)); and ambiguous database disconnects are no longer replayed ([#14773](https://github.com/paperclipai/paperclip/pull/14773)). - **Connections and apps** — OAuth sign-in challenges and reconnect states return 422 instead of being reported as crashes ([#13786](https://github.com/paperclipai/paperclip/pull/13786), [#13794](https://github.com/paperclipai/paperclip/pull/13794)); MCP OAuth setup explains failed or cancelled consent ([#13855](https://github.com/paperclipai/paperclip/pull/13855)); a disabled Slack MCP app gets actionable setup instructions ([a7d3b17a](https://github.com/paperclipai/paperclip/commit/a7d3b17a970a305e9b2cc2bebc2b16950e8bd31f)); broker and AgentMail failures keep allowlisted reason codes ([#14098](https://github.com/paperclipai/paperclip/pull/14098), [#14768](https://github.com/paperclipai/paperclip/pull/14768)); Google Chat and the Docs, Sheets, Slides, and Calendar profiles request fewer scopes ([#13820](https://github.com/paperclipai/paperclip/pull/13820), [#14740](https://github.com/paperclipai/paperclip/pull/14740)); work products validate their execution-workspace reference ([#14063](https://github.com/paperclipai/paperclip/pull/14063)); and malformed CLI auth challenge IDs return 400 ([#14095](https://github.com/paperclipai/paperclip/pull/14095)). - **Board UI** — The board recovers during server restarts with a connection message and retries, keeping open editors mounted ([#14560](https://github.com/paperclipai/paperclip/pull/14560)), and offers a retry screen when the app fails before React starts ([#13970](https://github.com/paperclipai/paperclip/pull/13970)). Code highlighting no longer crashes on a Lezer version mismatch ([a3749aac](https://github.com/paperclipai/paperclip/commit/a3749aac4680a901fa0fe1cc898907887abc9908)), destructive confirm buttons are readable in the light theme ([#14328](https://github.com/paperclipai/paperclip/pull/14328)), mobile pickers stay in view above the keyboard and scroll by touch ([#14022](https://github.com/paperclipai/paperclip/pull/14022), [#14249](https://github.com/paperclipai/paperclip/pull/14249), [#14250](https://github.com/paperclipai/paperclip/pull/14250), [#14599](https://github.com/paperclipai/paperclip/pull/14599)), newer drafts survive receipt cleanup ([#14332](https://github.com/paperclipai/paperclip/pull/14332)), other users' failed runs stay out of Mine ([#14572](https://github.com/paperclipai/paperclip/pull/14572)), "Recovery needed" is distinguished from "Recovery in progress" ([#14326](https://github.com/paperclipai/paperclip/pull/14326)) and a misleading Retry no longer appears when recovery is blocked ([#13775](https://github.com/paperclipai/paperclip/pull/13775)), new artifacts register a tab without opening the panel ([#14193](https://github.com/paperclipai/paperclip/pull/14193)), the Tasks panel shows ancestors ([#13823](https://github.com/paperclipai/paperclip/pull/13823)), and task content appears sooner with parallel server reads ([#14727](https://github.com/paperclipai/paperclip/pull/14727)). Also: property icons align with avatars ([#13319](https://github.com/paperclipai/paperclip/pull/13319)), runner commentary aligns with replies ([#14716](https://github.com/paperclipai/paperclip/pull/14716)), project save indicators stack below their label ([#14765](https://github.com/paperclipai/paperclip/pull/14765)), archiving a company navigates away ([#13846](https://github.com/paperclipai/paperclip/pull/13846)), experimental settings are alphabetized with empty groups hidden ([#13905](https://github.com/paperclipai/paperclip/pull/13905)), and the Cursor adapter picks the real error over a trace notice ([#14636](https://github.com/paperclipai/paperclip/pull/14636)). - **Observability** — Browser errors carry `SENTRY_ENVIRONMENT` ([#13784](https://github.com/paperclipai/paperclip/pull/13784)) and bounded component context ([#13904](https://github.com/paperclipai/paperclip/pull/13904)); run errors are isolated from later exceptions and a runtime capability header is redacted ([#13826](https://github.com/paperclipai/paperclip/pull/13826)); and run failure reports retain exit details, stacks, causes, runtime activity, and restore classification ([#14575](https://github.com/paperclipai/paperclip/pull/14575), [#14585](https://github.com/paperclipai/paperclip/pull/14585), [#14665](https://github.com/paperclipai/paperclip/pull/14665), [#14639](https://github.com/paperclipai/paperclip/pull/14639), [#14787](https://github.com/paperclipai/paperclip/pull/14787)). ## Improvements -- The account menu drops its profile rows for a header link and gains an Invite shortcut ([#14480](https://github.com/paperclipai/paperclip/pull/14480)); plugins can supply an organization switcher ([#13832](https://github.com/paperclipai/paperclip/pull/13832), [#13854](https://github.com/paperclipai/paperclip/pull/13854)); `PAPERCLIP_HIDDEN_SETTINGS` accepts a wildcard with named exceptions so new experimental flags stay hidden automatically ([#13980](https://github.com/paperclipai/paperclip/pull/13980)) and a `workspaces.isolation` key hides isolation controls ([#13907](https://github.com/paperclipai/paperclip/pull/13907)); the native runner gains a shared rich-ACP transport foundation for upcoming Cursor, GitHub Copilot, and Pi providers ([#14430](https://github.com/paperclipai/paperclip/pull/14430)); the coordination skill no longer tells agents to escalate through managers instead of asking the human who can act ([#14188](https://github.com/paperclipai/paperclip/pull/14188)); worktree seed-source failures explain the supported setups ([#14795](https://github.com/paperclipai/paperclip/pull/14795)); Google Workspace connectors are temporarily hidden from the Connections page while Google OAuth verification is pending, with saved connections and runtime access untouched ([#14774](https://github.com/paperclipai/paperclip/pull/14774)); and the README is refreshed with current harnesses, guide links, and an npx-first Quickstart ([#14741](https://github.com/paperclipai/paperclip/pull/14741), [#14744](https://github.com/paperclipai/paperclip/pull/14744)). +- The account menu drops its profile rows for a header link and gains an Invite shortcut ([#14480](https://github.com/paperclipai/paperclip/pull/14480)); plugins can supply an organization switcher ([#13832](https://github.com/paperclipai/paperclip/pull/13832), [#13854](https://github.com/paperclipai/paperclip/pull/13854)); `PAPERCLIP_HIDDEN_SETTINGS` accepts a wildcard with named exceptions so new experimental flags stay hidden automatically ([#13980](https://github.com/paperclipai/paperclip/pull/13980)) and a `workspaces.isolation` key hides isolation controls ([#13907](https://github.com/paperclipai/paperclip/pull/13907)); the native runner gains a shared rich-ACP transport foundation for upcoming Cursor, GitHub Copilot, and Pi providers ([#14430](https://github.com/paperclipai/paperclip/pull/14430)); native agents can hire teammates through a governed `hire_agent` action that inherits the caller's runtime configuration from a closed allowlist ([#13852](https://github.com/paperclipai/paperclip/pull/13852)); the coordination skill no longer tells agents to escalate through managers instead of asking the human who can act ([#14188](https://github.com/paperclipai/paperclip/pull/14188)); worktree seed-source failures explain the supported setups ([#14795](https://github.com/paperclipai/paperclip/pull/14795)); Google Workspace connectors are temporarily hidden from the Connections page while Google OAuth verification is pending, with saved connections and runtime access untouched ([#14774](https://github.com/paperclipai/paperclip/pull/14774)); and the README is refreshed with current harnesses, guide links, and an npx-first Quickstart ([#14741](https://github.com/paperclipai/paperclip/pull/14741), [#14744](https://github.com/paperclipai/paperclip/pull/14744)). ## Upgrade Guide diff --git a/scripts/runner-api-eval-worker.ts b/scripts/runner-api-eval-worker.ts index 4a76036e203..047046a0443 100644 --- a/scripts/runner-api-eval-worker.ts +++ b/scripts/runner-api-eval-worker.ts @@ -100,7 +100,7 @@ try { if (!request.reservationId || request.maxCostUsd !== 0.5 || !["gpt-5.6-luna", "claude-sonnet-5", ...OPENROUTER_MODELS].includes(request.model)) throw new Error("Paid attempt requires ledger reservation and qualified model"); if (isOpenRouter) { providerVersion = execFileSync(resolve("packages/paperclip-runner/node_modules/opencode-ai/bin/opencode.exe"), ["--version"], { encoding: "utf8" }).trim(); - if (providerVersion !== "1.18.32") throw new Error("OpenCode profile requires version 1.18.32"); + if (providerVersion !== "1.18.34") throw new Error("OpenCode profile requires version 1.18.34"); } const providerEnvironment = isOpenRouter ? openRouterEnvironment() : request.model === "claude-sonnet-5" ? (() => { const token = process.env.CLAUDE_CODE_OAUTH_TOKEN; diff --git a/scripts/tests/native-cleanup-paginated-codex.mjs b/scripts/tests/native-cleanup-paginated-codex.mjs index fab7baa7053..0636e7f2657 100644 --- a/scripts/tests/native-cleanup-paginated-codex.mjs +++ b/scripts/tests/native-cleanup-paginated-codex.mjs @@ -1,7 +1,7 @@ // Opt-in real Codex qualification; no model turn or live account data. // Run from the repository root: // node --import ./server/node_modules/tsx/dist/loader.mjs scripts/tests/native-cleanup-paginated-codex.mjs -// PAPERCLIP_TEST_CODEX_BINARY may select the exact installed Codex 0.156.0 binary. +// PAPERCLIP_TEST_CODEX_BINARY may select the exact installed Codex 0.160.0 binary. // Fresh synthetic fixture directories are retained for inspection; never reuse live homes. import { spawn, execFileSync } from "node:child_process"; import { @@ -26,10 +26,10 @@ if ( execFileSync(codexBinary, ["--version"], { encoding: "utf8", timeout: 10000, - }).trim() !== "codex-cli 0.156.0" + }).trim() !== "codex-cli 0.160.0" ) { throw new Error( - "This opt-in qualification requires Codex CLI 0.156.0. Requalify deliberately before changing the pin.", + "This opt-in qualification requires Codex CLI 0.160.0. Requalify deliberately before changing the pin.", ); } const home = await mkdtemp(join(tmpdir(), "paperclip-paginated-probe-")); @@ -132,7 +132,7 @@ const lines = timestamp, cwd: home, originator: "codex", - cli_version: "0.156.0", + cli_version: "0.160.0", source: "cli", model_provider: "openai", selected_capability_roots: [], diff --git a/scripts/tests/native-provider-startup-codex.mjs b/scripts/tests/native-provider-startup-codex.mjs index 2eca77066e5..a161601c0dc 100644 --- a/scripts/tests/native-provider-startup-codex.mjs +++ b/scripts/tests/native-provider-startup-codex.mjs @@ -88,7 +88,7 @@ if (args.length === 0 || (args.length === 1 && args[0] === "--help")) { }).trim(); assert.equal( version, - "codex-cli 0.156.0", + "codex-cli 0.160.0", "qualified_codex_version_required", ); const ledger = join(fixture, "provider-process-starts.txt"); @@ -309,7 +309,7 @@ if (args.length === 0 || (args.length === 1 && args[0] === "--help")) { kind: "codex", provider: "codex", driver: "codex_app_server", - providerVersion: "0.156.0", + providerVersion: "0.160.0", command: shim, args: [ "--cd", diff --git a/server/src/__tests__/adapter-models.test.ts b/server/src/__tests__/adapter-models.test.ts index a8f736a5dff..12bc2043692 100644 --- a/server/src/__tests__/adapter-models.test.ts +++ b/server/src/__tests__/adapter-models.test.ts @@ -50,6 +50,7 @@ describe("adapter model listing", () => { expect(models).toEqual(codexFallbackModels); // The bare gpt-5.6 alias is intentionally not advertised (Codex has no metadata for it). expect(models.some((model) => model.id === "gpt-5.6")).toBe(false); + expect(models.some((model) => model.id === "gpt-6.1-sol")).toBe(true); expect(models.some((model) => model.id === "gpt-5.6-sol")).toBe(true); expect(models.some((model) => model.id === "gpt-5.6-terra")).toBe(true); expect(models.some((model) => model.id === "gpt-5.6-luna")).toBe(true); @@ -170,9 +171,11 @@ describe("adapter model listing", () => { // Fable 5.1 leads here too, using its documented dateless Bedrock ID. expect(models[0]?.id).toBe("us.anthropic.claude-fable-5-1"); 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", - "us.anthropic.claude-fable-5-1", "us.anthropic.claude-opus-4-7", "us.anthropic.claude-sonnet-4-6", + "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", + "us.anthropic.claude-sonnet-4-6", ])); + 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(fetchSpy).not.toHaveBeenCalled(); @@ -293,7 +296,7 @@ describe("adapter model listing", () => { const models = await listAdapterModels("opencode_local"); expect(models).toEqual(opencodeFallbackModels); - expect(models.map((model) => model.id)).toEqual(expect.arrayContaining(["openai/gpt-6-astra", "openai/gpt-6-sol", "openai/gpt-6-luna", "openai/gpt-5.6-sol", "openai/gpt-5.6-terra", "openai/gpt-5.6-luna", "anthropic/claude-opus-5-5", "anthropic/claude-opus-5", "anthropic/claude-fable-5-1", "anthropic/claude-sonnet-5", "google/gemini-3.8-flash", "xai/grok-4.7"])); + expect(models.map((model) => model.id)).toEqual(expect.arrayContaining(["openai/gpt-6-astra", "openai/gpt-6.1-sol", "openai/gpt-6-sol", "openai/gpt-6-luna", "openai/gpt-5.6-sol", "openai/gpt-5.6-terra", "openai/gpt-5.6-luna", "anthropic/claude-opus-5-5", "anthropic/claude-opus-5", "anthropic/claude-fable-5-1", "anthropic/claude-sonnet-5-5", "anthropic/claude-sonnet-5", "google/gemini-3.8-flash", "xai/grok-4.7"])); }); it("loads cursor models dynamically and caches them", async () => { diff --git a/server/src/__tests__/adapter-registry.test.ts b/server/src/__tests__/adapter-registry.test.ts index f7e162a3731..fddd8d7af93 100644 --- a/server/src/__tests__/adapter-registry.test.ts +++ b/server/src/__tests__/adapter-registry.test.ts @@ -362,8 +362,8 @@ describe("server adapter registry", () => { const expectedCodexInstall = `if ! command -v 'codex' >/dev/null 2>&1; then ${buildSandboxNpmInstallCommand("@openai/codex")}; fi`; const expectedGeminiInstall = `if ! command -v 'gemini' >/dev/null 2>&1; then ${buildSandboxNpmInstallCommand("@google/gemini-cli")}; fi`; const expectedOpenCodeInstall = `if ! command -v 'opencode' >/dev/null 2>&1; then ${buildSandboxNpmInstallCommand("opencode-ai")}; fi`; - const expectedRunnerCodexInstall = `if ! command -v 'codex' >/dev/null 2>&1; then ${buildSandboxNpmInstallCommand("@openai/codex@0.156.0")}; fi`; - const expectedRunnerOpenCodeInstall = `if ! command -v 'opencode' >/dev/null 2>&1; then ${buildSandboxNpmInstallCommand("opencode-ai@1.18.32")}; fi`; + const expectedRunnerCodexInstall = `if ! command -v 'codex' >/dev/null 2>&1; then ${buildSandboxNpmInstallCommand("@openai/codex@0.160.0")}; fi`; + const expectedRunnerOpenCodeInstall = `if ! command -v 'opencode' >/dev/null 2>&1; then ${buildSandboxNpmInstallCommand("opencode-ai@1.18.34")}; fi`; expect(findActiveServerAdapter("claude_local")?.getRuntimeCommandSpec?.({})).toEqual({ command: "claude", diff --git a/server/src/__tests__/heartbeat-active-run-output-watchdog.test.ts b/server/src/__tests__/heartbeat-active-run-output-watchdog.test.ts index eb04d057a4c..197dc260ed4 100644 --- a/server/src/__tests__/heartbeat-active-run-output-watchdog.test.ts +++ b/server/src/__tests__/heartbeat-active-run-output-watchdog.test.ts @@ -1,5 +1,5 @@ import { randomUUID } from "node:crypto"; -import { and, eq, sql } from "drizzle-orm"; +import { and, eq } from "drizzle-orm"; import { afterAll, afterEach, beforeAll, describe, expect, it, vi } from "vitest"; import { activityLog, @@ -19,6 +19,7 @@ import { getEmbeddedPostgresTestSupport, startEmbeddedPostgresTestDatabase, } from "./helpers/embedded-postgres.js"; +import { truncateTablesWithDeadlockRetry } from "./helpers/truncate-with-deadlock-retry.js"; import { appendHeartbeatRunEvent } from "../services/heartbeat-run-events.js"; import { ACTIVE_RUN_OUTPUT_CONTINUE_REARM_MS, @@ -43,29 +44,6 @@ if (!embeddedPostgresSupport.supported) { ); } -function errorHasPostgresCode(error: unknown, code: string): boolean { - let current: unknown = error; - for (let depth = 0; depth < 4; depth += 1) { - if (!current || typeof current !== "object") return false; - const record = current as { code?: unknown; cause?: unknown }; - if (record.code === code) return true; - current = record.cause; - } - return false; -} - -async function truncateCompaniesWithDeadlockRetry(db: ReturnType) { - for (let attempt = 0; attempt < 5; attempt += 1) { - try { - await db.execute(sql.raw(`TRUNCATE TABLE "companies" CASCADE`)); - return; - } catch (error) { - if (!errorHasPostgresCode(error, "40P01") || attempt === 4) throw error; - await new Promise((resolve) => setTimeout(resolve, 50 * (attempt + 1))); - } - } -} - describeEmbeddedPostgres("active-run output watchdog", () => { let tempDb: Awaited> | null = null; let db: ReturnType; @@ -77,7 +55,10 @@ describeEmbeddedPostgres("active-run output watchdog", () => { afterEach(async () => { mockedAppendHeartbeatRunEvent.mockClear(); - await truncateCompaniesWithDeadlockRetry(db); + await truncateTablesWithDeadlockRetry(db, `TRUNCATE TABLE "companies" CASCADE`, { + attempts: 5, + delayMs: (attempt) => 50 * (attempt + 1), + }); }); afterAll(async () => { diff --git a/server/src/__tests__/heartbeat-stale-queue-invalidation.test.ts b/server/src/__tests__/heartbeat-stale-queue-invalidation.test.ts index 882a81e5d2b..99efb01d320 100644 --- a/server/src/__tests__/heartbeat-stale-queue-invalidation.test.ts +++ b/server/src/__tests__/heartbeat-stale-queue-invalidation.test.ts @@ -22,6 +22,8 @@ import { getEmbeddedPostgresTestSupport, startEmbeddedPostgresTestDatabase, } from "./helpers/embedded-postgres.js"; +import { drainHeartbeatRunsToQuiescence } from "./helpers/drain-heartbeat-runs.js"; +import { truncateTablesWithDeadlockRetry } from "./helpers/truncate-with-deadlock-retry.js"; import { MAX_TURN_CONTINUATION_RETRY_REASON, MAX_TURN_CONTINUATION_WAKE_REASON, @@ -89,42 +91,30 @@ async function waitForCondition(fn: () => Promise, timeoutMs = 3_000) { } async function cleanupHeartbeatInvalidationFixture(db: ReturnType) { - for (let attempt = 0; attempt < 10; attempt += 1) { - try { - await db.execute(sql.raw(` - TRUNCATE TABLE - "company_skills", - "issue_comments", - "issue_documents", - "document_revisions", - "documents", - "issue_relations", - "issue_tree_holds", - "issues", - "heartbeat_run_events", - "cost_events", - "activity_log", - "heartbeat_runs", - "agent_wakeup_requests", - "agent_runtime_state", - "agents", - "companies" - RESTART IDENTITY CASCADE - `)); - return; - } catch (error) { - const isLateCommentRace = - error instanceof Error && - error.message.includes("issue_comments_issue_id_issues_id_fk"); - if (!isLateCommentRace || attempt === 9) { - throw error; - } - - // Heartbeat completion can write issue-thread comments shortly after the - // run leaves queued/running. Retry the dependent deletes once those land. - await new Promise((resolve) => setTimeout(resolve, 100)); - } - } + await truncateTablesWithDeadlockRetry( + db, + ` + TRUNCATE TABLE + "company_skills", + "issue_comments", + "issue_documents", + "document_revisions", + "documents", + "issue_relations", + "issue_tree_holds", + "issues", + "heartbeat_run_events", + "cost_events", + "activity_log", + "heartbeat_runs", + "agent_wakeup_requests", + "agent_runtime_state", + "agents", + "companies" + RESTART IDENTITY CASCADE + `, + { attempts: 10, delayMs: () => 100 }, + ); } type SeedOptions = { @@ -182,21 +172,12 @@ describeEmbeddedPostgres("heartbeat stale queued-run invalidation", () => { model: "test-model", })); runningProcesses.clear(); - let idlePolls = 0; - for (let attempt = 0; attempt < 100; attempt += 1) { - const runs = await db - .select({ status: heartbeatRuns.status }) - .from(heartbeatRuns); - const hasActiveRun = runs.some((run) => run.status === "queued" || run.status === "running"); - if (!hasActiveRun) { - idlePolls += 1; - if (idlePolls >= 3) break; - } else { - idlePolls = 0; - } - await new Promise((resolve) => setTimeout(resolve, 50)); - } - await new Promise((resolve) => setTimeout(resolve, 50)); + // A table poll for "queued" or "running" rows cannot see a wakeup promise + // that has not yet written its run row. The shared drain helper awaits + // both in-flight wakeup promises and in-flight run executions first, then + // re-checks the run table, so a late writer cannot still be in flight when + // the TRUNCATE below runs. + await drainHeartbeatRunsToQuiescence(db, heartbeat); await cleanupHeartbeatInvalidationFixture(db); }); diff --git a/server/src/__tests__/helpers/truncate-with-deadlock-retry.test.ts b/server/src/__tests__/helpers/truncate-with-deadlock-retry.test.ts new file mode 100644 index 00000000000..98d9d657eef --- /dev/null +++ b/server/src/__tests__/helpers/truncate-with-deadlock-retry.test.ts @@ -0,0 +1,96 @@ +import { describe, expect, it, vi } from "vitest"; +import { errorHasPostgresCode, truncateTablesWithDeadlockRetry } from "./truncate-with-deadlock-retry.js"; + +function deadlockError(): Error & { code: string } { + return Object.assign(new Error("deadlock detected"), { code: "40P01" }); +} + +function lateCommentForeignKeyError(): Error { + return new Error( + 'insert or update on table "issue_comments" violates foreign key constraint "issue_comments_issue_id_issues_id_fk"', + ); +} + +function unrelatedError(): Error & { code: string } { + return Object.assign(new Error("relation does not exist"), { code: "42P01" }); +} + +function fakeDb(execute: ReturnType) { + return { execute } as unknown as Parameters[0]; +} + +describe("truncateTablesWithDeadlockRetry", () => { + it("retries a deadlock (40P01) and succeeds once the lock clears", async () => { + const execute = vi.fn() + .mockRejectedValueOnce(deadlockError()) + .mockRejectedValueOnce(deadlockError()) + .mockResolvedValueOnce(undefined); + + await truncateTablesWithDeadlockRetry(fakeDb(execute), "TRUNCATE TABLE \"companies\" CASCADE", { + attempts: 5, + delayMs: () => 0, + }); + + expect(execute).toHaveBeenCalledTimes(3); + }); + + it("retries the late-comment foreign key violation and succeeds once the dependent row lands", async () => { + const execute = vi.fn() + .mockRejectedValueOnce(lateCommentForeignKeyError()) + .mockResolvedValueOnce(undefined); + + await truncateTablesWithDeadlockRetry(fakeDb(execute), "TRUNCATE TABLE \"issue_comments\" CASCADE", { + attempts: 5, + delayMs: () => 0, + }); + + expect(execute).toHaveBeenCalledTimes(2); + }); + + it("rethrows once attempts are exhausted on a persistent deadlock", async () => { + const error = deadlockError(); + const execute = vi.fn().mockRejectedValue(error); + + await expect( + truncateTablesWithDeadlockRetry(fakeDb(execute), "TRUNCATE TABLE \"companies\" CASCADE", { + attempts: 3, + delayMs: () => 0, + }), + ).rejects.toBe(error); + + expect(execute).toHaveBeenCalledTimes(3); + }); + + it("rethrows immediately on an error that is neither a deadlock nor the late-comment race", async () => { + const error = unrelatedError(); + const execute = vi.fn().mockRejectedValue(error); + + await expect( + truncateTablesWithDeadlockRetry(fakeDb(execute), "TRUNCATE TABLE \"companies\" CASCADE", { + attempts: 5, + delayMs: () => 0, + }), + ).rejects.toBe(error); + + expect(execute).toHaveBeenCalledTimes(1); + }); +}); + +describe("errorHasPostgresCode", () => { + it("finds the code on the error itself", () => { + expect(errorHasPostgresCode(deadlockError(), "40P01")).toBe(true); + }); + + it("finds the code on a wrapped cause", () => { + const wrapped = new Error("wrapper", { cause: deadlockError() }); + expect(errorHasPostgresCode(wrapped, "40P01")).toBe(true); + }); + + it("returns false when the code never matches", () => { + expect(errorHasPostgresCode(unrelatedError(), "40P01")).toBe(false); + }); + + it("returns false for a non-object error", () => { + expect(errorHasPostgresCode("plain string failure", "40P01")).toBe(false); + }); +}); diff --git a/server/src/__tests__/helpers/truncate-with-deadlock-retry.ts b/server/src/__tests__/helpers/truncate-with-deadlock-retry.ts new file mode 100644 index 00000000000..98f64b78944 --- /dev/null +++ b/server/src/__tests__/helpers/truncate-with-deadlock-retry.ts @@ -0,0 +1,49 @@ +import { sql } from "drizzle-orm"; +import type { createDb } from "@paperclipai/db"; + +type Db = ReturnType; + +const LATE_COMMENT_FOREIGN_KEY = "issue_comments_issue_id_issues_id_fk"; +const DEADLOCK_DETECTED_CODE = "40P01"; + +export function errorHasPostgresCode(error: unknown, code: string): boolean { + let current: unknown = error; + for (let depth = 0; depth < 4; depth += 1) { + if (!current || typeof current !== "object") return false; + const record = current as { code?: unknown; cause?: unknown }; + if (record.code === code) return true; + current = record.cause; + } + return false; +} + +function isLateWriterRace(error: unknown): boolean { + if (errorHasPostgresCode(error, DEADLOCK_DETECTED_CODE)) return true; + return error instanceof Error && error.message.includes(LATE_COMMENT_FOREIGN_KEY); +} + +// A fixture cleanup can race a background write that the test's drain step +// cannot see yet. Two forms of that race show up in this suite: a PostgreSQL +// deadlock (code 40P01) when a late writer holds a row lock that the +// TRUNCATE's lock ordering also needs, and a foreign-key violation when a +// dependent row lands between two deletes. Retry a fixed number of times with +// a backoff delay before the caller gives up and rethrows. +export async function truncateTablesWithDeadlockRetry( + db: Db, + truncateStatement: string, + opts: { attempts?: number; delayMs?: (attempt: number) => number } = {}, +): Promise { + const attempts = opts.attempts ?? 10; + const delayMs = opts.delayMs ?? ((attempt: number) => 50 * (attempt + 1)); + for (let attempt = 0; attempt < attempts; attempt += 1) { + try { + await db.execute(sql.raw(truncateStatement)); + return; + } catch (error) { + if (!isLateWriterRace(error) || attempt === attempts - 1) { + throw error; + } + await new Promise((resolve) => setTimeout(resolve, delayMs(attempt))); + } + } +} diff --git a/server/src/adapters/registry.ts b/server/src/adapters/registry.ts index 996ad3e465f..5b3ff1fa14f 100644 --- a/server/src/adapters/registry.ts +++ b/server/src/adapters/registry.ts @@ -519,7 +519,7 @@ const paperclipRunnerAdapter: ServerAdapterModule = { "opencode", `opencode-ai@${QUALIFIED_OPENCODE_RUNNER_VERSION}`, ) - : buildNpmRuntimeCommandSpec(config, "codex", "@openai/codex@0.156.0"), + : buildNpmRuntimeCommandSpec(config, "codex", "@openai/codex@0.160.0"), agentConfigurationDoc: "# Paperclip Runner\n\nAdapter: paperclip_runner\n\nRuns Codex, OpenCode, Claude Managed, AWS AgentCore, or ACPX Claude/Grok Build through the Rust Paperclip runner and authenticated PRP transport. Cursor, GitHub Copilot, and Pi are awaiting local and Daytona qualification and are not enabled for production runs. Managed providers use company-scoped qualified profiles, explicit retention acknowledgement, and spend limits.\n", getConfigSchema: () => ({ diff --git a/server/src/services/native-runtime/codex-runtime-compatibility.test.ts b/server/src/services/native-runtime/codex-runtime-compatibility.test.ts index 3f9a72542ef..81159c6653e 100644 --- a/server/src/services/native-runtime/codex-runtime-compatibility.test.ts +++ b/server/src/services/native-runtime/codex-runtime-compatibility.test.ts @@ -15,13 +15,13 @@ describe("remote Codex compatibility window", () => { vi.useRealTimers(); } }); - it.each(["0.149.0", "0.149.1", "0.150.0", "0.150.1", "0.151.0", "0.152.1", "0.153.4", "0.154.0", "0.155.1", "0.156.0", "0.156.99"])( + it.each(["0.149.0", "0.149.1", "0.150.0", "0.150.1", "0.151.0", "0.152.1", "0.153.4", "0.154.0", "0.155.1", "0.156.0", "0.156.99", "0.157.0", "0.158.0", "0.159.3", "0.160.0", "0.160.99"])( "accepts stable supported version %s", (version) => { expect(isSupportedRemoteCodexVersion(version)).toBe(true); expect(parseCodexCliVersion(`codex-cli ${version}\n`)).toBe(version); }, ); - it.each(["0.148.99", "0.100.0", "0.157.0", "0.999.0", "1.0.0", "0.156.0-alpha.1", "0.149.0-dev", "0.156.0+custom", "00.149.0", "0.149", "0.149.9007199254740992", ""])( + it.each(["0.148.99", "0.100.0", "0.161.0", "0.162.0", "0.999.0", "1.0.0", "0.160.0-alpha.1", "0.149.0-dev", "0.160.0+custom", "00.149.0", "0.149", "0.149.9007199254740992", ""])( "rejects unsupported or ambiguous version %s", (version) => { expect(isSupportedRemoteCodexVersion(version)).toBe(false); }, @@ -30,9 +30,9 @@ describe("remote Codex compatibility window", () => { expect(parseCodexCliVersion("WARNING: PATH unchanged\r\n\rcodex-cli 0.149.0\r\n")).toBe("0.149.0"); }); it.each([ - "codex-cli 0.156.0-alpha.1", "codex-cli 0.156.0+custom", "codex-cli 0.156.0 garbage", - "wrapper says codex-cli 0.156.0", "codex 0.156.0", "0.156.0", "", - "codex-cli 0.149.0\ncodex-cli 0.156.0", + "codex-cli 0.160.0-alpha.1", "codex-cli 0.160.0+custom", "codex-cli 0.160.0 garbage", + "wrapper says codex-cli 0.160.0", "codex 0.160.0", "0.160.0", "", + "codex-cli 0.149.0\ncodex-cli 0.160.0", ])("does not partially parse %j as a supported stable CLI", (output) => { expect(parseCodexCliVersion(output)).toBeNull(); }); diff --git a/server/src/services/native-runtime/codex-runtime-compatibility.ts b/server/src/services/native-runtime/codex-runtime-compatibility.ts index d5a1a25ba71..940222bb3ce 100644 --- a/server/src/services/native-runtime/codex-runtime-compatibility.ts +++ b/server/src/services/native-runtime/codex-runtime-compatibility.ts @@ -6,7 +6,7 @@ * Do not query a registry at startup. */ export const REMOTE_CODEX_MINIMUM_VERSION = "0.149.0"; -export const REMOTE_CODEX_MAXIMUM_VERSION_EXCLUSIVE = "0.157.0"; +export const REMOTE_CODEX_MAXIMUM_VERSION_EXCLUSIVE = "0.161.0"; export const REMOTE_CODEX_SUPPORTED_RANGE = `>=${REMOTE_CODEX_MINIMUM_VERSION} <${REMOTE_CODEX_MAXIMUM_VERSION_EXCLUSIVE}`; diff --git a/server/src/services/native-runtime/native-session-executor.test.ts b/server/src/services/native-runtime/native-session-executor.test.ts index f9551e26cc4..f1ef9b31cf8 100644 --- a/server/src/services/native-runtime/native-session-executor.test.ts +++ b/server/src/services/native-runtime/native-session-executor.test.ts @@ -1087,8 +1087,8 @@ describe("remote provider pack manifest", () => { const payload = { pins: { nodeMinimum: "24.11.0", - codex: "0.156.0", - opencode: "1.18.32", + codex: "0.160.0", + opencode: "1.18.34", acpx: "0.13.1", claudeAcp: "0.73.0", codexAcp: "1.6.2", @@ -1148,7 +1148,7 @@ describe("remote provider pack manifest", () => { ); await writeManifest(); expect(readRemoteProviderPackManifest(root).payload.pins.opencode).toBe( - "1.18.32", + "1.18.34", ); const candidatePath = "provider-assets/pi/linux-x64"; await mkdir(join(root, candidatePath), { recursive: true }); @@ -2180,7 +2180,7 @@ describe("remote preinstalled executable discovery", () => { const shim = '#!/bin/sh\ncat "$(dirname "$0")/version.txt"\nprintf "%s\\n" "$@"\n'; await writeFile(source, shim, { mode: 0o755 }); - await writeFile(join(installation, "version.txt"), "codex-cli 0.156.0\n"); + await writeFile(join(installation, "version.txt"), "codex-cli 0.160.0\n"); // Existing deployments may already have the old symlink. Never write // through it into the shared installation while upgrading the launcher. await symlink(source, target); @@ -2193,7 +2193,7 @@ describe("remote preinstalled executable discovery", () => { execFileSync(target, ["--version", "argument with 'quotes'"], { encoding: "utf8", }), - ).toBe("codex-cli 0.156.0\n--version\nargument with 'quotes'\n"); + ).toBe("codex-cli 0.160.0\n--version\nargument with 'quotes'\n"); expect(await readFile(source, "utf8")).toBe(shim); } expect(await readdir(join(root, "workspace", "bin"))).toEqual(["codex"]); @@ -11177,7 +11177,7 @@ describe("runnerd provider runtime wiring", () => { }), stderr: "", }; if (command.args?.[0] === "--version") return { - exitCode: 0, timedOut: false, stdout: "codex-cli 0.156.0", stderr: "", + exitCode: 0, timedOut: false, stdout: "codex-cli 0.160.0", stderr: "", }; if (command.args?.[1]?.includes("base64")) return { exitCode: 1, timedOut: false, stdout: "", stderr: "", @@ -11254,7 +11254,7 @@ describe("runnerd provider runtime wiring", () => { }), stderr: "", }; if (command.args?.[0] === "--version") return { - exitCode: 0, timedOut: false, stdout: "codex-cli 0.156.0", stderr: "", + exitCode: 0, timedOut: false, stdout: "codex-cli 0.160.0", stderr: "", }; if (command.args?.[2] === "paperclip-runner-launch") { throw new Error("fixture_stop_after_launch_staging"); @@ -11336,10 +11336,10 @@ describe("runnerd provider runtime wiring", () => { it.each([ ...["current", "preinstalled-exact", "preinstalled-mismatch", "preinstalled-error", "preinstalled-timeout", "stale", "missing", "retained", "retained-mismatch", "retained-error", "retained-timeout", "retained-explicit"] - .map((image) => ({ image, version: "0.156.0", compatible: true })), - ...["0.149.0", "0.149.1", "0.153.4", "0.156.1"] + .map((image) => ({ image, version: "0.160.0", compatible: true })), + ...["0.149.0", "0.149.1", "0.153.4", "0.156.0", "0.160.1"] .map((version) => ({ image: "current", version, compatible: true })), - ...["0.148.9", "0.157.0", "1.0.0", "0.156.0-alpha.1", "unknown"] + ...["0.148.9", "0.161.0", "1.0.0", "0.160.0-alpha.1", "unknown"] .map((version) => ({ image: "current", version, compatible: false })), ])("uses shared Codex and the server-owned replacement artifact (image=$image, Codex=$version)", async ({ image, version, compatible }) => { const retained = image.startsWith("retained"); @@ -11433,7 +11433,7 @@ describe("runnerd provider runtime wiring", () => { controlPlaneRegistration: (authority: unknown) => Promise; }; await expect(transport.controlPlaneRegistration({})).rejects.toThrow( - compatible ? "reached-preinstalled-codex-verification" : "runner_remote_provider_artifact_incompatible: supported Codex versions >=0.149.0 <0.157.0", + compatible ? "reached-preinstalled-codex-verification" : "runner_remote_provider_artifact_incompatible: supported Codex versions >=0.149.0 <0.161.0", ); if (!compatible) { expect(syncIn).not.toHaveBeenCalled(); @@ -11441,7 +11441,7 @@ describe("runnerd provider runtime wiring", () => { expect(onLog).not.toHaveBeenCalledWith("stderr", expect.stringContaining("using compatible Codex")); return; } - if (version !== "0.156.0") { + if (version !== "0.160.0") { expect(onLog).toHaveBeenCalledWith("stderr", expect.stringContaining(`using compatible Codex ${version}`)); } if (needsReplacement) { diff --git a/server/src/services/native-runtime/native-session-executor.ts b/server/src/services/native-runtime/native-session-executor.ts index 043ae17eb6d..cc217b94525 100644 --- a/server/src/services/native-runtime/native-session-executor.ts +++ b/server/src/services/native-runtime/native-session-executor.ts @@ -9407,8 +9407,8 @@ const RUNNERD_BINARY_CONTRACT_VERSION = 2; const REMOTE_PROVIDER_PACK_SCHEMA = "paperclip-runner/remote-provider-pack/v1"; const REMOTE_PROVIDER_PACK_PINS = { nodeMinimum: "24.11.0", - codex: "0.156.0", - opencode: "1.18.32", + codex: "0.160.0", + opencode: "1.18.34", acpx: "0.13.1", claudeAcp: "0.73.0", codexAcp: "1.6.2", diff --git a/server/src/services/native-runtime/provider-profile.ts b/server/src/services/native-runtime/provider-profile.ts index 371c04ac593..45afa9f3104 100644 --- a/server/src/services/native-runtime/provider-profile.ts +++ b/server/src/services/native-runtime/provider-profile.ts @@ -15,7 +15,7 @@ import { } from "../provider-profile-qualification.js"; import { resolveAcpxQualification, type AcpxQualificationCandidate } from "./acpx-qualification.js"; -export const QUALIFIED_OPENCODE_RUNNER_VERSION = "1.18.32" as const; +export const QUALIFIED_OPENCODE_RUNNER_VERSION = "1.18.34" as const; export const DEFAULT_OPENCODE_RUNNER_MODEL = "openrouter/deepseek/deepseek-v4-flash-0731" as const; export const CLAUDE_MANAGED_BETA_VERSION = "managed-agents-2026-04-01" as const; diff --git a/ui/src/adapters/codex-local/config-fields.test.tsx b/ui/src/adapters/codex-local/config-fields.test.tsx index 261b194aa32..1272376e2e2 100644 --- a/ui/src/adapters/codex-local/config-fields.test.tsx +++ b/ui/src/adapters/codex-local/config-fields.test.tsx @@ -41,7 +41,7 @@ describe("Paperclip Runner Codex configuration", () => { const html = renderRunner({ provider: "codex" }); expect(html).toContain(''); - expect(html).toContain("OpenCode 1.18.32"); + expect(html).toContain("OpenCode 1.18.34"); expect(html).toContain(''); expect(html).not.toContain("Permission mode"); expect(html).not.toContain("Ask when requested"); @@ -58,7 +58,7 @@ describe("Paperclip Runner Codex configuration", () => { }); expect(html).toContain( - '', + '', ); expect(html).toContain("Full auto (allow)"); expect(html).toContain('aria-label="Permission mode"'); diff --git a/ui/src/adapters/codex-local/config-fields.tsx b/ui/src/adapters/codex-local/config-fields.tsx index bb737ee45ce..ce36b43769d 100644 --- a/ui/src/adapters/codex-local/config-fields.tsx +++ b/ui/src/adapters/codex-local/config-fields.tsx @@ -231,7 +231,7 @@ export function CodexLocalConfigFields({ }} > - + diff --git a/ui/src/components/task-chat/useWindowAutoFollow.test.tsx b/ui/src/components/task-chat/useWindowAutoFollow.test.tsx index ba43d080b98..4cfde316a28 100644 --- a/ui/src/components/task-chat/useWindowAutoFollow.test.tsx +++ b/ui/src/components/task-chat/useWindowAutoFollow.test.tsx @@ -8,7 +8,7 @@ import { TaskChatScrollNavigation } from "./scroll-navigation"; function Host({ contentKey, enabled }: { contentKey: unknown; enabled: boolean }) { useWindowAutoFollow(contentKey, enabled); - return
thread
; + return
thread
; } /** @@ -189,6 +189,71 @@ describe("useWindowAutoFollow", () => { expect(scrollToCalls).toHaveLength(0); }); + it("follows a late thread resize without a React content update or body resize", async () => { + const observed = new Set(); + let resizeThread = () => {}; + vi.stubGlobal("ResizeObserver", class { + constructor(callback: ResizeObserverCallback) { + resizeThread = () => { + const thread = container.querySelector('[data-testid="task-chat-thread"]')!; + if (observed.has(thread)) callback([{ target: thread } as ResizeObserverEntry], this as unknown as ResizeObserver); + }; + } + observe(element: Element) { observed.add(element); } + disconnect() { observed.clear(); } + }); + const geometry = fakeWindowGeometry(); + render(0); + scrollToCalls = []; + + geometry.setScrollHeight(2400); + resizeThread(); + + expect(scrollToCalls).toContain(2400); + expect(window.scrollY).toBe(1600); + }); + + it("keeps following when a scroll event arrives after growth before reconciliation", async () => { + const geometry = fakeWindowGeometry(); + render(0); + + geometry.setScrollHeight(2400); + await scrollWindowTo(1200); // Still at the old bottom; the user did not move up. + scrollToCalls = []; + render(1); + + expect(scrollToCalls).toContain(2400); + }); + + it("holds an upward user scroll during growth and resumes after returning to the bottom", async () => { + const geometry = fakeWindowGeometry(); + render(0); + + geometry.setScrollHeight(2400); + await scrollWindowTo(900); + scrollToCalls = []; + render(1); + expect(scrollToCalls).toHaveLength(0); + + await scrollWindowTo(1600); + geometry.setScrollHeight(2700); + render(2); + expect(scrollToCalls).toContain(2700); + }); + + it("follows viewport resizing while pinned and holds it while reading older output", async () => { + render(0); + Object.defineProperty(window, "innerHeight", { value: 600, configurable: true }); + window.dispatchEvent(new Event("resize")); + expect(window.scrollY).toBe(1400); + + await scrollWindowTo(500); + scrollToCalls = []; + Object.defineProperty(window, "innerHeight", { value: 700, configurable: true }); + window.dispatchEvent(new Event("resize")); + expect(scrollToCalls).toHaveLength(0); + }); + it("does nothing when disabled", () => { render(0, false); expect(scrollToCalls).toHaveLength(0); diff --git a/ui/src/components/task-chat/useWindowAutoFollow.ts b/ui/src/components/task-chat/useWindowAutoFollow.ts index df17a1dcfcd..d971e94e42f 100644 --- a/ui/src/components/task-chat/useWindowAutoFollow.ts +++ b/ui/src/components/task-chat/useWindowAutoFollow.ts @@ -32,11 +32,13 @@ function scrollWindowToBottom(): void { */ export function useWindowAutoFollow(contentKey: unknown, enabled: boolean): void { const pinnedRef = useRef(true); + const lastScrollYRef = useRef(window.scrollY); const navigation = useTaskChatScrollNavigation(); const initialPositionApplied = useRef(false); const appliedNavigation = useRef({ key: navigation.key, hash: navigation.hash }); const anchorRef = useRef(null); const rememberAnchor = () => { + lastScrollYRef.current = window.scrollY; const root = document.querySelector('[data-testid="task-chat-thread"]'); if (root) anchorRef.current = readThreadScrollAnchor(root, 0, window.innerHeight); if (initialPositionApplied.current) navigation.remember(window.scrollY, anchorRef.current); @@ -56,16 +58,22 @@ export function useWindowAutoFollow(contentKey: unknown, enabled: boolean): void useEffect(() => { if (!enabled) return; const onScroll = () => { - pinnedRef.current = windowPinned(); + // Content or viewport growth can leave a gap below the old bottom before + // ResizeObserver runs. Only an upward scroll gives up existing follow + // intent; a scroll event at the same position must not strand the output. + pinnedRef.current = windowPinned() || (pinnedRef.current && window.scrollY >= lastScrollYRef.current); rememberAnchor(); }; window.addEventListener("scroll", onScroll, { passive: true }); - return () => window.removeEventListener("scroll", onScroll); + window.addEventListener("resize", reconcile); + return () => { + window.removeEventListener("scroll", onScroll); + window.removeEventListener("resize", reconcile); + }; }, [enabled, navigation.key, navigation.hash, navigation.ready]); useLayoutEffect(() => { if (!enabled || typeof ResizeObserver === "undefined") return; - const observed = document.body; let previousScrollHeight = scrollingElement()?.scrollHeight ?? null; const observer = new ResizeObserver(() => { const nextScrollHeight = scrollingElement()?.scrollHeight ?? null; @@ -78,7 +86,12 @@ export function useWindowAutoFollow(contentKey: unknown, enabled: boolean): void previousScrollHeight = nextScrollHeight; reconcile(); }); - observer.observe(observed); + // The mobile body is viewport-sized even when its contents overflow. Watch + // the thread box too, so streamed rows, images and expanding tools follow + // after their own layout changes without needing a new parent content key. + observer.observe(document.body); + const thread = document.querySelector('[data-testid="task-chat-thread"]'); + if (thread) observer.observe(thread); return () => observer.disconnect(); }, [enabled, navigation.key, navigation.hash, navigation.ready]); diff --git a/ui/src/lib/codex-reasoning-effort.test.ts b/ui/src/lib/codex-reasoning-effort.test.ts index 0d7424e52bb..aa1b8f13fc3 100644 --- a/ui/src/lib/codex-reasoning-effort.test.ts +++ b/ui/src/lib/codex-reasoning-effort.test.ts @@ -4,7 +4,7 @@ import { describe, expect, it } from "vitest"; import { codexReasoningEffortOptions } from "./codex-reasoning-effort"; describe("codexReasoningEffortOptions", () => { - it.each(["gpt-6-astra", "gpt-6-sol", "gpt-5.6-sol", "gpt-5.6-terra"])("exposes only the supported %s reasoning efforts", (model) => { + it.each(["gpt-6-astra", "gpt-6.1-sol", "gpt-6-sol", "gpt-5.6-sol", "gpt-5.6-terra"])("exposes only the supported %s reasoning efforts", (model) => { expect(codexReasoningEffortOptions(model)).toEqual([ { value: "", label: "Default" }, { value: "low", label: "Low" }, diff --git a/ui/storybook/stories/task-chat-mobile-follow.stories.tsx b/ui/storybook/stories/task-chat-mobile-follow.stories.tsx new file mode 100644 index 00000000000..1fb4d9b3cad --- /dev/null +++ b/ui/storybook/stories/task-chat-mobile-follow.stories.tsx @@ -0,0 +1,57 @@ +import { useEffect, useState, type CSSProperties } from "react"; +import type { Meta, StoryObj } from "@storybook/react-vite"; +import { MobileBottomNav } from "@/components/MobileBottomNav"; +import { TaskChatComposer } from "@/components/task-chat/TaskChatComposer"; +import { TaskChatComposerDock } from "@/components/task-chat/TaskChatComposerDock"; +import { TaskChatThreadView } from "@/components/task-chat/TaskChatThreadView"; +import { useWindowAutoFollow } from "@/components/task-chat/useWindowAutoFollow"; + +function StreamingResponse({ running }: { running: boolean }) { + const [lines, setLines] = useState(16); + useEffect(() => { + if (!running || lines >= 256) return; + const timer = window.setTimeout(() => setLines(lines + 1), 500); + return () => window.clearTimeout(timer); + }, [running, lines]); + return `Update ${index + 1}: I checked the next section and recorded the results for the final report.`).join("\n\n"), + }, + ]} />; +} + +function MobileFollow() { + const [running, setRunning] = useState(true); + // The child updates independently, exercising late layout growth as well as + // normal streaming without relying on a parent content-key notification. + useWindowAutoFollow(0, true); + return
+
Streaming progress report
+
+
+ + + setRunning(true)} + onStop={running ? async () => setRunning(false) : undefined} /> + +
+
+ +
; +} + +const meta = { + title: "Task chat/Mobile streaming follow", + component: MobileFollow, + parameters: { + layout: "fullscreen", + docs: { description: { component: "Controlled output in the production thread and composer. At the bottom, updates stay visible. Scroll up to hold your reading position, then return to the bottom to resume following. Stop pauses the fixture; send a message to resume. No agent or provider calls." } }, + }, + globals: { theme: "light", viewport: { value: "mobile", isRotated: false } }, +} satisfies Meta; +export default meta; +type Story = StoryObj; +export const Streaming: Story = {};