mirror of
https://github.com/nexu-io/open-design.git
synced 2026-06-01 03:14:35 +07:00
fix: expand Codex picker coverage (#757)
* fix: add newer Codex model choices * fix: expand Codex picker coverage --------- Co-authored-by: leprincep35700 <leprincep35700@users.noreply.github.com>
This commit is contained in:
parent
09eb88f683
commit
bef8203ad9
2 changed files with 64 additions and 0 deletions
|
|
@ -213,6 +213,10 @@ export const AGENT_DEFS = [
|
|||
// as a hint. Users can supply other ids via the custom-model input.
|
||||
fallbackModels: [
|
||||
DEFAULT_MODEL_OPTION,
|
||||
{ id: 'gpt-5.5', label: 'gpt-5.5' },
|
||||
{ id: 'gpt-5.4', label: 'gpt-5.4' },
|
||||
{ id: 'gpt-5.4-mini', label: 'gpt-5.4-mini' },
|
||||
{ id: 'gpt-5.3-codex', label: 'gpt-5.3-codex' },
|
||||
{ id: 'gpt-5-codex', label: 'gpt-5-codex' },
|
||||
{ id: 'gpt-5', label: 'gpt-5' },
|
||||
{ id: 'o3', label: 'o3' },
|
||||
|
|
@ -220,10 +224,12 @@ export const AGENT_DEFS = [
|
|||
],
|
||||
reasoningOptions: [
|
||||
{ id: 'default', label: 'Default' },
|
||||
{ id: 'none', label: 'None' },
|
||||
{ id: 'minimal', label: 'Minimal' },
|
||||
{ id: 'low', label: 'Low' },
|
||||
{ id: 'medium', label: 'Medium' },
|
||||
{ id: 'high', label: 'High' },
|
||||
{ id: 'xhigh', label: 'XHigh' },
|
||||
],
|
||||
// Prompt is delivered via stdin pipe (gated by `promptViaStdin: true`
|
||||
// below) to avoid Windows `spawn ENAMETOOLONG` while keeping Codex on
|
||||
|
|
|
|||
|
|
@ -138,6 +138,64 @@ test('codex args keep plugins enabled when OD_CODEX_DISABLE_PLUGINS is not 1', (
|
|||
assert.equal(args.includes('plugins'), false);
|
||||
});
|
||||
|
||||
test('codex model picker includes current OpenAI choices in priority order', async () => {
|
||||
const expectedModels = [
|
||||
'default',
|
||||
'gpt-5.5',
|
||||
'gpt-5.4',
|
||||
'gpt-5.4-mini',
|
||||
'gpt-5.3-codex',
|
||||
'gpt-5-codex',
|
||||
'gpt-5',
|
||||
'o3',
|
||||
'o4-mini',
|
||||
];
|
||||
|
||||
assert.deepEqual(codex.fallbackModels.map((m) => m.id), expectedModels);
|
||||
assert.deepEqual(codex.reasoningOptions.map((o) => o.id), [
|
||||
'default',
|
||||
'none',
|
||||
'minimal',
|
||||
'low',
|
||||
'medium',
|
||||
'high',
|
||||
'xhigh',
|
||||
]);
|
||||
|
||||
const args = codex.buildArgs(
|
||||
'',
|
||||
[],
|
||||
[],
|
||||
{ model: 'gpt-5.5', reasoning: 'xhigh' },
|
||||
{ cwd: '/tmp/od-project' },
|
||||
);
|
||||
assert.ok(args.includes('--model'));
|
||||
assert.ok(args.includes('gpt-5.5'));
|
||||
assert.ok(args.includes('model_reasoning_effort="xhigh"'));
|
||||
|
||||
const dir = mkdtempSync(join(tmpdir(), 'od-agents-codex-models-'));
|
||||
try {
|
||||
const codexBin = join(dir, 'codex');
|
||||
writeFileSync(
|
||||
codexBin,
|
||||
'#!/bin/sh\nif [ "$1" = "--version" ]; then echo "codex 1.0.0"; exit 0; fi\nexit 0\n',
|
||||
);
|
||||
chmodSync(codexBin, 0o755);
|
||||
process.env.OD_AGENT_HOME = dir;
|
||||
process.env.PATH = dir;
|
||||
|
||||
const agents = await detectAgents();
|
||||
const detected = agents.find((agent) => agent.id === 'codex');
|
||||
|
||||
assert.ok(detected);
|
||||
assert.equal(detected.available, true);
|
||||
assert.equal(detected.version, 'codex 1.0.0');
|
||||
assert.deepEqual(detected.models.map((m) => m.id), expectedModels);
|
||||
} finally {
|
||||
rmSync(dir, { recursive: true, force: true });
|
||||
}
|
||||
});
|
||||
|
||||
// Recent Codex CLI versions reject a bare `-` argv sentinel; passing it
|
||||
// alongside the stdin pipe causes `error: unexpected argument '-' found`
|
||||
// and exit code 2 before any prompt is read. We deliver the prompt via
|
||||
|
|
|
|||
Loading…
Reference in a new issue