Skip to content

Local-first AI coding agent desktop: Electron + Rust host core + pi Agent Harness + user-installable plugins

fix(subagents): show provider names on fallback rows

inorilzy930e8692634e
diff --git a/apps/desktop/src/components/settings/SubagentFallbackModels.tsx b/apps/desktop/src/components/settings/SubagentFallbackModels.tsx
index 85f321633..aaf75e2dc 100644
--- a/apps/desktop/src/components/settings/SubagentFallbackModels.tsx
+++ b/apps/desktop/src/components/settings/SubagentFallbackModels.tsx
@@ -3,6 +3,7 @@ import { Button, Field } from "../ui";
import { SubagentModelPicker } from "./SubagentModelPicker";
import {
groupSubagentModelChoices,
+ pinMatchesChoice,
subagentModelSelectValue,
type SubagentModelChoice,
} from "./subagent-models";
@@ -25,17 +26,21 @@ export function SubagentFallbackModels({ primary, values, choices, onChange }: {
return (
<Field label={t("extensions.subagents.fallbackModels")} hint={t("extensions.subagents.fallbackModelsHint")}>
<ol className="space-y-2">
- {values.map((pin, index) => (
- <li key={`${index}:${pin}`} className="flex items-center gap-2">
- <span className="min-w-0 flex-1 break-all text-sm">{index + 1}. {pin}</span>
- <Button size="sm" variant="secondary" disabled={index === 0} onClick={() => move(index, -1)}
- aria-label={t("extensions.subagents.fallbackMoveUp", { model: pin })}>↑</Button>
- <Button size="sm" variant="secondary" disabled={index === values.length - 1} onClick={() => move(index, 1)}
- aria-label={t("extensions.subagents.fallbackMoveDown", { model: pin })}>↓</Button>
- <Button size="sm" variant="secondary" onClick={() => onChange(values.filter((_, position) => position !== index))}
- aria-label={t("extensions.subagents.fallbackRemove", { model: pin })}>×</Button>
- </li>
- ))}
+ {values.map((pin, index) => {
+ const choice = choices.find((candidate) => pinMatchesChoice(pin, candidate));
+ const label = choice ? `${choice.providerName}/${choice.modelId}` : pin;
+ return (
+ <li key={`${index}:${pin}`} className="flex items-center gap-2">
+ <span className="min-w-0 flex-1 break-all text-sm">{index + 1}. {label}</span>
+ <Button size="sm" variant="secondary" disabled={index === 0} onClick={() => move(index, -1)}
+ aria-label={t("extensions.subagents.fallbackMoveUp", { model: label })}>↑</Button>
+ <Button size="sm" variant="secondary" disabled={index === values.length - 1} onClick={() => move(index, 1)}
+ aria-label={t("extensions.subagents.fallbackMoveDown", { model: label })}>↓</Button>
+ <Button size="sm" variant="secondary" onClick={() => onChange(values.filter((_, position) => position !== index))}
+ aria-label={t("extensions.subagents.fallbackRemove", { model: label })}>×</Button>
+ </li>
+ );
+ })}
</ol>
<SubagentModelPicker
value=""
diff --git a/apps/desktop/test/subagent-fallback-label.test.mjs b/apps/desktop/test/subagent-fallback-label.test.mjs
new file mode 100644
index 000000000..d51df5050
--- /dev/null
+++ b/apps/desktop/test/subagent-fallback-label.test.mjs
@@ -0,0 +1,64 @@
+import assert from "node:assert/strict";
+import { createElement } from "react";
+import { renderToStaticMarkup } from "react-dom/server";
+import { createInstance } from "i18next";
+import { I18nextProvider } from "react-i18next";
+import { createServer } from "vite";
+import test from "node:test";
+import { fileURLToPath } from "node:url";
+
+test("fallback rows show configured provider names without changing model pins", async () => {
+ const server = await createServer({
+ root: fileURLToPath(new URL("..", import.meta.url)),
+ configFile: false,
+ server: { middlewareMode: true, hmr: false, ws: false },
+ esbuild: { jsx: "automatic" },
+ appType: "custom",
+ optimizeDeps: { noDiscovery: true, include: [] },
+ });
+ try {
+ const { SubagentFallbackModels } = await server.ssrLoadModule(
+ "/src/components/settings/SubagentFallbackModels.tsx",
+ );
+ const i18n = createInstance();
+ await i18n.init({ lng: "en", interpolation: { escapeValue: false }, resources: { en: { translation: {
+ extensions: { subagents: {
+ fallbackMoveUp: "Move {{model}} up",
+ fallbackMoveDown: "Move {{model}} down",
+ fallbackRemove: "Remove {{model}}",
+ } },
+ } } } });
+ const render = (values, choices) => renderToStaticMarkup(
+ createElement(I18nextProvider, { i18n }, createElement(SubagentFallbackModels, {
+ primary: "",
+ values,
+ choices,
+ onChange() {},
+ })),
+ );
+ const pin = "721fcc76-026e-4f35-a32d-5e2a8d204499/deepseek-v4.1-flash";
+ const choices = [{
+ value: "other-provider/deepseek-v4.1-flash",
+ modelId: "deepseek-v4.1-flash",
+ providerId: "other-provider",
+ providerName: "Other Workspace",
+ vendorKey: "custom",
+ }, {
+ value: pin,
+ modelId: "deepseek-v4.1-flash",
+ providerId: "721fcc76-026e-4f35-a32d-5e2a8d204499",
+ providerName: "DeepSeek Workspace",
+ vendorKey: "custom",
+ }];
+ const html = render([pin], choices);
+ assert.match(html, /DeepSeek Workspace\/deepseek-v4\.1-flash/);
+ assert.match(html, /aria-label="Remove DeepSeek Workspace\/deepseek-v4\.1-flash"/);
+ assert.doesNotMatch(html, /721fcc76-026e-4f35-a32d-5e2a8d204499/);
+ assert.doesNotMatch(html, /1\. Other Workspace\/deepseek-v4\.1-flash/);
+
+ const unavailable = render([pin], []);
+ assert.match(unavailable, /721fcc76-026e-4f35-a32d-5e2a8d204499\/deepseek-v4\.1-flash/);
+ } finally {
+ await server.close();
+ }
+});
diff --git a/docs/spec/03-runtime/13-model-catalog-and-selection.md b/docs/spec/03-runtime/13-model-catalog-and-selection.md
index afceb37ae..c33e53723 100644
--- a/docs/spec/03-runtime/13-model-catalog-and-selection.md
+++ b/docs/spec/03-runtime/13-model-catalog-and-selection.md
@@ -156,7 +156,9 @@ provider disappears from the picker.
The sheet also offers an ordered **Fallback models** list using that same
configured-model picker. Users can add, move up/down, or remove alternatives.
-Already-selected models are excluded from the add menu. Saved pins that become
+Already-selected models are excluded from the add menu. Each saved row shows the
+configured provider display name and model ID when the catalog still contains it;
+the stored pin is unchanged. Saved pins that become
unavailable stay visible and removable; reopening or editing another field
must not drop them. Clearing the list saves `fallbackModels: []`. Inherit-session
remains a primary-only choice. The hint explains that alternatives run after
diff --git a/docs/spec/06-delivery/04-e2e-test-plan.md b/docs/spec/06-delivery/04-e2e-test-plan.md
index 5ffa65dbf..13f84c7c6 100644
--- a/docs/spec/06-delivery/04-e2e-test-plan.md
+++ b/docs/spec/06-delivery/04-e2e-test-plan.md
@@ -10200,6 +10200,12 @@ This test plan spec is accepted when:
confirm the sheet saves with the pin `<display name>/<modelId>` and the
save button enabled. The picker and the draft check must never disagree
about what is saveable.
+ 4b. Configure two providers with the same display name and vendor key, so
+ their pins use distinct stored provider ids. Add one as a fallback model,
+ save and reopen the sheet. Confirm the ordered row and its move/remove
+ accessible names use the provider display name and model ID, not the id,
+ while the saved pin still identifies the chosen provider. Disable that
+ provider and confirm the unavailable pin stays visible and removable.
5. Confirm the picker offers no **Custom (provider/model)…** entry and the
field renders no free-text input, so a model id can only come from the
configured catalog. Switch the picker to **Inherit session model**, save,