mirror of
https://github.com/Kaelio/ktx.git
synced 2026-06-25 08:48:08 +02:00
feat: add codex llm backend
This commit is contained in:
parent
21744fc520
commit
64b8a416fe
28 changed files with 1462 additions and 14 deletions
|
|
@ -44,6 +44,17 @@ function withClaudeCodeLlm(config: KtxProjectConfig): KtxProjectConfig {
|
|||
};
|
||||
}
|
||||
|
||||
function withCodexLlm(config: KtxProjectConfig): KtxProjectConfig {
|
||||
return {
|
||||
...config,
|
||||
llm: {
|
||||
...config.llm,
|
||||
provider: { backend: 'codex' },
|
||||
models: { ...config.llm.models, default: 'gpt-5.3-codex' },
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
function baseProjectConfig(): KtxProjectConfig {
|
||||
return withClaudeCodeLlm(buildDefaultKtxProjectConfig());
|
||||
}
|
||||
|
|
@ -391,6 +402,38 @@ describe('buildProjectStatus --fast', () => {
|
|||
});
|
||||
});
|
||||
|
||||
describe('buildProjectStatus codex', () => {
|
||||
it('reports authenticated local Codex session', async () => {
|
||||
const project = projectWithConfig(withCodexLlm(buildDefaultKtxProjectConfig()));
|
||||
const status = await buildProjectStatus(project, {
|
||||
codexAuthProbe: async () => ({ ok: true as const }),
|
||||
});
|
||||
|
||||
expect(status.llm).toMatchObject({
|
||||
backend: 'codex',
|
||||
model: 'gpt-5.3-codex',
|
||||
status: 'ok',
|
||||
detail: 'local Codex session authenticated',
|
||||
});
|
||||
});
|
||||
|
||||
it('skips Codex auth probe with --fast', async () => {
|
||||
let probeCalls = 0;
|
||||
const project = projectWithConfig(withCodexLlm(buildDefaultKtxProjectConfig()));
|
||||
const status = await buildProjectStatus(project, {
|
||||
fast: true,
|
||||
codexAuthProbe: async () => {
|
||||
probeCalls += 1;
|
||||
return { ok: true };
|
||||
},
|
||||
});
|
||||
|
||||
expect(probeCalls).toBe(0);
|
||||
expect(status.llm.status).toBe('skipped');
|
||||
expect(status.llm.detail).toMatch(/--fast/);
|
||||
});
|
||||
});
|
||||
|
||||
describe('buildLocalStatsStatus', () => {
|
||||
let tempDir: string;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue