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.
Python agentagent-osaiai-agentsai-partnerchatopsclaudeclaude-codecodexdevtoolsdiscord-botlark-botllmlocal-firstlong-term-memoryopencodeslack-botvibe-codingvibeywechat
fix(model-hub): draw inherited supply connections (#1925)
Call White2206255511a4
diff --git a/docs/plans/model-hub-ui-spec.md b/docs/plans/model-hub-ui-spec.mdindex 19206600c..d4182e844 100644--- a/docs/plans/model-hub-ui-spec.md+++ b/docs/plans/model-hub-ui-spec.md@@ -1985,6 +1985,8 @@ Other limits `[derived]`:| Many sources (> 6) | The upstream module grows with every source; the enclosing settings route pane scrolls, so the head, groups and footer remain in one reading flow. || Many backends (> 3) | The gateway module grows with every backend; the enclosing settings route pane scrolls and no nested gateway scrollbar appears. || Zero supply relations | The wire layer renders nothing — no placeholder path. |+| Relation membership | For every routeable model in the current backend catalog, use its fresh exact AgentChain regardless of Automatic, Manual or Passthrough origin. Deduplicate by Source/backend pair, including collapsed model rows. An unread chain may retain known manual membership, but never infer inherited membership from default order or stale chains. Dormant overrides outside the catalog create no relation. |+| Passthrough ink (owner amendment 2026-09-07) | An actively supplying relation whose contributing fresh chains are all Passthrough uses the existing Passthrough badge `--gold-ink` token and active wire width, with a matching EN/ZH legend. A mixed Automatic/Manual/Passthrough relation retains normal supply ink. Takeover, paused supply and connected-but-unused classification keep their existing precedence and treatment; responsive wire visibility and shared anchors are unchanged. || Wires | Generated from the supply-relation set, never hand-placed; the frame's four paths are an instance of that generator, not a fixed asset. Every path leaves its Source at the shared right-edge midpoint, and every relation targeting the same Agent lands at that Agent card's shared left-edge midpoint while remaining a distinct curve. One neutral marker represents each shared Source or Agent anchor, so relation ordering cannot hide or recolor either endpoint. Paths rest at low opacity; hovering or focusing a Source or Agent restores full opacity only for its connected paths. The corridor draws no independent central axis. The SVG follows the natural-height `cols` track and remains clipped before the legend and following page sections. |---diff --git a/ui/src/components/settings/models/SettingsModelsPage.render.test.tsx b/ui/src/components/settings/models/SettingsModelsPage.render.test.tsxindex 81a21e09d..7fe060f13 100644--- a/ui/src/components/settings/models/SettingsModelsPage.render.test.tsx+++ b/ui/src/components/settings/models/SettingsModelsPage.render.test.tsx@@ -125,9 +125,9 @@ const deferred = <T,>() => {return { promise, resolve };};-const renderPage = (sources: Source[]) => {+const renderPage = (sources: Source[], agents?: AgentSupply[]) => {vi.spyOn(modelsApi, 'listSources').mockResolvedValue(sources);- vi.spyOn(modelsApi, 'listAgents').mockResolvedValue([+ vi.spyOn(modelsApi, 'listAgents').mockResolvedValue(agents ?? [directAgent('claude'),directAgent('codex'),directAgent('opencode'),@@ -165,6 +165,29 @@ afterEach(() => {});describe('SettingsModelsPage surface branches', () => {+ it.each(['automatic', 'passthrough', 'manual'] as const)('renders %s relations from the actual chain collection for all backends', async (origin) => {+ const agents = (['claude', 'codex', 'opencode'] as const).map((backend): AgentSupply => ({+ ...takeoverAgent, backend, sources: { order: [retainedSource.id], eligibility: [] },+ routes: origin === 'manual' ? { 'gpt-5.6-sol': { hops: [{ source_id: retainedSource.id, model_id: 'upstream' }] } } : {},+ model_supply: [{ model_id: 'gpt-5.6-sol', route_origin: origin, chain_length: 1, has_runnable_hop: true }],+ }));+ vi.spyOn(modelsApi, 'getAgentChains').mockImplementation(async (backend) => [{+ ...takeoverChain, backend, route_origin: origin,+ manual_override: agents.find((agent) => agent.backend === backend)?.routes?.['gpt-5.6-sol'] ?? null,+ current: { source_id: retainedSource.id, model_id: 'upstream' },+ chain: [{ ...takeoverChain.chain[1], source_id: retainedSource.id, model_id: 'upstream' }], supply_state: 'ok',+ }]);+ const view = renderPage([retainedSource], agents);+ await waitFor(() => expect(view.container.querySelectorAll('[data-wire-source-id="src_retained"]')).toHaveLength(3));+ await waitFor(() => {+ for (const backend of ['claude', 'codex', 'opencode']) {+ expect(view.container.querySelector(`[data-wire-agent-backend="${backend}"]`)?.classList+ .contains(`model-hub-wire--${origin === 'passthrough' ? 'passthrough' : 'gateway'}`)).toBe(true);+ }+ });+ if (origin === 'passthrough') expect(view.container.querySelector('.model-hub-legend-swatch--passthrough')).not.toBeNull();+ });+it('acknowledges a catalog save and reveals a new model beyond the collapsed limit', async () => {const ids = Array.from({ length: 6 }, (_, index) => `catalog-model-${index + 1}`);const addedId = 'catalog-model-added';diff --git a/ui/src/components/settings/models/SupplyGraph.test.ts b/ui/src/components/settings/models/SupplyGraph.test.tsindex 2397e1474..410fc8761 100644--- a/ui/src/components/settings/models/SupplyGraph.test.ts+++ b/ui/src/components/settings/models/SupplyGraph.test.ts@@ -1,7 +1,7 @@import { describe, expect, it } from 'vitest';import { modelChainKey } from './modelRows';-import { readyRegion } from './regionRead';+import { degradedRegion, loadingRegion, readyRegion, unreadRegion } from './regionRead';import { freshRuntimeProjection } from './runtimeLifecycle';import { buildSupplyRelations as buildRelations } from './supplyRelations';import type { AgentChain, AgentSupply, RuntimeDependency, Source } from './types';@@ -60,6 +60,80 @@ const chain = (current: string, headHealth: AgentChain['chain'][number]['health'});describe('buildSupplyRelations', () => {+ describe.each(['claude', 'codex', 'opencode'] as const)('%s effective routes', (backend) => {+ it.each(['automatic', 'passthrough', 'manual'] as const)('draws every %s supplier once from the effective chain', (origin) => {+ const projection: AgentChain = { ...chain('relay'), backend, route_origin: origin,+ chain: chain('relay').chain.map((hop) => ({ ...hop, channel: 'hub' })),+ manual_override: origin === 'manual' ? chain('relay').manual_override : null };+ const supplied: AgentSupply = { ...agent, backend,+ menu_kind: backend === 'opencode' ? 'open' : 'fixed', menu: { view: 'featured', checked: ['model-a'] },+ routes: origin === 'manual' ? agent.routes : {},+ model_supply: [{ model_id: 'model-a', route_origin: origin, chain_length: 3, has_runnable_hop: true }] };+ const sources = [source('native', 'hub'), source('relay', 'hub'), source('unused', 'hub'), source('off-route', 'hub')];+ expect(buildSupplyRelations([supplied], sources, { [modelChainKey(backend, 'model-a')]: readyRegion(projection) })).toEqual([+ { sourceId: 'native', backend, kind: 'connected_unused' },+ { sourceId: 'relay', backend, kind: origin === 'passthrough' ? 'passthrough' : 'gateway' },+ { sourceId: 'unused', backend, kind: 'connected_unused' },+ ]);+ });+ });++ it('unions all catalog chains, deduplicates sources and keeps mixed origins in normal supply ink', () => {+ const ids = Array.from({ length: 8 }, (_, index) => `model-${index}`);+ const supplied: AgentSupply = { ...agent, routes: {}, builtin_models: ids, model_supply: [] };+ const chains = Object.fromEntries(ids.map((modelId, index) => [modelChainKey('claude', modelId), readyRegion({+ ...chain('relay'), model_id: modelId, manual_override: null,+ route_origin: index === 7 ? 'automatic' as const : 'passthrough' as const,+ })]));+ expect(buildSupplyRelations([supplied], [source('relay', 'hub')], chains)).toEqual([+ { sourceId: 'relay', backend: 'claude', kind: 'gateway' },+ ]);+ });++ it('does not infer inherited relations from defaults, stale reads or another model identity', () => {+ const supplied: AgentSupply = { ...agent, routes: {} };+ const inherited: AgentChain = { ...chain('relay'), manual_override: null, route_origin: 'automatic' };+ const key = modelChainKey('claude', 'model-a');+ const sources = [source('relay', 'hub')];+ for (const read of [loadingRegion<AgentChain>(), unreadRegion<AgentChain>(),+ degradedRegion(inherited, 'refreshing', false), degradedRegion(inherited, 'read_failed', true),+ readyRegion({ ...inherited, backend: 'codex' as const }), readyRegion({ ...inherited, model_id: 'other' }),+ readyRegion({ ...inherited, current: null, chain: [], route_origin: null })]) {+ expect(buildSupplyRelations([supplied], sources, { [key]: read })).toEqual([]);+ }+ expect(buildRelations([supplied], sources, { [key]: readyRegion(inherited) }, null)).toEqual([]);+ });++ it('does not draw dormant overrides or stale chain entries outside the canonical catalog', () => {+ const supplied: AgentSupply = { ...agent, catalog_models: [] };+ expect(buildSupplyRelations([supplied], [source('relay', 'hub')], {+ [modelChainKey('claude', 'model-a')]: readyRegion(chain('relay')),+ })).toEqual([]);+ });++ it('keeps paused and takeover state ahead of passthrough ink', () => {+ const supplied: AgentSupply = { ...agent, routes: {} };+ const projection: AgentChain = { ...chain('relay', 'cooldown', false), manual_override: null, route_origin: 'passthrough',+ chain: chain('relay', 'cooldown', false).chain.map((hop) => ({ ...hop, channel: 'hub' })) };+ const relations = buildSupplyRelations([supplied], [source('native', 'hub'), source('relay', 'hub')], {+ [modelChainKey('claude', 'model-a')]: readyRegion(projection),+ });+ expect(relations).toEqual([+ { sourceId: 'native', backend: 'claude', kind: 'unavailable' },+ { sourceId: 'relay', backend: 'claude', kind: 'takeover' },+ ]);+ });++ it('uses a fresh empty chain over old manual membership and retains only known membership while unread', () => {+ const key = modelChainKey('claude', 'model-a');+ const sources = [source('relay', 'hub')];+ expect(buildSupplyRelations([agent], sources, { [key]: unreadRegion() })).toEqual([+ { sourceId: 'relay', backend: 'claude', kind: 'connected_unused' },+ ]);+ expect(buildSupplyRelations([agent], sources, { [key]: readyRegion({ ...chain('relay'), chain: [], current: null,+ manual_override: null, route_origin: null }) })).toEqual([]);+ });+it('derives relation ink from configured routes and the exact current hop', () => {const sources = [source('native', 'native_cli'), source('relay', 'hub'), source('unused', 'hub')];const key = modelChainKey('claude', 'model-a');diff --git a/ui/src/components/settings/models/SupplyGraph.tsx b/ui/src/components/settings/models/SupplyGraph.tsxindex d17649360..4d7a44054 100644--- a/ui/src/components/settings/models/SupplyGraph.tsx+++ b/ui/src/components/settings/models/SupplyGraph.tsx@@ -129,10 +129,11 @@ export const SupplyGraph: React.FC<{);};-const LEGEND_ORDER: SupplyRelationKind[] = ['native', 'gateway', 'connected_unused', 'takeover', 'unavailable'];+const LEGEND_ORDER: SupplyRelationKind[] = ['native', 'gateway', 'passthrough', 'connected_unused', 'takeover', 'unavailable'];const LEGEND_COPY: Record<SupplyRelationKind, string> = {native: 'native',gateway: 'viaGateway',+ passthrough: 'passthrough',connected_unused: 'connectedUnused',takeover: 'takeover',unavailable: 'unavailable',diff --git a/ui/src/components/settings/models/modelHubStylePolicy.test.ts b/ui/src/components/settings/models/modelHubStylePolicy.test.tsindex 037c85080..5ab6f669d 100644--- a/ui/src/components/settings/models/modelHubStylePolicy.test.ts+++ b/ui/src/components/settings/models/modelHubStylePolicy.test.ts@@ -37,6 +37,22 @@ describe('Model Hub theme token policy', () => {});describe('Model Hub visual token policy', () => {+ it('uses the passthrough badge ink for active passthrough wires and their legend', () => {+ const root = postcss.parse(surfaceCss);+ const declarations = (selector: string) => {+ const result: Record<string, string> = {};+ root.walkRules(selector, (rule) => rule.walkDecls((decl) => { result[decl.prop] = decl.value; }));+ return result;+ };+ const ink = declarations('.model-hub-route-origin--passthrough').color;+ expect(ink).toBe('var(--gold-ink)');+ expect(declarations('.model-hub-wire--passthrough')).toMatchObject({+ stroke: ink, 'stroke-width': 'var(--model-hub-wire-active-width)',+ });+ expect(declarations('.model-hub-legend-swatch--passthrough').background).toBe(ink);+ expect(declarations('.model-hub-wire--unavailable')['stroke-width']).toBe('var(--model-hub-wire-muted-width)');+ });+it('contains full Default Routing text in stretched columns and growing rows', () => {const root = postcss.parse(surfaceCss);const declarations = (selector: string) => {diff --git a/ui/src/components/settings/models/modelHubSurface.css b/ui/src/components/settings/models/modelHubSurface.cssindex 7e153254d..db32fd77a 100644--- a/ui/src/components/settings/models/modelHubSurface.css+++ b/ui/src/components/settings/models/modelHubSurface.css@@ -2253,6 +2253,11 @@filter: drop-shadow(var(--shadow-glow-wire-mint));}+.model-hub-wire--passthrough {+ stroke: var(--gold-ink);+ stroke-width: var(--model-hub-wire-active-width);+}+.model-hub-wire--connected_unused {stroke: color-mix(in srgb, var(--foreground) 15%, transparent);stroke-width: var(--model-hub-wire-muted-width);@@ -2296,6 +2301,10 @@height: 1px;}+.model-hub-legend-swatch--passthrough {+ background: var(--gold-ink);+}+/* ── Backend model catalog ────────────────────────────────────────────────* The catalog dialog and its row editor: two halves of one editing surface. The* metrics they share — the 40px control height that puts search and 「Add model」diff --git a/ui/src/components/settings/models/supplyRelations.ts b/ui/src/components/settings/models/supplyRelations.tsindex 4c9417afd..4d209957f 100644--- a/ui/src/components/settings/models/supplyRelations.ts+++ b/ui/src/components/settings/models/supplyRelations.ts@@ -1,12 +1,13 @@import { modelChainKey, type ModelChainIndex } from './modelRows';+import { catalogModelIds } from './backendCatalog';import { equalHopIdentity, hopBelongsToSource } from './hopIdentity';import { foldRegionRead } from './regionRead';import { agentHasLiveChainProjection, type FreshRuntimeProjection } from './runtimeLifecycle';import { classifyChainLink, classifySourceStatus } from './sourceStateClassification';import { isTakeoverChain } from './takeover';-import type { AgentBackend, AgentSupply, Source } from './types';+import type { AgentBackend, AgentChain, AgentSupply, Source } from './types';-export type SupplyRelationKind = 'native' | 'gateway' | 'connected_unused' | 'takeover' | 'unavailable';+export type SupplyRelationKind = 'native' | 'gateway' | 'passthrough' | 'connected_unused' | 'takeover' | 'unavailable';export type SupplyRelation = {sourceId: string;@@ -16,23 +17,16 @@ export type SupplyRelation = {const relationKind = (source: Source,- agent: AgentSupply,- chains: ModelChainIndex,+ chains: readonly AgentChain[],): SupplyRelationKind => {let isCurrent = false;let isTakeover = false;let isUnavailable = false;let hasRunnableLink = false;- for (const modelId of Object.keys(agent.routes ?? {})) {- const read = chains[modelChainKey(agent.backend, modelId)];- const chain = read ? foldRegionRead(read, {- loading: () => null,- ready: (value) => value,- unread: () => null,- degraded: () => null,- }) : null;- if (!chain) continue;+ let passthroughOnly = true;+ for (const chain of chains) {for (const link of chain.chain.filter((candidate) => hopBelongsToSource(candidate, source.id))) {+ passthroughOnly &&= chain.route_origin === 'passthrough';hasRunnableLink ||= link.runnable;if (!link.runnable && classifyChainLink(link) !== null) isUnavailable = true;if (equalHopIdentity(chain.current, link)) {@@ -42,7 +36,7 @@ const relationKind = (}}if (isTakeover) return 'takeover';- if (isCurrent) return source.supply_channel === 'native_cli' ? 'native' : 'gateway';+ if (isCurrent) return source.supply_channel === 'native_cli' ? 'native' : passthroughOnly ? 'passthrough' : 'gateway';if ((!hasRunnableLink && isUnavailable) || classifySourceStatus(source.state.status) !== null) return 'unavailable';return 'connected_unused';};@@ -53,17 +47,28 @@ export function buildSupplyRelations(chains: ModelChainIndex,runtime: FreshRuntimeProjection | null,): SupplyRelation[] {- const sourceById = new Map(sources.map((source) => [source.id, source]));const relations: SupplyRelation[] = [];for (const agent of agents) {if (!agentHasLiveChainProjection(runtime, agent)) continue;- const sourceIds = new Set(- Object.values(agent.routes ?? {}).flatMap((route) => route.hops.map((hop) => hop.source_id)),- );+ const sourceIds = new Set<string>();+ const effectiveChains: AgentChain[] = [];+ for (const modelId of catalogModelIds(agent)) {+ const key = modelChainKey(agent.backend, modelId);+ const read = chains[key];+ const chain = read ? foldRegionRead(read, {+ loading: () => null,+ ready: (value) => modelChainKey(value.backend, value.model_id) === key ? value : null,+ unread: () => null,+ degraded: () => null,+ }) : null;+ if (chain) effectiveChains.push(chain);+ // Unread chains can retain known manual membership, never inferred defaults+ // or stale inherited hops. Only fresh chains classify current supply.+ for (const hop of chain?.chain ?? agent.routes?.[modelId]?.hops ?? []) sourceIds.add(hop.source_id);+ }for (const source of sources) {if (!sourceIds.has(source.id)) continue;- const canonical = sourceById.get(source.id);- if (canonical) relations.push({ sourceId: source.id, backend: agent.backend, kind: relationKind(canonical, agent, chains) });+ relations.push({ sourceId: source.id, backend: agent.backend, kind: relationKind(source, effectiveChains) });}}return relations;diff --git a/ui/src/i18n/en.json b/ui/src/i18n/en.jsonindex 51faff206..e33c26e59 100644--- a/ui/src/i18n/en.json+++ b/ui/src/i18n/en.json@@ -1076,6 +1076,7 @@"legend": {"native": "Native","viaGateway": "Gateway supply",+ "passthrough": "Passthrough","connectedUnused": "Enabled · not currently used","takeover": "Taken over · temporarily rerouted","unavailable": "Supply paused",diff --git a/ui/src/i18n/zh.json b/ui/src/i18n/zh.jsonindex 4eeee835b..188de3abf 100644--- a/ui/src/i18n/zh.json+++ b/ui/src/i18n/zh.json@@ -1076,6 +1076,7 @@"legend": {"native": "Agent 管理","viaGateway": "模型网关管理",+ "passthrough": "透传","connectedUnused": "已启用 · 当前未被使用","takeover": "已自动切换 · 临时使用备用供应商","unavailable": "当前不可用",