mirror of
https://github.com/wu736139669/hapi.git
synced 2026-11-25 05:07:05 +00:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user