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(workbench): address Codex P2s — backend default, dispatch, logs link, set-default agent

cyh4b7cf56b6c73
diff --git a/ui/src/components/settings/SettingsDiagnosticsPage.tsx b/ui/src/components/settings/SettingsDiagnosticsPage.tsx
index 386bc1bc7..44353616e 100644
--- a/ui/src/components/settings/SettingsDiagnosticsPage.tsx
+++ b/ui/src/components/settings/SettingsDiagnosticsPage.tsx
@@ -13,7 +13,7 @@ export const SettingsDiagnosticsPage: React.FC = () => {
title={t('settings.diagnosticsTitle')}
subtitle={t('settings.diagnosticsSubtitle')}
>
- <DoctorPanel isPage logsPath="/api/logs" titleKey="settings.diagnosticsDoctorTitle" />
+ <DoctorPanel isPage logsPath="/admin/logs" titleKey="settings.diagnosticsDoctorTitle" />
</SettingsPageShell>
);
};
diff --git a/ui/src/components/workbench/AgentsPage.tsx b/ui/src/components/workbench/AgentsPage.tsx
index 98e7121c3..524862197 100644
--- a/ui/src/components/workbench/AgentsPage.tsx
+++ b/ui/src/components/workbench/AgentsPage.tsx
@@ -11,6 +11,7 @@ import {
Plus,
RefreshCw,
Search,
+ Star,
Trash2,
Upload,
} from 'lucide-react';
@@ -151,6 +152,16 @@ export const AgentsPage: React.FC = () => {
}
};
+ // Promote the selected agent to the global default so plain "new chat"
+ // / IM routing without an explicit agent lands here. Throws on failure
+ // so the detail panel can surface a toast.
+ const onSetDefault = async () => {
+ if (!selected) return;
+ await api.setDefaultVibeAgent(selected.name);
+ setDefaultName(selected.name);
+ refresh();
+ };
+
const onDelete = async () => {
if (!selected || isSystemAgent(selected)) return;
const confirmed = window.confirm(t('agents.deleteConfirm', { name: selected.name }));
@@ -303,6 +314,7 @@ export const AgentsPage: React.FC = () => {
agent={selected}
isDefault={defaultName === selected.name}
onChange={updateField}
+ onSetDefault={onSetDefault}
onDelete={onDelete}
onClose={() => setSelected(null)}
/>
@@ -446,6 +458,7 @@ interface DetailProps {
agent: VibeAgentFull;
isDefault: boolean;
onChange: (patch: Partial<VibeAgentFull>) => void;
+ onSetDefault: () => Promise<void>;
onDelete: () => void;
onClose: () => void;
}
@@ -455,13 +468,14 @@ interface DetailProps {
// System Prompt (collapsible) → footer Run / Delete. Name is editable
// for user agents (rename = create-then-delete since backend keeps name
// as the immutable reference id). System agents lock the name.
-const AgentDetailPanel: React.FC<DetailProps> = ({ agent, onChange, onDelete, onClose }) => {
+const AgentDetailPanel: React.FC<DetailProps> = ({ agent, isDefault, onChange, onSetDefault, onDelete, onClose }) => {
const { t } = useTranslation();
const api = useApi();
const { showToast } = useToast();
const system = isSystemAgent(agent);
const [name, setName] = useState(agent.name);
const [renaming, setRenaming] = useState(false);
+ const [settingDefault, setSettingDefault] = useState(false);
const [model, setModel] = useState(agent.model ?? '');
const [effort, setEffort] = useState(agent.reasoning_effort ?? 'medium');
const [systemPrompt, setSystemPrompt] = useState(agent.system_prompt ?? '');
@@ -550,6 +564,19 @@ const AgentDetailPanel: React.FC<DetailProps> = ({ agent, onChange, onDelete, on
}
};
+ const handleSetDefault = async () => {
+ if (settingDefault) return;
+ setSettingDefault(true);
+ try {
+ await onSetDefault();
+ showToast(t('agents.detail.defaultSet', { name: agent.name }), 'success');
+ } catch (err: any) {
+ showToast(err?.message ?? String(err), 'error');
+ } finally {
+ setSettingDefault(false);
+ }
+ };
+
return (
<div className="flex flex-col gap-3.5">
{/* Header row — design.pen j5dGQ8 without DEFAULT badge (now read-
@@ -592,6 +619,40 @@ const AgentDetailPanel: React.FC<DetailProps> = ({ agent, onChange, onDelete, on
/>
</div>
+ {/* Default routing — promotes this agent to the global default so a
+ plain "new chat" (and IM routing without an explicit agent)
+ lands here. Restores the set-default control dropped in the
+ workbench rebuild; a disabled agent can't be the default. */}
+ <div
+ className={clsx(
+ 'flex items-center justify-between gap-3 rounded-[10px] border px-3.5 py-3',
+ isDefault ? 'border-mint/40 bg-mint-soft' : 'border-border-strong bg-surface-2',
+ )}
+ >
+ <div className="flex min-w-0 flex-col gap-0.5">
+ <span className="text-[13px] font-bold text-foreground">{t('agents.detail.defaultTitle')}</span>
+ <span className="text-[11px] text-muted">{t('agents.detail.defaultHint')}</span>
+ </div>
+ {isDefault ? (
+ <Badge variant="success" className="font-mono uppercase">
+ <Star className="size-3" />
+ {t('agents.detail.defaultActive')}
+ </Badge>
+ ) : (
+ <Button
+ type="button"
+ variant="outline"
+ size="xs"
+ onClick={handleSetDefault}
+ disabled={settingDefault || !agent.enabled}
+ title={!agent.enabled ? t('agents.detail.defaultNeedsEnabled') : undefined}
+ >
+ {settingDefault ? <Loader2 className="size-3 animate-spin" /> : <Star className="size-3" />}
+ {t('agents.detail.setDefault')}
+ </Button>
+ )}
+ </div>
+
{/* Name — system agents are locked; user agents are editable via
create-then-delete (no DB-level rename support). */}
<Field label={t('agents.detail.name')}>
diff --git a/ui/src/components/workbench/CreateViaChatDialog.tsx b/ui/src/components/workbench/CreateViaChatDialog.tsx
index 37d55ca64..0ed539ab0 100644
--- a/ui/src/components/workbench/CreateViaChatDialog.tsx
+++ b/ui/src/components/workbench/CreateViaChatDialog.tsx
@@ -60,9 +60,10 @@ export const CreateViaChatDialog: React.FC<CreateViaChatDialogProps> = ({ kind,
setError(null);
try {
const titleKey = kind === 'task' ? 'workbench.createDialog.kindTask' : 'workbench.createDialog.kindWatch';
+ // Omit agent_backend so the server routes through the configured
+ // agents.default_backend rather than a hard-coded one.
const session = await api.createSession({
project_id: projectId,
- agent_backend: 'claude',
title: t(`harness.createDialog.${kind === 'task' ? 'kindTask' : 'kindWatch'}`, {
// titleKey is only here so the translation linter doesn't drop it
defaultValue: t(titleKey, { defaultValue: 'Background work' }),
@@ -71,17 +72,14 @@ export const CreateViaChatDialog: React.FC<CreateViaChatDialogProps> = ({ kind,
const prompt = t(
kind === 'task' ? 'harness.createDialog.promptTask' : 'harness.createDialog.promptWatch',
);
- // Send the seed message without `stream=1` — the user will land on
- // the chat page and may want to edit before the agent answers. The
- // backend still dispatches the agent run asynchronously, so the
- // first reply is on the way by the time the page mounts.
- try {
- await api.sendSessionMessage(session.id, { text: prompt });
- } catch (msgErr) {
- // Non-fatal — the session exists; the user can just type instead.
- console.error('[create-via-chat] seed message failed', msgErr);
- }
- navigate(`/chat/${encodeURIComponent(session.id)}`);
+ // Hand the seed prompt to ChatPage as router state; it replays the
+ // message through the streaming compose path (POST ?stream=1) so the
+ // agent turn actually starts. A bare non-stream send would only
+ // persist the prompt and never dispatch, leaving the task/watch
+ // creation stuck with no agent reply.
+ navigate(`/chat/${encodeURIComponent(session.id)}`, {
+ state: { initialMessage: prompt },
+ });
} catch (err: any) {
setError(err?.message ?? String(err));
setSubmitting(false);
diff --git a/ui/src/components/workbench/WorkbenchSidebar.tsx b/ui/src/components/workbench/WorkbenchSidebar.tsx
index eefa6da01..149ed200b 100644
--- a/ui/src/components/workbench/WorkbenchSidebar.tsx
+++ b/ui/src/components/workbench/WorkbenchSidebar.tsx
@@ -424,10 +424,10 @@ export const WorkbenchSidebar: React.FC = () => {
return next;
});
try {
- // Default backend = 'claude' — backend resolves agent + model defaults
- // from the project's stored settings (or the global defaults if the
- // project never overrode them).
- const session = await api.createSession({ project_id: projectId, agent_backend: 'claude' });
+ // Omit agent_backend so the server routes through the configured
+ // agents.default_backend (and the project's stored agent/model
+ // defaults) rather than a hard-coded backend.
+ const session = await api.createSession({ project_id: projectId });
// Optimistically prepend so the user sees it before refetch lands.
setSessionsByProject((prev) => {
const existing = prev[projectId] ?? [];
diff --git a/ui/src/i18n/en.json b/ui/src/i18n/en.json
index 1c1e5e6f7..97a90c7f7 100644
--- a/ui/src/i18n/en.json
+++ b/ui/src/i18n/en.json
@@ -1254,6 +1254,12 @@
"detail": {
"enabled": "Enabled",
"enabledHint": "Disabling keeps the agent in the registry but excludes it from new sessions; running sessions are unaffected.",
+ "defaultTitle": "Default agent",
+ "defaultHint": "New chats and IM messages without an explicit agent route to this one.",
+ "defaultActive": "Default",
+ "setDefault": "Set as default",
+ "defaultNeedsEnabled": "Enable the agent before making it the default.",
+ "defaultSet": "{{name}} is now the default agent.",
"name": "Name",
"backend": "Backend",
"backendLocked": "creation-time only · locked",
diff --git a/ui/src/i18n/zh.json b/ui/src/i18n/zh.json
index ecdfd5eed..53acc48fe 100644
--- a/ui/src/i18n/zh.json
+++ b/ui/src/i18n/zh.json
@@ -1253,6 +1253,12 @@
"detail": {
"enabled": "已启用",
"enabledHint": "关掉后此 Agent 不会被新会话选用,已运行的会话不受影响",
+ "defaultTitle": "默认 Agent",
+ "defaultHint": "未指定 Agent 的新会话和 IM 消息都会路由到这个 Agent。",
+ "defaultActive": "默认",
+ "setDefault": "设为默认",
+ "defaultNeedsEnabled": "请先启用该 Agent 再设为默认。",
+ "defaultSet": "{{name}} 已设为默认 Agent。",
"name": "名称",
"backend": "后端",
"backendLocked": "创建时确定 · 不可改",