mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-10-26 18:31:34 +01:00
## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work. > - Codex local is the adapter subsystem that exposes OpenAI Codex CLI model choices to agents and issue overrides. > - OpenAI has GPT-5.6 Codex-capable models that should appear in Paperclip's built-in Codex model list and refresh behavior. > - Paperclip's server model listing falls back to the adapter metadata and merges OpenAI refresh results with known Codex defaults. > - This pull request updates the Codex default model metadata to include GPT-5.6 options and adds regression coverage for fallback and refresh paths. > - The benefit is that operators can select the new Codex models without relying on manual model IDs, and refresh behavior keeps known GPT-5.6 options visible. ## Linked Issues or Issue Description Refs #9322. Refs #9342. Refs #9346. ### Agent or provider Codex CLI (OpenAI). ### Why this adapter is useful OpenAI's GPT-5.6 Codex-capable models should be available in Paperclip's Codex adapter defaults and model refresh path. ### How the agent is invoked `codex` ## What Changed - Changed the `codex_local` default model metadata from `gpt-5.5` to `gpt-5.6`. - Added `gpt-5.6-sol`, `gpt-5.6-terra`, and `gpt-5.6-luna` to the built-in Codex adapter model list. - Updated adapter and server model-listing tests to cover GPT-5.6 fallback and refresh behavior. - Aligned Codex Fast mode support and helper text with the new `gpt-5.6` default, while preserving GPT-5.5, GPT-5.4, and manual model ID support. ## Verification - `git diff --check origin/master...HEAD` - `pnpm exec vitest run packages/adapters/codex-local/src/index.test.ts packages/adapters/codex-local/src/server/codex-args.test.ts server/src/__tests__/adapter-models.test.ts server/src/__tests__/adapter-model-refresh-routes.test.ts` - `pnpm check:token-gates` - `pnpm --filter @paperclipai/adapter-codex-local typecheck` - `pnpm --filter @paperclipai/server typecheck` - `pnpm --filter @paperclipai/ui typecheck` ## Risks Medium risk because changing `DEFAULT_CODEX_LOCAL_MODEL` from `gpt-5.5` to `gpt-5.6` changes the adapter's default model selection for new blank configurations. The model-list additions are otherwise low risk and covered by adapter/server metadata tests. This PR intentionally overlaps related PRs #9342 and #9346, so reviewers may prefer to close or fold it into one of those branches. > 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 OpenAI Codex coding agent based on GPT-5, with shell, git, GitHub CLI, and repository editing tool use. Exact served model ID and context window were not exposed by the runtime. ## Checklist - [x] I have included a thinking path that traces from project context to this change - [x] I have specified the model used (with version and capability details) - [x] I have checked ROADMAP.md and confirmed this PR does not duplicate planned core work - [x] I have searched GitHub for duplicate or related PRs and linked them above - [x] I have either (a) linked existing issues with `Fixes: #` / `Closes #` / `Refs #` OR (b) described the issue in-PR following the relevant issue template - [x] I have not referenced internal/instance-local Paperclip issues or links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip` URLs) - [x] My branch name describes the change (e.g. `docs/...`, `fix/...`) and contains no internal Paperclip ticket id or instance-derived details - [x] I have run tests locally and they pass - [x] I have added or updated tests where applicable - [x] I have updated relevant documentation to reflect my changes - [x] I have considered and documented any risks above - [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 --------- Co-authored-by: Paperclip <noreply@paperclip.ing>
147 lines
3.4 KiB
TypeScript
147 lines
3.4 KiB
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { buildCodexExecArgs } from "./codex-args.js";
|
|
|
|
describe("buildCodexExecArgs", () => {
|
|
it("enables Codex fast mode overrides for GPT-5.4", () => {
|
|
const result = buildCodexExecArgs({
|
|
model: "gpt-5.4",
|
|
search: true,
|
|
fastMode: true,
|
|
});
|
|
|
|
expect(result.fastModeRequested).toBe(true);
|
|
expect(result.fastModeApplied).toBe(true);
|
|
expect(result.fastModeIgnoredReason).toBeNull();
|
|
expect(result.args).toEqual([
|
|
"--search",
|
|
"exec",
|
|
"--json",
|
|
"--model",
|
|
"gpt-5.4",
|
|
"-c",
|
|
'service_tier="fast"',
|
|
"-c",
|
|
"features.fast_mode=true",
|
|
"-",
|
|
]);
|
|
});
|
|
|
|
it("enables Codex fast mode overrides for GPT-5.5", () => {
|
|
const result = buildCodexExecArgs({
|
|
model: "gpt-5.5",
|
|
fastMode: true,
|
|
});
|
|
|
|
expect(result.fastModeRequested).toBe(true);
|
|
expect(result.fastModeApplied).toBe(true);
|
|
expect(result.fastModeIgnoredReason).toBeNull();
|
|
expect(result.args).toEqual([
|
|
"exec",
|
|
"--json",
|
|
"--model",
|
|
"gpt-5.5",
|
|
"-c",
|
|
'service_tier="fast"',
|
|
"-c",
|
|
"features.fast_mode=true",
|
|
"-",
|
|
]);
|
|
});
|
|
|
|
it("enables Codex fast mode overrides for manual models", () => {
|
|
const result = buildCodexExecArgs({
|
|
model: "future-codex-model",
|
|
fastMode: true,
|
|
});
|
|
|
|
expect(result.fastModeRequested).toBe(true);
|
|
expect(result.fastModeApplied).toBe(true);
|
|
expect(result.fastModeIgnoredReason).toBeNull();
|
|
expect(result.args).toEqual([
|
|
"exec",
|
|
"--json",
|
|
"--model",
|
|
"future-codex-model",
|
|
"-c",
|
|
'service_tier="fast"',
|
|
"-c",
|
|
"features.fast_mode=true",
|
|
"-",
|
|
]);
|
|
});
|
|
|
|
it("enables Codex fast mode overrides when model is omitted (CLI default)", () => {
|
|
const result = buildCodexExecArgs({
|
|
fastMode: true,
|
|
});
|
|
|
|
expect(result.fastModeRequested).toBe(true);
|
|
expect(result.fastModeApplied).toBe(true);
|
|
expect(result.fastModeIgnoredReason).toBeNull();
|
|
expect(result.args).toEqual([
|
|
"exec",
|
|
"--json",
|
|
"-c",
|
|
'service_tier="fast"',
|
|
"-c",
|
|
"features.fast_mode=true",
|
|
"-",
|
|
]);
|
|
});
|
|
|
|
it("ignores fast mode for unsupported models", () => {
|
|
const result = buildCodexExecArgs({
|
|
model: "gpt-5.3-codex-spark",
|
|
fastMode: true,
|
|
});
|
|
|
|
expect(result.fastModeRequested).toBe(true);
|
|
expect(result.fastModeApplied).toBe(false);
|
|
expect(result.fastModeIgnoredReason).toContain(
|
|
"currently only supported on gpt-5.6, gpt-5.5, gpt-5.4 or manually configured model IDs",
|
|
);
|
|
expect(result.args).toEqual([
|
|
"exec",
|
|
"--json",
|
|
"--model",
|
|
"gpt-5.3-codex-spark",
|
|
"-",
|
|
]);
|
|
});
|
|
|
|
it("ignores fast mode for gpt-5.4-mini", () => {
|
|
const result = buildCodexExecArgs({
|
|
model: "gpt-5.4-mini",
|
|
fastMode: true,
|
|
});
|
|
|
|
expect(result.fastModeRequested).toBe(true);
|
|
expect(result.fastModeApplied).toBe(false);
|
|
expect(result.args).toEqual([
|
|
"exec",
|
|
"--json",
|
|
"--model",
|
|
"gpt-5.4-mini",
|
|
"-",
|
|
]);
|
|
});
|
|
|
|
it("adds --skip-git-repo-check when requested", () => {
|
|
const result = buildCodexExecArgs(
|
|
{
|
|
model: "gpt-5.5",
|
|
},
|
|
{ skipGitRepoCheck: true },
|
|
);
|
|
|
|
expect(result.args).toEqual([
|
|
"exec",
|
|
"--json",
|
|
"--skip-git-repo-check",
|
|
"--model",
|
|
"gpt-5.5",
|
|
"-",
|
|
]);
|
|
});
|
|
});
|