(
+ undefined,
+ );
+ const isMemoryEnabled = memoryOverride ?? initialMemoryEnabled;
+ const isDirty = isMemoryEnabled !== initialMemoryEnabled;
+
+ const handleSave = () => {
+ saveSettings(
+ { enable_memory_context: isMemoryEnabled },
+ {
+ onError: (error) => {
+ const message = retrieveAxiosErrorMessage(error as AxiosError);
+ displayErrorToast(message || t(I18nKey.ERROR$GENERIC));
+ },
+ onSuccess: () => {
+ displaySuccessToast(t(I18nKey.SETTINGS$SAVED));
+ setMemoryOverride(undefined);
+ },
+ },
+ );
+ };
+
+ if (isLoading) return null;
+
+ return (
+
+
+
+
+ {t(I18nKey.SETTINGS$ENABLE_MEMORY_CONTEXT)}
+
+
+ {t(I18nKey.SETTINGS$ENABLE_MEMORY_CONTEXT_HELPER)}
+
+
+
+
+
+
+ {isPending
+ ? t(I18nKey.SETTINGS$SAVING)
+ : t(I18nKey.SETTINGS$SAVE_CHANGES)}
+
+
+
+ );
+}
diff --git a/frontend/src/routes/agent-settings.tsx b/frontend/src/routes/agent-settings.tsx
index 31fedcf4b7..dd3fe844f1 100644
--- a/frontend/src/routes/agent-settings.tsx
+++ b/frontend/src/routes/agent-settings.tsx
@@ -21,6 +21,7 @@ import {
displaySuccessToast,
} from "#/utils/custom-toast-handlers";
import { createPermissionGuard } from "#/utils/org/permission-guard";
+import { isAgentContextPageEnabled } from "#/utils/settings-utils";
import { retrieveAxiosErrorMessage } from "#/utils/retrieve-axios-error-message";
import {
coerceFieldValue,
@@ -82,6 +83,11 @@ export default function AgentSettingsScreen() {
const isAcpEnabled = !!config?.feature_flags?.enable_acp;
const acpProviders = config?.acp_providers ?? EMPTY_ACP_PROVIDERS;
+ // OHE-3456: once the dedicated (SaaS-only) Agent Context page is on, the
+ // memory toggle lives there and this page no longer shows it.
+ const hasAgentContextPage =
+ config?.app_mode === "saas" &&
+ isAgentContextPageEnabled(config?.feature_flags);
// ── Parallel tool calls (OpenHands mode) ─────────────────────────────────
// Surfaced only when the backend schema exposes the field, so older
@@ -317,7 +323,7 @@ export default function AgentSettingsScreen() {
) : null}
{/* Agent Context: persistent memory toggle (OpenHands mode) */}
- {!isAcp && (
+ {!isAcp && !hasAgentContextPage && (
{t(I18nKey.SETTINGS$AGENT_CONTEXT)}
diff --git a/frontend/src/routes/settings.tsx b/frontend/src/routes/settings.tsx
index 7c5eb54dec..a708c49378 100644
--- a/frontend/src/routes/settings.tsx
+++ b/frontend/src/routes/settings.tsx
@@ -36,6 +36,7 @@ import { useMe } from "#/hooks/query/use-me";
import { OrgWideSettingsBadge } from "#/components/features/settings/org-wide-settings-badge";
const SAAS_ONLY_PATHS = [
+ "/settings/agent-context",
"/settings/user",
"/settings/billing",
"/settings/credits",
diff --git a/frontend/src/utils/settings-utils.ts b/frontend/src/utils/settings-utils.ts
index 3788535ab1..e436b02b72 100644
--- a/frontend/src/utils/settings-utils.ts
+++ b/frontend/src/utils/settings-utils.ts
@@ -43,6 +43,20 @@ export const ADMIN_ONLY_SETTINGS_PATHS = new Set([
"/settings/budgets",
]);
+/**
+ * The Agent Context page (OHE-3456) is on when its own flag is, or when the
+ * Agent Profiles page is: that page replaces the Agent page which hosted the
+ * memory toggle, so it needs the toggle's new home too.
+ */
+export function isAgentContextPageEnabled(
+ featureFlags: WebClientFeatureFlags | undefined,
+): boolean {
+ return !!(
+ featureFlags?.enable_agent_context_page ||
+ featureFlags?.enable_agent_profiles_page
+ );
+}
+
/**
* Checks if a settings page should be hidden based on feature flags.
* Used by both the route loader and navigation hook to keep logic in sync.
@@ -64,6 +78,14 @@ export function isSettingsPageHidden(
return true;
if (featureFlags?.hide_integrations_page && path === "/settings/integrations")
return true;
+ // OHE-3456 pages stay hidden until their flag is turned on.
+ if (
+ !isAgentContextPageEnabled(featureFlags) &&
+ path === "/settings/agent-context"
+ )
+ return true;
+ if (!featureFlags?.enable_agent_profiles_page && path === "/settings/agents")
+ return true;
return false;
}
diff --git a/openhands/app_server/web_client/default_web_client_config_injector.py b/openhands/app_server/web_client/default_web_client_config_injector.py
index 5e00cd73bf..e290f2f1a8 100644
--- a/openhands/app_server/web_client/default_web_client_config_injector.py
+++ b/openhands/app_server/web_client/default_web_client_config_injector.py
@@ -217,7 +217,8 @@ def _get_feature_flags() -> WebClientFeatureFlags:
Reads ENABLE_BILLING, HIDE_LLM_SETTINGS, ENABLE_JIRA, ENABLE_JIRA_DC,
ENABLE_LINEAR, HIDE_USERS_PAGE, HIDE_BILLING_PAGE, HIDE_INTEGRATIONS_PAGE,
HIDE_PERSONAL_WORKSPACES, OH_ENABLE_ONBOARDING, ENABLE_AGENT_CANVAS_BANNER,
- ENABLE_BYOR_EXPORT, ENABLE_SUPER_ADMIN, and ENABLE_OAUTH_V2_LOGIN from
+ ENABLE_BYOR_EXPORT, ENABLE_SUPER_ADMIN, ENABLE_OAUTH_V2_LOGIN,
+ ENABLE_AGENT_CONTEXT_PAGE, and ENABLE_AGENT_PROFILES_PAGE from
environment.
OH_ALLOW_USER_LLM_CONFIGURATION and ENABLE_ACP are the exceptions: they
@@ -256,6 +257,8 @@ def _get_feature_flags() -> WebClientFeatureFlags:
enable_super_admin=_env_flag_enabled('ENABLE_SUPER_ADMIN'),
enable_oauth_v2_login=_env_flag_enabled('ENABLE_OAUTH_V2_LOGIN'),
enable_litellm=_env_flag_enabled('ENABLE_LEGACY_LITELLM', 'true'),
+ enable_agent_context_page=_env_flag_enabled('ENABLE_AGENT_CONTEXT_PAGE'),
+ enable_agent_profiles_page=_env_flag_enabled('ENABLE_AGENT_PROFILES_PAGE'),
)
diff --git a/openhands/app_server/web_client/web_client_models.py b/openhands/app_server/web_client/web_client_models.py
index 99320b2954..eb1e2064f8 100644
--- a/openhands/app_server/web_client/web_client_models.py
+++ b/openhands/app_server/web_client/web_client_models.py
@@ -71,6 +71,17 @@ class WebClientFeatureFlags(BaseModel):
# create/refresh) and show a "Please enable LiteLLM to use this
# feature" placeholder instead. Set from the ENABLE_LEGACY_LITELLM env var.
enable_litellm: bool = True
+ # OHE-3456 settings pages, hidden until bug bash is complete. Each gates
+ # one Personal Settings entry: ``enable_agent_context_page`` shows the
+ # dedicated Agent Context page (``/settings/agent-context``) and
+ # ``enable_agent_profiles_page`` replaces ``Agent`` with Agent Profiles
+ # (``/settings/agents``) and, because that Agent page hosted the memory
+ # toggle, also shows the Agent Context page. Set from ENABLE_AGENT_CONTEXT_PAGE and
+ # ENABLE_AGENT_PROFILES_PAGE (or the OH_WEB_CLIENT_FEATURE_FLAGS_* form).
+ # Default False so every existing install keeps today's settings UI.
+ # UI-level only -- the agent-profiles API is not gated.
+ enable_agent_context_page: bool = False
+ enable_agent_profiles_page: bool = False
# This can be removed / replaced when a DeploymentMode (or similar) env var is created.
@model_validator(mode='after')