Skip to content

Open-source Grok Bot alternative for named AI teammates. Local-first desktop, web, and mobile clients with per-bot tools, instructions, and memory. Independent fork of T3 Code.

feat(web): move archived bots to Settings and delete them after 7 days (#347)

Leo57c1afb08cdf
diff --git a/.changeset/archived-bots-settings.md b/.changeset/archived-bots-settings.md
new file mode 100644
index 000000000..8ce464911
--- /dev/null
+++ b/.changeset/archived-bots-settings.md
@@ -0,0 +1,5 @@
+---
+"akeru-bot": minor
+---
+
+Archived bots no longer appear in the sidebar. They are listed in Settings > Archived, where you can restore or delete them, and Akeru deletes them automatically 7 days after they were archived. Their chats stay in your history.
diff --git a/apps/server/src/archivedBotRetention.test.ts b/apps/server/src/archivedBotRetention.test.ts
new file mode 100644
index 000000000..c9879fc06
--- /dev/null
+++ b/apps/server/src/archivedBotRetention.test.ts
@@ -0,0 +1,117 @@
+import * as NodeServices from "@effect/platform-node/NodeServices";
+import { BotId, type OrchestrationCommand } from "@akeru/contracts";
+import { assert, it } from "@effect/vitest";
+import * as Effect from "effect/Effect";
+import * as Layer from "effect/Layer";
+import * as Stream from "effect/Stream";
+import * as TestClock from "effect/testing/TestClock";
+
+import { deleteExpiredArchivedBots } from "./archivedBotRetention.ts";
+import { OrchestrationCommandInvariantError } from "./orchestration/Errors.ts";
+import * as OrchestrationEngine from "./orchestration/Services/OrchestrationEngine.ts";
+import * as ProjectionSnapshotQuery from "./orchestration/Services/ProjectionSnapshotQuery.ts";
+
+const now = Date.parse("2026-10-10T12:00:00.000Z");
+
+const makeBot = (id: string, archivedAt: string | null) => ({ id: BotId.make(id), archivedAt });
+
+const runSweep = (input: {
+ readonly bots: ReadonlyArray<ReturnType<typeof makeBot>>;
+ readonly dispatch: OrchestrationEngine.OrchestrationEngineService["Service"]["dispatch"];
+}) =>
+ TestClock.setTime(now).pipe(
+ Effect.andThen(deleteExpiredArchivedBots),
+ Effect.provide(
+ Layer.mock(ProjectionSnapshotQuery.ProjectionSnapshotQuery)({
+ getCommandReadModel: () => Effect.succeed({ bots: input.bots } as never),
+ }),
+ ),
+ Effect.provideService(OrchestrationEngine.OrchestrationEngineService, {
+ readEvents: () => Stream.empty,
+ readThreadEvents: () => Stream.empty,
+ getThreadReplayStats: () => Effect.die("unused thread replay stats"),
+ dispatch: input.dispatch,
+ streamDomainEvents: Stream.empty,
+ subscribeDomainEvents: Effect.succeed(Stream.empty),
+ latestSequence: Effect.succeed(0),
+ }),
+ Effect.provide(NodeServices.layer),
+ );
+
+it.effect("deletes bots archived for seven days or more and keeps the rest", () => {
+ const dispatched: OrchestrationCommand[] = [];
+
+ return runSweep({
+ bots: [
+ makeBot("active", null),
+ makeBot("recent", "2026-10-04T12:00:00.000Z"),
+ makeBot("exactly-seven-days", "2026-10-03T12:00:00.000Z"),
+ makeBot("old", "2026-09-01T00:00:00.000Z"),
+ ],
+ dispatch: (command) =>
+ Effect.sync(() => dispatched.push(command)).pipe(Effect.as({ sequence: dispatched.length })),
+ }).pipe(
+ Effect.tap(() =>
+ Effect.sync(() => {
+ assert.deepStrictEqual(
+ dispatched.map((command) =>
+ command.type === "bot.delete" ? String(command.botId) : null,
+ ),
+ ["exactly-seven-days", "old"],
+ );
+ }),
+ ),
+ );
+});
+
+it.effect("pins each delete to the archive time it saw", () => {
+ const dispatched: OrchestrationCommand[] = [];
+
+ return runSweep({
+ bots: [makeBot("old", "2026-09-01T00:00:00.000Z")],
+ dispatch: (command) =>
+ Effect.sync(() => dispatched.push(command)).pipe(Effect.as({ sequence: dispatched.length })),
+ }).pipe(
+ Effect.tap(() =>
+ Effect.sync(() => {
+ const [command] = dispatched;
+ assert.strictEqual(
+ command?.type === "bot.delete" ? command.archivedAt : null,
+ "2026-09-01T00:00:00.000Z",
+ );
+ }),
+ ),
+ );
+});
+
+it.effect("keeps sweeping after one bot fails to delete", () => {
+ const attempted: string[] = [];
+
+ return runSweep({
+ bots: [
+ makeBot("boss", "2026-09-01T00:00:00.000Z"),
+ makeBot("broken", "2026-09-01T06:00:00.000Z"),
+ makeBot("old", "2026-09-02T00:00:00.000Z"),
+ ],
+ dispatch: (command) =>
+ Effect.gen(function* () {
+ if (command.type !== "bot.delete") return yield* Effect.die("unexpected command");
+ attempted.push(command.botId);
+
+ if (command.botId === "boss") {
+ return yield* new OrchestrationCommandInvariantError({
+ commandType: command.type,
+ detail: "Set a new boss before deleting it.",
+ });
+ }
+
+ if (command.botId === "broken") return yield* Effect.die("projection crashed");
+
+ return { sequence: attempted.length };
+ }),
+ }).pipe(
+ Effect.tap(() =>
+ Effect.sync(() => assert.deepStrictEqual(attempted, ["boss", "broken", "old"])),
+ ),
+ );
+});
diff --git a/apps/server/src/archivedBotRetention.ts b/apps/server/src/archivedBotRetention.ts
new file mode 100644
index 000000000..35a8d39e1
--- /dev/null
+++ b/apps/server/src/archivedBotRetention.ts
@@ -0,0 +1,57 @@
+import { archivedBotDeletesAtMs, CommandId } from "@akeru/contracts";
+import * as Clock from "effect/Clock";
+import * as Crypto from "effect/Crypto";
+import * as Duration from "effect/Duration";
+import * as Effect from "effect/Effect";
+import * as Schedule from "effect/Schedule";
+
+import * as OrchestrationEngine from "./orchestration/Services/OrchestrationEngine.ts";
+import * as ProjectionSnapshotQuery from "./orchestration/Services/ProjectionSnapshotQuery.ts";
+
+const SWEEP_INTERVAL = Duration.hours(1);
+
+/** Deletes every bot whose archive retention window has passed. One failed bot never blocks the rest. */
+export const deleteExpiredArchivedBots = Effect.gen(function* () {
+ const crypto = yield* Crypto.Crypto;
+ const orchestrationEngine = yield* OrchestrationEngine.OrchestrationEngineService;
+ const query = yield* ProjectionSnapshotQuery.ProjectionSnapshotQuery;
+ const now = yield* Clock.currentTimeMillis;
+ const { bots } = yield* query.getCommandReadModel();
+
+ for (const bot of bots) {
+ const { archivedAt } = bot;
+
+ if (archivedAt === null || archivedBotDeletesAtMs(archivedAt) > now) {
+ continue;
+ }
+
+ yield* Effect.gen(function* () {
+ yield* orchestrationEngine.dispatch({
+ type: "bot.delete",
+ commandId: CommandId.make(yield* crypto.randomUUIDv4),
+ botId: bot.id,
+ archivedAt,
+ });
+ yield* Effect.logInfo("archived bot deleted after retention window", {
+ botId: bot.id,
+ archivedAt,
+ });
+ }).pipe(
+ Effect.catch((error) =>
+ Effect.logWarning("failed to delete expired archived bot", { botId: bot.id, error }),
+ ),
+ Effect.catchDefect((defect) =>
+ Effect.logWarning("failed to delete expired archived bot", { botId: bot.id, defect }),
+ ),
+ );
+ }
+});
+
+/** Runs the archived-bot sweep at startup and then hourly for the life of the scope. */
+export const archivedBotRetentionLoop = deleteExpiredArchivedBots.pipe(
+ Effect.catch((error) => Effect.logWarning("archived bot retention sweep failed", { error })),
+ Effect.catchDefect((defect) =>
+ Effect.logWarning("archived bot retention sweep defect", { defect }),
+ ),
+ Effect.repeat(Schedule.spaced(SWEEP_INTERVAL)),
+);
diff --git a/apps/server/src/orchestration/decider.botDelete.cascade.test.ts b/apps/server/src/orchestration/decider.botDelete.cascade.test.ts
index 0d33584c5..e5fb04ea4 100644
--- a/apps/server/src/orchestration/decider.botDelete.cascade.test.ts
+++ b/apps/server/src/orchestration/decider.botDelete.cascade.test.ts
@@ -35,6 +35,24 @@ it.layer(NodeServices.layer)("bot delete decider", (it) => {
}),
);
+ it.effect("rejects a delete pinned to an archive the bot no longer has", () =>
+ Effect.gen(function* () {
+ const readModel = makeReadModel({ bots: [makeBot({ id: BOT_ID })] });
+
+ const error = yield* decideOrchestrationCommand({
+ command: {
+ type: "bot.delete",
+ commandId: CommandId.make("cmd-delete-restored"),
+ botId: BOT_ID,
+ archivedAt: NOW,
+ },
+ readModel,
+ }).pipe(Effect.flip);
+
+ expect(error.message).toContain("no longer archived");
+ }),
+ );
+
it.effect("deletes the bot's routines and skill assignments", () =>
Effect.gen(function* () {
const withRoutine = yield* projectEvent(createEmptyReadModel(NOW), {
diff --git a/apps/server/src/orchestration/decider.botDelete.test.ts b/apps/server/src/orchestration/decider.botDelete.test.ts
index 015ca8abe..c48fa2b0b 100644
--- a/apps/server/src/orchestration/decider.botDelete.test.ts
+++ b/apps/server/src/orchestration/decider.botDelete.test.ts
@@ -27,7 +27,7 @@ import {
} from "./test-support/BotDeleteFixtures.ts";
it.layer(NodeServices.layer)("bot delete decider", (it) => {
- it.effect("deletes a bot and detaches its chats", () =>
+ it.effect("deletes a bot and moves its detached chats to Archived chats", () =>
Effect.gen(function* () {
const readModel = makeReadModel({
bots: [makeBot({ id: BOT_ID })],
@@ -47,6 +47,7 @@ it.layer(NodeServices.layer)("bot delete decider", (it) => {
expect(events.map((event) => event.type)).toEqual([
"thread.ownership-updated",
+ "thread.archived",
"bot.deleted",
]);
const ownership = events[0];
@@ -72,6 +73,7 @@ it.layer(NodeServices.layer)("bot delete decider", (it) => {
expect(next.bots).toHaveLength(0);
expect(next.threads[0]?.botId).toBeNull();
+ expect(next.threads[0]?.archivedAt).not.toBeNull();
}),
);
@@ -168,7 +170,9 @@ it.layer(NodeServices.layer)("bot delete decider", (it) => {
"thread.session-stop-requested",
"thread.session-stop-requested",
"thread.ownership-updated",
+ "thread.archived",
"thread.ownership-updated",
+ "thread.archived",
"bot.deleted",
]);
expect(
diff --git a/apps/server/src/orchestration/decider/bots.ts b/apps/server/src/orchestration/decider/bots.ts
index 847b19fba..9fb97833b 100644
--- a/apps/server/src/orchestration/decider/bots.ts
+++ b/apps/server/src/orchestration/decider/bots.ts
@@ -337,6 +337,14 @@ export const decideBots = Effect.fn("decideBots")(function* ({
case "bot.delete": {
const bot = yield* requireBot({ readModel, command, botId: command.botId });
+
+ if (command.archivedAt !== undefined && bot.archivedAt !== command.archivedAt) {
+ return yield* new OrchestrationCommandInvariantError({
+ commandType: command.type,
+ detail: `Bot '${command.botId}' is no longer archived at ${command.archivedAt}.`,
+ });
+ }
+
const bossGroup = readModel.groups.find((group) => group.bossBotId === command.botId);
if (bossGroup) {
@@ -503,6 +511,20 @@ export const decideBots = Effect.fn("decideBots")(function* ({
updatedAt: occurredAt,
},
});
+
+ // A detached chat has no bot page, so it moves to Archived chats where it stays reachable.
+ if (owned && thread.archivedAt === null) {
+ events.push({
+ ...(yield* withEventBase({
+ aggregateKind: "thread",
+ aggregateId: thread.id,
+ occurredAt,
+ commandId: command.commandId,
+ })),
+ type: "thread.archived",
+ payload: { threadId: thread.id, archivedAt: occurredAt, updatedAt: occurredAt },
+ });
+ }
}
for (const routine of readModel.routines ?? []) {
diff --git a/apps/server/src/serverRuntimeStartup.ts b/apps/server/src/serverRuntimeStartup.ts
index 4a92995d8..12ed1ed67 100644
--- a/apps/server/src/serverRuntimeStartup.ts
+++ b/apps/server/src/serverRuntimeStartup.ts
@@ -33,6 +33,7 @@ import {
ServerRuntimeStartupError,
ServerRuntimeStartup,
} from "./startupCommandGate.ts";
+import { archivedBotRetentionLoop } from "./archivedBotRetention.ts";
import { reconcileDelegations, reconcileProviderSessions } from "./startupReconciliation.ts";
import {
resolveWelcomeBase,
@@ -125,6 +126,8 @@ export const make = (options?: StartupOptions) =>
yield* runStartupPhase("provider-sessions.reconcile", reconcileProviderSessions);
+ yield* forkParked(archivedBotRetentionLoop).pipe(Scope.provide(reactorScope));
+
yield* runStartupPhase(
"channels.restore",
Option.match(channelRuntime, {
diff --git a/apps/web/src/components/CommandPalette.tsx b/apps/web/src/components/CommandPalette.tsx
index 986068985..a1cd1ee68 100644
--- a/apps/web/src/components/CommandPalette.tsx
+++ b/apps/web/src/components/CommandPalette.tsx
@@ -236,8 +236,17 @@ function OpenCommandPaletteDialog(props: { readonly setOpen: (open: boolean) =>
}),
{
value: "action:archived-chats",
- searchTerms: [t("Archived chats"), "archived", "archive", "unarchive", "restore", "chats"],
- title: t("Archived chats"),
+ searchTerms: [
+ t("Archived chats"),
+ t("Archived bots"),
+ "archived",
+ "archive",
+ "unarchive",
+ "restore",
+ "chats",
+ "bots",
+ ],
+ title: t("Archived"),
icon: <ArchiveIcon className={ITEM_ICON_CLASS} />,
run: async () => {
openSettings("archived");
diff --git a/apps/web/src/components/roster/BotRosterSidebar.tsx b/apps/web/src/components/roster/BotRosterSidebar.tsx
index 89110bd11..87ffcad57 100644
--- a/apps/web/src/components/roster/BotRosterSidebar.tsx
+++ b/apps/web/src/components/roster/BotRosterSidebar.tsx
@@ -2,7 +2,7 @@ import { Match, Predicate } from "effect";
import { DndContext } from "@dnd-kit/core";
import { SortableContext } from "@dnd-kit/sortable";
import { useAtomValue } from "@effect/atom-react";
-import { BotId, GroupId } from "@akeru/contracts";
+import { ARCHIVED_BOT_RETENTION_DAYS, BotId, GroupId } from "@akeru/contracts";
import { useLocation, useNavigate } from "@tanstack/react-router";
import { SearchIcon } from "lucide-react";
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
@@ -51,7 +51,6 @@ import {
import { RosterDragLifecycle } from "./roster.pointer";
import { useRosterStore } from "./rosterStore";
import { resolveRosterListState } from "./rosterRouteSelection";
-import { RosterArchivedSection } from "./RosterArchivedSection";
import { RosterLoadStatus } from "./RosterLoadStatus";
import { useRosterLoadState } from "./useServerRoster";
import type { Bot, BotAvatar, Group } from "./types";
@@ -703,7 +702,6 @@ export default function BotRosterSidebar({ chrome = "full" }: { chrome?: "full"
)),
)}
{/* Archiving is reversible, so the way back stays in the roster itself. */}
- <RosterArchivedSection bots={bots} />
</SidebarContent>
{/* Rail create menu sits above the footer, like the expanded header's plus. */}
<RosterRailCreateMenu onNewBot={handleNewBot} onNewGroup={handleNewGroup} />
@@ -742,8 +740,8 @@ export default function BotRosterSidebar({ chrome = "full" }: { chrome?: "full"
</AlertDialogTitle>
<AlertDialogDescription>
{t(
- "{name} leaves the roster and stops taking messages. Its chat history is kept, and you can restore it from Archived at any time.",
- { name: archivingBot.name },
+ "{name} leaves the roster and stops taking messages. You can restore it from Settings > Archived for {days} days, then it is deleted. Its chats stay in your history.",
+ { name: archivingBot.name, days: ARCHIVED_BOT_RETENTION_DAYS },
)}
</AlertDialogDescription>
</AlertDialogHeader>
diff --git a/apps/web/src/components/roster/RosterArchivedSection.tsx b/apps/web/src/components/roster/RosterArchivedSection.tsx
deleted file mode 100644
index 47c8c0d47..000000000
--- a/apps/web/src/components/roster/RosterArchivedSection.tsx
+++ /dev/null
@@ -1,104 +0,0 @@
-import { Predicate } from "effect";
-import { BotId } from "@akeru/contracts";
-import { ArchiveRestoreIcon, ChevronDownIcon } from "lucide-react";
-import { useMemo, useState } from "react";
-
-import { useI18n } from "../../i18n";
-import { cn } from "../../lib/utils";
-import { botEnvironment } from "../../state/bots";
-import { usePrimaryEnvironmentId } from "../../state/environments";
-import { useAtomCommand } from "../../state/use-atom-command";
-import { SidebarGroup } from "../ui/sidebar";
-import { toastManager } from "../ui/toast";
-import { Tooltip, TooltipPopup, TooltipTrigger } from "../ui/tooltip";
-import { BotAvatarView } from "./BotAvatarView";
-import { archivedRosterBots } from "./roster.logic";
-import { commandFailureMessage } from "./rosterCommands.logic";
-import type { Bot } from "./types";
-
-/** Collapsible list of archived bots under the roster, each with a restore action. */
-export function RosterArchivedSection({ bots }: { bots: readonly Bot[] }) {
- const { t } = useI18n();
- const environmentId = usePrimaryEnvironmentId();
- const restoreBotCommand = useAtomCommand(botEnvironment.restore, { reportFailure: false });
- const archivedBots = useMemo(() => archivedRosterBots(bots), [bots]);
- const [archivedOpen, setArchivedOpen] = useState(false);
-
- const handleRestoreBot = async (bot: Bot) => {
- if (environmentId === null) {
- toastManager.add({ type: "error", title: t("Connect an environment first") });
-
- return;
- }
-
- const result = await restoreBotCommand({
- environmentId,
- input: { botId: BotId.make(bot.id) },
- });
-
- if (Predicate.isTagged(result, "Failure")) {
- toastManager.add({
- type: "error",
- title: t("Could not restore {name}", { name: bot.name }),
- description: commandFailureMessage(result, t),
- });
- }
- };
-
- if (archivedBots.length === 0) return null;
-
- return (
- <SidebarGroup
- data-testid="roster-archived"
- className="px-(--sidebar-content-inset) pb-1 pt-1 group-data-[collapsible=icon]:hidden"
- >
- <button
- type="button"
- aria-expanded={archivedOpen}
- onClick={() => setArchivedOpen((open) => !open)}
- className="flex h-8 items-center gap-1.5 rounded-lg px-2 text-xs font-medium text-sidebar-muted-foreground outline-none hover:text-sidebar-foreground focus-visible:ring-2 focus-visible:ring-ring"
- >
- <ChevronDownIcon
- className={cn("size-3.5 transition-transform", !archivedOpen && "-rotate-90")}
- />
- <span>{t("Archived")}</span>
- <span
- className="tabular-nums"
- aria-label={t("{count} archived", { count: archivedBots.length })}
- >
- {archivedBots.length}
- </span>
- </button>
- {archivedOpen ? (
- <ul role="list" aria-label={t("Archived bots")} className="flex flex-col gap-px">
- {archivedBots.map((bot) => (
- <li
- key={bot.id}
- className="flex list-none items-center gap-2.5 rounded-lg px-2 py-1.5 hover:bg-sidebar-row-hover"
- >
- <BotAvatarView avatar={bot.avatar} name={bot.name} className="size-8 opacity-60" />
- <span className="min-w-0 flex-1 truncate text-sm text-sidebar-muted-foreground">
- {bot.name}
- </span>
- <Tooltip>
- <TooltipTrigger
- render={
- <button
- type="button"
- aria-label={t("Restore {name}", { name: bot.name })}
- onClick={() => void handleRestoreBot(bot)}
- className="flex size-7 shrink-0 items-center justify-center rounded-lg text-sidebar-muted-foreground outline-none hover:bg-sidebar-row-hover hover:text-sidebar-foreground focus-visible:ring-2 focus-visible:ring-ring"
- >
- <ArchiveRestoreIcon className="size-4" />
- </button>
- }
- />
- <TooltipPopup side="top">{t("Restore")}</TooltipPopup>
- </Tooltip>
- </li>
- ))}
- </ul>
- ) : null}
- </SidebarGroup>
- );
-}
diff --git a/apps/web/src/components/roster/roster.logic.test.ts b/apps/web/src/components/roster/roster.logic.test.ts
index 1c29e9564..a0b2db26d 100644
--- a/apps/web/src/components/roster/roster.logic.test.ts
+++ b/apps/web/src/components/roster/roster.logic.test.ts
@@ -2,7 +2,6 @@ import { BotId } from "@akeru/contracts";
import { describe, expect, it } from "vite-plus/test";
import {
- archivedRosterBots,
buildGroupedRosterSections,
buildRosterSections,
buildRosterStrip,
@@ -79,18 +78,6 @@ describe("rosterZoneHeading", () => {
});
});
-describe("archivedRosterBots", () => {
- it("lists archived bots newest first and leaves active bots out", () => {
- const archived = archivedRosterBots([
- bot({ id: "active", name: "Active" }),
- bot({ id: "older", name: "Older", archivedAt: "2026-08-02T00:00:00.000Z" }),
- bot({ id: "newer", name: "Newer", archivedAt: "2026-08-09T00:00:00.000Z" }),
- ]);
-
- expect(archived.map((entry) => entry.id)).toEqual(["newer", "older"]);
- });
-});
-
describe("buildGroupedRosterSections", () => {
const group: Group = {
id: "group-product",
diff --git a/apps/web/src/components/roster/roster.logic.ts b/apps/web/src/components/roster/roster.logic.ts
index 3efc4bba0..22e79722a 100644
--- a/apps/web/src/components/roster/roster.logic.ts
+++ b/apps/web/src/components/roster/roster.logic.ts
@@ -172,13 +172,6 @@ export function rosterZoneHeading(items: readonly RosterItemRef[]): string {
return "Bots";
}
-/** Archived bots, newest archive first, for the roster's restore list. */
-export function archivedRosterBots(bots: readonly Bot[]): Bot[] {
- return bots
- .filter((bot) => bot.archivedAt !== null)
- .toSorted((left, right) => (right.archivedAt ?? "").localeCompare(left.archivedAt ?? ""));
-}
-
export const ROSTER_TILE_LIMIT = 5;
export function buildRosterStrip(
diff --git a/apps/web/src/components/settings/ArchivedBotsSettings.test.tsx b/apps/web/src/components/settings/ArchivedBotsSettings.test.tsx
new file mode 100644
index 000000000..4abf91bd3
--- /dev/null
+++ b/apps/web/src/components/settings/ArchivedBotsSettings.test.tsx
@@ -0,0 +1,143 @@
+import { Predicate } from "effect";
+import { BotId, EnvironmentId, type OrchestrationBot } from "@akeru/contracts";
+import { Children, isValidElement, type ReactNode } from "react";
+import { renderToStaticMarkup } from "react-dom/server";
+import { beforeEach, describe, expect, it, vi } from "vite-plus/test";
+
+type ButtonProps = { onClick?: () => void; "aria-label"?: string };
+
+const mocks = vi.hoisted(() => ({
+ bots: [] as unknown[],
+ buttons: new Map<string, ButtonProps>(),
+ restore: vi.fn(async () => ({ _tag: "Success" })),
+ delete: vi.fn(async () => ({ _tag: "Success" })),
+ confirmed: true,
+}));
+
+function textOf(node: ReactNode): string {
+ return Children.toArray(node)
+ .map((child) =>
+ Predicate.isString(child)
+ ? child
+ : isValidElement<{ children?: ReactNode }>(child)
+ ? textOf(child.props.children)
+ : "",
+ )
+ .join("")
+ .trim();
+}
+
+vi.mock("@effect/atom-react", () => ({ useAtomValue: () => mocks.bots }));
+
+vi.mock("../../state/bots", () => ({
+ environmentBotsAtom: () => "bots",
+ botEnvironment: { restore: "restore", delete: "delete" },
+}));
+
+vi.mock("../../state/use-atom-command", () => ({
+ useAtomCommand: (command: string) => (command === "restore" ? mocks.restore : mocks.delete),
+}));
+
+vi.mock("../../confirmDialog", () => ({
+ requestConfirmDialog: () => Promise.resolve(mocks.confirmed),
+}));
+
+vi.mock("../roster/BotAvatarView", () => ({ BotAvatarView: () => null }));
+
+vi.mock("./settingsLayout", () => ({
+ SettingsSection: ({ title, children }: { title: string; children: ReactNode }) => (
+ <section>
+ <h2>{title}</h2>
+ {children}
+ </section>
+ ),
+ SettingsRow: (props: { title: ReactNode; description?: ReactNode; control?: ReactNode }) => (
+ <div data-row>
+ <h3>{props.title}</h3>
+ <p>{props.description}</p>
+ {props.control}
+ </div>
+ ),
+}));
+
+vi.mock("../ui/button", () => ({
+ Button: (props: ButtonProps & { children: ReactNode }) => {
+ mocks.buttons.set(props["aria-label"] ?? textOf(props.children), props);
+
+ return null;
+ },
+}));
+
+import { ArchivedBotsSection, archivedBots } from "./ArchivedBotsSettings";
+
+const environmentId = EnvironmentId.make("env-1");
+
+const bot = (id: string, archivedAt: string | null) =>
+ ({
+ id: BotId.make(id),
+ name: id,
+ archivedAt,
+ updatedAt: "2026-09-01T00:00:00.000Z",
+ avatar: { kind: "dither", seed: id },
+ }) as OrchestrationBot;
+
+function render(): string {
+ mocks.buttons.clear();
+
+ return renderToStaticMarkup(<ArchivedBotsSection environmentId={environmentId} />);
+}
+
+beforeEach(() => {
+ mocks.bots = [];
+ mocks.confirmed = true;
+ mocks.restore.mockClear();
+ mocks.delete.mockClear();
+});
+
+describe("archivedBots", () => {
+ it("lists archived bots newest first and leaves active bots out", () => {
+ const archived = archivedBots([
+ bot("active", null),
+ bot("older", "2026-08-02T00:00:00.000Z"),
+ bot("newer", "2026-08-09T00:00:00.000Z"),
+ ]);
+
+ expect(archived.map((entry) => entry.id)).toEqual(["newer", "older"]);
+ });
+});
+
+describe("ArchivedBotsSection", () => {
+ it("renders nothing when no bot is archived", () => {
+ mocks.bots = [bot("active", null)];
+ expect(render()).toBe("");
+ });
+
+ it("shows when each archived bot is deleted and restores or deletes it", async () => {
+ mocks.bots = [bot("Mori", "2026-09-20T12:00:00.000Z")];
+ const markup = render();
+
+ expect(markup).toContain("Archived bots");
+ expect(markup).toContain("Mori");
+ expect(markup).toContain("Sep 27, 2026");
+
+ mocks.buttons.get("Restore")?.onClick?.();
+ mocks.buttons.get("Delete Mori")?.onClick?.();
+ await vi.waitFor(() => expect(mocks.delete).toHaveBeenCalled());
+
+ const call = { environmentId, input: { botId: BotId.make("Mori") } };
+ expect(mocks.restore).toHaveBeenCalledWith(call);
+ expect(mocks.delete).toHaveBeenCalledWith(call);
+ });
+
+ it("does not delete when the confirmation is declined", async () => {
+ mocks.confirmed = false;
+ mocks.bots = [bot("Mori", "2026-09-20T12:00:00.000Z")];
+ render();
+
+ mocks.buttons.get("Delete Mori")?.onClick?.();
+ await Promise.resolve();
+ await Promise.resolve();
+
+ expect(mocks.delete).not.toHaveBeenCalled();
+ });
+});
diff --git a/apps/web/src/components/settings/ArchivedBotsSettings.tsx b/apps/web/src/components/settings/ArchivedBotsSettings.tsx
new file mode 100644
index 000000000..dbcad399e
--- /dev/null
+++ b/apps/web/src/components/settings/ArchivedBotsSettings.tsx
@@ -0,0 +1,145 @@
+import { Predicate } from "effect";
+import { useAtomValue } from "@effect/atom-react";
+import {
+ archivedBotDeletesAtMs,
+ type EnvironmentId,
+ type OrchestrationBot,
+} from "@akeru/contracts";
+import { ArchiveRestoreIcon, Trash2Icon } from "lucide-react";
+import { useMemo, useState } from "react";
+
+import { requestConfirmDialog } from "../../confirmDialog";
+import { useI18n } from "../../i18n";
+import { botEnvironment, environmentBotsAtom } from "../../state/bots";
+import { useAtomCommand } from "../../state/use-atom-command";
+import { BotAvatarView } from "../roster/BotAvatarView";
+import { commandFailureMessage } from "../roster/rosterCommands.logic";
+import { Button } from "../ui/button";
+import { toastManager } from "../ui/toast";
+import { SettingsRow, SettingsSection } from "./settingsLayout";
+
+/** Archived bots, newest archive first. Restoring returns a bot to the roster. */
+export function archivedBots(bots: readonly OrchestrationBot[]): OrchestrationBot[] {
+ return bots
+ .filter((bot) => bot.archivedAt !== null)
+ .toSorted((left, right) => (right.archivedAt ?? "").localeCompare(left.archivedAt ?? ""));
+}
+
+/**
+ * Settings > Archived: bots that left the roster. The server deletes each one
+ * once its retention window passes, so every row shows that date.
+ */
+export function ArchivedBotsSection({ environmentId }: { readonly environmentId: EnvironmentId }) {
+ const { t, formatDate } = useI18n();
+ const bots = useAtomValue(environmentBotsAtom(environmentId));
+ const restoreBot = useAtomCommand(botEnvironment.restore, { reportFailure: false });
+ const deleteBot = useAtomCommand(botEnvironment.delete, { reportFailure: false });
+ const archived = useMemo(() => archivedBots(bots), [bots]);
+ const [busyBotIds, setBusyBotIds] = useState<ReadonlySet<string>>(() => new Set());
+
+ const runForBot = async <A,>(botId: string, action: () => Promise<A>) => {
+ setBusyBotIds((current) => new Set(current).add(botId));
+
+ try {
+ return await action();
+ } finally {
+ setBusyBotIds((current) => {
+ const next = new Set(current);
+ next.delete(botId);
+
+ return next;
+ });
+ }
+ };
+
+ if (archived.length === 0) return null;
+
+ const handleRestore = async (bot: OrchestrationBot) => {
+ const result = await runForBot(bot.id, () =>
+ restoreBot({ environmentId, input: { botId: bot.id } }),
+ );
+
+ if (Predicate.isTagged(result, "Failure")) {
+ toastManager.add({
+ type: "error",
+ title: t("Could not restore {name}", { name: bot.name }),
+ description: commandFailureMessage(result, t),
+ });
+ }
+ };
+
+ const handleDelete = async (bot: OrchestrationBot) => {
+ const confirmation = requestConfirmDialog(
+ t("Delete {name}? Its chats stay in your history. This cannot be undone.", {
+ name: bot.name,
+ }),
+ { variant: "destructive" },
+ );
+
+ if (!confirmation || !(await confirmation)) return;
+
+ const result = await runForBot(bot.id, () =>
+ deleteBot({ environmentId, input: { botId: bot.id } }),
+ );
+
+ if (Predicate.isTagged(result, "Failure")) {
+ toastManager.add({
+ type: "error",
+ title: t("Could not delete {name}", { name: bot.name }),
+ description: commandFailureMessage(result, t),
+ });
+ }
+ };
+
+ return (
+ <SettingsSection id="archived-bots" title={t("Archived bots")}>
+ {archived.map((bot) => {
+ const busy = busyBotIds.has(bot.id);
+ const archivedAt = bot.archivedAt ?? bot.updatedAt;
+ const time = formatDate(new Date(archivedAt), { dateStyle: "medium" });
+
+ const date = formatDate(new Date(archivedBotDeletesAtMs(archivedAt)), {
+ dateStyle: "medium",
+ });
+
+ return (
+ <SettingsRow
+ key={bot.id}
+ data-testid="archived-bot-row"
+ title={
+ <span className="inline-flex items-center gap-2">
+ <BotAvatarView avatar={bot.avatar} name={bot.name} className="size-5" />
+ {bot.name}
+ </span>
+ }
+ description={t("Archived {time}. Deleted automatically on {date}.", { time, date })}
+ control={
+ <>
+ <Button
+ type="button"
+ size="sm"
+ variant="outline"
+ disabled={busy}
+ onClick={() => void handleRestore(bot)}
+ >
+ <ArchiveRestoreIcon className="size-3.5" />
+ {t("Restore")}
+ </Button>
+ <Button
+ type="button"
+ size="icon-sm"
+ variant="ghost"
+ aria-label={t("Delete {title}", { title: bot.name })}
+ disabled={busy}
+ onClick={() => void handleDelete(bot)}
+ >
+ <Trash2Icon className="size-3.5" />
+ </Button>
+ </>
+ }
+ />
+ );
+ })}
+ </SettingsSection>
+ );
+}
diff --git a/apps/web/src/components/settings/ArchivedChatsSettings.test.tsx b/apps/web/src/components/settings/ArchivedChatsSettings.test.tsx
index f4cf07b40..d0a53c4ae 100644
--- a/apps/web/src/components/settings/ArchivedChatsSettings.test.tsx
+++ b/apps/web/src/components/settings/ArchivedChatsSettings.test.tsx
@@ -41,6 +41,8 @@ vi.mock("../../state/bots", () => ({
environmentGroupsAtom: () => "groups",
}));
+vi.mock("./ArchivedBotsSettings", () => ({ ArchivedBotsSection: () => null }));
+
vi.mock("../../lib/archivedThreadsState", () => ({
useArchivedThreadSnapshots: () => mocks.archive,
}));
@@ -138,6 +140,30 @@ describe("ArchivedChatsSettingsPanel", () => {
expect(markup).toContain("Could not load archived chats");
});
+ it("offers only delete for chats whose bot was deleted", () => {
+ mocks.archive.snapshots = [
+ {
+ environmentId,
+ snapshot: makeShellSnapshot({
+ bots: [],
+ groups: [],
+ threads: [
+ {
+ id: "thread-1",
+ title: "Trip plans",
+ createdAt: "2026-09-01T00:00:00.000Z",
+ updatedAt: "2026-09-20T00:00:00.000Z",
+ archivedAt: "2026-09-20T00:00:00.000Z",
+ },
+ ],
+ }),
+ },
+ ];
+ expect(render()).toContain("Other chats");
+ expect(mocks.buttons.has("Unarchive")).toBe(false);
+ expect(mocks.buttons.has("Delete Trip plans")).toBe(true);
+ });
+
it("lists archived chats under their bot and restores or deletes them", async () => {
mocks.bots = [{ id: "bot-mori", name: "Mori" } as OrchestrationBot];
mocks.archive.snapshots = [
diff --git a/apps/web/src/components/settings/ArchivedChatsSettings.tsx b/apps/web/src/components/settings/ArchivedChatsSettings.tsx
index 73f76841a..28462cad2 100644
--- a/apps/web/src/components/settings/ArchivedChatsSettings.tsx
+++ b/apps/web/src/components/settings/ArchivedChatsSettings.tsx
@@ -12,10 +12,11 @@ import { useSettingsEnvironmentId } from "../../settingsDialogStore";
import { environmentBotsAtom, environmentGroupsAtom } from "../../state/bots";
import { Button } from "../ui/button";
import { Spinner } from "../ui/spinner";
+import { ArchivedBotsSection } from "./ArchivedBotsSettings";
import { buildArchivedChatSections, type ArchivedChat } from "./ArchivedChatsSettings.logic";
import { SettingsPageContainer, SettingsRow, SettingsSection } from "./settingsLayout";
-/** Settings > Archived chats: every archived chat on this environment, by bot or group. */
+/** Settings > Archived: archived bots, then every archived chat on this environment, by bot or group. */
export function ArchivedChatsSettingsPanel() {
const { t } = useI18n();
const environmentId = useSettingsEnvironmentId();
@@ -30,7 +31,10 @@ export function ArchivedChatsSettingsPanel() {
/>
</SettingsSection>
) : (
- <ArchivedChatsContent key={environmentId} environmentId={environmentId} />
+ <>
+ <ArchivedBotsSection key={`bots-${environmentId}`} environmentId={environmentId} />
+ <ArchivedChatsContent key={environmentId} environmentId={environmentId} />
+ </>
)}
</SettingsPageContainer>
);
@@ -132,16 +136,19 @@ function ArchivedChatsContent({ environmentId }: { readonly environmentId: Envir
description={t("Archived {time}", { time: archivedAt })}
control={
<>
- <Button
- type="button"
- size="sm"
- variant="outline"
- disabled={busy}
- onClick={() => void run(chat, "unarchive")}
- >
- <ArchiveRestoreIcon className="size-3.5" />
- {t("Unarchive")}
- </Button>
+ {/* A chat with no bot or group has no page on web, so unarchiving would hide it. */}
+ {section.kind === "other" ? null : (
+ <Button
+ type="button"
+ size="sm"
+ variant="outline"
+ disabled={busy}
+ onClick={() => void run(chat, "unarchive")}
+ >
+ <ArchiveRestoreIcon className="size-3.5" />
+ {t("Unarchive")}
+ </Button>
+ )}
<Button
type="button"
size="icon-sm"
diff --git a/apps/web/src/components/settings/SettingsDialog.tsx b/apps/web/src/components/settings/SettingsDialog.tsx
index b33a8161a..9dfe9b2a0 100644
--- a/apps/web/src/components/settings/SettingsDialog.tsx
+++ b/apps/web/src/components/settings/SettingsDialog.tsx
@@ -130,7 +130,7 @@ export const SETTINGS_NAV_GROUPS: ReadonlyArray<{
{ section: "keybindings", label: "Keyboard", icon: KeyboardIcon },
{ section: "connections", label: "Connections", icon: Link02Icon },
{ section: "privacy", label: "Privacy & data", icon: SecurityCheckIcon },
- { section: "archived", label: "Archived chats", icon: Archive02Icon },
+ { section: "archived", label: "Archived", icon: Archive02Icon },
{ section: "advanced", label: "Advanced", icon: SlidersHorizontalIcon },
],
},
diff --git a/apps/web/src/components/settings/settingsSearch.ts b/apps/web/src/components/settings/settingsSearch.ts
index cff0191b9..b227eacd3 100644
--- a/apps/web/src/components/settings/settingsSearch.ts
+++ b/apps/web/src/components/settings/settingsSearch.ts
@@ -293,6 +293,13 @@ export const SETTINGS_SEARCH_ITEMS = [
to: "/settings/archived",
keywords: ["archive", "unarchive", "restore", "delete"],
},
+ {
+ id: "archived-bots",
+ title: "Archived bots",
+ to: "/settings/archived",
+ targetId: "archived-bots",
+ keywords: ["archive", "restore", "delete", "bot"],
+ },
{
id: "providers",
title: "Providers",
diff --git a/docs/user/bots.md b/docs/user/bots.md
index 99376da90..8e4310213 100644
--- a/docs/user/bots.md
+++ b/docs/user/bots.md
@@ -174,8 +174,9 @@ The sidebar shows pinned bots and groups as launcher cards at the top, followed
To archive a bot, open its menu and select **Archive bot**. Archived bots leave the roster and stop
taking messages, but their chats are kept. A message sent from another device that still shows the
-bot is refused with a note that the bot is archived. Open **Archived** at the bottom of the roster and select
-**Restore** to bring one back.
+bot is refused with a note that the bot is archived. Archived bots are listed in **Settings >
+Archived**, where **Restore** brings one back and the delete button removes it right away. Akeru
+deletes an archived bot automatically 7 days after it was archived. Its chats stay in your history.
Pins only change the roster layout. They do not change group membership or settle chats.
@@ -231,7 +232,7 @@ Open the bot's settings and choose a provider under **Workspace > Image generati
Open the bot's settings page and select **Delete** under **Danger**, then confirm. On mobile, open
the chat's settings and select **Delete bot** under **Danger**. Deleting removes the bot from the
-roster. Its chats stay in your history.
+roster. Its chats stay in your history and move to **Settings > Archived**.
Deleting stops anything the bot is doing. Running replies stop, work it handed to other bots or
received from them is canceled, and a voice call with the bot ends. In a group chat the bot was
diff --git a/docs/user/chats.md b/docs/user/chats.md
index 09f6353af..3790a2bea 100644
--- a/docs/user/chats.md
+++ b/docs/user/chats.md
@@ -46,7 +46,7 @@ first, with how long ago each one was active. The chat you are looking at is hig
chat to open it in place of the newest one. Sending a message there makes it the newest chat again.
Select the newest chat, or start a **New chat** from the same list, to go back to the bot's usual
view. **New chat** appears once the open chat has a message. Archived chats stay in **Settings >
-Archived chats**.
+Archived**.
The open chat is remembered for this session only. Reloading the page, or archiving or deleting the
open chat, returns the bot to its newest chat.
@@ -79,7 +79,7 @@ does not: the bot then opens its next newest chat, or an empty chat if it has no
## Archived chats
-**Settings > Archived chats** lists the chats you archived on this environment, grouped by bot or
+**Settings > Archived** lists the chats you archived on this environment, grouped by bot or
group, newest first. Select **Unarchive** to bring a chat back, or the delete button to remove it
for good. An unarchived chat becomes the bot's open chat again when it is the bot's newest chat.
Work one bot handed to another does not appear here, because it never shows as a chat of its own.
diff --git a/packages/client-runtime/src/i18n/__snapshots__/coverage.test.ts.snap b/packages/client-runtime/src/i18n/__snapshots__/coverage.test.ts.snap
index ebfacc514..5181a3f90 100644
--- a/packages/client-runtime/src/i18n/__snapshots__/coverage.test.ts.snap
+++ b/packages/client-runtime/src/i18n/__snapshots__/coverage.test.ts.snap
@@ -2,7 +2,7 @@
exports[`discovered interface message coverage > covers static calls and finite label sources without translating identifiers 1`] = `
{
- "directMessageCount": 1771,
+ "directMessageCount": 1770,
"expressions": {
"apps/mobile/src/components/DictationControls.tsx": [
"announcements[status]);",
@@ -242,7 +242,7 @@ exports[`discovered interface message coverage > covers static calls and finite
"Keyboard",
"Connections",
"Privacy & data",
- "Archived chats",
+ "Archived",
"Advanced",
"Bots",
"Providers",
@@ -297,6 +297,7 @@ exports[`discovered interface message coverage > covers static calls and finite
"Stream token by token (legacy)",
"Keybindings",
"Archived chats",
+ "Archived bots",
"Providers",
"Sandbox",
"Default sandbox",
@@ -487,7 +488,6 @@ exports[`discovered interface message coverage > covers static calls and finite
"apps/web/src/components/roster/MemoryApprovalPrompt.tsx",
"apps/web/src/components/roster/NewBotDialog.tsx",
"apps/web/src/components/roster/NewGroupDialog.tsx",
- "apps/web/src/components/roster/RosterArchivedSection.tsx",
"apps/web/src/components/roster/RosterHeaders.tsx",
"apps/web/src/components/roster/RosterLoadStatus.tsx",
"apps/web/src/components/roster/RosterRows.tsx",
@@ -506,6 +506,7 @@ exports[`discovered interface message coverage > covers static calls and finite
"apps/web/src/components/roster/useBotLandingTimeline.ts",
"apps/web/src/components/roster/useBotProfileDraft.ts",
"apps/web/src/components/roster/useMessageReactionUpdater.ts",
+ "apps/web/src/components/settings/ArchivedBotsSettings.tsx",
"apps/web/src/components/settings/ArchivedChatsSettings.tsx",
"apps/web/src/components/settings/BackgroundActivitySettings.tsx",
"apps/web/src/components/settings/BotChannelsSettings.tsx",
diff --git a/packages/client-runtime/src/i18n/catalogs/en/roster.ts b/packages/client-runtime/src/i18n/catalogs/en/roster.ts
index 8b10a4821..4921901fb 100644
--- a/packages/client-runtime/src/i18n/catalogs/en/roster.ts
+++ b/packages/client-runtime/src/i18n/catalogs/en/roster.ts
@@ -76,8 +76,10 @@ export const rosterCatalog = {
Groups: "Groups",
"No bots match": "No bots match",
"Archived bots": "Archived bots",
- "{name} leaves the roster and stops taking messages. Its chat history is kept, and you can restore it from Archived at any time.":
- "{name} leaves the roster and stops taking messages. Its chat history is kept, and you can restore it from Archived at any time.",
+ "{name} leaves the roster and stops taking messages. You can restore it from Settings > Archived for {days} days, then it is deleted. Its chats stay in your history.":
+ "{name} leaves the roster and stops taking messages. You can restore it from Settings > Archived for {days} days, then it is deleted. Its chats stay in your history.",
+ "Archived {time}. Deleted automatically on {date}.":
+ "Archived {time}. Deleted automatically on {date}.",
"{count} bot": "{count} bot",
"{count} bots": "{count} bots",
"Bot name": "Bot name",
diff --git a/packages/client-runtime/src/i18n/catalogs/zh-CN/roster.ts b/packages/client-runtime/src/i18n/catalogs/zh-CN/roster.ts
index 898c47794..f54cbc218 100644
--- a/packages/client-runtime/src/i18n/catalogs/zh-CN/roster.ts
+++ b/packages/client-runtime/src/i18n/catalogs/zh-CN/roster.ts
@@ -73,8 +73,9 @@ export const rosterCatalog = {
Groups: "群组",
"No bots match": "没有匹配的机器人",
"Archived bots": "已归档的机器人",
- "{name} leaves the roster and stops taking messages. Its chat history is kept, and you can restore it from Archived at any time.":
- "{name} 将离开机器人列表并停止接收消息。它的聊天记录会保留,你可以随时从“已归档”中恢复它。",
+ "{name} leaves the roster and stops taking messages. You can restore it from Settings > Archived for {days} days, then it is deleted. Its chats stay in your history.":
+ "{name} 将离开机器人列表并停止接收消息。你可以在 {days} 天内从“设置 > 已归档”中恢复它,之后它将被删除。它的聊天记录会保留。",
+ "Archived {time}. Deleted automatically on {date}.": "归档于 {time}。将于 {date} 自动删除。",
"{count} bot": "{count} 个机器人",
"{count} bots": "{count} 个机器人",
"Bot name": "机器人名称",
diff --git a/packages/contracts/src/orchestration.ts b/packages/contracts/src/orchestration.ts
index 545541d02..096bc9887 100644
--- a/packages/contracts/src/orchestration.ts
+++ b/packages/contracts/src/orchestration.ts
@@ -61,6 +61,8 @@ export {
ChannelFailureCategory,
ChannelBinding,
OrchestrationBot,
+ ARCHIVED_BOT_RETENTION_DAYS,
+ archivedBotDeletesAtMs,
GroupMembershipRole,
GroupBotMembership,
GroupPersonMembership,
diff --git a/packages/contracts/src/orchestration/roster.ts b/packages/contracts/src/orchestration/roster.ts
index 444b3cefa..7554cbb47 100644
--- a/packages/contracts/src/orchestration/roster.ts
+++ b/packages/contracts/src/orchestration/roster.ts
@@ -361,3 +361,10 @@ export const OrchestrationGroup = Schema.Struct({
});
export type OrchestrationGroup = typeof OrchestrationGroup.Type;
+
+/** Days an archived bot is kept before the server deletes it. Its chats stay in history. */
+export const ARCHIVED_BOT_RETENTION_DAYS = 7;
+
+/** When the server deletes a bot archived at `archivedAt`, in epoch milliseconds. */
+export const archivedBotDeletesAtMs = (archivedAt: string): number =>
+ Date.parse(archivedAt) + ARCHIVED_BOT_RETENTION_DAYS * 24 * 60 * 60 * 1000;
diff --git a/packages/contracts/src/orchestration/rosterCommands.ts b/packages/contracts/src/orchestration/rosterCommands.ts
index cfe27a75c..b66434c3d 100644
--- a/packages/contracts/src/orchestration/rosterCommands.ts
+++ b/packages/contracts/src/orchestration/rosterCommands.ts
@@ -139,6 +139,8 @@ export const BotDeleteCommand = Schema.Struct({
type: Schema.Literal("bot.delete"),
commandId: CommandId,
botId: BotId,
+ /** Deletes only while the bot is still archived at this time, so a restore wins a race with the retention sweep. */
+ archivedAt: Schema.optional(IsoDateTime),
});
export const ChannelConnectCommand = Schema.Union([