π OpenHands: AI-Driven Development
Remove broken browser counter logic (#6334)
mamoodi987861b5e7ad
diff --git a/frontend/__tests__/components/browser.test.tsx b/frontend/__tests__/components/browser.test.tsxindex f375e2dd50..a3056df1d3 100644--- a/frontend/__tests__/components/browser.test.tsx+++ b/frontend/__tests__/components/browser.test.tsx@@ -37,7 +37,6 @@ describe("Browser", () => {browser: {url: "https://example.com",screenshotSrc: "",- updateCount: 0,},},});@@ -53,7 +52,6 @@ describe("Browser", () => {url: "https://example.com",screenshotSrc:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mN0uGvyHwAFCAJS091fQwAAAABJRU5ErkJggg==",- updateCount: 0,},},});diff --git a/frontend/src/routes/_oh.app/route.tsx b/frontend/src/routes/_oh.app/route.tsxindex aed4bdde74..ac846567e0 100644--- a/frontend/src/routes/_oh.app/route.tsx+++ b/frontend/src/routes/_oh.app/route.tsx@@ -1,7 +1,7 @@import { useDisclosure } from "@nextui-org/react";import React from "react";import { Outlet } from "react-router";-import { useDispatch, useSelector } from "react-redux";+import { useDispatch } from "react-redux";import { FaServer } from "react-icons/fa";import toast from "react-hot-toast";import { useTranslation } from "react-i18next";@@ -11,7 +11,6 @@ import {useConversation,} from "#/context/conversation-context";import { Controls } from "#/components/features/controls/controls";-import { RootState } from "#/store";import { clearMessages } from "#/state/chat-slice";import { clearTerminal } from "#/state/command-slice";import { useEffectOnce } from "#/hooks/use-effect-once";@@ -33,7 +32,6 @@ import {import Security from "#/components/shared/modals/security/security";import { useEndSession } from "#/hooks/use-end-session";import { useUserConversation } from "#/hooks/query/use-user-conversation";-import { CountBadge } from "#/components/layout/count-badge";import { ServedAppLabel } from "#/components/layout/served-app-label";import { TerminalStatusLabel } from "#/components/features/terminal/terminal-status-label";import { useSettings } from "#/hooks/query/use-settings";@@ -52,7 +50,6 @@ function AppContent() {const endSession = useEndSession();const [width, setWidth] = React.useState(window.innerWidth);- const { updateCount } = useSelector((state: RootState) => state.browser);const secrets = React.useMemo(() => [gitHubToken].filter((secret) => secret !== null),@@ -144,7 +141,6 @@ function AppContent() {label: (<div className="flex items-center gap-1">{t(I18nKey.BROWSER$TITLE)}- {updateCount > 0 && <CountBadge count={updateCount} />}</div>),to: "browser",diff --git a/frontend/src/state/browser-slice.ts b/frontend/src/state/browser-slice.tsindex 7276f3577a..fc05f0c508 100644--- a/frontend/src/state/browser-slice.ts+++ b/frontend/src/state/browser-slice.ts@@ -5,8 +5,6 @@ export const initialState = {url: "https://github.com/All-Hands-AI/OpenHands",// Base64-encoded screenshot of browser window (placeholder for now, will be replaced with the actual screenshot later)screenshotSrc: "",- // Counter for browser updates- updateCount: 0,};export const browserSlice = createSlice({@@ -18,7 +16,6 @@ export const browserSlice = createSlice({},setScreenshotSrc: (state, action) => {state.screenshotSrc = action.payload;- state.updateCount += 1;},},});diff --git a/openhands/server/settings.py b/openhands/server/settings.pyindex bdb755fd5c..83d89e20b1 100644--- a/openhands/server/settings.py+++ b/openhands/server/settings.py@@ -21,7 +21,7 @@ class Settings(BaseModel):def llm_api_key_serializer(self, llm_api_key: SecretStr, info: SerializationInfo):"""Custom serializer for the LLM API key.- To serialize the API key instead of `"********"`, set `expose_secrets` to True in the serialization context. For example::+ To serialize the API key instead of ********, set expose_secrets to True in the serialization context. For example:settings.model_dump_json(context={'expose_secrets': True})"""