feat(routing): support per-agent backend selection across native/external
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { describe, expect, it } from 'vitest';
|
||||
|
||||
import { configSchema } from '../config/schema.js';
|
||||
import { createConfiguredExternalBackend } from './index.js';
|
||||
import { createConfiguredExternalBackend, createConfiguredExternalBackends } from './index.js';
|
||||
|
||||
describe('createConfiguredExternalBackend', () => {
|
||||
const base = configSchema.parse({
|
||||
@@ -37,4 +37,19 @@ describe('createConfiguredExternalBackend', () => {
|
||||
const backend = createConfiguredExternalBackend(cfg);
|
||||
expect(backend?.name).toBe('gemini');
|
||||
});
|
||||
|
||||
it('returns all enabled external backends and the default priority selection', () => {
|
||||
const cfg = {
|
||||
...base,
|
||||
backends: {
|
||||
...base.backends,
|
||||
codex: { enabled: true, path: '/usr/bin/codex' },
|
||||
gemini: { enabled: true, path: '/usr/bin/gemini' },
|
||||
},
|
||||
};
|
||||
const configured = createConfiguredExternalBackends(cfg);
|
||||
expect(configured.defaultName).toBe('codex');
|
||||
expect(configured.backends.codex?.name).toBe('codex');
|
||||
expect(configured.backends.gemini?.name).toBe('gemini');
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user