Skip to content

armgit / avibe

Public Imported from GitHub
0

Make your computer a home for your AI partner. Avibe is the local-first Agent OS: Vibey, its built-in AI partner, works out of the box, and Claude Code, Codex & OpenCode run unchanged beside it — reach them from your browser, phone, or any chat app.

fix(ui): preserve agent backend preload hint

cyh7073c0179d8c
diff --git a/ui/src/components/shared/RoutingConfigPanel.tsx b/ui/src/components/shared/RoutingConfigPanel.tsx
index 1bf07a352..46d19349e 100644
--- a/ui/src/components/shared/RoutingConfigPanel.tsx
+++ b/ui/src/components/shared/RoutingConfigPanel.tsx
@@ -247,11 +247,12 @@ export const RoutingConfigPanel: React.FC<RoutingConfigPanelProps> = ({
value={value.routing.agent_name || ''}
onChange={(e) => {
const nextName = e.target.value || null;
+ const nextAgent = nextName ? vibeAgents.find((agent) => agent.name === nextName) || null : null;
onChange({
routing: {
...value.routing,
agent_name: nextName,
- agent_backend: null,
+ agent_backend: nextAgent?.backend || null,
model: null,
reasoning_effort: null,
},
diff --git a/ui/src/components/steps/ChannelList.tsx b/ui/src/components/steps/ChannelList.tsx
index 423ef1707..7224e20fd 100644
--- a/ui/src/components/steps/ChannelList.tsx
+++ b/ui/src/components/steps/ChannelList.tsx
@@ -618,7 +618,10 @@ export const ChannelList: React.FC<ChannelListProps> = ({ data = {}, onNext, onB
const raw = configs[channel.id];
if (!raw || raw.enabled === false) return;
const effectiveCwd = (raw.custom_cwd ?? '') || defaultCwd;
- const backend = raw.routing?.agent_backend || defaultBackend;
+ const routing = raw.routing || {};
+ const selectedAgent = routing.agent_name ? agentByName[routing.agent_name] : null;
+ const defaultAgent = !routing.agent_backend ? agentByName[defaultAgentName || ''] : null;
+ const backend = selectedAgent?.backend || routing.agent_backend || defaultAgent?.backend || defaultBackend;
if (backend === 'opencode' && config.agents?.opencode?.enabled) {
neededOpenCodeCwds.add(effectiveCwd);
@@ -648,7 +651,7 @@ export const ChannelList: React.FC<ChannelListProps> = ({ data = {}, onNext, onB
void loadCodexAgents(cwd);
}
});
- }, [channels, configs, config.runtime?.default_cwd, config.agents?.default_backend, config.agents?.opencode?.enabled, config.agents?.claude?.enabled, config.agents?.codex?.enabled]);
+ }, [channels, configs, config.runtime?.default_cwd, config.agents?.default_backend, config.agents?.opencode?.enabled, config.agents?.claude?.enabled, config.agents?.codex?.enabled, agentByName, defaultAgentName]);
const isChannelEnabled = (channelId: string) => {
const channel = configs[channelId];
diff --git a/ui/src/components/steps/UserList.tsx b/ui/src/components/steps/UserList.tsx
index 9dd496c1a..6f591d8cb 100644
--- a/ui/src/components/steps/UserList.tsx
+++ b/ui/src/components/steps/UserList.tsx
@@ -571,12 +571,15 @@ export const UserList: React.FC = () => {
aggregated.forEach((u) => {
if (!u.config.enabled) return;
const cwd = u.config.custom_cwd || defaultCwd;
- const backend = u.config.routing?.agent_backend || defaultBackend;
+ const routing = u.config.routing || {};
+ const selectedAgent = routing.agent_name ? agentByName[routing.agent_name] : null;
+ const defaultAgent = !routing.agent_backend ? agentByName[defaultAgentName || ''] : null;
+ const backend = selectedAgent?.backend || routing.agent_backend || defaultAgent?.backend || defaultBackend;
if (backend === 'opencode' && config.agents?.opencode?.enabled && !opencodeOptionsByCwd[cwd]) loadOpenCodeOptions(cwd);
if (backend === 'claude' && config.agents?.claude?.enabled && !claudeAgentsByCwd[cwd]) loadClaudeAgents(cwd);
if (backend === 'codex' && config.agents?.codex?.enabled && !codexAgentsByCwd[cwd]) loadCodexAgents(cwd);
});
- }, [aggregated, config]);
+ }, [aggregated, config, agentByName, defaultAgentName]);
const persistUsers = async (platform: string, next: Record<string, UserConfig>) => {
setLoading(true);