feat(codex): support explicit local model catalog configuration (#2266)

* fix(codex): reuse local model catalogs by default

* fix(codex): verify catalog provenance and native schema before reuse

* fix(codex): keep refresh credentials out of discovery homes

* refactor(codex): reduce catalog support to explicit configuration

* fix(codex): invalidate selected catalogs and resolve shim names
This commit is contained in:
Jee
2026-11-04 15:08:54 +08:00
committed by GitHub
parent db7ace3dc3
commit e2b2af695b
11 changed files with 280 additions and 5 deletions
+7 -4
View File
@@ -5,6 +5,8 @@ import { logger } from '@/ui/logger';
import { JsonLineParser } from '@/utils/jsonLineParser';
import { killProcessByChildProcess } from '@/utils/process';
import { CODEX_WEBSOCKET_MAX_PAYLOAD } from './websocketLimits';
import { resolveModelCatalogArgs } from './utils/modelCatalog';
import { resolveSelectedCodexCommand } from './utils/codexExecutable';
import type {
CollaborationModeListResponse,
InitializeParams,
@@ -255,9 +257,10 @@ export class CodexAppServerClient extends JsonLineParser {
return;
}
const codexCommand = resolveCodexAppServerCommand();
logger.debug(`[CodexAppServer] Starting ${codexCommand} app-server`);
const child = spawn(codexCommand, ['app-server'], {
const codexCommand = resolveSelectedCodexCommand(resolveCodexAppServerCommand());
logger.debug(`[CodexAppServer] Starting ${codexCommand.command} app-server`);
const catalogArgs = resolveModelCatalogArgs();
const child = spawn(codexCommand.command, [...codexCommand.args, 'app-server', ...catalogArgs], {
cwd: this.options.cwd,
env: Object.keys(process.env).reduce((acc, key) => {
const value = process.env[key];
@@ -265,7 +268,7 @@ export class CodexAppServerClient extends JsonLineParser {
return acc;
}, {} as Record<string, string>),
stdio: ['pipe', 'pipe', 'pipe'],
shell: process.platform === 'win32',
shell: false,
windowsHide: process.platform === 'win32'
});
this.process = child;