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(models): show a replay refusal beside the call's success on a Source chip (#2656)

Call White9296791188dd
diff --git a/tests/scenarios/model_hub/catalog.yaml b/tests/scenarios/model_hub/catalog.yaml
index 919a89360..a66caa0de 100644
--- a/tests/scenarios/model_hub/catalog.yaml
+++ b/tests/scenarios/model_hub/catalog.yaml
@@ -458,6 +458,7 @@ scenarios:
- 'ui/src/components/settings/models/SourceDetailPanel.test.tsx::MH-HOSTED-UI-006: says when the capability read failed instead of drawing a Source with no evidence'
- 'ui/src/components/settings/models/SourceDetailPanel.test.tsx::MH-HOSTED-UI-006: adds no capability column when no model has evidence'
- 'ui/src/components/settings/models/hostedTools.test.ts::MH-HOSTED-UI-006: gives each pair one record, a refusal over a success and a call refusal over a replay one'
+ - 'ui/src/components/settings/models/hostedTools.test.ts::MH-HOSTED-UI-006: gives a Source model one capability per feature, a call refusal hiding the success and the replay'
- 'ui/src/components/settings/models/hostedTools.test.ts::MH-HOSTED-UI-006: gives a Source model one capability per tool with a record, in catalog order'
- id: MH-HOSTED-UI-007
name: Hosted-tool writes and clears run one at a time and a read never overlaps one, so the screen holds the newest committed state
diff --git a/ui/src/components/settings/models/HostedCapabilityChips.tsx b/ui/src/components/settings/models/HostedCapabilityChips.tsx
index 229d2e061..3d07d8b65 100644
--- a/ui/src/components/settings/models/HostedCapabilityChips.tsx
+++ b/ui/src/components/settings/models/HostedCapabilityChips.tsx
@@ -223,7 +223,7 @@ export const HostedCapabilityChips: React.FC<{
}> = ({ modelId, capabilities, refusedEfforts = [], pendingTools, sourceBusy, onClearTool, onClearEffort }) => (
<span className="flex min-w-0 flex-wrap items-center gap-1.5">
{capabilities.map((capability) => (
- <CapabilityChip key={capability.tool} capability={capability} modelId={modelId} clearing={pendingTools.has(capability.tool)} onClear={onClearTool} />
+ <CapabilityChip key={`${capability.tool}:${capability.evidence.kind === 'ok' ? 'ok' : capability.evidence.refusal.aspect}`} capability={capability} modelId={modelId} clearing={pendingTools.has(capability.tool)} onClear={onClearTool} />
))}
{refusedEfforts.map((refused) => (
<EffortChip key={refused.effort} refused={refused} modelId={modelId} clearing={sourceBusy} onClear={onClearEffort} />
diff --git a/ui/src/components/settings/models/SourceDetailPanel.test.tsx b/ui/src/components/settings/models/SourceDetailPanel.test.tsx
index 6811235b7..9ed80d7c0 100644
--- a/ui/src/components/settings/models/SourceDetailPanel.test.tsx
+++ b/ui/src/components/settings/models/SourceDetailPanel.test.tsx
@@ -1402,7 +1402,8 @@ describe('SourceDetailPanel hosted-tool capability chips', () => {
const run = (verified: HostedSuccess[], refusals: HostedRefusal[]) => ({ latest_ok: null, verified, refused: refusals });
const status = (): HostedToolsStatus => ({
tools: [
- { name: 'web_search', enabled: true, status: run([ok('model-a')], [refused('model-b', 'replay')]), executor_order: null, effective_order: [], executor_candidates: [] },
+ // model-b runs web search but refused a replay of its results; model-a refused nothing.
+ { name: 'web_search', enabled: true, status: run([ok('model-a'), ok('model-b')], [refused('model-b', 'replay')]), executor_order: null, effective_order: [], executor_candidates: [] },
// A later refusal on a pair that once ran the tool: the refusal is what routes.
{ name: 'x_search', enabled: true, status: run([ok('model-a', '2026-10-10T08:00:00Z')], [refused('model-a')]), executor_order: null, effective_order: [], executor_candidates: [] },
{ name: 'image_generate', enabled: true, status: run([], []), default_model: null, effective_default: null, models: [], image_offered_by: [] },
@@ -1428,8 +1429,10 @@ describe('SourceDetailPanel hosted-tool capability chips', () => {
it('MH-HOSTED-UI-006: draws one chip per feature with a record, a refusal over a success, and nothing for an unused model', () => {
renderChips(status(), { models: twoModels.models.map(efforts) });
+ // A call refusal wins over the call's success.
expect(chips('model-a')).toEqual(['web_search:ok', 'x_search:refused']);
- expect(chips('model-b')).toEqual(['web_search:replay', 'effort:xhigh']);
+ // A replay refusal is its own feature: it sits beside the success, as the model still runs the tool.
+ expect(chips('model-b')).toEqual(['web_search:ok', 'web_search:replay', 'effort:xhigh']);
cleanup();
renderChips({ tools: [] });
diff --git a/ui/src/components/settings/models/hostedTools.test.ts b/ui/src/components/settings/models/hostedTools.test.ts
index 1ff02ddaf..c8fab4fdd 100644
--- a/ui/src/components/settings/models/hostedTools.test.ts
+++ b/ui/src/components/settings/models/hostedTools.test.ts
@@ -66,6 +66,17 @@ describe('hosted-tool status projection', () => {
]);
});
+ it('MH-HOSTED-UI-006: gives a Source model one capability per feature, a call refusal hiding the success and the replay', () => {
+ const replayed = run({ verified: [ok(RELAY, 'gpt-6-astra', '2026-10-15T08:00:00Z')], refused: [refused(RELAY, 'gpt-6-astra', '2026-10-14T09:00:00Z', 'replay')] });
+ const refusedToo = { ...replayed, refused: [...replayed.refused, refused(RELAY, 'gpt-6-astra', '2026-10-14T10:00:00Z')] };
+ const kinds = (runStatus: HostedToolRunStatus) => modelCapabilities(
+ { tools: [{ name: 'web_search', enabled: true, status: runStatus, executor_order: null, effective_order: [], executor_candidates: [] }] },
+ RELAY, 'gpt-6-astra',
+ ).map(({ evidence }) => (evidence.kind === 'ok' ? 'ok' : evidence.refusal.aspect));
+ expect(kinds(replayed)).toEqual(['ok', 'replay']);
+ expect(kinds(refusedToo)).toEqual(['call']);
+ });
+
it('MH-HOSTED-UI-006: gives a Source model one capability per tool with a record, in catalog order', () => {
const status: HostedToolsStatus = {
tools: [
diff --git a/ui/src/components/settings/models/hostedTools.ts b/ui/src/components/settings/models/hostedTools.ts
index 34a014000..7a82b6c5c 100644
--- a/ui/src/components/settings/models/hostedTools.ts
+++ b/ui/src/components/settings/models/hostedTools.ts
@@ -82,11 +82,24 @@ export const pairEvidence = (status: HostedToolRunStatus): PairEvidence[] => {
export type ModelCapability = { tool: HostedToolName; evidence: PairEvidence };
-/** A Source model's evidence for each tool, in catalog order, for its detail chips. No record draws nothing. */
+/**
+ * A Source model's chips, in catalog order: one per feature with a record. The
+ * call is one feature and its replay another. A call refusal wins over a success,
+ * because it is routing state, and also hides the replay chip, which is moot while
+ * the tool is not declared natively. A replay refusal sits beside the success: the
+ * model still runs the tool. No record draws nothing.
+ */
export const modelCapabilities = (status: HostedToolsStatus, sourceId: string, modelId: string): ModelCapability[] =>
- status.tools.flatMap((tool) => {
- const evidence = pairEvidence(tool.status).find((pair) => pair.sourceId === sourceId && pair.modelId === modelId);
- return evidence ? [{ tool: tool.name, evidence }] : [];
+ status.tools.flatMap((tool): ModelCapability[] => {
+ const mine = <T extends { source_id: string; model_id: string }>(item: T) => item.source_id === sourceId && item.model_id === modelId;
+ const success = tool.status.verified.find(mine) ?? null;
+ const call = tool.status.refused.find((refusal) => mine(refusal) && refusal.aspect === 'call');
+ if (call) return [{ tool: tool.name, evidence: { kind: 'refused', sourceId, modelId, refusal: call, lastOk: success } }];
+ const replay = tool.status.refused.find((refusal) => mine(refusal) && refusal.aspect === 'replay');
+ return [
+ ...(success ? [{ tool: tool.name, evidence: { kind: 'ok', sourceId, modelId, success } } satisfies ModelCapability] : []),
+ ...(replay ? [{ tool: tool.name, evidence: { kind: 'refused', sourceId, modelId, refusal: replay, lastOk: null } } satisfies ModelCapability] : []),
+ ];
});
/**