From bf3dbbfe322ff3eefdc211b72c1e773066daf020 Mon Sep 17 00:00:00 2001 From: William Valentin Date: Tue, 17 Feb 2026 09:29:30 -0800 Subject: [PATCH] feat(routing): support per-agent backend selection across native/external --- README.md | 9 +++++++++ src/daemon/index.test.ts | 17 ++++++++++++++++- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 1f36637..c10c260 100644 --- a/README.md +++ b/README.md @@ -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: diff --git a/src/daemon/index.test.ts b/src/daemon/index.test.ts index 2abe66a..c545dbb 100644 --- a/src/daemon/index.test.ts +++ b/src/daemon/index.test.ts @@ -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'); + }); });