feat(routing): support per-agent backend selection across native/external

This commit is contained in:
William Valentin
2026-02-17 09:29:30 -08:00
parent 1d59becfa5
commit bf3dbbfe32
2 changed files with 25 additions and 1 deletions
+9
View File
@@ -331,6 +331,15 @@ backends:
If multiple external backends are enabled, Flynn selects the first in this order: `codex` -> `claude_code` -> `opencode` -> `gemini`. 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 ### Native Audio Support
Voice messages from channels can be handled in two ways: Voice messages from channels can be handled in two ways:
+16 -1
View File
@@ -1,7 +1,7 @@
import { describe, expect, it } from 'vitest'; import { describe, expect, it } from 'vitest';
import { configSchema } from '../config/schema.js'; import { configSchema } from '../config/schema.js';
import { createConfiguredExternalBackend } from './index.js'; import { createConfiguredExternalBackend, createConfiguredExternalBackends } from './index.js';
describe('createConfiguredExternalBackend', () => { describe('createConfiguredExternalBackend', () => {
const base = configSchema.parse({ const base = configSchema.parse({
@@ -37,4 +37,19 @@ describe('createConfiguredExternalBackend', () => {
const backend = createConfiguredExternalBackend(cfg); const backend = createConfiguredExternalBackend(cfg);
expect(backend?.name).toBe('gemini'); 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');
});
}); });