From 4f8ae9cc2c4aaa6932bb8ae88c0a72709b498fce Mon Sep 17 00:00:00 2001 From: Alessandro <155005371+3clyp50@users.noreply.github.com> Date: Tue, 11 Aug 2026 23:29:23 +0200 Subject: [PATCH] Keep hidden utility profile out of new chats Normalize legacy global settings that still select the internal default profile to Agent 0. This keeps fresh chats aligned with the visible profile catalog while preserving existing chat selections. --- helpers/settings.py | 3 +++ helpers/settings.py.dox.md | 2 ++ tests/test_subagent_profiles.py | 9 ++++++++- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/helpers/settings.py b/helpers/settings.py index 9eabff9ee..ddeb02d35 100644 --- a/helpers/settings.py +++ b/helpers/settings.py @@ -434,6 +434,9 @@ def normalize_settings(settings: Settings) -> Settings: except (ValueError, TypeError): copy[key] = value # make default instead + if copy["agent_profile"] == "default": + copy["agent_profile"] = "agent0" + # mcp server token is set automatically copy["mcp_server_token"] = create_auth_token() copy["max_consecutive_unusable_responses"] = max( diff --git a/helpers/settings.py.dox.md b/helpers/settings.py.dox.md index aaf5b3812..bb6d8656b 100644 --- a/helpers/settings.py.dox.md +++ b/helpers/settings.py.dox.md @@ -71,6 +71,8 @@ A currently configured unavailable profile remains visible with an explicit unavailable label so settings can round-trip it truthfully, except that the exact `default` utility profile is never offered as a selectable option. +- Legacy settings that still name the hidden `default` utility profile normalize + to `agent0`, so newly created chats always start with a selectable profile. - Keep request/response, tool, or helper semantics documented here at the same time as source changes. ## Work Guidance diff --git a/tests/test_subagent_profiles.py b/tests/test_subagent_profiles.py index 605e83fd3..30bf312e6 100644 --- a/tests/test_subagent_profiles.py +++ b/tests/test_subagent_profiles.py @@ -5,7 +5,7 @@ from types import SimpleNamespace import pytest from agent import Agent, AgentConfig, AgentContext -from helpers import persist_chat, projects +from helpers import persist_chat, projects, settings from helpers.errors import RepairableException @@ -34,6 +34,13 @@ class _FakeParentAgent: return "" +def test_hidden_default_profile_normalizes_to_agent0() -> None: + configured = settings.get_default_settings() + configured["agent_profile"] = "default" + + assert settings.normalize_settings(configured)["agent_profile"] == "agent0" + + class _FakeSubAgent: DATA_NAME_SUPERIOR = "_superior" DATA_NAME_SUBORDINATE = "_subordinate"