Files
PaperClipAI/docs
emme1t 32e80f80fe fix(codex-local): accept newer prerelease CLI versions (#18508)
## Thinking Path

> - Paperclip manages AI agents and checks their execution environment.
> - The Codex adapter checks the installed CLI against the selected
model's minimum version.
> - The parser rejects prerelease builds shipped with Codex Desktop,
including builds newer than that minimum.
> - This stops the hello probe and can leave an approved agent in
verification.
> - This change accepts valid prerelease versions and compares their
release numbers with the stable minimum.
> - A prerelease of the minimum release stays below the minimum.

## Linked Issues or Issue Description

Fixes: #18498

Refs #15399, which introduced the version check, and #15053, which
reports the original model compatibility problem. Related open #15534
adds model catalog discovery; this change addresses version parsing.

## What Changed

- Parse one stable or prerelease `codex-cli` version line. Keep
malformed and ambiguous output invalid.
- Accept `0.164.0-alpha.11.1` against `0.157.0`. Keep `0.157.0-alpha.1`
below `0.157.0`.
- Cover the parser, stable minimum comparison, CLI hello-probe
admission, and ACP environment check.
- Document this version rule in the Codex adapter guide. The change
stays in the adapter that owns this rule.

## Verification

Tested source commit `d8e2e2e` on Windows x64, Node 24.16.0 and pnpm
9.15.4, with isolated test homes.

- Seven affected assertions fail with the original production code and
pass with this change. The three affected test files report 58 passed
and one existing Windows path-separator failure. The same path failure
occurs on the original source.
- The real `checkCodexCliVersionForModel` launches the installed
`codex.exe --version`, which reports `0.165.0-alpha.1.2`. Checks for
`gpt-6-luna`, `gpt-6-sol`, and `gpt-6.1-sol` fail on the original source
and pass after this change. This probe makes no model request.
- `pnpm --filter @paperclipai/adapter-codex-local typecheck` passes. The
package build passes with Git Bash as the script shell.
- The complete Codex adapter suite reports 530 passed, 65 failed, and
one skipped. All 65 failure names also fail on the original production
source. That comparison reports 522 passed and 73 failed: seven failures
are this regression, and one independent auth-lock timing test changes
result between runs. Existing failures include Windows symlink
permissions, POSIX file modes/signals, and path expectations.
- Full workspace checks remain incomplete on this host. `pnpm -r
typecheck` stops at the unchanged Grok launcher digest check in the CRLF
checkout. `pnpm test:run` stops at `spawnSync pnpm ENOENT`. `pnpm build`
stops at the shared package's POSIX shell command under Windows cmd.
Initial install/preflight symlink errors were resolved for local
workspace links with directory junctions; those earlier failures remain
recorded.
- `git diff --check` passes. Greptile reports 5/5 on this commit, and
Codex code review completed with no findings. On November 20, GitHub
reported 55 passing checks and three skipped checks for this commit.

To run the focused tests:

```sh
pnpm exec vitest run --config packages/adapters/codex-local/vitest.config.ts packages/adapters/codex-local/src/index.test.ts packages/adapters/codex-local/src/server/test.remote.test.ts packages/adapters/codex-local/src/server/acp.cli-version.test.ts
```

The hello responses in the adapter tests use transport fixtures. Live
model execution, lifecycle completion, and native Runner qualification
were not exercised.

## Risks

The check now admits prereleases whose release numbers exceed a verified
stable floor. The hello probe still checks the selected model after
version admission. Equal-release prereleases, invalid versions, and
ambiguous output stay incompatible. The verified model floors are
unchanged.

## Model Used

OpenAI GPT-6 through Codex, with reasoning, tool use, and local code
execution. This session does not expose its exact deployment model ID or
context-window limit.

## 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
- [x] All Paperclip CI gates are green
- [x] Greptile is 5/5 with no open P2s, recommendations, or follow-ups
- [x] I will address all Greptile and reviewer comments before
requesting merge

With assistance from Astra.
2026-12-05 03:05:52 -08:00
..
…