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.

feat(ui): keep Fast switchable when unconfirmed and mark it with a hollow bolt (#3098)

Call White6b407d379204
diff --git a/docs/plans/fast-mode.md b/docs/plans/fast-mode.md
index 215adee91..9f5066f69 100644
--- a/docs/plans/fast-mode.md
+++ b/docs/plans/fast-mode.md
@@ -125,14 +125,19 @@ without losing a count. Pricing details: `docs/plans/model-hub-capability-model.
again when a fast turn ends.
- The compact picker's Fast toggle sits beside the effort heading. Its hover and
keyboard-focus tooltip says what it does. While fast mode is on, a touch screen
- shows the same line under the efforts. On a model without the tier, or one
- whose last fast response did not confirm it ran, the toggle keeps the
- Session's choice but is disabled, the trigger shows no mark, and the tooltip
- (or, on a touch screen, the line under the efforts) says which.
+ shows the same line under the efforts. On a model without the tier, the
+ toggle keeps the Session's choice but is disabled, the trigger shows no mark,
+ and the tooltip says so.
+- Where the model's hop is asked for the tier but its last fast response did not
+ confirm it ran (owner decision, 2026-10-31), the toggle stays switchable: the
+ user may try it, or stop paying for it. While fast mode is on there, the
+ trigger shows the bolt hollow, the toggle's bolt is hollow too, and a line
+ under the efforts says the provider did not confirm it, on every device. The
+ field keeps being sent, so the bolt fills in once a reply confirms it.
- The trigger's mark, a slim bolt in light amber, sits beside the chevron,
- outside the parts a narrow row drops. It shows only while the Session asks for
- the fast tier, its model's hop is asked for it, and that hop's last fast
- response did not say otherwise.
+ outside the parts a narrow row drops. It is filled while the Session asks for
+ the fast tier and its model's hop last confirmed it (or has not answered yet),
+ and hollow while that hop's last fast response did not confirm it.
## Not in this change
diff --git a/ui/e2e/workbench-general/composer-route-trigger.spec.ts b/ui/e2e/workbench-general/composer-route-trigger.spec.ts
index 35db35c0e..9e97624a2 100644
--- a/ui/e2e/workbench-general/composer-route-trigger.spec.ts
+++ b/ui/e2e/workbench-general/composer-route-trigger.spec.ts
@@ -11,7 +11,9 @@ const EFFORTS = ['low', 'medium', 'high', 'xhigh'].map((value) => ({ value, labe
async function serveChat(
page: Page,
- { running, agentName = 'pm-claude', fast = false }: { running: boolean; agentName?: string; fast?: boolean },
+ { running, agentName = 'pm-claude', fast = false, confirmed = null }: {
+ running: boolean; agentName?: string; fast?: boolean; confirmed?: boolean | null;
+ },
) {
const denied = await serveProduct(page);
const session = {
@@ -45,6 +47,7 @@ async function serveChat(
context_window: null, max_output_tokens: null, input_modalities: [], output_modalities: [],
supports_tools: null, supports_reasoning: true, reasoning_efforts: ['low', 'medium', 'high', 'xhigh'],
locked: false, routeable: true, effort_menu: { omitted: [], not_on: {} }, fast_mode: true,
+ fast_mode_confirmed: confirmed,
}] } }
: { ok: false } }));
await page.route('**/api/claude/models', (route) => route.fulfill({ json: {
@@ -154,8 +157,12 @@ test('a name wider than a crowded phone row keeps its beginning and ends in an e
expect(denied).toEqual([]);
});
-test('a route that runs fast keeps its mark beside the chevron when a crowded phone row drops detail', async ({ page }) => {
- const denied = await serveChat(page, { running: true, fast: true });
+for (const { label, confirmed, markAttr } of [
+ { label: 'runs fast', confirmed: true, markAttr: '' },
+ // Asked for, not confirmed by the last response: the hollow bolt holds the same slot.
+ { label: 'asks for an unconfirmed fast tier', confirmed: false, markAttr: 'unconfirmed' },
+]) test(`a route that ${label} keeps its mark beside the chevron when a crowded phone row drops detail`, async ({ page }) => {
+ const denied = await serveChat(page, { running: true, fast: true, confirmed });
await page.setViewportSize({ width: 320, height: 760 });
await open(page, `/chat/${SESSION_ID}`);
await expect(page.getByRole('button', { name: 'Stop', exact: true })).toBeVisible();
@@ -166,11 +173,12 @@ test('a route that runs fast keeps its mark beside the chevron when a crowded ph
const trigger = page.locator('main').getByRole('button', { name: /pm-claude/ });
const mark = trigger.locator('[data-fast-mark]');
await expect(mark).toBeVisible();
+ await expect(mark).toHaveAttribute('data-fast-mark', markAttr);
// The mark says the route costs more: detail gives way, the mark does not.
const parts = trigger.locator('[data-route-trigger-parts]');
expect(await shownDetails(parts)).not.toContain('effort');
expect(inside((await mark.boundingBox())!, (await trigger.boundingBox())!)).toBe(true);
- await page.screenshot({ path: 'e2e/.artifacts/workbench-general/shots/composer-route-trigger-fast.png' });
+ await page.screenshot({ path: `e2e/.artifacts/workbench-general/shots/composer-route-trigger-fast${markAttr ? `-${markAttr}` : ''}.png` });
expect(denied).toEqual([]);
});
diff --git a/ui/src/components/workbench/AgentRoutePicker.test.tsx b/ui/src/components/workbench/AgentRoutePicker.test.tsx
index f25a9f22e..ebcedc421 100644
--- a/ui/src/components/workbench/AgentRoutePicker.test.tsx
+++ b/ui/src/components/workbench/AgentRoutePicker.test.tsx
@@ -640,21 +640,36 @@ describe('AgentRoutePicker compact presentation', () => {
);
};
- it('says so where the last fast response did not confirm the fast tier ran, and keeps the choice', async () => {
+ it('keeps Fast switchable where the last fast response did not confirm it, and marks it hollow with a note', async () => {
// Opus's hop is asked for the fast tier, but a relay answered at the standard one.
hubMode = 'hub';
catalogReasoning = { sonnet: [{ value: 'low', label: 'low' }], opus: [{ value: 'low', label: 'low' }] };
catalogFastUnconfirmed = ['opus'];
const user = userEvent.setup();
- render(<FastOwner initial={{ ...CLAUDE_ROUTE, model: 'opus' }} initialSpeed="fast" onSpeed={vi.fn()} />);
+ const onSpeed = vi.fn();
+ render(<FastOwner initial={{ ...CLAUDE_ROUTE, model: 'opus' }} initialSpeed="fast" onSpeed={onSpeed} />);
+ const solid = () => screen.queryByLabelText('chat.picker.fastOn');
+ const hollow = () => screen.queryByLabelText('chat.picker.fastOnUnconfirmed');
+
await openMenu(user);
- const toggle = screen.getByRole('button', { name: 'chat.picker.fast' }) as HTMLButtonElement;
- expect(toggle.disabled).toBe(true);
- expect(toggle.getAttribute('aria-pressed')).toBe('true');
+ // The trigger says Fast is on but not confirmed: a hollow bolt, never the filled one.
+ expect(hollow()?.getAttribute('data-fast-mark')).toBe('unconfirmed');
+ expect(solid()).toBeNull();
+ const toggle = () => screen.getByRole('button', { name: 'chat.picker.fast' }) as HTMLButtonElement;
+ expect(toggle().disabled).toBe(false);
+ expect(toggle().getAttribute('aria-pressed')).toBe('true');
expect(screen.getByRole('tooltip').textContent).toContain('chat.picker.fastUnconfirmed');
- // No mark: nothing says the route runs fast. A touch screen reads why.
- expect(screen.queryByLabelText('chat.picker.fastOn')).toBeNull();
- expect(screen.getByText('chat.picker.fastUnconfirmedCaption')).not.toBeNull();
+ // Every device reads why, not only a touch screen.
+ expect(screen.getByText('chat.picker.fastUnconfirmedNote')).not.toBeNull();
+
+ // The user can stop paying for it, and try it again.
+ await user.click(toggle());
+ expect(onSpeed).toHaveBeenLastCalledWith(null);
+ expect(hollow()).toBeNull();
+ expect(screen.queryByText('chat.picker.fastUnconfirmedNote')).toBeNull();
+ await user.click(toggle());
+ expect(onSpeed).toHaveBeenLastCalledWith('fast');
+ expect(hollow()).not.toBeNull();
});
it("judges Fast on the Agent's model for a route that names none", async () => {
diff --git a/ui/src/components/workbench/AgentRoutePicker.tsx b/ui/src/components/workbench/AgentRoutePicker.tsx
index 83e5b409b..947bdee5c 100644
--- a/ui/src/components/workbench/AgentRoutePicker.tsx
+++ b/ui/src/components/workbench/AgentRoutePicker.tsx
@@ -1,7 +1,7 @@
import { useCallback, useEffect, useId, useMemo, useRef, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { useNavigate } from 'react-router-dom';
-import { Check, ChevronDown, ChevronLeft, ChevronRight, Loader2, Plus, Search, Sparkles } from 'lucide-react';
+import { Check, ChevronDown, ChevronLeft, ChevronRight, Loader2, Plus, Search, Sparkles, TriangleAlert } from 'lucide-react';
import clsx from 'clsx';
import { useApi } from '../../context/ApiContext';
@@ -192,10 +192,11 @@ export const AgentRoutePicker: React.FC<AgentRoutePickerProps> = ({
// The closed trigger names the model as the menu does, from labels remembered
// across pickers and loads; the raw id stays one hover away.
const currentModelLabel = useRememberedModelLabel(backend, currentModel) ?? currentModel;
- // Fast mode is the route's to ask for and the model's hop's to grant: the mark
- // and the toggle follow whether this model's hop is asked for the fast tier
- // and its last fast response did not say otherwise, so asking on a model
- // without it keeps the choice for the next model that has it.
+ // Fast mode is the route's to ask for and the response's to confirm. The toggle
+ // works wherever the model's hop is asked for the fast tier, confirmed or not;
+ // the mark says which: a filled bolt where the last fast response ran fast, a
+ // hollow one where it did not confirm it. A model without the tier keeps the
+ // choice for the next model that has it.
const fastControls = compact && Boolean(onSpeedChange);
const fastOn = speed === 'fast';
// The model a turn runs on: the route's own, else its Agent's default, which a
@@ -204,6 +205,7 @@ export const AgentRoutePicker: React.FC<AgentRoutePickerProps> = ({
const fastState = useRememberedFastModel(backend, effectiveModel, fastControls && (fastOn || open));
const fastOffered = fastState === 'offered';
const fastActive = fastControls && fastOn && fastOffered;
+ const fastUnconfirmed = fastControls && fastOn && fastState === 'unconfirmed';
const currentAgentLabel = displayedAgent?.display_name || currentAgent;
const triggerLabel = (routeIsDefault && defaultLabel) || currentAgentLabel || defaultLabel || t('chat.pickAgent');
const agentLabel = currentAgentLabel || defaultLabel || t('chat.pickAgent');
@@ -543,6 +545,9 @@ export const AgentRoutePicker: React.FC<AgentRoutePickerProps> = ({
{/* Outside the wrapping parts, so the mark never gives way: it says the
route costs more, which a narrow row must not hide. */}
{fastActive && <FastMark data-fast-mark="" aria-label={t('chat.picker.fastOn')} className="text-gold/60" />}
+ {fastUnconfirmed && (
+ <FastMark data-fast-mark="unconfirmed" aria-label={t('chat.picker.fastOnUnconfirmed')} hollow className="text-gold/70" />
+ )}
{saving ? (
<Loader2 className="size-3 shrink-0 animate-spin text-muted" aria-label={t('common.saving')} />
) : (
@@ -657,7 +662,7 @@ export const AgentRoutePicker: React.FC<AgentRoutePickerProps> = ({
on={fastOn}
offered={fastOffered}
unconfirmed={fastState === 'unconfirmed'}
- active={fastActive}
+ active={fastActive || fastUnconfirmed}
disabled={loadingModels}
onToggle={() => onSpeedChange?.(fastOn ? null : 'fast')}
/>
@@ -702,9 +707,17 @@ export const AgentRoutePicker: React.FC<AgentRoutePickerProps> = ({
)}
{/* A touch screen has no hover for the toggle's explanation: it is
written out while the route asks for the fast tier. */}
- {fastControls && fastOn && (fastOffered || fastState === 'unconfirmed') && (
+ {fastActive && (
<p className="pt-1.5 text-[10px] leading-snug text-muted [@media(hover:hover)]:hidden">
- {fastOffered ? t('chat.picker.fastCaption') : t('chat.picker.fastUnconfirmedCaption')}
+ {t('chat.picker.fastCaption')}
+ </p>
+ )}
+ {/* Not a hover detail: the Session pays for a tier it may not be
+ getting, so every device reads it while Fast is on. */}
+ {fastUnconfirmed && (
+ <p className="flex items-start gap-1 pt-1.5 text-[10px] leading-snug text-gold-ink">
+ <TriangleAlert aria-hidden className="mt-px size-3 shrink-0" />
+ <span>{t('chat.picker.fastUnconfirmedNote')}</span>
</p>
)}
</div>
@@ -930,19 +943,28 @@ const ModelName: React.FC<{ label: string }> = ({ label }) => {
};
// The fast-mode bolt: a slim filled glyph, quiet enough to sit beside the
-// chevron without competing with the route's name. Colour comes from the caller.
+// chevron without competing with the route's name. Hollow while the last fast
+// response did not confirm the tier: asked for, not filled. Colour comes from
+// the caller.
const FAST_BOLT_PATH = 'M13.6 2.2 6.4 13.1h5l-1.5 8.7 7.7-11.4h-5.2z';
-const FastMark: React.FC<React.SVGProps<SVGSVGElement>> = ({ className, ...props }) => (
- <svg viewBox="0 0 24 24" fill="currentColor" aria-hidden={props['aria-label'] ? undefined : true} className={clsx('size-[11px] shrink-0', className)} {...props}>
- <path d={FAST_BOLT_PATH} />
+const FastMark: React.FC<React.SVGProps<SVGSVGElement> & { hollow?: boolean }> = ({ className, hollow, ...props }) => (
+ <svg
+ viewBox="0 0 24 24"
+ fill={hollow ? 'none' : 'currentColor'}
+ aria-hidden={props['aria-label'] ? undefined : true}
+ className={clsx('size-[11px] shrink-0', className)}
+ {...props}
+ >
+ <path d={FAST_BOLT_PATH} {...(hollow ? { stroke: 'currentColor', strokeWidth: 1.8, strokeLinejoin: 'round' as const } : {})} />
</svg>
);
// The Fast toggle beside the effort heading. Hover or keyboard focus explains
-// it; a click's focus does not, so the tip never lingers over the model list. A
-// model whose hop offers no fast tier, or whose last fast response did not
-// confirm it ran, keeps the choice but cannot change it here.
+// it; a click's focus does not, so the tip never lingers over the model list.
+// It stays switchable where the last fast response did not confirm the tier: a
+// user may try it, or stop paying for it. Only a model whose hop offers no fast
+// tier keeps the choice without changing it here.
const FastToggle: React.FC<{
on: boolean;
offered: boolean;
@@ -959,7 +981,7 @@ const FastToggle: React.FC<{
type="button"
aria-pressed={on}
aria-describedby={tipId}
- disabled={disabled || !offered}
+ disabled={disabled || !(offered || unconfirmed)}
onClick={onToggle}
className={clsx(
'inline-flex items-center gap-1 rounded-full border px-2 py-0.5 text-[11px] font-semibold transition-colors',
@@ -967,7 +989,7 @@ const FastToggle: React.FC<{
active ? 'border-gold/30 bg-gold-soft text-gold-ink/80' : 'border-border text-muted hover:text-foreground',
)}
>
- <FastMark className={active ? 'text-gold/60' : undefined} />
+ <FastMark hollow={on && unconfirmed} className={active ? (unconfirmed ? 'text-gold/70' : 'text-gold/60') : undefined} />
{t('chat.picker.fast')}
</button>
<span
diff --git a/ui/src/i18n/en.json b/ui/src/i18n/en.json
index 9ca486c93..9f08e386a 100644
--- a/ui/src/i18n/en.json
+++ b/ui/src/i18n/en.json
@@ -5183,13 +5183,14 @@
"speed": "Speed",
"fast": "Fast",
"fastOn": "Fast mode on",
+ "fastOnUnconfirmed": "Fast mode on, not confirmed by the provider",
"fastTitle": "Fast mode",
"fastDescription": "Same model, faster output, higher price.",
"fastScope": "Offered on some models and providers only",
"fastUnavailable": "Not offered for this model or provider",
"fastUnconfirmed": "This provider didn't confirm the last request ran fast",
"fastCaption": "Fast: faster output, higher price",
- "fastUnconfirmedCaption": "Fast: this provider didn't confirm it ran fast",
+ "fastUnconfirmedNote": "The provider didn't confirm the last request ran fast (a relay may not support it). Avibe keeps asking, and the bolt fills in once a reply confirms it.",
"newAgent": "New agent",
"addModel": "Add model",
"noModels": "No models found",
diff --git a/ui/src/i18n/zh.json b/ui/src/i18n/zh.json
index be4cc9797..c23c92bf6 100644
--- a/ui/src/i18n/zh.json
+++ b/ui/src/i18n/zh.json
@@ -5183,13 +5183,14 @@
"speed": "速度",
"fast": "Fast",
"fastOn": "Fast 模式已开启",
+ "fastOnUnconfirmed": "Fast 模式已开启,服务商未确认生效",
"fastTitle": "Fast 模式",
"fastDescription": "同一个模型,输出更快,费用更高。",
"fastScope": "仅部分模型和服务商支持",
"fastUnavailable": "当前模型或服务商不支持",
"fastUnconfirmed": "这个服务商上次没有确认以 Fast 运行",
"fastCaption": "Fast:输出更快,费用更高",
- "fastUnconfirmedCaption": "Fast:这个服务商没有确认以 Fast 运行",
+ "fastUnconfirmedNote": "最近一次请求,服务商没有确认以 Fast 运行(可能是中转不支持)。仍会继续尝试,确认生效后闪电会变回实心。",
"newAgent": "新建 Agent",
"addModel": "添加模型",
"noModels": "未找到模型",