AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.
fix(platform): name Otto or the expert where screens still said AutoPilot or Copilot (#15768)
Nicholas Tindle771cf0b8cf84
diff --git a/autogpt_platform/backend/backend/copilot/executor/processor.py b/autogpt_platform/backend/backend/copilot/executor/processor.pyindex 0cbbde77a4..58d28a3186 100644--- a/autogpt_platform/backend/backend/copilot/executor/processor.py+++ b/autogpt_platform/backend/backend/copilot/executor/processor.py@@ -84,7 +84,7 @@ logger = TruncatedLogger(logging.getLogger(__name__), prefix="[CoPilotExecutor]"SHUTDOWN_ERROR_MESSAGE = (- "Copilot executor shut down before this turn finished. Please retry."+ "The server running this turn shut down before it finished. Please retry.")# A platform turn whose allowance can't be read doesn't run unmetered.RATE_LIMIT_UNAVAILABLE_CODE = "rate_limit_unavailable"diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/__tests__/autopilot-mode-selector.test.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/__tests__/autopilot-mode-selector.test.tsxindex 55f8db67e4..73bdb9e026 100644--- a/autogpt_platform/frontend/src/app/(platform)/copilot/__tests__/autopilot-mode-selector.test.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/__tests__/autopilot-mode-selector.test.tsx@@ -129,6 +129,11 @@ describe("AutoPilot mode selector", () => {expect(screen.queryByRole("button", { name: /approval mode: unsupervised/i }),).toBeNull();+ expect(+ await screen.findByText(+ /^Otto will not ask before anything in this chat\./,+ ),+ ).toBeDefined();await user.click(await screen.findByRole("button", { name: /run unsupervised/i }),);@@ -278,6 +283,26 @@ describe("AutoPilot mode selector", () => {expect(await findModeButton(/approval mode: unsupervised/i)).toBeDefined();});++ it("names the chat's expert in the Unsupervised confirm", async () => {+ server.use(+ getListExpertIdentitiesMockHandler([mariaIdentity("ask_first")]),+ );++ renderHost({+ sessionOverride: {+ expert_id: "expert-maria",+ metadata: { dry_run: false, autopilot_mode: "ask_first" },+ },+ });+ await pickMode(/approval mode: ask first/i, /unsupervised/i);++ expect(+ await screen.findByText(+ /^Maria will not ask before anything in this chat\./,+ ),+ ).toBeDefined();+ });});describe("autopilotModeStore", () => {diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/components/AutopilotModeSelector/AutopilotModeSelector.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/components/AutopilotModeSelector/AutopilotModeSelector.tsxindex baa2c6d661..8bc6df3aed 100644--- a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/components/AutopilotModeSelector/AutopilotModeSelector.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/components/AutopilotModeSelector/AutopilotModeSelector.tsx@@ -11,7 +11,11 @@ import {} from "@/components/molecules/DropdownMenu/DropdownMenu";import { cn } from "@/lib/utils";import type { AutopilotMode } from "../../../../autopilotModeStore";-import { AUTOPILOT_MODE_OPTIONS, getModeOption } from "./helpers";+import {+ AUTOPILOT_MODE_OPTIONS,+ getModeOption,+ unsupervisedChatDescription,+} from "./helpers";import { UnsupervisedConfirmDialog } from "./UnsupervisedConfirmDialog";import { useAutopilotModeSelector } from "./useAutopilotModeSelector";@@ -28,6 +32,7 @@ export function AutopilotModeSelector({ sessionId, persistedMode }: Props) {isConfirmOpen,confirmUnsupervised,cancelUnsupervised,+ assistantName,} = useAutopilotModeSelector({ sessionId, persistedMode });const current = getModeOption(mode);@@ -82,6 +87,7 @@ export function AutopilotModeSelector({ sessionId, persistedMode }: Props) {isOpen={isConfirmOpen}onConfirm={confirmUnsupervised}onCancel={cancelUnsupervised}+ description={unsupervisedChatDescription(assistantName)}/></>);diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/components/AutopilotModeSelector/UnsupervisedConfirmDialog.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/components/AutopilotModeSelector/UnsupervisedConfirmDialog.tsxindex effab1ffa9..bf9473c14f 100644--- a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/components/AutopilotModeSelector/UnsupervisedConfirmDialog.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/components/AutopilotModeSelector/UnsupervisedConfirmDialog.tsx@@ -4,15 +4,12 @@ import { Button } from "@/components/atoms/Button/Button";import { Text } from "@/components/atoms/Text/Text";import { Dialog } from "@/components/molecules/Dialog/Dialog";-const DEFAULT_DESCRIPTION =- "AutoPilot will not ask before anything in this chat. Edits, commands and actions outside the platform, like sending a message or an email, run without your approval.";-interface Props {isOpen: boolean;onConfirm: () => void;onCancel: () => void;title?: string;- description?: string;+ description: string;}export function UnsupervisedConfirmDialog({@@ -20,7 +17,7 @@ export function UnsupervisedConfirmDialog({onConfirm,onCancel,title = "Run this chat unsupervised?",- description = DEFAULT_DESCRIPTION,+ description,}: Props) {return (<Dialogdiff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/components/AutopilotModeSelector/helpers.ts b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/components/AutopilotModeSelector/helpers.tsindex 13f0f9697d..34414806da 100644--- a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/components/AutopilotModeSelector/helpers.ts+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/components/AutopilotModeSelector/helpers.ts@@ -46,3 +46,7 @@ export function getModeOption(mode: AutopilotMode) {export function isAutopilotMode(value: string): value is AutopilotMode {return AUTOPILOT_MODE_OPTIONS.some((option) => option.value === value);}++export function unsupervisedChatDescription(assistantName: string) {+ return `${assistantName} will not ask before anything in this chat. Edits, commands and actions outside the platform, like sending a message or an email, run without your approval.`;+}diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/components/AutopilotModeSelector/useAutopilotModeSelector.ts b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/components/AutopilotModeSelector/useAutopilotModeSelector.tsindex 0724f7d1e7..d3535cbb39 100644--- a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/components/AutopilotModeSelector/useAutopilotModeSelector.ts+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/components/AutopilotModeSelector/useAutopilotModeSelector.ts@@ -1,10 +1,11 @@-import { useState } from "react";+import { useContext, useState } from "react";import {type AutopilotMode,DEFAULT_AUTOPILOT_MODE,useAutopilotModeChoice,useAutopilotModeStore,} from "../../../../autopilotModeStore";+import { CopilotChatActionsContext } from "../../../CopilotChatActionsProvider/useCopilotChatActions";import { isAutopilotMode } from "./helpers";interface Args {@@ -15,6 +16,7 @@ interface Args {export function useAutopilotModeSelector({ sessionId, persistedMode }: Args) {const choice = useAutopilotModeChoice(sessionId);const choose = useAutopilotModeStore((state) => state.choose);+ const actions = useContext(CopilotChatActionsContext);const [isConfirmOpen, setIsConfirmOpen] = useState(false);const mode = choice ?? persistedMode ?? DEFAULT_AUTOPILOT_MODE;@@ -43,5 +45,6 @@ export function useAutopilotModeSelector({ sessionId, persistedMode }: Args) {isConfirmOpen,confirmUnsupervised,cancelUnsupervised,+ assistantName: actions?.assistantName ?? "Otto",};}diff --git a/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/__tests__/approval-mode.test.tsx b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/__tests__/approval-mode.test.tsxindex 34389e9567..30ee170c75 100644--- a/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/__tests__/approval-mode.test.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/__tests__/approval-mode.test.tsx@@ -220,6 +220,9 @@ describe("Expert approval mode", () => {name: "Run Maria unsupervised by default?",}),).toBeDefined();+ expect(+ screen.getByText(/^Maria will not ask before anything in new chats\./),+ ).toBeDefined();await user.click(screen.getByRole("button", { name: "Cancel" }));await waitFor(() =>expect(diff --git a/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/__tests__/main.test.tsx b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/__tests__/main.test.tsxindex 83e1020ac1..ae9022b614 100644--- a/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/__tests__/main.test.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/__tests__/main.test.tsx@@ -1226,7 +1226,7 @@ describe("ExpertDetailPage", () => {expect(within(panel).getByPlaceholderText("Message Maria…")).toBeDefined();expect(within(panel)- .getByRole("link", { name: "Open in Copilot" })+ .getByRole("link", { name: "Open in Chat" }).getAttribute("href"),).toBe("/copilot?expertId=expert-maria&new=1");expect(listedSessions).toBe(0);diff --git a/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertModeSection/ExpertModeSection.tsx b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertModeSection/ExpertModeSection.tsxindex ce1283243d..824dd7db0b 100644--- a/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertModeSection/ExpertModeSection.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertModeSection/ExpertModeSection.tsx@@ -93,7 +93,7 @@ function ExpertModeOptions({ expert }: Props) {onConfirm={confirmUnsupervised}onCancel={cancelUnsupervised}title={`Run ${expert.name} unsupervised by default?`}- description={`AutoPilot will not ask before anything in new chats with ${expert.name}. Edits, commands and actions outside the platform, like sending a message or an email, run without your approval unless you switch a chat back from the composer.`}+ description={`${expert.name} will not ask before anything in new chats. Edits, commands and actions outside the platform, like sending a message or an email, run without your approval unless you switch a chat back from the composer.`}/></section>);diff --git a/autogpt_platform/frontend/src/app/(platform)/team/components/ExpertChatDrawer/ExpertChatDrawer.tsx b/autogpt_platform/frontend/src/app/(platform)/team/components/ExpertChatDrawer/ExpertChatDrawer.tsxindex 91fd0ce150..4a5a8fb673 100644--- a/autogpt_platform/frontend/src/app/(platform)/team/components/ExpertChatDrawer/ExpertChatDrawer.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/team/components/ExpertChatDrawer/ExpertChatDrawer.tsx@@ -81,7 +81,7 @@ export function ExpertChatDrawer({variant="ghost"size="icon-xs"leadingIcon={ArrowExpandIcon}- aria-label="Open in Copilot"+ aria-label="Open in Chat"/></>}