Open-source, local-first AI agent team for your desktop: multi-agent group chats, computer use, browser, MCP, routines and approvals. macOS, Windows, Linux + Android. Built on pi.
TypeScript agentai-agentai-agentsai-assistantandroidautomationchatgptcoding-agentcomputer-usedesktop-appelectronllmlocal-firstmcpmulti-agentollamaopenaiprivacyself-hostedtypescript
import type { Message } from "@pibot/protocol";
import { interruptedRun, RUN_INTERRUPTED } from "@pibot/protocol";
/** Renderer hint for the reply whose run a restart interrupted. */
export function interruptedMessage(message: Pick<Message, "role" | "status" | "usage">): boolean {
const usage = message.usage;
const stopReason =
usage &&
typeof usage === "object" &&
!Array.isArray(usage) &&
usage.stopReason === RUN_INTERRUPTED
? RUN_INTERRUPTED
: null;
return message.role === "assistant" && interruptedRun({ status: message.status, stopReason });
}