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(model-hub): label built-in free services without an API list price (#2995)

Call White5e9598df6e1c
diff --git a/ui/src/components/settings/models/SearchServiceParts.tsx b/ui/src/components/settings/models/SearchServiceParts.tsx
index 80bbd1316..88b77abf9 100644
--- a/ui/src/components/settings/models/SearchServiceParts.tsx
+++ b/ui/src/components/settings/models/SearchServiceParts.tsx
@@ -21,11 +21,15 @@ export const SearchVendorGlyph: React.FC<{ vendor: string }> = ({ vendor }) => (
</span>
);
+/** A zero price is a built-in free service, not a list price: it names no API list price or date. */
export const SearchServicePrice: React.FC<{ price: HostedServiceListPrice }> = ({ price }) => {
const { t } = useTranslation();
+ const free = price.usd_per_1k === 0;
return <span className="flex flex-col gap-0.5">
- <span className="font-semibold text-foreground">{price.usd_per_1k === 0 ? t('settings.models.searchServices.free') : t('settings.models.searchServices.price', { usd: formatSmallUsd(price.usd_per_1k) })}</span>
- <a href={price.url} target="_blank" rel="noopener noreferrer" className="model-hub-tool-cost-note underline underline-offset-2">{t('settings.models.searchServices.priceDate', { date: price.as_of })}</a>
+ <span className="font-semibold text-foreground">{free ? t('settings.models.searchServices.free') : t('settings.models.searchServices.price', { usd: formatSmallUsd(price.usd_per_1k) })}</span>
+ {free
+ ? <span className="model-hub-tool-cost-note">{t('settings.models.searchServices.builtInPrice')}</span>
+ : <a href={price.url} target="_blank" rel="noopener noreferrer" className="model-hub-tool-cost-note underline underline-offset-2">{t('settings.models.searchServices.priceDate', { date: price.as_of })}</a>}
</span>;
};
diff --git a/ui/src/components/settings/models/SearchServices.test.tsx b/ui/src/components/settings/models/SearchServices.test.tsx
index d786e4bf6..961ebb4a0 100644
--- a/ui/src/components/settings/models/SearchServices.test.tsx
+++ b/ui/src/components/settings/models/SearchServices.test.tsx
@@ -148,6 +148,25 @@ describe('search service activation and mixed order', () => {
expect(onViewOrder).toHaveBeenCalledOnce();
});
+ it.each(['en', 'zh'])('labels a zero price as built in, never as a dated API list price, in %s', (lng) => {
+ const locale = i18n.cloneInstance({ lng });
+ const listPrice = (date: string) => locale.t('settings.models.searchServices.priceDate', { date }) as string;
+ render(wrap(<ToolsTab read={readyRegion({ tools: [KEYLESS_ACTIVE_SEARCH] })} sources={SEARCH_SOURCES} pending={new Set()} onSave={vi.fn()} onClear={vi.fn()} onRetry={vi.fn()} />, lng));
+ const keylessRow = document.querySelector('[data-executor="src_exakeyless"]') as HTMLElement;
+ const keylessPrice = KEYLESS_ACTIVE_SEARCH.executor_candidates.find((row) => row.source_id === 'src_exakeyless')!.price!;
+ expect(within(keylessRow).getByText(locale.t('settings.models.searchServices.builtInPrice') as string)).toBeTruthy();
+ expect(keylessRow.textContent).not.toContain(listPrice(keylessPrice.as_of));
+ // A paid service keeps its dated list-price link.
+ const paid = KEYLESS_ACTIVE_SEARCH.executor_candidates.find((row) => row.kind === 'service' && (row.price?.usd_per_1k ?? 0) > 0)!;
+ const paidRow = document.querySelector(`[data-executor="${paid.source_id}"]`) as HTMLElement;
+ expect(within(paidRow).getByRole('link', { name: listPrice(paid.price!.as_of) })).toBeTruthy();
+ cleanup();
+ addDialog(KEYLESS_ACTIVE_SEARCH, lng);
+ const builtInCard = screen.getByRole('region', { name: locale.t('settings.models.searchServices.vendorName.exa-mcp') as string });
+ expect(within(builtInCard).getByText(locale.t('settings.models.searchServices.builtInPrice') as string)).toBeTruthy();
+ expect(builtInCard.textContent).not.toContain(listPrice(keylessPrice.as_of));
+ });
+
it('saves the built-in keyless Exa row switch without opening credential actions', async () => {
const onSave = vi.fn();
tab(KEYLESS_ACTIVE_SEARCH, onSave);
diff --git a/ui/src/components/settings/models/WebFetchOrder.tsx b/ui/src/components/settings/models/WebFetchOrder.tsx
index a6f959adf..afc814200 100644
--- a/ui/src/components/settings/models/WebFetchOrder.tsx
+++ b/ui/src/components/settings/models/WebFetchOrder.tsx
@@ -47,7 +47,7 @@ export const FetchServiceSettings: React.FC<{
<div className="flex flex-wrap items-center gap-2"><FetchStatus candidate={candidate} tool={tool} />{candidate.kind !== 'local' && candidate.cooldown_until && <Button variant="outline" size="xs" disabled={pending} onClick={() => onRetry(sourceId)}>{t('settings.models.searchServices.retry')}</Button>}</div>
{candidate.kind !== 'local' && <p className="model-hub-tool-note break-all">{t('settings.models.webFetch.endpoint')}: {t(`settings.models.webFetch.endpoints.${vendor.id}`, { defaultValue: candidate.model_id })}</p>}
<FetchPrice candidate={candidate} />
- {candidate.kind !== 'local' && <a href={candidate.price.url} target="_blank" rel="noopener noreferrer" className="model-hub-tool-note underline">{t('settings.models.searchServices.priceDate', { date: candidate.price.as_of })}</a>}
+ {candidate.kind !== 'local' && candidate.price.usd_per_1k !== 0 && <a href={candidate.price.url} target="_blank" rel="noopener noreferrer" className="model-hub-tool-note underline">{t('settings.models.searchServices.priceDate', { date: candidate.price.as_of })}</a>}
{vendor.id === 'local' && <><p className="model-hub-tool-note">{t('settings.models.webFetch.localDetail')}</p><p className="model-hub-tool-note">{t('settings.models.webFetch.limits')}</p></>}
{vendor.id === 'exa-mcp' && <p className="model-hub-tool-note">{t('settings.models.webFetch.exaDetail')}</p>}
{vendor.id === 'jina-reader' && <><p className="model-hub-tool-note">{t('settings.models.webFetch.jinaDetail')}</p><a href="https://jina.ai/legal/" target="_blank" rel="noopener noreferrer" className="model-hub-tool-note underline">{t('settings.models.webFetch.terms')}</a></>}
diff --git a/ui/src/i18n/en.json b/ui/src/i18n/en.json
index a7fac9f28..a8776dd20 100644
--- a/ui/src/i18n/en.json
+++ b/ui/src/i18n/en.json
@@ -2570,6 +2570,7 @@
"keylessEmpty": "Exa (free) is built in, needs no key, and searches before model executors. Added search services precede it. List prices: {{prices}}. Plans and actual bills may differ.",
"vendorPrice": "{{vendor}} ${{usd}} / 1k searches",
"priceDate": "API list price · {{date}}",
+ "builtInPrice": "Built in · no key or setup",
"priceNote": "Prices are the catalog's dated API list prices. Free allowances, plans and actual bills may differ.",
"custody": "Search service keys stay with the gateway, like other provider keys. They are never passed to the model or Agent.",
"keylessQueryDestination": "Queries go directly from this Avibe runtime to Exa (mcp.exa.ai); Exa can see the connection's IP.",
diff --git a/ui/src/i18n/zh.json b/ui/src/i18n/zh.json
index ea6d1b476..c82d56237 100644
--- a/ui/src/i18n/zh.json
+++ b/ui/src/i18n/zh.json
@@ -2570,6 +2570,7 @@
"keylessEmpty": "Exa(免费)已内置,无需密钥,在模型代搜之前搜索。添加的搜索服务会排在它前面。标价:{{prices}}。套餐和实际账单可能不同。",
"vendorPrice": "{{vendor}} ${{usd}} / 千次",
"priceDate": "API 标价 · {{date}}",
+ "builtInPrice": "内置 · 无需密钥或设置",
"priceNote": "价格为目录标注日期的 API 标价,免费额度、套餐与实际账单可能不同。",
"custody": "搜索服务的密钥和其他供应商一样由网关保管,不会交给模型或 Agent。",
"keylessQueryDestination": "查询会从此 Avibe 运行时直接发送到 Exa(mcp.exa.ai);Exa 可看到该连接的 IP。",