mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-11-20 18:26:40 +01:00
feat(runner): pin Codex 0.170.0 and Agent SDK 0.3.328 so Fable 5.2 and GPT-6.2 run (#22278)
## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work. > - Paperclip Runner runs Claude and Codex agents from one shared provider pack. The pack pins an exact Claude Agent SDK (which bundles Claude Code) and an exact Codex CLI. > - #22222 added Claude Fable 5.2 (minimum Claude Code 2.1.321) and GPT-6.2 Sol and Astra (minimum Codex 0.169.1). The pack still bundles Claude Code 2.1.286 and Codex 0.160.0. > - Because of this, Paperclip Runner stops these models with a named version error, and native remote Codex accepts only `>=0.149.0 <0.161.0`. > - This pull request moves the provider pack to Agent SDK 0.3.328 (Claude Code 2.1.328) and Codex 0.170.0. It moves every constant that depends on these pins, and the remote Codex window to `<0.171.0`. > - The benefit is that Fable 5.2 and GPT-6.2 run on Paperclip Runner after a sandbox image with this pack is promoted. ## Linked Issues or Issue Description Refs #22222 (adds the models and the version floors; this pull request makes them runnable on Paperclip Runner). Refs #18488 (moves only the Codex pin to 0.166.0 and the window to `<0.167.0`; it is not updated since November 1 and has conflicts with `master`). Refs #18486 (GPT-6.1 Terra needs Codex 0.165.0; Codex 0.170.0 satisfies it). **Overlap with #18488.** #18488 changes the same Codex pin locations. This pull request uses a newer pin (0.170.0) and also moves the Claude runtime. If this pull request merges first, #18488 has no remaining change. I did not change the #18488 branch. ## What Changed - Claude runtime: `@anthropic-ai/claude-agent-sdk` 0.3.286 → 0.3.328 (Claude Code 2.1.286 → 2.1.328). This changes the root `pnpm.overrides`, `pnpm-workspace.yaml`, the ACPX `claude` profile, and the qualified Claude runtime in `installation-integrity.ts`, with new executable digests for Linux x64, Linux ARM64, macOS ARM64, and macOS x64. - Codex runtime: `@openai/codex` 0.160.0 → 0.170.0. This changes the runner dependency, the `codex-acp@1.6.2>@openai/codex` override, the `codex-acp` patch dependency line, the ACPX `codex` profile, and the qualified Linux x64 runtime with its new executable digest. - The ACP bridges do not change: `claude-agent-acp` 0.73.0 and the patched `codex-acp` 1.6.2. Their `commandDigest` values and profile versions do not change. - Generated declarations: `generated-profiles.ts` and `generated_acpx_profiles.rs` are regenerated with `generate:acpx-profiles`. - Remote native Codex window: `REMOTE_CODEX_MAXIMUM_VERSION_EXCLUSIVE` 0.161.0 → 0.171.0. The minimum stays at 0.149.0. Images with Codex 0.149.0 through 0.170.x are accepted. - Codex company observability: the qualified-version check moves to `codex-cli 0.170.0`. The `otel` configuration keys that Paperclip writes (`exporter`, `trace_exporter`, `metrics_exporter`) are present in the 0.170.0 configuration schema. The `OtelExporterKind`, `OtelHttpProtocol`, and `OtelTlsConfig` definitions are identical to 0.160.0. - Daytona runner image probes (`Dockerfile`, `Dockerfile.release`) expect `codex-cli 0.170.0` and `2.1.328 (Claude Code)`. The remote npm install spec in `server/src/adapters/registry.ts` is `@openai/codex@0.170.0`. - Tests: fixtures and assertions that mirror the pins use the new versions. The window tests accept 0.161.0 through 0.170.99 and reject 0.171.0. The ACPX gate tests now show that Fable 5.2 and GPT-6.2 are admitted. A new test mocks an older bundled runtime and keeps the named version-gap errors covered. The fallback test shows that GPT-6.2 stays on 0.170.0 and still falls back on 0.160.0. - Opt-in qualification scripts (`scripts/tests/native-cleanup-paginated-codex.mjs`, `native-provider-startup-codex.mjs`) require Codex 0.170.0. - Documentation: `docker/daytona-runner/README.md`, `doc/architecture/paperclip-runner-compatibility.md`, `doc/agent-observability.md`, `docs/deploy/environment-variables.md`, and the deferred item in `doc/adapter-model-audit-2026-11-18.md`. - `pnpm-lock.yaml` is not part of this pull request. The refresh bot regenerates it on `master`, as for the previous pin refreshes (#14942, #14993). ## Verification Sources, checked on 2026-11-19: - npm registry: `@openai/codex@0.170.0` (published 2026-11-18T03:45Z) and `@anthropic-ai/claude-agent-sdk@0.3.328` (published 2026-11-18T23:13Z, `claudeCodeVersion` 2.1.328). Both are the `latest` tags. - [Codex releases](https://github.com/openai/codex/releases) 0.161.0 through 0.170.0. The notes record no app-server protocol break. 0.169.0 keeps project configuration disabled for `codex exec` in untrusted directories; Paperclip's CLI path already uses `--skip-git-repo-check`, and the native path uses `app-server`. - [Claude Code changelog](https://github.com/anthropics/claude-code/blob/main/CHANGELOG.md) 2.1.287 through 2.1.328. See "Risks" for the headless changes that I reviewed. Digests and package shape: - I downloaded each platform archive with `npm pack`, which verifies registry integrity, and computed the SHA-256 of the executable. As a method check, the same command on the 0.3.286 Linux x64 archive gives the digest that is on `master` (`fe503f65…`). The Codex 0.160.0 archive also gives the `master` digest (`12eb3e81…`). - The extracted executables report `codex-cli 0.170.0` and `2.1.328 (Claude Code)`. - The Codex 0.170.0 Linux x64 archive no longer contains `codex-resources/zsh/bin/zsh`. Paperclip does not reference that path. - The Agent SDK 0.3.328 `optionalDependencies` have the same platform set as 0.3.286. The Codex 0.170.0 `optionalDependencies` use the same `npm:@openai/codex@<version>-<platform>` aliases. - Bridge link check: I installed `@agentclientprotocol/claude-agent-acp@0.73.0` with an override to Agent SDK 0.3.328 and imported its entry module. Node linked all of the named SDK imports, and the import completed. Real Codex qualification (no model turn, no credentials): - `PAPERCLIP_TEST_CODEX_BINARY=<installed 0.170.0 Linux x64 binary> node --import ./server/node_modules/tsx/dist/loader.mjs scripts/tests/native-cleanup-paginated-codex.mjs` passed: `green: true`, with the expected red control and paginated `thread/resume` through the real 0.170.0 `app-server`. The installed binary digest matches the pinned digest. Focused suites (Linux x64, Node 25.9.0, local `pnpm install --no-frozen-lockfile`): - `cd packages/paperclip-runner && pnpm run typecheck:typescript` passed, including `check:acpx-profiles`. - `npx tsc --noEmit` passed in `packages/adapters/codex-local` and `packages/adapters/claude-local`. - `packages/adapters/codex-local`: 625 passed. `packages/adapters/claude-local`: 419 passed, 1 skipped. - `node --test`: `acpx-codex-package-contract` 9 passed, `controlled-evals/controller` 77 passed, `scripts/acpx-patch-packaging` 26 passed, `scripts/__tests__/grok-public-install-sandbox` 27 passed. - `server`: `acpx-qualification`, `codex-runtime-compatibility`, and `codex-model-fallback` 110 passed. `native-session-executor` 1541 passed, 1 failed. The failure (`compares export process compatibility … db.transaction is not a function`) also fails on unchanged `master` on this host. - `packages/paperclip-runner` vitest (`installation-integrity`, `qualified-profiles`, `codex-security-config`, `native-execution`, `native-backend-factory`): 283 passed, 25 failed. All 25 failures are in `installation-integrity.test.ts` with "ACPX provider lifetime guardian failed to start". The same 25 tests fail on unchanged `master` on this host (master fails 30 here). Rust (toolchain 1.97.1 from `rust-toolchain.toml`, Linux x64): - `cargo test -p paperclip-runner-core --lib`: 658 passed, 2 failed, 4 ignored. `warm_run_attachment_reuses_the_provider_ingress_listener` also fails on unchanged `master` on this host. `reaping_stops_a_dead_runners_provider_and_its_escaped_tool_job` is flaky here: on this branch it passed 2 of 3 reruns. - `cargo test -p paperclip-runner-core --test acpx_warm_attachment --test native_provider_backend`: 7 and 45 passed. - The new and changed saved-session tests pass: `a_session_saved_by_the_previous_agent_runtime_is_refused_by_name`, `unrestorable_saved_sessions_keep_strict_bindings_and_name_their_class`, and `a_settled_session_saved_by_the_previous_acpx_release_continues`. `rustfmt --check` passes. - `server`: `native-session-resume.test.ts` and `acpx-qualification.test.ts` 110 passed, 2 skipped. Both new resume cases run and pass. Not run here: - `native-provider-startup-codex.mjs`, because it needs a compiled `paperclip-runnerd`. The trusted CI runner workflow covers startup and session-resume probes. - The Docker image build and any live model turn. A live Fable 5.2 and GPT-6.2 test follows the staging image rollout. ## Saved sessions from the previous release This change keeps the ACPX bridge command digests and profile versions. It changes `agentRuntimeVersion` in the `claude` and `codex` ACPX profiles. That field is part of the saved session identity. The previous release saved sessions with Agent SDK 0.3.286 or Codex 0.160.0. This build refuses those saved sessions. It does not migrate them. - **Next run (the usual case):** the saved provider descriptor names the old runtime. `rebindNativeSessionCheckpoint` does not match it, so the next run starts a fresh provider session in the same workspace with the complete handoff prompt. No run fails. The earlier provider conversation does not carry over. - **A run in flight at the deploy (settled or mid-turn):** the runner restore refuses the saved descriptor with the permanent class `provider_state_incompatible`. The server reports it as `native_provider_state_incompatible` and stops automatic retries. The runner opens no provider and keeps the saved state bytes and the workspace. The next run on the task starts a fresh provider session. - **Native Codex (`codex_app_server`) and OpenCode** sessions do not record this field, so their resume decision does not change. After a new image is promoted, native Codex resumes a saved thread with Codex 0.170.0 instead of 0.160.0. This pull request does not test that cross-version thread resume. New tests: - `acpx_provider_backend.rs`: `a_session_saved_by_the_previous_agent_runtime_is_refused_by_name` covers settled Claude and Codex sessions and a Claude turn interrupted mid-run by the deploy. `unrestorable_saved_sessions_keep_strict_bindings_and_name_their_class` has a new `agent_runtime_release` case. Each case checks the named class, that no provider session opens, and that the saved bytes do not change. - `native-session-resume.test.ts`: "a session saved by the previous Claude or Codex ACPX runtime" checks that a same-release session resumes, and that a session saved with Agent SDK 0.3.286 or Codex 0.160.0 starts fresh in the same workspace. ## Risks - Medium. Every Paperclip Runner Claude and Codex run uses the new executables. The digests, generated profiles, image probes, and window must agree. They agree locally, and CI runs the Rust and runner suites again. - Claude Code 2.1.287 through 2.1.328 change some headless defaults. I checked each one against Paperclip: - 2.1.302: `-p` and Agent SDK sessions with no permission mode start in `default` mode on third-party providers. Paperclip always sets a mode (`bypassPermissions` or `default`), so this does not apply. - 2.1.299: MCP allow rules now match only the whole server name. Paperclip already writes `mcp__<server>__*` and exact `mcp__paperclip__<tool>` rules. - 2.1.302: fork subagents are on by default in `-p` and the Agent SDK, as in the terminal. This pull request keeps the upstream default and does not set `CLAUDE_CODE_FORK_SUBAGENT=0`. Reviewers can ask to keep them off. - 2.1.299 and later: stdio MCP connections negotiate MCP protocol 2026-07-28 first and fall back to the older protocol for servers that do not answer. - Agent SDK 0.3.328 is less than one day old. If a regression appears, revert this pull request to return to 0.3.286 and Codex 0.160.0. - Sandbox images built before this change still carry Codex 0.160.0 and Claude Code 2.1.286. They stay accepted. On those images, Fable 5.2 and GPT-6.2 keep the existing named errors and fallbacks until a new image is promoted. - Until the refresh bot updates `pnpm-lock.yaml` on `master`, a local `--frozen-lockfile` install fails, as with the previous pin refreshes. > For core feature work, check [`ROADMAP.md`](ROADMAP.md) first and discuss it in `#dev` before opening the PR. Feature PRs that overlap with planned core work may need to be redirected — check the roadmap first. See `CONTRIBUTING.md`. ## Model Used - Anthropic Claude, model ID `claude-opus-5-5`, through Claude Code with tool use (shell, file edit, `gh`) and code execution. The context window and reasoning mode are not reported in this session. - The registry archives, digests, release notes, configuration schemas, and changelog were read directly. No model output was used as a source for those facts. ## Checklist - [x] I have included a thinking path that traces from project context to this change - [x] I have specified the model used (with version and capability details) - [x] I have checked ROADMAP.md and confirmed this PR does not duplicate planned core work - [x] I have searched GitHub for duplicate or related PRs and linked them above - [x] I have either (a) linked existing issues with `Fixes: #` / `Closes #` / `Refs #` OR (b) described the issue in-PR following the relevant issue template - [x] I have not referenced internal/instance-local Paperclip issues or links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip` URLs) - [x] My branch name describes the change (e.g. `docs/...`, `fix/...`) and contains no internal Paperclip ticket id or instance-derived details - [ ] I have run tests locally and they pass - [x] I have added or updated tests where applicable - [x] I have updated relevant documentation to reflect my changes - [x] I have considered and documented any risks above - [ ] All Paperclip CI gates are green - [ ] Greptile is 5/5 with no open P2s, recommendations, or follow-ups - [x] I will address all Greptile and reviewer comments before requesting merge 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: devinfoley <139239+devinfoley@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
43 files changed
+307
-171
No files matched your search
@@ -97,7 +97,7 @@ try {
|
||||
runnerEnvironment: { ...process.env, CODEX_HOME: codexHome }, useRunnerd: true, onLog,
|
||||
runnerExecutionTarget: remote?.target, runnerIngressAuthorized: Boolean(remote),
|
||||
runnerRemoteBinaryPath: remote ? process.env.PAPERCLIP_LIVE_LINUX_RUNNER : undefined,
|
||||
runnerRemoteCodexNpmSpec: remote ? "@openai/codex@0.160.0" : undefined,
|
||||
runnerRemoteCodexNpmSpec: remote ? "@openai/codex@0.170.0" : undefined,
|
||||
managedAiCredentialHome: codexHome,
|
||||
}).catch((error) => { throw new Error(redactSensitiveText(log.slice(-3000)), { cause: error }); });
|
||||
}
|
||||
|
||||
@@ -408,7 +408,7 @@ 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.160.0")}; fi`;
|
||||
const expectedRunnerCodexInstall = `if ! command -v 'codex' >/dev/null 2>&1; then ${buildSandboxNpmInstallCommand("@openai/codex@0.170.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({
|
||||
|
||||
@@ -56,7 +56,7 @@ try {
|
||||
let retrieved = "";
|
||||
const started = Date.now();
|
||||
bundle = createRunnerdCodexTransport({
|
||||
codexCommand: process.env.PAPERCLIP_LIVE_CODEX_COMMAND ?? fileURLToPath(new URL("../../../../node_modules/.pnpm/@openai+codex@0.160.0/node_modules/@openai/codex/bin/codex.js", import.meta.url)),
|
||||
codexCommand: process.env.PAPERCLIP_LIVE_CODEX_COMMAND ?? fileURLToPath(new URL("../../../../node_modules/.pnpm/@openai+codex@0.170.0/node_modules/@openai/codex/bin/codex.js", import.meta.url)),
|
||||
sourceCodexHome: codexHome, environment: { ...process.env, CODEX_HOME: codexHome },
|
||||
disableCodexProjectInstructions: true,
|
||||
stateDirectory: join(root, "runner"),
|
||||
|
||||
@@ -642,7 +642,7 @@ const paperclipRunnerAdapter: ServerAdapterModule = {
|
||||
"opencode",
|
||||
`opencode-ai@${QUALIFIED_OPENCODE_RUNNER_VERSION}`,
|
||||
)
|
||||
: buildNpmRuntimeCommandSpec(config, "codex", "@openai/codex@0.160.0"),
|
||||
: buildNpmRuntimeCommandSpec(config, "codex", "@openai/codex@0.170.0"),
|
||||
agentConfigurationDoc:
|
||||
"# Paperclip Runner\n\nAdapter: paperclip_runner\n\nRuns Codex, OpenCode, Claude Managed, AWS AgentCore, or ACPX Claude/Grok Build/Cursor/Pi through the Rust Paperclip runner and authenticated PRP transport. Pi accepts an explicit provider/model ID and uses the company credentials bound to the agent environment. GitHub Copilot requires a saved GitHub token and an explicitly selected available model. Managed providers use company-scoped qualified profiles, explicit retention acknowledgement, and spend limits. A board operator creates each Claude Managed (Anthropic managed agent) profile through POST /api/companies/{companyId}/managed-agent-profiles; agent credentials cannot create, qualify or list one.\n",
|
||||
getConfigSchema: () => ({
|
||||
|
||||
@@ -88,32 +88,50 @@ describe("host ACPX qualification admission", () => {
|
||||
expect(resolvePaperclipRunnerNativeProviderInput({ backend: "acpx_runtime", adapterConfig }))
|
||||
.toMatchObject({ acpxAgent, model: "explicit-new-model" });
|
||||
});
|
||||
it("names the Claude Code gap when the bundled SDK predates the model's minimum", () => {
|
||||
expect(QUALIFIED_ACPX_PROFILES.claude.agentRuntimeVersion).toBe("0.3.286");
|
||||
for (const model of ["claude-fable-5-2", "claude-fable-5-2[1m]"]) {
|
||||
expect(() => resolvePaperclipRunnerProviderProfile({ provider: "acpx", acpxAgent: "claude", model }))
|
||||
.toThrow(expect.objectContaining({
|
||||
code: "paperclip_runner_claude_cli_version_incompatible",
|
||||
message: expect.stringContaining("requires Claude Code 2.1.321 or newer; this Paperclip Runner bundles Claude Code 2.1.286"),
|
||||
}));
|
||||
}
|
||||
for (const model of ["claude-opus-5-5", "claude-sonnet-5-5", "claude-fable-5-1"]) {
|
||||
it("admits Fable 5.2 because the bundled Agent SDK ships Claude Code 2.1.328", () => {
|
||||
expect(QUALIFIED_ACPX_PROFILES.claude.agentRuntimeVersion).toBe("0.3.328");
|
||||
for (const model of ["claude-fable-5-2", "claude-fable-5-2[1m]", "claude-opus-5-5", "claude-sonnet-5-5", "claude-fable-5-1"]) {
|
||||
expect(resolvePaperclipRunnerProviderProfile({ provider: "acpx", acpxAgent: "claude", model }))
|
||||
.toMatchObject({ acpxAgent: "claude", model });
|
||||
}
|
||||
});
|
||||
it("names the Codex gap when the qualified ACPX runtime predates the model's minimum", () => {
|
||||
expect(QUALIFIED_ACPX_PROFILES.codex.agentRuntimeVersion).toBe("0.160.0");
|
||||
for (const model of ["gpt-6.2-sol", "gpt-6.2-astra"]) {
|
||||
expect(() => resolvePaperclipRunnerProviderProfile({ provider: "acpx", acpxAgent: "codex", model }))
|
||||
it("admits GPT-6.2 because the qualified ACPX runtime is Codex 0.170.0", () => {
|
||||
expect(QUALIFIED_ACPX_PROFILES.codex.agentRuntimeVersion).toBe("0.170.0");
|
||||
for (const model of ["gpt-6.2-sol", "gpt-6.2-astra", "gpt-6.1-sol", "gpt-6-astra"]) {
|
||||
expect(resolvePaperclipRunnerProviderProfile({ provider: "acpx", acpxAgent: "codex", model }))
|
||||
.toMatchObject({ acpxAgent: "codex", model });
|
||||
}
|
||||
});
|
||||
it("names the CLI gap when a bundled runtime predates the model's minimum", async () => {
|
||||
vi.resetModules();
|
||||
vi.doMock("../../vendor/paperclip-runner/index.js", async (importOriginal) => {
|
||||
const original = await importOriginal<typeof import("../../vendor/paperclip-runner/index.js")>();
|
||||
const olderRuntime = { claude: "0.3.286", codex: "0.160.0" } as Record<string, string>;
|
||||
return {
|
||||
...original,
|
||||
resolveQualifiedAcpxProfile: (agent: string, model: string) => {
|
||||
const profile = original.resolveQualifiedAcpxProfile(agent as never, model);
|
||||
return olderRuntime[agent] ? { ...profile, agentRuntimeVersion: olderRuntime[agent] } : profile;
|
||||
},
|
||||
};
|
||||
});
|
||||
try {
|
||||
const { resolvePaperclipRunnerProviderProfile: resolveWithOlderRuntime } = await import("./provider-profile.js");
|
||||
expect(() => resolveWithOlderRuntime({ provider: "acpx", acpxAgent: "claude", model: "claude-fable-5-2" }))
|
||||
.toThrow(expect.objectContaining({
|
||||
code: "paperclip_runner_claude_cli_version_incompatible",
|
||||
message: expect.stringContaining("requires Claude Code 2.1.321 or newer; this Paperclip Runner bundles Claude Code 2.1.286"),
|
||||
}));
|
||||
expect(() => resolveWithOlderRuntime({ provider: "acpx", acpxAgent: "codex", model: "gpt-6.2-sol" }))
|
||||
.toThrow(expect.objectContaining({
|
||||
code: "paperclip_runner_codex_cli_version_incompatible",
|
||||
message: expect.stringContaining("requires Codex 0.169.1 or newer; this Paperclip Runner bundles Codex 0.160.0"),
|
||||
}));
|
||||
}
|
||||
for (const model of ["gpt-6.1-sol", "gpt-6-astra"]) {
|
||||
expect(resolvePaperclipRunnerProviderProfile({ provider: "acpx", acpxAgent: "codex", model }))
|
||||
.toMatchObject({ acpxAgent: "codex", model });
|
||||
expect(resolveWithOlderRuntime({ provider: "acpx", acpxAgent: "codex", model: "gpt-6.1-sol" }))
|
||||
.toMatchObject({ acpxAgent: "codex", model: "gpt-6.1-sol" });
|
||||
} finally {
|
||||
vi.doUnmock("../../vendor/paperclip-runner/index.js");
|
||||
vi.resetModules();
|
||||
}
|
||||
});
|
||||
it("requires an explicit Codex ACP selection", () => {
|
||||
|
||||
@@ -24,17 +24,22 @@ describe("bounded Codex model fallback", () => {
|
||||
expect(unavailable.mock.calls).toEqual([["gpt-6-sol"], ["gpt-5.6-sol"]]);
|
||||
});
|
||||
|
||||
it("moves GPT-6.2 to the newest same-class model the pinned 0.160.0 CLI accepts", () => {
|
||||
it("moves GPT-6.2 to the newest same-class model an older 0.160.0 CLI accepts", () => {
|
||||
expect(codexModelFallbackCandidates("gpt-6.2-sol")).toEqual(["gpt-6.1-sol", "gpt-6-sol", "gpt-5.6-sol"]);
|
||||
expect(codexModelFallbackCandidates("gpt-6.2-astra")).toEqual(["gpt-6-astra", "gpt-5.6-sol"]);
|
||||
expect(compatibleCodexModel("gpt-6.2-sol", "0.160.0")).toBe("gpt-6.1-sol");
|
||||
expect(compatibleCodexModel("gpt-6.2-astra", "0.160.0")).toBe("gpt-6-astra");
|
||||
});
|
||||
|
||||
it("keeps GPT-6.2 on the pinned 0.170.0 CLI", () => {
|
||||
expect(compatibleCodexModel("gpt-6.2-sol", "0.170.0")).toBe("gpt-6.2-sol");
|
||||
expect(compatibleCodexModel("gpt-6.2-astra", "0.170.0")).toBe("gpt-6.2-astra");
|
||||
});
|
||||
|
||||
it.each([
|
||||
["gpt-6.1-sol", "0.159.0"], ["gpt-6-sol", "0.157.0"], ["gpt-5.6-sol", "0.156.0"],
|
||||
["team-model", "0.156.0"], [null, "0.156.0"], ["gpt-6.1-sol", null],
|
||||
["gpt-6.1-sol", "0.148.9"], ["gpt-6.1-sol", "0.161.0"], ["gpt-6.1-sol", "0.160.0-alpha.1"],
|
||||
["gpt-6.1-sol", "0.148.9"], ["gpt-6.1-sol", "0.171.0"], ["gpt-6.1-sol", "0.160.0-alpha.1"],
|
||||
])("preserves %s on %s when no safe startup substitution applies", (model, version) => {
|
||||
expect(compatibleCodexModel(model, version)).toBe(model);
|
||||
});
|
||||
@@ -86,7 +91,7 @@ describe("remote model compatibility preflight", () => {
|
||||
});
|
||||
|
||||
it.each([
|
||||
["codex-cli 0.148.9", {}], ["codex-cli 0.161.0", {}], ["codex-cli 0.160.0-alpha.1", {}],
|
||||
["codex-cli 0.148.9", {}], ["codex-cli 0.171.0", {}], ["codex-cli 0.160.0-alpha.1", {}],
|
||||
["codex-cli 0.156.0\ncodex-cli 0.160.0", {}], ["codex-cli 0.156.0", { timedOut: true }],
|
||||
["codex-cli 0.156.0", { exitCode: 1 }],
|
||||
])("keeps the launch verifier authoritative for invalid probes: %s %j", async (stdout, overrides) => {
|
||||
|
||||
@@ -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", "0.157.0", "0.158.0", "0.159.3", "0.160.0", "0.160.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", "0.161.0", "0.165.0", "0.169.1", "0.170.0", "0.170.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.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", ""])(
|
||||
it.each(["0.148.99", "0.100.0", "0.171.0", "0.172.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);
|
||||
},
|
||||
|
||||
@@ -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.161.0";
|
||||
export const REMOTE_CODEX_MAXIMUM_VERSION_EXCLUSIVE = "0.171.0";
|
||||
export const REMOTE_CODEX_SUPPORTED_RANGE =
|
||||
`>=${REMOTE_CODEX_MINIMUM_VERSION} <${REMOTE_CODEX_MAXIMUM_VERSION_EXCLUSIVE}`;
|
||||
|
||||
|
||||
@@ -3521,7 +3521,7 @@ describe("remote provider pack manifest", () => {
|
||||
const payload = {
|
||||
pins: {
|
||||
nodeMinimum: "24.11.0",
|
||||
codex: "0.160.0",
|
||||
codex: "0.170.0",
|
||||
opencode: "1.18.34",
|
||||
acpx: "0.22.0",
|
||||
claudeAcp: "0.73.0",
|
||||
@@ -5356,7 +5356,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.160.0\n");
|
||||
await writeFile(join(installation, "version.txt"), "codex-cli 0.170.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);
|
||||
@@ -5369,7 +5369,7 @@ describe("remote preinstalled executable discovery", () => {
|
||||
execFileSync(target, ["--version", "argument with 'quotes'"], {
|
||||
encoding: "utf8",
|
||||
}),
|
||||
).toBe("codex-cli 0.160.0\n--version\nargument with 'quotes'\n");
|
||||
).toBe("codex-cli 0.170.0\n--version\nargument with 'quotes'\n");
|
||||
expect(await readFile(source, "utf8")).toBe(shim);
|
||||
}
|
||||
expect(await readdir(join(root, "workspace", "bin"))).toEqual(["codex"]);
|
||||
@@ -18623,7 +18623,7 @@ describe("runnerd provider runtime wiring", () => {
|
||||
schema: "paperclip-runner/runnerd-build-metadata/v1", binaryName: "paperclip-runnerd",
|
||||
packageName: "@paperclipai/paperclip-runner", binaryContractVersion: 2,
|
||||
durableSessionCapabilities: ["unlimited_runtime", "connection_lease_renewal"], prpTransportModes: ["listen_ws"],
|
||||
}) : request.args[0] === "--version" ? "codex-cli 0.160.0"
|
||||
}) : request.args[0] === "--version" ? "codex-cli 0.170.0"
|
||||
: script.includes("base64") && script.includes("runner-state.json") ? Buffer.from(JSON.stringify(runnerState)).toString("base64")
|
||||
: script.includes("base64") ? Buffer.from(JSON.stringify(providerState)).toString("base64")
|
||||
: script.includes("cat --") ? `nonce\n123\n2026-09-19T10:00:00.000Z\n${identity.runnerInstanceId}\nlinux:abcd-1234:100\n` : "";
|
||||
@@ -18937,7 +18937,7 @@ describe("runnerd provider runtime wiring", () => {
|
||||
schema: "paperclip-runner/runnerd-build-metadata/v1", binaryName: "paperclip-runnerd",
|
||||
packageName: "@paperclipai/paperclip-runner", binaryContractVersion: 2,
|
||||
durableSessionCapabilities: ["unlimited_runtime", "connection_lease_renewal"], prpTransportModes: ["listen_ws"],
|
||||
}) : request.args[0] === "--version" ? "codex-cli 0.160.0" : script.includes("base64")
|
||||
}) : request.args[0] === "--version" ? "codex-cli 0.170.0" : script.includes("base64")
|
||||
? Buffer.from(JSON.stringify({ ...identity, lifecycle: "turn_active", outbox: [{ id: 2205 }], pendingTerminalDelivery: null,
|
||||
nextSourceSeq: mode === "progressing" ? 2345 : 2205, ackedSourceSeq: 2204, lastControllerCommandSeq: 61 })).toString("base64")
|
||||
: script.includes("cat --") ? `nonce\n1806\n2026-11-13T08:30:36.187Z\n${identity.runnerInstanceId}\nlinux:abcd-1234:100\n` : "" };
|
||||
@@ -19030,7 +19030,7 @@ describe("runnerd provider runtime wiring", () => {
|
||||
schema: "paperclip-runner/runnerd-build-metadata/v1", binaryName: "paperclip-runnerd",
|
||||
packageName: "@paperclipai/paperclip-runner", binaryContractVersion: 2,
|
||||
durableSessionCapabilities: ["unlimited_runtime", "connection_lease_renewal"], prpTransportModes: ["listen_ws"],
|
||||
}) : request.args[0] === "--version" ? "codex-cli 0.160.0" : request.args[1]?.includes("base64")
|
||||
}) : request.args[0] === "--version" ? "codex-cli 0.170.0" : request.args[1]?.includes("base64")
|
||||
? Buffer.from(JSON.stringify({ ...identity, lifecycle: "ready", outbox: [], pendingTerminalDelivery: null })).toString("base64")
|
||||
: request.args[1]?.includes("cat --") ? `nonce\n123\n2026-09-19T10:00:00.000Z\n${identity.runnerInstanceId}\nlinux:abcd-1234:100\n` : "" }));
|
||||
const revalidate = vi.fn(async () => undefined);
|
||||
@@ -19949,7 +19949,7 @@ describe("runnerd provider runtime wiring", () => {
|
||||
packageName: "@paperclipai/paperclip-runner", binaryContractVersion: 2,
|
||||
durableSessionCapabilities: ["unlimited_runtime", "connection_lease_renewal"], prpTransportModes: ["listen_ws"],
|
||||
}) };
|
||||
if (command.args?.[0] === "--version") return { exitCode: 0, timedOut: false, stdout: "codex-cli 0.160.0", stderr: "" };
|
||||
if (command.args?.[0] === "--version") return { exitCode: 0, timedOut: false, stdout: "codex-cli 0.170.0", stderr: "" };
|
||||
// The archive script and the harness inspection run for real against
|
||||
// the local directory that stands in for the sandbox filesystem.
|
||||
if (command.args?.[1]?.includes("base64")) {
|
||||
@@ -20044,7 +20044,7 @@ describe("runnerd provider runtime wiring", () => {
|
||||
packageName: "@paperclipai/paperclip-runner", binaryContractVersion: 2,
|
||||
durableSessionCapabilities: ["unlimited_runtime", "connection_lease_renewal"], prpTransportModes: ["listen_ws"],
|
||||
}) };
|
||||
if (command.args?.[0] === "--version") return { exitCode: 0, timedOut: false, stdout: "codex-cli 0.160.0", stderr: "" };
|
||||
if (command.args?.[0] === "--version") return { exitCode: 0, timedOut: false, stdout: "codex-cli 0.170.0", stderr: "" };
|
||||
if (command.args?.[1]?.includes("base64")) {
|
||||
try { return { exitCode: 0, timedOut: false, stdout: execFileSync("sh", command.args, { encoding: "utf8" }), stderr: "" }; }
|
||||
catch { return { exitCode: 1, timedOut: false, stdout: "", stderr: "" }; }
|
||||
@@ -22391,7 +22391,7 @@ describe("runnerd provider runtime wiring", () => {
|
||||
command.args?.[0] === "--build-metadata" ? JSON.stringify({
|
||||
schema: "paperclip-runner/runnerd-build-metadata/v1", binaryName: "paperclip-runnerd", packageName: "@paperclipai/paperclip-runner",
|
||||
binaryContractVersion: 2, durableSessionCapabilities: ["unlimited_runtime", "connection_lease_renewal"], prpTransportModes: ["listen_ws"],
|
||||
}) : command.args?.[0] === "--version" ? "codex-cli 0.160.0" : "" };
|
||||
}) : command.args?.[0] === "--version" ? "codex-cli 0.170.0" : "" };
|
||||
});
|
||||
const controllerArtifact = join(isolatedStateDirectory, "backup-fixture-runnerd");
|
||||
await writeFile(controllerArtifact, "fixture bootstrap artifact");
|
||||
@@ -22449,7 +22449,7 @@ describe("runnerd provider runtime wiring", () => {
|
||||
command.args?.[0] === "--build-metadata" ? JSON.stringify({
|
||||
schema: "paperclip-runner/runnerd-build-metadata/v1", binaryName: "paperclip-runnerd", packageName: "@paperclipai/paperclip-runner",
|
||||
binaryContractVersion: 2, durableSessionCapabilities: ["unlimited_runtime", "connection_lease_renewal"], prpTransportModes: ["listen_ws"],
|
||||
}) : command.args?.[0] === "--version" ? "codex-cli 0.160.0" : "" };
|
||||
}) : command.args?.[0] === "--version" ? "codex-cli 0.170.0" : "" };
|
||||
});
|
||||
const controllerArtifact = join(isolatedStateDirectory, "backup-fixture-runnerd");
|
||||
await writeFile(controllerArtifact, "fixture bootstrap artifact");
|
||||
@@ -22521,7 +22521,7 @@ describe("runnerd provider runtime wiring", () => {
|
||||
packageName: "@paperclipai/paperclip-runner", binaryContractVersion: 2,
|
||||
durableSessionCapabilities: ["unlimited_runtime", "connection_lease_renewal"], prpTransportModes: ["listen_ws"],
|
||||
}) };
|
||||
if (command.args?.[0] === "--version") return { exitCode: 0, timedOut: false, stdout: "codex-cli 0.160.0", stderr: "" };
|
||||
if (command.args?.[0] === "--version") return { exitCode: 0, timedOut: false, stdout: "codex-cli 0.170.0", stderr: "" };
|
||||
if (command.args?.[1]?.includes("base64")) {
|
||||
try { return { exitCode: 0, timedOut: false, stdout: execFileSync("sh", command.args, { encoding: "utf8" }), stderr: "" }; }
|
||||
catch { return { exitCode: 1, timedOut: false, stdout: "", stderr: "" }; }
|
||||
@@ -22684,7 +22684,7 @@ describe("runnerd provider runtime wiring", () => {
|
||||
packageName: "@paperclipai/paperclip-runner", binaryContractVersion: 2,
|
||||
durableSessionCapabilities: ["unlimited_runtime", "connection_lease_renewal"], prpTransportModes: ["listen_ws"],
|
||||
}) };
|
||||
if (command.args?.[0] === "--version") return { exitCode: 0, timedOut: false, stdout: "codex-cli 0.160.0", stderr: "" };
|
||||
if (command.args?.[0] === "--version") return { exitCode: 0, timedOut: false, stdout: "codex-cli 0.170.0", stderr: "" };
|
||||
if (command.args?.[1]?.includes("base64")) {
|
||||
try { return { exitCode: 0, timedOut: false, stdout: execFileSync("sh", command.args, { encoding: "utf8" }), stderr: "" }; }
|
||||
catch { return { exitCode: 1, timedOut: false, stdout: "", stderr: "" }; }
|
||||
@@ -22762,7 +22762,7 @@ describe("runnerd provider runtime wiring", () => {
|
||||
}), stderr: "",
|
||||
};
|
||||
if (command.args?.[0] === "--version") return {
|
||||
exitCode: 0, timedOut: false, stdout: "codex-cli 0.160.0", stderr: "",
|
||||
exitCode: 0, timedOut: false, stdout: "codex-cli 0.170.0", stderr: "",
|
||||
};
|
||||
if (command.args?.[1]?.includes("base64")) return {
|
||||
exitCode: 1, timedOut: false, stdout: "", stderr: "",
|
||||
@@ -22889,7 +22889,7 @@ describe("runnerd provider runtime wiring", () => {
|
||||
}), stderr: "",
|
||||
};
|
||||
if (command.args?.[0] === "--version") return {
|
||||
exitCode: 0, timedOut: false, stdout: "codex-cli 0.160.0", stderr: "",
|
||||
exitCode: 0, timedOut: false, stdout: "codex-cli 0.170.0", stderr: "",
|
||||
};
|
||||
if (command.args?.includes("paperclip-remote-home")) return {
|
||||
exitCode: 0, timedOut: false, stdout: "/home/executor\n", stderr: "",
|
||||
@@ -23155,7 +23155,7 @@ describe("runnerd provider runtime wiring", () => {
|
||||
}), stderr: "",
|
||||
};
|
||||
if (command.args?.[0] === "--version") return {
|
||||
exitCode: 0, timedOut: false, stdout: "codex-cli 0.160.0", stderr: "",
|
||||
exitCode: 0, timedOut: false, stdout: "codex-cli 0.170.0", stderr: "",
|
||||
};
|
||||
if (command.args?.[1]?.includes("base64")) return {
|
||||
exitCode: 1, timedOut: false, stdout: "", stderr: "",
|
||||
@@ -23255,10 +23255,10 @@ describe("runnerd provider runtime wiring", () => {
|
||||
|
||||
it.each([
|
||||
...["current", "preinstalled-exact", "preinstalled-mismatch", "preinstalled-error", "preinstalled-timeout", "preinstalled-explicit", "preinstalled-explicit-mismatch", "preinstalled-explicit-discover-fails", "stale", "missing", "retained", "retained-mismatch", "retained-error", "retained-timeout", "retained-explicit"]
|
||||
.map((image) => ({ image, version: "0.160.0" })),
|
||||
.map((image) => ({ image, version: "0.170.0" })),
|
||||
...["0.149.0", "0.149.1", "0.153.4", "0.156.0", "0.160.1"]
|
||||
.map((version) => ({ image: "current", version })),
|
||||
...["0.148.9", "0.161.0", "1.0.0", "0.160.0-alpha.1", "unknown"]
|
||||
...["0.148.9", "0.171.0", "1.0.0", "0.160.0-alpha.1", "unknown"]
|
||||
.map((version) => ({ image: "current", version })),
|
||||
])("uses shared Codex and the server-owned replacement artifact (image=$image, Codex=$version)", async ({ image, version }) => {
|
||||
const retained = image.startsWith("retained");
|
||||
@@ -23353,7 +23353,7 @@ describe("runnerd provider runtime wiring", () => {
|
||||
await expect(transport.controlPlaneRegistration({})).rejects.toThrow(
|
||||
"reached-preinstalled-codex-verification",
|
||||
);
|
||||
if (version !== "0.160.0") {
|
||||
if (version !== "0.170.0") {
|
||||
expect(onLog).toHaveBeenCalledWith("stderr", expect.stringContaining(`using installed Codex ${version === "unknown" || version.includes("alpha") ? "unrecognized version" : version}`));
|
||||
}
|
||||
if (needsReplacement) {
|
||||
|
||||
@@ -314,6 +314,60 @@ describe("a source whose saved provider session the runner proved incompatible",
|
||||
});
|
||||
});
|
||||
|
||||
describe("a session saved by the previous Claude or Codex ACPX runtime", () => {
|
||||
// The previous release bundled Agent SDK 0.3.286 and Codex 0.160.0 behind the
|
||||
// same bridge command digests. The saved provider records that runtime, so the
|
||||
// next run after the upgrade starts a fresh provider session in the same
|
||||
// workspace instead of resuming a conversation the new runtime cannot restore.
|
||||
const acpxExecution = (runId: string, acpxAgent: "claude" | "codex", model: string) =>
|
||||
buildNativeExecutionInput({
|
||||
companyId,
|
||||
runId,
|
||||
issue: { id: issueId, identifier: "DOT-2", title: "Test", description: null, workMode: "standard" },
|
||||
taskPrompt: "Only the current turn",
|
||||
agentId,
|
||||
workspace: { id: runId, cwd: "/workspace", repoUrl: null, repoRef: null, branchName: null },
|
||||
normalizedSessionId,
|
||||
provider: "acpx",
|
||||
acpxAgent,
|
||||
model,
|
||||
acpxPermissionMode: "approve-all",
|
||||
completionContract: execution(runId).completionContract,
|
||||
runtimeContext: nativeRuntimeContextFixture(),
|
||||
});
|
||||
const sourceWith = (nativeExecutionInput: ReturnType<typeof acpxExecution>) => {
|
||||
const source = previousRun();
|
||||
return { ...source, runnerProfileJson: { ...source.runnerProfileJson, nativeExecutionInput } };
|
||||
};
|
||||
|
||||
it.each([
|
||||
["claude", "claude-opus-5-5", "0.3.286"],
|
||||
["codex", "gpt-6.1-sol", "0.160.0"],
|
||||
] as const)("starts a fresh %s provider session in the same workspace", (acpxAgent, model, priorRuntime) => {
|
||||
const current = acpxExecution(currentRunId, acpxAgent, model);
|
||||
const sameRelease = sourceWith(acpxExecution(previousRunId, acpxAgent, model));
|
||||
expect(rebindNativeSessionCheckpoint({ previousRun: sameRelease, currentExecution: current })).not.toBeNull();
|
||||
|
||||
const saved = acpxExecution(previousRunId, acpxAgent, model);
|
||||
const profile = (saved.provider as { profile: { agentRuntimeVersion: string | null } }).profile;
|
||||
expect(profile.agentRuntimeVersion).not.toBe(priorRuntime);
|
||||
profile.agentRuntimeVersion = priorRuntime;
|
||||
const source = sourceWith(saved);
|
||||
expect(rebindNativeSessionCheckpoint({ previousRun: source, currentExecution: current })).toBeNull();
|
||||
|
||||
const buildExecution = vi.fn(({ normalizedSessionId: sessionId, resumedSession }) => {
|
||||
const built = acpxExecution(currentRunId, acpxAgent, model);
|
||||
built.session.normalizedSessionId = sessionId;
|
||||
built.task.prompt = resumedSession ? "wake delta" : "original goal and complete handoff";
|
||||
return built;
|
||||
});
|
||||
const result = buildNativeExecutionWithCheckpoint({ previousRun: source, normalizedSessionId, buildExecution });
|
||||
expect(result.checkpoint).toBeNull();
|
||||
expect(result.execution.task.prompt).toContain("complete handoff");
|
||||
expect(result.execution.workspace).toEqual(current.workspace);
|
||||
});
|
||||
});
|
||||
|
||||
describe("a source whose provider state was not saved after its result was accepted", () => {
|
||||
const unsaved = { [NATIVE_PROVIDER_STATE_UNSAVED_KEY]: { code: NATIVE_PROVIDER_STATE_INCOMPATIBLE,
|
||||
reason: "harness_backup_not_saved", recordedAt: "2026-11-11T00:00:00.000Z" } };
|
||||
|
||||
Reference in new issue
Block a user