feat(routing): support per-agent backend selection across native/external
This commit is contained in:
@@ -331,6 +331,15 @@ backends:
|
||||
|
||||
If multiple external backends are enabled, Flynn selects the first in this order: `codex` -> `claude_code` -> `opencode` -> `gemini`.
|
||||
|
||||
You can also route specific named agents to a backend:
|
||||
|
||||
```yaml
|
||||
agent_configs:
|
||||
coder:
|
||||
model_tier: complex
|
||||
backend: codex # native | codex | claude_code | opencode | gemini
|
||||
```
|
||||
|
||||
### Native Audio Support
|
||||
|
||||
Voice messages from channels can be handled in two ways:
|
||||
|
||||
@@ -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