diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/ChatInput.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/ChatInput.tsx index 1a00f8def6..c4c116b3cd 100644 --- a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/ChatInput.tsx +++ b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/ChatInput.tsx @@ -218,25 +218,19 @@ export function ChatInput({ onFilesSelected={handleFilesSelected} disabled={isBusy} /> - {showModeToggle && - !isStreaming && - (!hasSession || copilotChatMode === "extended_thinking") && ( - - )} - {showModeToggle && - !isStreaming && - (!hasSession || copilotLlmModel === "advanced") && ( - - )} - {showDryRunToggle && (!hasSession || isDryRun) && ( + {showModeToggle && !isStreaming && !hasSession && ( + + )} + {showModeToggle && !isStreaming && !hasSession && ( + + )} + {showDryRunToggle && ( void; - readOnly?: boolean; } -export function ModeToggleButton({ mode, onToggle, readOnly = false }: Props) { +export function ModeToggleButton({ mode, onToggle }: Props) { const isExtended = mode === "extended_thinking"; return ( ); } diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/components/__tests__/ModelToggleButton.test.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/components/__tests__/ModelToggleButton.test.tsx index 1f3931f7bb..a17e702f1a 100644 --- a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/components/__tests__/ModelToggleButton.test.tsx +++ b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/components/__tests__/ModelToggleButton.test.tsx @@ -5,9 +5,10 @@ import { ModelToggleButton } from "../ModelToggleButton"; afterEach(cleanup); describe("ModelToggleButton", () => { - it("shows Standard label when model is standard", () => { + it("shows no text label when model is standard", () => { render(); - expect(screen.getByText("Standard")).toBeTruthy(); + expect(screen.queryByText("Standard")).toBeNull(); + expect(screen.queryByText("Advanced")).toBeNull(); }); it("shows Advanced label when model is advanced", () => { @@ -33,30 +34,4 @@ describe("ModelToggleButton", () => { const btn = screen.getByLabelText("Switch to Standard model"); expect(btn.getAttribute("aria-pressed")).toBe("true"); }); - - it("is disabled when readOnly", () => { - render(); - expect(screen.getByRole("button").hasAttribute("disabled")).toBe(true); - }); - - it("does not call onToggle when readOnly", () => { - const onToggle = vi.fn(); - render(); - fireEvent.click(screen.getByRole("button")); - expect(onToggle).not.toHaveBeenCalled(); - }); - - it("shows session-locked title when readOnly and advanced", () => { - render(); - expect( - screen.getByTitle("Advanced model active for this session"), - ).toBeDefined(); - }); - - it("shows session-locked title when readOnly and standard", () => { - render(); - expect( - screen.getByTitle("Standard model active for this session"), - ).toBeDefined(); - }); });