Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.
Go
feat(agents): archive from Settings and allow archiving Mika (MUL-10292) (#11668)
Jiayuan Zhangb64739562c3f
diff --git a/packages/core/onboarding/index.ts b/packages/core/onboarding/index.tsindex c732b8d05f..490cf163be 100644--- a/packages/core/onboarding/index.ts+++ b/packages/core/onboarding/index.ts@@ -27,6 +27,7 @@ export {} from "./use-bootstrap-mika";export {MIKA_SYSTEM_KEY,+ isArchivableAgent,isMikaAgent,memberNeedsMikaSetup,workspaceNeedsMika,diff --git a/packages/core/onboarding/mika.test.ts b/packages/core/onboarding/mika.test.tsindex 0b1564a557..bb232df3da 100644--- a/packages/core/onboarding/mika.test.ts+++ b/packages/core/onboarding/mika.test.ts@@ -1,5 +1,10 @@import { describe, expect, it } from "vitest";-import { isMikaAgent, memberNeedsMikaSetup, workspaceNeedsMika } from "./mika";+import {+ isArchivableAgent,+ isMikaAgent,+ memberNeedsMikaSetup,+ workspaceNeedsMika,+} from "./mika";const mika = { id: "agent-mika", system_key: "mika" };const other = { id: "agent-other", system_key: undefined };@@ -67,4 +72,21 @@ describe("memberNeedsMikaSetup", () => {it("is false once the member has a kicked-off Mika conversation", () => {expect(memberNeedsMikaSetup([other, mika], [kicked])).toBe(false);});++ // Archiving Mika opts the workspace out; the server would refuse to+ // provision a second one anyway.+ it("is false when Mika is archived, even without a session", () => {+ expect(+ memberNeedsMikaSetup([{ ...mika, archived_at: "2026-11-26T08:00:00Z" }], []),+ ).toBe(false);+ });+});++describe("isArchivableAgent", () => {+ it("allows ordinary agents and Mika, but not other system agents", () => {+ expect(isArchivableAgent({ system_key: undefined })).toBe(true);+ expect(isArchivableAgent({ system_key: "" })).toBe(true);+ expect(isArchivableAgent({ system_key: "mika" })).toBe(true);+ expect(isArchivableAgent({ system_key: "agent_builder:abc" })).toBe(false);+ });});diff --git a/packages/core/onboarding/mika.ts b/packages/core/onboarding/mika.tsindex 1250920543..10797ffc07 100644--- a/packages/core/onboarding/mika.ts+++ b/packages/core/onboarding/mika.ts@@ -11,6 +11,14 @@ export function isMikaAgent(agent: Pick<Agent, "system_key">): boolean {return agent.system_key === MIKA_SYSTEM_KEY;}+/**+ * Whether the workspace may archive this agent. Mirrors the server's archive+ * guard: Mika is the one product-defined agent with a lifecycle of its own.+ */+export function isArchivableAgent(agent: Pick<Agent, "system_key">): boolean {+ return !agent.system_key || isMikaAgent(agent);+}+/*** Whether the workspace still needs a Mika provisioned.*@@ -40,11 +48,14 @@ export function workspaceNeedsMika(agents: Pick<Agent, "system_key">[]): boolean* re-running the flow from here is always safe.*/export function memberNeedsMikaSetup(- agents: Pick<Agent, "id" | "system_key">[],+ agents: (Pick<Agent, "id" | "system_key"> & { archived_at?: string | null })[],sessions: Pick<ChatSession, "agent_id" | "last_message">[],): boolean {const mika = agents.find(isMikaAgent);if (!mika) return true;+ // An archived Mika is the workspace opting out, and the server refuses to+ // provision past her.+ if (mika.archived_at) return false;// Sessions are per member, so this is the caller's own conversation.const session = sessions.find((s) => s.agent_id === mika.id);diff --git a/packages/views/agents/components/agent-advanced-settings.tsx b/packages/views/agents/components/agent-advanced-settings.tsxindex 9749c5e298..6a532c386e 100644--- a/packages/views/agents/components/agent-advanced-settings.tsx+++ b/packages/views/agents/components/agent-advanced-settings.tsx@@ -30,6 +30,7 @@ import { McpConfigTab } from "./tabs/mcp-config-tab";import { AgentAppsTab } from "./tabs/agent-apps-tab";import { QoderAgentTab } from "./tabs/qoder-agent-tab";import { RuntimeConfigTab } from "./tabs/runtime-config-tab";+import { AgentLifecycleSection } from "./agent-lifecycle-section";import { AgentDetailInspector } from "./agent-detail-inspector";import { AgentAccessSettings } from "./agent-access-settings";import { useT } from "../../i18n";@@ -90,6 +91,8 @@ interface AgentAdvancedSettingsProps {/** The open section, or `null` when the dialog is closed. */section: AdvancedSection | null;onSectionChange: (section: AdvancedSection | null) => void;+ /** Present when the caller may archive or restore this agent. */+ lifecycle?: { onArchive: () => void; onRestore: () => void };}/**@@ -107,6 +110,7 @@ export function AgentAdvancedSettings({canEdit,section,onSectionChange,+ lifecycle,}: AgentAdvancedSettingsProps) {const { t } = useT("agents");const composioMCPAppsEnabled = useFeatureEnabled(@@ -265,6 +269,15 @@ export function AgentAdvancedSettings({currentUserId={currentUserId}canEdit={canEdit}onUpdate={onUpdate}+ footer={+ lifecycle ? (+ <AgentLifecycleSection+ archived={!!agent.archived_at}+ onArchive={lifecycle.onArchive}+ onRestore={lifecycle.onRestore}+ />+ ) : null+ }/>)}{active.id === "access" && (diff --git a/packages/views/agents/components/agent-detail-inspector.tsx b/packages/views/agents/components/agent-detail-inspector.tsxindex 3b94d631e9..f3aeac4f0d 100644--- a/packages/views/agents/components/agent-detail-inspector.tsx+++ b/packages/views/agents/components/agent-detail-inspector.tsx@@ -1,6 +1,6 @@"use client";-import { useCallback, useEffect, useMemo, useState } from "react";+import { useCallback, useEffect, useMemo, useState, type ReactNode } from "react";import type {Agent,AgentConversationStarter,@@ -48,6 +48,8 @@ interface InspectorProps {currentUserId: string | null;canEdit: boolean;onUpdate: (id: string, data: Record<string, unknown>) => Promise<void>;+ /** Rendered last in the form column, below the execution settings. */+ footer?: ReactNode;}interface ProfileDraft {@@ -88,6 +90,7 @@ export function AgentDetailInspector({currentUserId,canEdit,onUpdate,+ footer,}: InspectorProps) {const { t } = useT("agents");const { t: ts } = useT("settings");@@ -369,6 +372,8 @@ export function AgentDetailInspector({</SettingsRow></SettingsCard></SettingsSection>++ {footer}</div><SettingsSectiondiff --git a/packages/views/agents/components/agent-detail-page.test.tsx b/packages/views/agents/components/agent-detail-page.test.tsxindex 6651dbe6b3..b6fc2ab2e8 100644--- a/packages/views/agents/components/agent-detail-page.test.tsx+++ b/packages/views/agents/components/agent-detail-page.test.tsx@@ -783,10 +783,24 @@ describe("AgentDetailPage DM button", () => {});describe("AgentDetailPage more actions", () => {- it("keeps Settings and copy actions but no Archive for a system agent", async () => {+ it("offers Archive for Mika and says the Mika prompt stops", async () => {+ agentsRef.current = [{ ...baseAgent, system_key: "mika" }];+ membersRef.current = [{ user_id: "user-1", role: "admin" }];+ renderPage();++ await screen.findByRole("button", { name: "Assign work" });+ fireEvent.click(+ within(openMoreActions()).getByRole("menuitem", { name: "Archive agent" }),+ );+ expect(+ await screen.findByText(/"Start with Mika" prompt won't appear again/),+ ).toBeInTheDocument();+ });++ it("keeps Settings and copy actions but no Archive for other system agents", async () => {// An admin passes `canEditAgent`, so only the system key keeps Archive// out of the menu.- agentsRef.current = [{ ...baseAgent, system_key: "mika" }];+ agentsRef.current = [{ ...baseAgent, system_key: "agent_builder:abc" }];membersRef.current = [{ user_id: "user-1", role: "admin" }];renderPage();diff --git a/packages/views/agents/components/agent-detail-page.tsx b/packages/views/agents/components/agent-detail-page.tsxindex f9cdc63610..f82d85c9d9 100644--- a/packages/views/agents/components/agent-detail-page.tsx+++ b/packages/views/agents/components/agent-detail-page.tsx@@ -16,7 +16,6 @@ import {Server,Settings2,Square,- Trash2,} from "@multica/ui/icons";import { toast } from "sonner";import { useQuery, useQueryClient } from "@tanstack/react-query";@@ -34,6 +33,7 @@ import { useWorkspaceId } from "@multica/core/hooks";import { refreshFeaturesOnLockedError } from "@multica/core/billing";import { useModalStore } from "@multica/core/modals";import { useWorkspacePaths } from "@multica/core/paths";+import { isArchivableAgent, isMikaAgent } from "@multica/core/onboarding";import {agentDetailOptions,agentListOptions,@@ -450,8 +450,8 @@ export function AgentDetailPage({ agentId }: AgentDetailPageProps) {const runningCount = presence?.runningCount ?? 0;const queuedCount = presence?.queuedCount ?? 0;const hasActiveWork = runningCount + queuedCount > 0;- // Multica's built-in agents cannot be archived — the server refuses it.- const canArchive = canEdit.allowed && !isArchived && !agent.system_key;+ const canManageLifecycle = canEdit.allowed && isArchivableAgent(agent);+ const canArchive = canManageLifecycle && !isArchived;// Chat shares the invocation gate with assignment (MUL-3963): starting a// chat triggers agent runs. The button stays visible either way — a denied@@ -585,7 +585,7 @@ export function AgentDetailPage({ agentId }: AgentDetailPageProps) {variant="destructive"onClick={() => setConfirmArchive(true)}>- <Trash2 />+ <Archive />{t(($) => $.detail.more_archive)}</DropdownMenuItem></>@@ -743,6 +743,14 @@ export function AgentDetailPage({ agentId }: AgentDetailPageProps) {canEdit={canEdit.allowed}section={advancedSection}onSectionChange={openAdvanced}+ lifecycle={+ canManageLifecycle+ ? {+ onArchive: () => setConfirmArchive(true),+ onRestore: () => void handleRestore(agent.id),+ }+ : undefined+ }/><AgentWorkDialog agent={agent} open={workOpen} onOpenChange={openWork} />@@ -799,6 +807,7 @@ export function AgentDetailPage({ agentId }: AgentDetailPageProps) {</DialogTitle><DialogDescription className="text-caption">{t(($) => $.detail.archive_dialog_description, { name: agent.name })}+ {isMikaAgent(agent) && t(($) => $.row_actions.archive_dialog_mika_note)}</DialogDescription></DialogHeader></div>diff --git a/packages/views/agents/components/agent-lifecycle-section.test.tsx b/packages/views/agents/components/agent-lifecycle-section.test.tsxnew file mode 100644index 0000000000..d0645b62e2--- /dev/null+++ b/packages/views/agents/components/agent-lifecycle-section.test.tsx@@ -0,0 +1,41 @@+// @vitest-environment jsdom++import { describe, it, expect, vi } from "vitest";+import { fireEvent, render, screen } from "@testing-library/react";+import { I18nProvider } from "@multica/core/i18n/react";+import enAgents from "../../locales/en/agents.json";+import { AgentLifecycleSection } from "./agent-lifecycle-section";++function renderSection(archived: boolean) {+ const onArchive = vi.fn();+ const onRestore = vi.fn();+ render(+ <I18nProvider locale="en" resources={{ en: { agents: enAgents } }}>+ <AgentLifecycleSection+ archived={archived}+ onArchive={onArchive}+ onRestore={onRestore}+ />+ </I18nProvider>,+ );+ return { onArchive, onRestore };+}++describe("AgentLifecycleSection", () => {+ it("offers Archive in a danger zone for an active agent", () => {+ const { onArchive, onRestore } = renderSection(false);+ expect(screen.getByText("Danger zone")).toBeInTheDocument();+ fireEvent.click(screen.getByRole("button", { name: "Archive" }));+ expect(onArchive).toHaveBeenCalledOnce();+ expect(onRestore).not.toHaveBeenCalled();+ expect(screen.queryByRole("button", { name: "Restore" })).not.toBeInTheDocument();+ });++ it("offers Restore for an archived agent", () => {+ const { onArchive, onRestore } = renderSection(true);+ expect(screen.queryByText("Danger zone")).not.toBeInTheDocument();+ fireEvent.click(screen.getByRole("button", { name: "Restore" }));+ expect(onRestore).toHaveBeenCalledOnce();+ expect(onArchive).not.toHaveBeenCalled();+ });+});diff --git a/packages/views/agents/components/agent-lifecycle-section.tsx b/packages/views/agents/components/agent-lifecycle-section.tsxnew file mode 100644index 0000000000..2976f1721f--- /dev/null+++ b/packages/views/agents/components/agent-lifecycle-section.tsx@@ -0,0 +1,60 @@+"use client";++import { Archive, ArchiveRestore } from "@multica/ui/icons";+import { Button } from "@multica/ui/components/ui/button";+import {+ SettingsCard,+ SettingsRow,+ SettingsSection,+} from "../../settings/components/settings-layout";+import { useT } from "../../i18n";++/**+ * Archive / Restore at the foot of Settings → General — where people look for+ * an agent's lifecycle. Same actions as the page's More menu.+ */+export function AgentLifecycleSection({+ archived,+ onArchive,+ onRestore,+}: {+ archived: boolean;+ onArchive: () => void;+ onRestore: () => void;+}) {+ const { t } = useT("agents");++ if (archived) {+ return (+ <SettingsSection title={t(($) => $.row.archived)}>+ <SettingsCard>+ <SettingsRow+ label={t(($) => $.lifecycle.restore_label)}+ description={t(($) => $.detail.archived_banner)}+ >+ <Button variant="outline" size="sm" onClick={onRestore}>+ <ArchiveRestore />+ {t(($) => $.row_actions.restore)}+ </Button>+ </SettingsRow>+ </SettingsCard>+ </SettingsSection>+ );+ }++ return (+ <SettingsSection title={t(($) => $.lifecycle.danger_zone)}>+ <SettingsCard>+ <SettingsRow+ label={t(($) => $.detail.more_archive)}+ description={t(($) => $.row_actions.archive_dialog_description)}+ >+ <Button variant="outline" size="sm" onClick={onArchive}>+ <Archive />+ {t(($) => $.row_actions.archive)}+ </Button>+ </SettingsRow>+ </SettingsCard>+ </SettingsSection>+ );+}diff --git a/packages/views/agents/components/agent-row-actions.tsx b/packages/views/agents/components/agent-row-actions.tsxindex 7021d3c2e0..834691605b 100644--- a/packages/views/agents/components/agent-row-actions.tsx+++ b/packages/views/agents/components/agent-row-actions.tsx@@ -3,17 +3,18 @@import { useState, type ReactNode } from "react";import {AlertCircle,+ Archive,Copy,ExternalLink,RotateCcw,Settings2,Square,- Trash2,} from "@multica/ui/icons";import { useQueryClient } from "@tanstack/react-query";import { toast } from "sonner";import type { Agent } from "@multica/core/types";import type { AgentPresenceDetail } from "@multica/core/agents";+import { isArchivableAgent, isMikaAgent } from "@multica/core/onboarding";import { api } from "@multica/core/api";import { useWorkspaceId } from "@multica/core/hooks";import { useWorkspacePaths } from "@multica/core/paths";@@ -88,11 +89,7 @@ export function AgentRowActions({// branches.const showStop = canManage && !isArchived && hasActiveWork;const showDuplicate = !isArchived; // any workspace member can duplicate- // Multica's built-in agents cannot be archived — the server refuses it, and- // the workspace's entry point runs through one. Hide the action rather than- // let it fail with a toast.- const isSystemAgent = !!agent.system_key;- const showArchive = canManage && !isArchived && !isSystemAgent;+ const showArchive = canManage && !isArchived && isArchivableAgent(agent);const showRestore = canManage && isArchived;const invalidateAgents = () => {@@ -198,7 +195,7 @@ export function AgentRowActions({variant="destructive"onClick={() => setConfirmArchive(true)}>- <Trash2 className="h-3.5 w-3.5" />+ <Archive className="h-3.5 w-3.5" />{t(($) => $.row_actions.archive)}</DropdownMenuItem></>@@ -258,6 +255,7 @@ export function AgentRowActions({</AlertDialogTitle><AlertDialogDescription>{t(($) => $.row_actions.archive_dialog_description)}+ {isMikaAgent(agent) && t(($) => $.row_actions.archive_dialog_mika_note)}</AlertDialogDescription></div></div>diff --git a/packages/views/locales/en/agents.json b/packages/views/locales/en/agents.jsonindex 193a33568a..ded2a91a2d 100644--- a/packages/views/locales/en/agents.json+++ b/packages/views/locales/en/agents.json@@ -131,6 +131,7 @@"cancel_dialog_confirm": "Cancel all runs","archive_dialog_title": "Archive \"{{name}}\"?","archive_dialog_description": "The agent won't be assignable or mentionable, and any active runs will be cancelled. All history is preserved and you can restore it later.",+ "archive_dialog_mika_note": " The \"Start with Mika\" prompt won't appear again until Mika is restored.","archive_dialog_cancel": "Cancel","archive_dialog_confirm": "Archive","set_access_applies_to_one": "Applies to {{count}} agent.",@@ -1139,5 +1140,9 @@"new_app": "New app for this agent","adds_app_note": "Answering adds {{app}} to {{agent}} for future runs.","add_to_agent": "Add {{app}} to {{agent}}"+ },+ "lifecycle": {+ "danger_zone": "Danger zone",+ "restore_label": "Restore agent"}}diff --git a/packages/views/locales/es/agents.json b/packages/views/locales/es/agents.jsonindex c755a2781a..c6e60f9280 100644--- a/packages/views/locales/es/agents.json+++ b/packages/views/locales/es/agents.json@@ -131,6 +131,7 @@"cancel_dialog_confirm": "Cancelar todas las ejecuciones","archive_dialog_title": "¿Archivar \"{{name}}\"?","archive_dialog_description": "El agente no podrá asignarse ni mencionarse, y sus ejecuciones activas se cancelarán. Todo el historial se conserva y podrás restaurarlo más tarde.",+ "archive_dialog_mika_note": " La sugerencia «Empezar con Mika» no volverá a aparecer hasta que restaures a Mika.","archive_dialog_cancel": "Cancelar","archive_dialog_confirm": "Archivar","set_access_applies_to_one": "Se aplica a {{count}} agente.",@@ -1139,5 +1140,9 @@"new_app": "Nueva aplicación para este agente","adds_app_note": "Al responder, se añade {{app}} a {{agent}} para las próximas ejecuciones.","add_to_agent": "Añadir {{app}} a {{agent}}"+ },+ "lifecycle": {+ "danger_zone": "Zona peligrosa",+ "restore_label": "Restaurar agente"}}diff --git a/packages/views/locales/fr/agents.json b/packages/views/locales/fr/agents.jsonindex 7c154d8603..6dbc45575f 100644--- a/packages/views/locales/fr/agents.json+++ b/packages/views/locales/fr/agents.json@@ -131,6 +131,7 @@"cancel_dialog_confirm": "Annuler toutes les exécutions","archive_dialog_title": "Archiver « {{name}} » ?","archive_dialog_description": "L'agent ne pourra plus être assigné ni mentionné, et ses exécutions actives seront annulées. Tout l'historique sera conservé et vous pourrez le restaurer plus tard.",+ "archive_dialog_mika_note": " L'invite « Commencer avec Mika » ne réapparaîtra pas tant que Mika n'est pas restaurée.","archive_dialog_cancel": "Annuler","archive_dialog_confirm": "Archiver","set_access_applies_to_one": "S'applique à {{count}} agent.",@@ -1139,5 +1140,9 @@"new_app": "Nouvelle app pour cet agent","adds_app_note": "Répondre ajoute {{app}} à {{agent}} pour les prochaines exécutions.","add_to_agent": "Ajouter {{app}} à {{agent}}"+ },+ "lifecycle": {+ "danger_zone": "Zone de danger",+ "restore_label": "Restaurer l'agent"}}diff --git a/packages/views/locales/ja/agents.json b/packages/views/locales/ja/agents.jsonindex b99bf5932c..cbef18a0df 100644--- a/packages/views/locales/ja/agents.json+++ b/packages/views/locales/ja/agents.json@@ -123,6 +123,7 @@"cancel_dialog_confirm": "すべての実行をキャンセル","archive_dialog_title": "\"{{name}}\" をアーカイブしますか?","archive_dialog_description": "このエージェントは割り当てやメンションができなくなり、アクティブな実行はすべてキャンセルされます。履歴はすべて保持され、後で復元できます。",+ "archive_dialog_mika_note": "Mika を復元するまで「Mika と始める」は表示されなくなります。","archive_dialog_cancel": "キャンセル","archive_dialog_confirm": "アーカイブ","set_access_applies_to_other": "{{count}} 件の agent に適用します。"@@ -1107,5 +1108,9 @@"new_app": "このエージェントの新しいアプリ","adds_app_note": "応答すると、今後の実行で {{agent}} が {{app}} を使えるようになります。","add_to_agent": "{{app}} を {{agent}} に追加"+ },+ "lifecycle": {+ "danger_zone": "危険な操作",+ "restore_label": "エージェントを復元"}}diff --git a/packages/views/locales/ko/agents.json b/packages/views/locales/ko/agents.jsonindex 7742fd5dcd..d97aa2d2d5 100644--- a/packages/views/locales/ko/agents.json+++ b/packages/views/locales/ko/agents.json@@ -123,6 +123,7 @@"cancel_dialog_confirm": "모든 실행 취소","archive_dialog_title": "\"{{name}}\"을(를) 보관할까요?","archive_dialog_description": "이 에이전트는 할당하거나 멘션할 수 없고, 활성 실행은 모두 취소됩니다. 기록은 유지되며 나중에 복원할 수 있습니다.",+ "archive_dialog_mika_note": " Mika를 복원하기 전까지 'Mika와 시작' 안내가 다시 표시되지 않습니다.","archive_dialog_cancel": "취소","archive_dialog_confirm": "보관","set_access_applies_to_other": "{{count}}개 agent에 적용됩니다."@@ -1107,5 +1108,9 @@"new_app": "이 에이전트의 새 앱","adds_app_note": "응답하면 이후 실행부터 {{agent}}이(가) {{app}}을(를) 사용할 수 있습니다.","add_to_agent": "{{agent}}에 {{app}} 추가"+ },+ "lifecycle": {+ "danger_zone": "위험 영역",+ "restore_label": "에이전트 복원"}}diff --git a/packages/views/locales/ru/agents.json b/packages/views/locales/ru/agents.jsonindex 5dfbdd1c42..83cd28a3b7 100644--- a/packages/views/locales/ru/agents.json+++ b/packages/views/locales/ru/agents.json@@ -139,6 +139,7 @@"cancel_dialog_confirm": "Отменить все запуски","archive_dialog_title": "Архивировать «{{name}}»?","archive_dialog_description": "Агента нельзя будет назначить или упомянуть, а все активные запуски будут отменены. Вся история сохраняется, и позже вы сможете его восстановить.",+ "archive_dialog_mika_note": " Предложение «Начать с Mika» не появится, пока Mika не будет восстановлена.","archive_dialog_cancel": "Отмена","archive_dialog_confirm": "Архивировать","cancelled_tasks_toast_few": "Отменено запусков: {{count}}",@@ -1203,5 +1204,9 @@"new_app": "Новое приложение для этого агента","adds_app_note": "Ответ добавит {{app}} агенту {{agent}} для будущих запусков.","add_to_agent": "Добавить {{app}} агенту {{agent}}"+ },+ "lifecycle": {+ "danger_zone": "Опасная зона",+ "restore_label": "Восстановить агента"}}diff --git a/packages/views/locales/zh-Hans/agents.json b/packages/views/locales/zh-Hans/agents.jsonindex beed855857..08408cc63e 100644--- a/packages/views/locales/zh-Hans/agents.json+++ b/packages/views/locales/zh-Hans/agents.json@@ -123,6 +123,7 @@"cancel_dialog_confirm": "取消全部运行","archive_dialog_title": "归档\"{{name}}\"?","archive_dialog_description": "归档后这个智能体将无法被分配或提及,进行中的运行会被取消。所有历史会被保留,可以稍后恢复。",+ "archive_dialog_mika_note": "恢复 Mika 之前,不会再出现\"和 Mika 开始\"的提示。","archive_dialog_cancel": "取消","archive_dialog_confirm": "归档","set_access_applies_to_other": "将应用于 {{count}} 个智能体。"@@ -1107,5 +1108,9 @@"new_app": "此智能体的新应用","adds_app_note": "回应后,{{agent}} 之后的运行都可以使用 {{app}}。","add_to_agent": "将 {{app}} 添加给 {{agent}}"+ },+ "lifecycle": {+ "danger_zone": "危险操作",+ "restore_label": "恢复智能体"}}diff --git a/packages/views/locales/zh-Hant/agents.json b/packages/views/locales/zh-Hant/agents.jsonindex c6fbe00704..2ca3b3ae70 100644--- a/packages/views/locales/zh-Hant/agents.json+++ b/packages/views/locales/zh-Hant/agents.json@@ -123,6 +123,7 @@"cancel_dialog_confirm": "取消全部執行","archive_dialog_title": "歸檔\"{{name}}\"?","archive_dialog_description": "歸檔後這個 AI 代理將無法被分配或提及,進行中的執行會被取消。所有歷史會被保留,可以稍後恢復。",+ "archive_dialog_mika_note": "恢復 Mika 之前,不會再出現「和 Mika 開始」的提示。","archive_dialog_cancel": "取消","archive_dialog_confirm": "歸檔","set_access_applies_to_other": "將應用於 {{count}} 個 AI 代理。"@@ -1107,5 +1108,9 @@"new_app": "此 AI 代理的新應用","adds_app_note": "回應後,{{agent}} 之後的執行都可以使用 {{app}}。","add_to_agent": "將 {{app}} 新增至 {{agent}}"+ },+ "lifecycle": {+ "danger_zone": "危險操作",+ "restore_label": "恢復 AI 代理"}}diff --git a/server/internal/handler/agent.go b/server/internal/handler/agent.goindex 05f3d3fa6f..718033e855 100644--- a/server/internal/handler/agent.go+++ b/server/internal/handler/agent.go@@ -2955,12 +2955,10 @@ func (h *Handler) ArchiveAgent(w http.ResponseWriter, r *http.Request) {return}- // A system agent belongs to the product, not to the workspace, and the- // workspace's whole entry point runs through it. Archiving it would hide- // it from every list while leaving the row in place — which also strands- // the bootstrap endpoint, since its lookup skips archived rows but the- // unique index does not.- if agent.SystemKey.Valid && agent.SystemKey.String != "" {+ // Mika is the one product-defined agent a workspace may archive; the Mika+ // bootstrap refuses to provision past an archived one. Other system agents+ // are runtime infrastructure with no lifecycle of their own.+ if agent.SystemKey.Valid && agent.SystemKey.String != "" && agent.SystemKey.String != service.MikaSystemKey {writeError(w, http.StatusBadRequest, "this agent is built into Multica and cannot be archived")return}diff --git a/server/internal/handler/mika_agent.go b/server/internal/handler/mika_agent.goindex 51f33f2c67..9a0852d784 100644--- a/server/internal/handler/mika_agent.go+++ b/server/internal/handler/mika_agent.go@@ -124,7 +124,7 @@ func (h *Handler) resolveMikaAgent(w http.ResponseWriter, r *http.Request, worksWorkspaceID: wsUUID,SystemKey: pgtype.Text{String: service.MikaSystemKey, Valid: true},}); err == nil {- return existing, false, true+ return refuseArchivedMika(w, existing)} else if !errors.Is(err, pgx.ErrNoRows) {writeError(w, http.StatusInternalServerError, "failed to look up the workspace agent")return db.Agent{}, false, false@@ -171,7 +171,7 @@ func (h *Handler) resolveMikaAgent(w http.ResponseWriter, r *http.Request, worksWorkspaceID: wsUUID,SystemKey: pgtype.Text{String: service.MikaSystemKey, Valid: true},}); err == nil {- return existing, false, true+ return refuseArchivedMika(w, existing)} else if !errors.Is(err, pgx.ErrNoRows) {writeError(w, http.StatusInternalServerError, "failed to look up the workspace agent")return db.Agent{}, false, false@@ -236,6 +236,17 @@ func (h *Handler) resolveMikaAgent(w http.ResponseWriter, r *http.Request, worksreturn created, true, true}+// refuseArchivedMika resolves an existing Mika row for resolveMikaAgent. An+// archived Mika is a workspace's decision to stop using her: neither restore+// her behind that decision nor provision a second one past it.+func refuseArchivedMika(w http.ResponseWriter, existing db.Agent) (db.Agent, bool, bool) {+ if existing.ArchivedAt.Valid {+ writeError(w, http.StatusConflict, "Mika is archived in this workspace; restore her from the Agents page to use her again")+ return db.Agent{}, false, false+ }+ return existing, false, true+}+func (h *Handler) writeMikaAgentResponse(w http.ResponseWriter, r *http.Request, agent db.Agent, workspaceID, userID, sessionTitle string, created bool) {resp := h.agentToResponse(agent)if err := h.enrichAgentResponseWithTargets(r.Context(), &resp, agent.ID); err != nil {diff --git a/server/internal/handler/mika_agent_test.go b/server/internal/handler/mika_agent_test.goindex f01d37d4e7..24c8e1582f 100644--- a/server/internal/handler/mika_agent_test.go+++ b/server/internal/handler/mika_agent_test.go@@ -175,36 +175,58 @@ func TestMikaSystemInstructionsUsesTheCurrentDisplayName(t *testing.T) {}}-// TestArchiveMikaIsRejected: archiving would hide the workspace's entry point-// while leaving the row in place, which also strands the bootstrap endpoint —-// its lookup skips archived rows but the unique index does not.-func TestArchiveMikaIsRejected(t *testing.T) {+// An archived Mika still holds the workspace's slot and her name, so the+// bootstrap must refuse rather than restore her or insert a second row.+func TestArchivedMikaIsNotReprovisioned(t *testing.T) {cleanupMika(t)- w := createMika(t, map[string]any{- "runtime_id": handlerTestRuntimeID(t),- "language": "en",- })+ runtimeID := handlerTestRuntimeID(t)+ w := createMika(t, map[string]any{"runtime_id": runtimeID, "language": "en"})if w.Code != http.StatusCreated {t.Fatalf("create: expected 201, got %d: %s", w.Code, w.Body.String())}agentID := decodeAgent(t, w).ID- req := withChatTestWorkspaceCtx(t, withURLParam(- newRequest("POST", "/api/agents/"+agentID+"/archive", nil), "id", agentID,- ))- archiveW := httptest.NewRecorder()- testHandler.ArchiveAgent(archiveW, req)- if archiveW.Code != http.StatusBadRequest {- t.Fatalf("archiving a system agent: expected 400, got %d: %s", archiveW.Code, archiveW.Body.String())+ lifecycle := func(action string) *httptest.ResponseRecorder {+ req := withChatTestWorkspaceCtx(t, withURLParam(+ newRequest("POST", "/api/agents/"+agentID+"/"+action, nil), "id", agentID,+ ))+ rec := httptest.NewRecorder()+ if action == "archive" {+ testHandler.ArchiveAgent(rec, req)+ } else {+ testHandler.RestoreAgent(rec, req)+ }+ return rec+ }++ if rec := lifecycle("archive"); rec.Code != http.StatusOK {+ t.Fatalf("archive Mika: expected 200, got %d: %s", rec.Code, rec.Body.String())}- var archivedAt *string+ again := createMika(t, map[string]any{"runtime_id": runtimeID, "language": "en"})+ if again.Code != http.StatusConflict {+ t.Fatalf("bootstrap after archive: expected 409, got %d: %s", again.Code, again.Body.String())+ }+ var count int+ var archived boolif err := testPool.QueryRow(context.Background(),- `SELECT archived_at::text FROM agent WHERE id = $1`, agentID).Scan(&archivedAt); err != nil {- t.Fatalf("load agent: %v", err)+ `SELECT count(*), bool_and(archived_at IS NOT NULL) FROM agent WHERE workspace_id = $1 AND system_key = $2`,+ testWorkspaceID, service.MikaSystemKey).Scan(&count, &archived); err != nil {+ t.Fatalf("count mika agents: %v", err)+ }+ if count != 1 || !archived {+ t.Fatalf("expected the one archived Mika to stay as is, got count=%d archived=%v", count, archived)+ }++ if rec := lifecycle("restore"); rec.Code != http.StatusOK {+ t.Fatalf("restore Mika: expected 200, got %d: %s", rec.Code, rec.Body.String())+ }+ restored := createMika(t, map[string]any{"runtime_id": runtimeID, "language": "en"})+ if restored.Code != http.StatusOK {+ t.Fatalf("bootstrap after restore: expected 200, got %d: %s", restored.Code, restored.Body.String())}- if archivedAt != nil {- t.Fatalf("agent must remain active, got archived_at = %v", *archivedAt)+ if got := decodeAgent(t, restored).ID; got != agentID {+ t.Fatalf("expected the restored Mika %s back, got %s", agentID, got)}}diff --git a/server/internal/handler/runtime_blocking_agents.go b/server/internal/handler/runtime_blocking_agents.goindex 0f3da5ed13..2dd2bd4798 100644--- a/server/internal/handler/runtime_blocking_agents.go+++ b/server/internal/handler/runtime_blocking_agents.go@@ -11,28 +11,25 @@ import (// A runtime or profile delete is refused while user agents are still bound.// Telling the user to "reassign or archive them" is only true for agents they-// can actually reach: the archive endpoint rejects anything carrying a-// system_key outright. Naming one remedy for every blocker therefore hands some-// users an instruction that cannot be carried out — the same class of defect-// this whole change set exists to remove, so the refusals classify their-// blockers instead.+// can actually reach: the archive endpoint rejects every system_key except+// Mika's. Naming one remedy for every blocker therefore hands some users an+// instruction that cannot be carried out — the same class of defect this whole+// change set exists to remove, so the refusals classify their blockers instead.//// Hidden kind='system' agents (the Agent Builder carriers) are never blockers:// both delete guards list kind='user' only, and TeardownRuntime deletes the// carriers with their runtime (GH #9762).//// system_key, not kind, is the discriminator. Mika is deliberately kind='user'-// (it must stay visible and assignable) while still being product-owned and-// unarchivable.+// (it must stay visible and assignable) while still being product-owned.type blockingAgentClass intconst (// blockingAgentUser is an ordinary workspace agent: rebind or archive it.blockingAgentUser blockingAgentClass = iota- // blockingAgentMika is the workspace's built-in Mika. It cannot be archived- // (agent.go rejects any system_key there) but it CAN be rebound: UpdateAgent- // takes runtime_id for it like any other manageable agent. Those two halves- // have to be stated separately or the remedy is wrong in one direction.+ // blockingAgentMika is the workspace's built-in Mika. It can be archived or+ // rebound like any manageable agent, but a profile refusal only clears if+ // the new runtime is outside that profile, so it gets its own clause.blockingAgentMika// blockingAgentOtherSystem is any future product-owned agent. Unarchivable// like the rest, with no remedy this code can name specifically.@@ -105,11 +102,10 @@ const (// blocker was product-owned and the caller should say so rather than suggest// an action.func blockingAgentRemedies(classes map[blockingAgentClass]bool, scope blockingAgentScope) []string {- // "Reassign or archive them" must not appear to cover the product-owned+ // "Reassign or archive them" must not appear to cover the unarchivable// blockers listed beside them, which is exactly the instruction they cannot// follow. When both are present the clause names which ones it applies to.- mixed := classes[blockingAgentMika] ||- classes[blockingAgentOtherSystem]+ mixed := classes[blockingAgentOtherSystem]var out []stringif classes[blockingAgentUser] && mixed {@@ -118,21 +114,14 @@ func blockingAgentRemedies(classes map[blockingAgentClass]bool, scope blockingAgout = append(out, "Reassign or archive them first.")}if classes[blockingAgentMika] {- // Mika is unarchivable but NOT immovable: UpdateAgent takes runtime_id- // for it like any other agent an admin can manage (the only system_key- // guard in agent.go is on archive), and the agent detail page shows it- // an editable runtime picker. An earlier version of this message said- // there was no supported way to move it, which told an owner who could- // have fixed this in one edit to give up instead — the exact failure- // this whole change set is about. TestMikaRemedyMatchesWhatMikaCanDo- // exercises both halves against the real endpoints so the claim cannot- // drift from the product again.+ // TestMikaRemedyMatchesWhatMikaCanDo exercises both remedies against+ // the real endpoints so the claim cannot drift from the product again.target := "another runtime"if scope == blockingAgentScopeProfile {target = "a runtime that this profile does not provide"}out = append(out, fmt.Sprintf(- "Mika is built into Multica, so it cannot be archived — but it can be moved: open Mika's agent page and bind it to %s.",+ "Mika can be archived, or moved: open Mika's agent page and bind it to %s.",target,))}diff --git a/server/internal/handler/runtime_delete_guidance_test.go b/server/internal/handler/runtime_delete_guidance_test.goindex 416b24ea9b..94c29364d7 100644--- a/server/internal/handler/runtime_delete_guidance_test.go+++ b/server/internal/handler/runtime_delete_guidance_test.go@@ -383,12 +383,10 @@ func createSystemFixtureAgent(t *testing.T, ctx context.Context, runtimeID, namereturn agentID}-// Mika cannot be archived — the archive endpoint rejects any agent carrying a-// system_key — but it CAN be rebound, so the generic "reassign or archive them"-// clause is wrong for it in both directions: half of it is impossible and the-// half that works needs a destination the generic wording never gives. The-// refusal has to carry Mika's own path instead. Capability itself is asserted-// against the real endpoints in TestMikaRemedyMatchesWhatMikaCanDo.+// Mika can be archived or rebound, but for a profile delete the rebind needs a+// destination the generic "reassign or archive them" wording never gives, so+// the refusal carries Mika's own path. Capability itself is asserted against+// the real endpoints in TestMikaRemedyMatchesWhatMikaCanDo.func TestDeleteRuntimeProfile_MikaBlockerGetsItsOwnRemedy(t *testing.T) {if testHandler == nil {t.Skip("database not available")@@ -405,12 +403,11 @@ func TestDeleteRuntimeProfile_MikaBlockerGetsItsOwnRemedy(t *testing.T) {if strings.Contains(msg, "can be reassigned or archived") || strings.Contains(msg, "Reassign or archive them first.") {t.Fatalf("the generic reassign-or-archive clause does not apply to Mika: %s", msg)}- if !strings.Contains(msg, "cannot be archived") {- t.Fatalf("refusal must still say Mika cannot be archived, got: %s", msg)+ if !strings.Contains(msg, "Mika can be archived") {+ t.Fatalf("refusal must say Mika can be archived, got: %s", msg)}- // The other half: Mika IS movable, and saying otherwise tells an owner who- // could fix this in one edit to give up. Scoped for a profile delete —- // moving Mika to a sibling runtime of the same profile would not help.+ // Scoped for a profile delete — moving Mika to a sibling runtime of the+ // same profile would not help.if !strings.Contains(msg, "a runtime that this profile does not provide") {t.Fatalf("refusal must point at the rebind that actually clears this, got: %s", msg)}@@ -431,9 +428,9 @@ func TestDeleteRuntimeProfile_MikaBlockerGetsItsOwnRemedy(t *testing.T) {}}-// With both an ordinary agent and Mika present each needs its own clause: the-// user agent is archivable, Mika is not, and collapsing them loses one or the-// other. A hidden builder carrier on the same runtime is not a blocker at all+// With both an ordinary agent and Mika present each needs its own clause:+// Mika's rebind needs a destination the generic clause does not give. A hidden+// builder carrier on the same runtime is not a blocker at all// (GH #9762), so it must not be counted, named, or given a remedy.func TestDeleteRuntimeProfile_MixedBlockersGiveEachItsOwnRemedy(t *testing.T) {if testHandler == nil {@@ -452,8 +449,8 @@ func TestDeleteRuntimeProfile_MixedBlockersGiveEachItsOwnRemedy(t *testing.T) {msg := conflictMessage(t, body)for _, want := range []string{- "not marked as built into Multica can be reassigned or archived",- "Mika is built into Multica, so it cannot be archived",+ "Reassign or archive them first.",+ "Mika can be archived, or moved",} {if !strings.Contains(msg, want) {t.Fatalf("mixed refusal missing %q, got: %s", want, msg)@@ -539,8 +536,8 @@ func TestDeleteAgentRuntime_OfflineInstanceHeldByMikaGetsMikasOwnRemedy(t *testiif strings.Contains(msg, "can be reassigned or archived") || strings.Contains(msg, "Reassign or archive them first.") {t.Fatalf("the generic reassign-or-archive clause does not apply to Mika: %s", msg)}- if !strings.Contains(msg, "cannot be archived") {- t.Fatalf("instance refusal must still say Mika cannot be archived, got: %s", msg)+ if !strings.Contains(msg, "Mika can be archived") {+ t.Fatalf("instance refusal must say Mika can be archived, got: %s", msg)}if !strings.Contains(msg, "bind it to another runtime") {t.Fatalf("instance refusal must point at the rebind, got: %s", msg)@@ -567,9 +564,8 @@ func deleteProfileExpectingConflict(t *testing.T, ctx context.Context, profileID// The remedies must come from the whole blocker set, not the sample. Sorting// puts the sample's contents outside the caller's control, so a class can fall// entirely past the cap: twenty ordinary agents that sort first push Mika to-// position 21, and a message built from the sample would then tell the user to-// archive all 21 — the exact unactionable instruction this change removes, just-// deferred until they have worked through the first twenty.+// position 21, and a message built from the sample would then omit the+// profile-scoped destination Mika's rebind needs.func TestDeleteRuntimeProfile_RemedyCoversBlockersBeyondTheSample(t *testing.T) {if testHandler == nil {t.Skip("database not available")@@ -587,15 +583,12 @@ func TestDeleteRuntimeProfile_RemedyCoversBlockersBeyondTheSample(t *testing.T)body := deleteProfileExpectingConflict(t, ctx, profileID)msg := conflictMessage(t, body)- if !strings.Contains(msg, "Mika is built into Multica") {+ if !strings.Contains(msg, "Mika can be archived") {t.Fatalf("Mika is blocker #21 and must still be reported, got: %s", msg)}if !strings.Contains(msg, "a runtime that this profile does not provide") {t.Fatalf("the out-of-sample Mika must still get its real remedy, got: %s", msg)}- if strings.Contains(msg, "Reassign or archive them first.") {- t.Fatalf("the blanket remedy must not cover a Mika the sample never showed: %s", msg)- }if got, _ := body["active_agent_count"].(float64); int(got) != maxReportedBlockingAgents+1 {t.Fatalf("active_agent_count = %v", got)}@@ -1015,8 +1008,8 @@ func TestDeleteAgentRuntime_OfflineInstanceMatchesTheRealGCDrainGate(t *testing.}// The Mika clause makes two claims about product capability, and an earlier-// version of it had the second one backwards — it said Mika could not be moved,-// which told an owner who could have fixed the block in one edit to give up.+// version of it had one backwards — it said Mika could not be moved, which told+// an owner who could have fixed the block in one edit to give up.// Both halves are therefore asserted against the real endpoints rather than// against anyone's reading of them, so the message cannot drift from the// product again. Correction contributed by review.@@ -1030,12 +1023,19 @@ func TestMikaRemedyMatchesWhatMikaCanDo(t *testing.T) {target := newTestRuntime(t, "Mika Remedy Target", "online")mikaID := createSystemFixtureAgent(t, ctx, source, "Mika", "user", "mika")- // Claim 1: Mika cannot be archived.+ // Claim 1: Mika can be archived (and restored, to test the move below).w := httptest.NewRecorder()testHandler.ArchiveAgent(w, withURLParam(newRequest("POST", "/api/agents/"+mikaID+"/archive", nil), "id", mikaID))- if w.Code == http.StatusOK {- t.Fatalf("Mika archived successfully; the refusal claims it cannot be: %s", w.Body.String())+ if w.Code != http.StatusOK {+ t.Fatalf("archiving Mika failed (%d), but the refusal tells the user to do it: %s",+ w.Code, w.Body.String())+ }+ w = httptest.NewRecorder()+ testHandler.RestoreAgent(w, withURLParam(+ newRequest("POST", "/api/agents/"+mikaID+"/restore", nil), "id", mikaID))+ if w.Code != http.StatusOK {+ t.Fatalf("restore Mika: %d %s", w.Code, w.Body.String())}// Claim 2: Mika can be rebound to another runtime.@@ -1070,7 +1070,7 @@ func TestMikaRemedyMatchesWhatMikaCanDo(t *testing.T) {if got, _ := body["active_agent_count"].(float64); int(got) != 0 {t.Fatalf("after the rebind the source should hold no agents, got %v", got)}- if msg := conflictMessage(t, body); strings.Contains(msg, "Mika is built into Multica") {+ if msg := conflictMessage(t, body); strings.Contains(msg, "Mika can be archived") {t.Fatalf("Mika moved away but is still named as a blocker: %s", msg)}}diff --git a/server/pkg/db/generated/agent.sql.go b/server/pkg/db/generated/agent.sql.goindex a84e6b8c0e..59bca64054 100644--- a/server/pkg/db/generated/agent.sql.go+++ b/server/pkg/db/generated/agent.sql.go@@ -4079,8 +4079,8 @@ func (q *Queries) GetAgent(ctx context.Context, id pgtype.UUID) (Agent, error) {const getAgentBySystemKey = `-- name: GetAgentBySystemKey :oneSELECT id, workspace_id, name, avatar_url, runtime_mode, runtime_config, visibility, status, max_concurrent_tasks, owner_id, created_at, updated_at, description, runtime_id, instructions, archived_at, archived_by, custom_env, custom_args, mcp_config, model, thinking_level, composio_toolkit_allowlist, permission_mode, kind, system_key, disabled_runtime_skills, service_tier, conversation_starters FROM agent-WHERE workspace_id = $1 AND system_key = $2 AND archived_at IS NULL-ORDER BY created_at ASC, id ASC+WHERE workspace_id = $1 AND system_key = $2+ORDER BY (archived_at IS NOT NULL) ASC, created_at ASC, id ASCLIMIT 1`@@ -4092,6 +4092,10 @@ type GetAgentBySystemKeyParams struct {// Resolves a workspace's built-in agent by its stable system_key. This is the// identity lookup for system agents: their display name is owner-editable, so// nothing server-side may key off it.+//+// Archived rows are included (an active row wins): an archived Mika still holds+// the workspace's slot and her name, so callers must see it to refuse a second+// one rather than insert past it.func (q *Queries) GetAgentBySystemKey(ctx context.Context, arg GetAgentBySystemKeyParams) (Agent, error) {row := q.db.QueryRow(ctx, getAgentBySystemKey, arg.WorkspaceID, arg.SystemKey)var i Agentdiff --git a/server/pkg/db/generated/runtime_profile.sql.go b/server/pkg/db/generated/runtime_profile.sql.goindex 222218061a..dbf6576d18 100644--- a/server/pkg/db/generated/runtime_profile.sql.go+++ b/server/pkg/db/generated/runtime_profile.sql.go@@ -293,7 +293,7 @@ type ListActiveAgentsByProfileRow struct {//// system_key rides along because it, not kind, decides what the user can// actually do about a blocker. Mika is kind='user' with system_key='mika' and-// can be moved but not archived.+// gets its own remedy clause.//// Bounded on purpose. The caller only needs to know that blockers exist, name a// few, and report how many there are — it never needs every row. This runsdiff --git a/server/pkg/db/queries/agent.sql b/server/pkg/db/queries/agent.sqlindex 03fb4d89d8..2f37ad68fe 100644--- a/server/pkg/db/queries/agent.sql+++ b/server/pkg/db/queries/agent.sql@@ -2856,9 +2856,13 @@ RETURNING a.*;-- Resolves a workspace's built-in agent by its stable system_key. This is the-- identity lookup for system agents: their display name is owner-editable, so-- nothing server-side may key off it.+--+-- Archived rows are included (an active row wins): an archived Mika still holds+-- the workspace's slot and her name, so callers must see it to refuse a second+-- one rather than insert past it.SELECT * FROM agent-WHERE workspace_id = $1 AND system_key = $2 AND archived_at IS NULL-ORDER BY created_at ASC, id ASC+WHERE workspace_id = $1 AND system_key = $2+ORDER BY (archived_at IS NOT NULL) ASC, created_at ASC, id ASCLIMIT 1;-- name: CreateSystemUserAgent :onediff --git a/server/pkg/db/queries/runtime_profile.sql b/server/pkg/db/queries/runtime_profile.sqlindex 2c49e990e8..3cf74b56c6 100644--- a/server/pkg/db/queries/runtime_profile.sql+++ b/server/pkg/db/queries/runtime_profile.sql@@ -152,7 +152,7 @@ RETURNING id, workspace_id, owner_id, daemon_id, provider;---- system_key rides along because it, not kind, decides what the user can-- actually do about a blocker. Mika is kind='user' with system_key='mika' and--- can be moved but not archived.+-- gets its own remedy clause.---- Bounded on purpose. The caller only needs to know that blockers exist, name a-- few, and report how many there are — it never needs every row. This runs