Skip to content

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.

refactor(platform): retire mature product flags (#15799)

Nicholas Tindle37899b064507
diff --git a/.github/scripts/platform-single-container-smoke.sh b/.github/scripts/platform-single-container-smoke.sh
index 6a25424c89..ff4a40c2cf 100644
--- a/.github/scripts/platform-single-container-smoke.sh
+++ b/.github/scripts/platform-single-container-smoke.sh
@@ -472,8 +472,7 @@ assert_pinned_topology_environment() {
DATABASE_API_PORT=8005 AGENT_API_HOST=127.0.0.1 AGENT_API_PORT=8006 \
NOTIFICATION_SERVICE_PORT=8007 COPILOT_EXECUTOR_PORT=8008 \
PLATFORM_LINKING_SERVICE_PORT=8009 COPILOT_CHAT_BRIDGE_PORT=8010 \
- BATCH_EXECUTOR_PORT=8011 SWAP_CREDENTIAL_SERVICE_PORT=8012 \
- FORCE_FLAG_GRAPHITI_MEMORY=true; do
+ BATCH_EXECUTOR_PORT=8011 SWAP_CREDENTIAL_SERVICE_PORT=8012; do
grep -Fxq "${expected}" <<<"${process_env}"
done
}
@@ -1017,7 +1016,6 @@ assert_memory_contract() {
--workdir /app/autogpt_platform/backend \
"${CONTAINER_NAME}" \
/app/autogpt_platform/backend/.venv/bin/python - "${action}" <<'PY'
-import asyncio
import shlex
import sys
from pathlib import Path
@@ -1067,10 +1065,6 @@ result = graph.query(
)
assert int(result.result_set[0][0]) == 1, result.result_set
-from backend.copilot.graphiti.config import is_enabled_for_user
-
-assert asyncio.run(is_enabled_for_user("single-container-smoke")) is True
-
if action == "cleanup":
redis.execute_command("GRAPH.DELETE", graph.name)
PY
diff --git a/.github/scripts/test_hosted_journeys_env.py b/.github/scripts/test_hosted_journeys_env.py
index bd27684073..7e3432b2dc 100644
--- a/.github/scripts/test_hosted_journeys_env.py
+++ b/.github/scripts/test_hosted_journeys_env.py
@@ -7,9 +7,9 @@ from hosted_journeys_env import DEFAULT_FLAGS_FILE, hosted_env_lines
class HostedJourneysEnvTests(unittest.TestCase):
def test_flags_become_backend_overrides(self):
lines = hosted_env_lines(
- {"hire-experts": True, "enable-platform-payment": False}
+ {"generic-trigger-agents": True, "enable-platform-payment": False}
)
- self.assertIn("FORCE_FLAG_HIRE_EXPERTS=true", lines)
+ self.assertIn("FORCE_FLAG_GENERIC_TRIGGER_AGENTS=true", lines)
self.assertIn("FORCE_FLAG_ENABLE_PLATFORM_PAYMENT=false", lines)
self.assertIn("ENABLE_CREDIT=true", lines)
diff --git a/autogpt_platform/backend/.env.default b/autogpt_platform/backend/.env.default
index 41d2748a93..209655c1e6 100644
--- a/autogpt_platform/backend/.env.default
+++ b/autogpt_platform/backend/.env.default
@@ -131,7 +131,7 @@ CHAT_BASE_URL=
CHAT_USE_LOCAL=false
# Graphiti Temporal Knowledge Graph Memory
-# Rollout controlled by LaunchDarkly flag "graphiti-memory"
+# Available when the required memory services and models are configured.
# LLM key falls back to CHAT_API_KEY (AutoPilot), then OPEN_ROUTER_API_KEY,
# then (under CHAT_USE_LOCAL=true) the chat-config api_key + base_url.
# Embedder key falls back to CHAT_OPENAI_API_KEY (AutoPilot), then
@@ -426,22 +426,6 @@ AUTOMOD_API_KEY=
RMFG_API_KEY=
## ===== ONBOARDING BRAIN DUMP ===== ##
-# The voice brain-dump onboarding step is gated on the `onboarding-brain-dump`
-# LaunchDarkly flag and is fail-closed: the endpoints 404 unless it is on.
-#
-# Left commented deliberately — .env.default ships to every install, and an
-# active override here would force the feature on for everyone and bypass
-# LaunchDarkly. Uncomment in your own .env to test locally, and set the
-# matching NEXT_PUBLIC_FORCE_FLAG_ONBOARDING_BRAIN_DUMP in frontend/.env.
-# FORCE_FLAG_ONBOARDING_BRAIN_DUMP=true
-
-# Expert-first onboarding (`onboarding-expert-team`, child of `hire-experts`):
-# the dump also produces expert recommendations and AutoPilot acts as the
-# Head of AI. Needs both flags; pair with the NEXT_PUBLIC_* twins in
-# frontend/.env.
-# FORCE_FLAG_HIRE_EXPERTS=true
-# FORCE_FLAG_ONBOARDING_EXPERT_TEAM=true
-
# Speech-to-text model for the brain dump. Requires a direct OpenAI key
# (OPENAI_INTERNAL_API_KEY, else OPENAI_API_KEY) — OpenRouter has no
# /audio/transcriptions endpoint. Falls back automatically on failure.
diff --git a/autogpt_platform/backend/backend/api/features/admin/execution_analytics_routes.py b/autogpt_platform/backend/backend/api/features/admin/execution_analytics_routes.py
index f2ac28c642..f8b8b23357 100644
--- a/autogpt_platform/backend/backend/api/features/admin/execution_analytics_routes.py
+++ b/autogpt_platform/backend/backend/api/features/admin/execution_analytics_routes.py
@@ -373,7 +373,6 @@ async def _process_batch(
user_id=execution.user_id,
execution_status=execution.status,
model_name=request.model_name,
- skip_feature_flag=True, # Admin endpoint bypasses feature flags
system_prompt=request.system_prompt or DEFAULT_SYSTEM_PROMPT,
user_prompt=request.user_prompt or DEFAULT_USER_PROMPT,
skip_existing=request.skip_existing,
diff --git a/autogpt_platform/backend/backend/api/features/admin/store_admin_routes.py b/autogpt_platform/backend/backend/api/features/admin/store_admin_routes.py
index f8b15c7ea0..13d9681c33 100644
--- a/autogpt_platform/backend/backend/api/features/admin/store_admin_routes.py
+++ b/autogpt_platform/backend/backend/api/features/admin/store_admin_routes.py
@@ -180,7 +180,6 @@ async def admin_add_agent_to_library(
"/skills/submissions",
summary="Admin List Pending Skill Submissions",
tags=["store", "admin"],
- dependencies=[fastapi.Depends(skill_routes.require_skills_hub_flag)],
)
async def list_pending_skill_submissions() -> list[skill_model.SkillSubmission]:
"""Skill submissions awaiting review, oldest first."""
@@ -197,7 +196,6 @@ async def list_pending_skill_submissions() -> list[skill_model.SkillSubmission]:
413: {"description": "File is too large to view"},
415: {"description": "File is not text"},
},
- dependencies=[fastapi.Depends(skill_routes.require_skills_hub_flag)],
)
async def read_skill_submission_file(
skill_listing_version_id: str,
@@ -217,7 +215,6 @@ async def read_skill_submission_file(
summary="Review Skill Submission",
tags=["store", "admin"],
responses={404: {"description": "Submission not found"}},
- dependencies=[fastapi.Depends(skill_routes.require_skills_hub_flag)],
)
async def review_skill_submission(
skill_listing_version_id: str,
diff --git a/autogpt_platform/backend/backend/api/features/admin/store_admin_routes_test.py b/autogpt_platform/backend/backend/api/features/admin/store_admin_routes_test.py
index df1512614c..8f03d1e6af 100644
--- a/autogpt_platform/backend/backend/api/features/admin/store_admin_routes_test.py
+++ b/autogpt_platform/backend/backend/api/features/admin/store_admin_routes_test.py
@@ -145,12 +145,9 @@ def test_add_to_library_requires_admin(mock_jwt_user) -> None:
assert response.status_code == 403
-def test_skill_submission_file_requires_admin(
- monkeypatch: pytest.MonkeyPatch, mock_jwt_user
-) -> None:
+def test_skill_submission_file_requires_admin(mock_jwt_user) -> None:
"""This route reads a package nobody has approved, addressed by version id
with no ownership check of its own — the admin gate is the whole check."""
- monkeypatch.setenv("FORCE_FLAG_SKILLS_HUB", "true")
app.dependency_overrides[get_jwt_payload] = mock_jwt_user["get_jwt_payload"]
response = client.get(f"/admin/skills/submissions/{SLV_ID}/files/scripts/run.sh")
@@ -363,25 +360,3 @@ async def test_library_member_can_view_pending_agent_in_builder() -> None:
]["in"]
)
assert SubmissionStatus.PENDING in statuses
-
-
- "call",
- [
- lambda: client.get("/admin/skills/submissions"),
- lambda: client.post(f"/admin/skills/submissions/{SLV_ID}/review"),
- lambda: client.get(f"/admin/skills/submissions/{SLV_ID}/files/SKILL.md"),
- ],
- ids=["list-pending", "review", "read-file"],
-)
-def test_skill_review_is_404_when_the_skills_hub_flag_is_off(
- monkeypatch: pytest.MonkeyPatch, call
-) -> None:
- """Admin review sits behind the same gate as the creator-facing routes;
- without it an admin could approve listings nobody can see."""
- monkeypatch.setenv("FORCE_FLAG_SKILLS_HUB", "false")
-
- response = call()
-
- assert response.status_code == 404
- assert response.json()["detail"] == "Feature not available"
diff --git a/autogpt_platform/backend/backend/api/features/experts/experts_db.py b/autogpt_platform/backend/backend/api/features/experts/experts_db.py
index 0a94af78a9..756b36f5d7 100644
--- a/autogpt_platform/backend/backend/api/features/experts/experts_db.py
+++ b/autogpt_platform/backend/backend/api/features/experts/experts_db.py
@@ -128,7 +128,6 @@ from backend.util.exceptions import (
ExpertWriteNotReadableError,
NotFoundError,
)
-from backend.util.feature_flag import Flag, is_feature_enabled
from backend.util.funnel_analytics import emit_funnel_event
from backend.util.posthog_events import PostHogEvent
from backend.util.timezone_utils import get_user_timezone_or_utc
@@ -397,7 +396,7 @@ async def with_bundled_skills(
) -> list[ExpertTemplate]:
"""Attach to each template the live Skills Hub listings it bundles —
exactly what ``hire_expert`` installs."""
- bundled = await _live_bundled_skills(user_id, [t.id for t in templates])
+ bundled = await _live_bundled_skills([t.id for t in templates])
return [
ExpertTemplate(
**template.model_dump(), bundled_skills=bundled.get(template.id, [])
@@ -407,12 +406,9 @@ async def with_bundled_skills(
async def _live_bundled_skills(
- user_id: str | None, template_ids: list[str]
+ template_ids: list[str],
) -> dict[str, list[ExpertBundledSkill]]:
"""Per template id, the live Hub listings it bundles, in roster order."""
- # The Hub routes' key, so nothing is linked or installed that would 404.
- if not await is_feature_enabled(Flag.SKILLS_HUB, user_id or "anonymous"):
- return {}
rows = await prisma.models.ExpertSkillListing.prisma().find_many(
where={"expertId": {"in": template_ids}}, order={"position": "asc"}
)
@@ -2133,7 +2129,7 @@ async def _install_bundled_skills(
Each install records its name on the row; a failed one is logged and
leaves no name, so the hire never lists a skill it does not have.
"""
- bundled = await _live_bundled_skills(user_id, [template_id])
+ bundled = await _live_bundled_skills([template_id])
missing = [s for s in bundled.get(template_id, []) if s.slug not in installed]
if not missing:
return []
diff --git a/autogpt_platform/backend/backend/api/features/experts/experts_db_test.py b/autogpt_platform/backend/backend/api/features/experts/experts_db_test.py
index f879fde661..9975564c68 100644
--- a/autogpt_platform/backend/backend/api/features/experts/experts_db_test.py
+++ b/autogpt_platform/backend/backend/api/features/experts/experts_db_test.py
@@ -773,14 +773,9 @@ async def hub_listing(make_hub_listing):
return await make_hub_listing()
-def skills_hub_on(monkeypatch):
- monkeypatch.setattr(experts_db, "is_feature_enabled", AsyncMock(return_value=True))
-
-
@pytest.mark.asyncio(loop_scope="session")
async def test_templates_resolve_bundled_skills_by_listing_id_in_roster_order(
- server: SpinTestServer, hub_listing, make_hub_listing, skills_hub_on
+ server: SpinTestServer, hub_listing, make_hub_listing
):
first = await make_hub_listing()
bundling = await _seed_template(
@@ -810,7 +805,7 @@ async def test_templates_resolve_bundled_skills_by_listing_id_in_roster_order(
@pytest.mark.asyncio(loop_scope="session")
async def test_hire_installs_the_hub_skills_the_template_bundles(
- server: SpinTestServer, test_user, hub_listing, skills_hub_on
+ server: SpinTestServer, test_user, hub_listing
):
template = await _seed_template(
name="Maria", preload_listings=[], bundled=[hub_listing.id]
@@ -829,7 +824,7 @@ async def test_hire_installs_the_hub_skills_the_template_bundles(
@pytest.mark.asyncio(loop_scope="session")
async def test_a_failed_bundled_skill_install_does_not_fail_the_hire(
- server: SpinTestServer, test_user, hub_listing, skills_hub_on, monkeypatch
+ server: SpinTestServer, test_user, hub_listing, monkeypatch
):
install = AsyncMock(side_effect=RuntimeError("storage down"))
_patch_install(monkeypatch, install)
@@ -845,22 +840,6 @@ async def test_a_failed_bundled_skill_install_does_not_fail_the_hire(
assert len(hired.expert.setup_failures) == 1
[email protected](loop_scope="session")
-async def test_hire_installs_nothing_while_the_hub_is_off(
- server: SpinTestServer, test_user, hub_listing, monkeypatch
-):
- monkeypatch.setattr(experts_db, "is_feature_enabled", AsyncMock(return_value=False))
- install = AsyncMock()
- _patch_install(monkeypatch, install)
- template = await _seed_template(
- name="Maria", preload_listings=[], bundled=[hub_listing.id]
- )
-
- await experts_db.hire_expert(test_user.id, template.id, None)
-
- install.assert_not_awaited()
-
-
def _patch_install(monkeypatch, install: AsyncMock) -> None:
"""Serve the hire's batch install from a per-slug *install* double."""
@@ -905,7 +884,7 @@ async def _template_with_setup(server, hub_listing) -> prisma.models.Expert:
@pytest.mark.asyncio(loop_scope="session")
async def test_hire_returns_before_any_skill_is_installed(
- server: SpinTestServer, test_user, hub_listing, skills_hub_on, monkeypatch
+ server: SpinTestServer, test_user, hub_listing, monkeypatch
):
release = asyncio.Event()
record = _recording_install()
@@ -940,7 +919,7 @@ async def test_hire_returns_before_any_skill_is_installed(
@pytest.mark.asyncio(loop_scope="session")
async def test_hire_setup_installs_everything_once_and_reruns_as_a_no_op(
- server: SpinTestServer, test_user, hub_listing, skills_hub_on, monkeypatch
+ server: SpinTestServer, test_user, hub_listing, monkeypatch
):
install = _recording_install()
_patch_install(monkeypatch, install)
@@ -969,7 +948,7 @@ async def test_hire_setup_installs_everything_once_and_reruns_as_a_no_op(
@pytest.mark.asyncio(loop_scope="session")
async def test_rehire_retries_a_failed_setup(
- server: SpinTestServer, test_user, hub_listing, skills_hub_on, monkeypatch
+ server: SpinTestServer, test_user, hub_listing, monkeypatch
):
_patch_install(monkeypatch, AsyncMock(side_effect=RuntimeError("storage down")))
template = await _seed_template(
diff --git a/autogpt_platform/backend/backend/api/features/experts/routes_test.py b/autogpt_platform/backend/backend/api/features/experts/routes_test.py
index f88f766ab8..e299f2de73 100644
--- a/autogpt_platform/backend/backend/api/features/experts/routes_test.py
+++ b/autogpt_platform/backend/backend/api/features/experts/routes_test.py
@@ -44,7 +44,6 @@ from backend.api.features.store.skill_model import MarketplaceSkill
from backend.api.rest_api import app as rest_app
from backend.copilot.tools.skills import SkillWriteLockError
from backend.util.exceptions import ConflictError, NotFoundError
-from backend.util.feature_flag import Flag
app = fastapi.FastAPI()
app.include_router(public_router)
@@ -191,14 +190,12 @@ def test_list_expert_templates_forwards_search_and_category(
mock_list.assert_awaited_once_with(search_query="Maria", category="marketing")
- ("user_id", "flag_key"), [(None, "anonymous"), ("user-1", "user-1")]
-)
[email protected]("user_id", [None, "user-1"])
def test_list_expert_templates_links_live_hub_skills(
- mocker: pytest_mock.MockerFixture, user_id: str | None, flag_key: str
+ mocker: pytest_mock.MockerFixture, user_id: str | None
) -> None:
app.dependency_overrides[get_optional_user_id] = lambda: user_id
- flag, _ = _mock_templates_with_hub_skill(mocker, hub_on=True)
+ rows_query = _mock_templates_with_hub_skill(mocker)
response = client.get("/experts/templates")
@@ -211,24 +208,10 @@ def test_list_expert_templates_links_live_hub_skills(
"description": "Keeps every draft on-brand.",
}
]
- flag.assert_awaited_once_with(Flag.SKILLS_HUB, flag_key)
-
-
-def test_list_expert_templates_links_nothing_with_the_hub_off(
- mocker: pytest_mock.MockerFixture,
-) -> None:
- _, rows_query = _mock_templates_with_hub_skill(mocker, hub_on=False)
+ rows_query.assert_awaited_once()
- response = client.get("/experts/templates")
-
- assert response.status_code == 200
- assert response.json()[0]["bundled_skills"] == []
- rows_query.assert_not_awaited()
-
-def _mock_templates_with_hub_skill(
- mocker: pytest_mock.MockerFixture, *, hub_on: bool
-) -> tuple[AsyncMock, AsyncMock]:
+def _mock_templates_with_hub_skill(mocker: pytest_mock.MockerFixture) -> AsyncMock:
template = _make_expert(
id="template-1",
is_template=True,
@@ -264,12 +247,7 @@ def _mock_templates_with_hub_skill(
)
},
)
- flag = mocker.patch(
- "backend.api.features.experts.experts_db.is_feature_enabled",
- new_callable=AsyncMock,
- return_value=hub_on,
- )
- return flag, rows_query
+ return rows_query
# ─── Hire ──────────────────────────────────────────────────────────────
diff --git a/autogpt_platform/backend/backend/api/features/experts/spend_approval.py b/autogpt_platform/backend/backend/api/features/experts/spend_approval.py
index d3aa16064c..950dad10ed 100644
--- a/autogpt_platform/backend/backend/api/features/experts/spend_approval.py
+++ b/autogpt_platform/backend/backend/api/features/experts/spend_approval.py
@@ -24,7 +24,6 @@ from backend.copilot.constants import (
from backend.data import human_review
from backend.data.execution import ExecutionStatus, update_graph_execution_stats
from backend.data.expert_spend import SpendWindow, get_spend, window_start
-from backend.util.feature_flag import Flag, is_feature_enabled
from backend.util.settings import Settings
logger = logging.getLogger(__name__)
@@ -84,11 +83,11 @@ async def spend_approval_required(
Like the weekly gate, the spend read is a snapshot: concurrent starts can
each pass before any of them meters, bounded by their own cost."""
+ if not settings.config.enable_credit:
+ return None
threshold = approval_threshold()
if threshold is None:
return None
- if not await is_feature_enabled(Flag.EXPERT_SPEND_APPROVAL, user_id):
- return None
window = approval_window()
spent = await get_spend(expert_id, window)
if spent < threshold:
diff --git a/autogpt_platform/backend/backend/api/features/experts/spend_approval_test.py b/autogpt_platform/backend/backend/api/features/experts/spend_approval_test.py
index 2a6eb05716..4e91e5c797 100644
--- a/autogpt_platform/backend/backend/api/features/experts/spend_approval_test.py
+++ b/autogpt_platform/backend/backend/api/features/experts/spend_approval_test.py
@@ -19,12 +19,12 @@ def _arm(
spent: int,
threshold: int | None = 250,
window: str = "week",
- flag: bool = True,
+ billing_enabled: bool = True,
approved: bool = False,
):
mocker.patch.object(sa, "approval_threshold", return_value=threshold)
mocker.patch.object(sa, "approval_window", return_value=window)
- mocker.patch.object(sa, "is_feature_enabled", AsyncMock(return_value=flag))
+ mocker.patch.object(sa.settings.config, "enable_credit", billing_enabled)
get_spend = mocker.patch.object(sa, "get_spend", AsyncMock(return_value=spent))
reviews = MagicMock(
find_first=AsyncMock(return_value=MagicMock() if approved else None)
@@ -51,9 +51,13 @@ async def test_check_fires_at_the_threshold_not_below(mocker, spent, expected) -
@pytest.mark.asyncio
[email protected]("threshold,flag", [(None, True), (250, False)])
-async def test_disabled_check_reads_no_spend(mocker, threshold, flag) -> None:
- get_spend, _ = _arm(mocker, spent=1_000, threshold=threshold, flag=flag)
[email protected]("threshold,billing_enabled", [(None, True), (250, False)])
+async def test_disabled_check_reads_no_spend(
+ mocker, threshold, billing_enabled
+) -> None:
+ get_spend, _ = _arm(
+ mocker, spent=1_000, threshold=threshold, billing_enabled=billing_enabled
+ )
assert await sa.spend_approval_required("owner", "e-1") is None
get_spend.assert_not_awaited()
diff --git a/autogpt_platform/backend/backend/api/features/feature_flags/routes_test.py b/autogpt_platform/backend/backend/api/features/feature_flags/routes_test.py
index c7d5712a6a..68b640905a 100644
--- a/autogpt_platform/backend/backend/api/features/feature_flags/routes_test.py
+++ b/autogpt_platform/backend/backend/api/features/feature_flags/routes_test.py
@@ -37,7 +37,7 @@ VISITOR_TERMS = ["Sales"]
VISITOR = "0b6c1f3e-visitor-0001"
USER_ID = "3f2b8c1e-7a4d-4e9b-9c2a-5d6e7f8a9b0c"
PINNING = FrontendFlag.CHAT_PINNING.value
-HIRE_EXPERTS = FrontendFlag.HIRE_EXPERTS.value
+GENERIC_TRIGGER_AGENTS = FrontendFlag.GENERIC_TRIGGER_AGENTS.value
PROGRESS_BAR = FrontendFlag.TASK_PROGRESS_BAR.value
STREAM_SHADOW = FrontendFlag.COPILOT_STREAM_SHADOW.value
@@ -64,7 +64,9 @@ def launchdarkly(mocker, monkeypatch: pytest.MonkeyPatch):
.fallthrough_variation(False)
)
td.update(
- td.flag(FrontendFlag.HIRE_EXPERTS.value).boolean_flag().variation_for_all(True)
+ td.flag(FrontendFlag.GENERIC_TRIGGER_AGENTS.value)
+ .boolean_flag()
+ .variation_for_all(True)
)
td.update(
td.flag(FrontendFlag.MARKETPLACE_SEARCH_TERMS.value)
@@ -120,6 +122,34 @@ async def test_each_flag_answers_what_the_backends_own_read_answers(caller):
)
[email protected]("caller", [USER_ID, None])
+async def test_retired_rollout_flags_are_not_served_or_restored_by_overrides(
+ caller, monkeypatch, mocker
+):
+ mocker.patch(
+ "backend.util.feature_flag._fetch_user_context_status",
+ AsyncMock(return_value=(Context.builder(caller or "anonymous").build(), True)),
+ )
+ retired = {
+ "artifacts-page",
+ "hire-experts",
+ "skills-hub",
+ "onboarding-brain-dump",
+ "onboarding-expert-team",
+ "graphiti-memory",
+ "graphiti-communities-enabled",
+ "expert-spend-approval",
+ "ai-agent-execution-summary",
+ }
+ for key in retired:
+ monkeypatch.setenv(f"FORCE_FLAG_{key.replace('-', '_').upper()}", "false")
+
+ flags = (await _get_flags(caller))["flags"]
+
+ assert retired.isdisjoint(flags)
+ assert set(flags) == {flag.value for flag in FrontendFlag}
+
+
async def test_a_flag_the_vendor_has_no_definition_of_is_answered_null():
flags = (await _get_flags("u-staff"))["flags"]
@@ -127,7 +157,7 @@ async def test_a_flag_the_vendor_has_no_definition_of_is_answered_null():
assert (
flags.get(PROGRESS_BAR, "left out"),
flags.get(STREAM_SHADOW, "left out"),
- flags[HIRE_EXPERTS],
+ flags[GENERIC_TRIGGER_AGENTS],
) == (None, None, True)
@@ -143,7 +173,10 @@ async def test_a_defined_flag_the_vendor_could_not_answer_is_left_out(mocker):
flags = (await _get_flags(USER_ID))["flags"]
# A default here would read as an answer and 404 a gated route for a user who has it.
- assert (HIRE_EXPERTS in flags, flags.get(PROGRESS_BAR, "left out")) == (False, None)
+ assert (GENERIC_TRIGGER_AGENTS in flags, flags.get(PROGRESS_BAR, "left out")) == (
+ False,
+ None,
+ )
@pytest.mark.parametrize("ready_first", [False, True])
@@ -168,7 +201,10 @@ async def test_a_signed_out_answer_is_kept_long_only_when_complete(
not_ready.close()
# Either way the second read sees the first, complete answer.
- assert (HIRE_EXPERTS in first, second.get(HIRE_EXPERTS)) == (ready_first, True)
+ assert (GENERIC_TRIGGER_AGENTS in first, second.get(GENERIC_TRIGGER_AGENTS)) == (
+ ready_first,
+ True,
+ )
@pytest.mark.parametrize(
@@ -227,7 +263,7 @@ async def test_a_signed_in_read_asks_posthog_nothing_about_flags_it_lacks(mocker
finally:
client.shutdown()
- # hire-experts is defined but needs /flags; nothing else may ask.
+ # generic-trigger-agents is defined but needs /flags; nothing else may ask.
assert (remote.call_count, flags.get(PROGRESS_BAR, "left out")) == (1, None)
@@ -249,9 +285,12 @@ async def test_on_posthog_only_loaded_definitions_can_rule_a_flag_undefined(
finally:
client.shutdown()
- # hire-experts is defined but needs /flags, which is down: left out either way.
+ # generic-trigger-agents is defined but needs /flags, which is down: left out either way.
expected = (False, None) if loaded else (False, "left out")
- assert (HIRE_EXPERTS in flags, flags.get(PROGRESS_BAR, "left out")) == expected
+ assert (
+ GENERIC_TRIGGER_AGENTS in flags,
+ flags.get(PROGRESS_BAR, "left out"),
+ ) == expected
async def test_with_no_vendor_configured_every_flag_is_the_frontends_default(mocker):
@@ -368,8 +407,8 @@ async def test_fresh_visitor_ids_cost_posthog_nothing(mocker):
"_get_flags_decision",
return_value={
"flags": {
- HIRE_EXPERTS: FeatureFlag.from_value_and_payload(
- HIRE_EXPERTS, True, None
+ GENERIC_TRIGGER_AGENTS: FeatureFlag.from_value_and_payload(
+ GENERIC_TRIGGER_AGENTS, True, None
)
}
},
@@ -392,7 +431,7 @@ async def test_fresh_visitor_ids_cost_posthog_nothing(mocker):
# Each is still bucketed by their own id where the definitions decide it, and
# takes the shared signed-out answer where only PostHog's servers could.
assert {v.get(PINNING) for v in visitors} == {True, False}
- assert all(v.get(HIRE_EXPERTS) is True for v in visitors)
+ assert all(v.get(GENERIC_TRIGGER_AGENTS) is True for v in visitors)
class _StillConnecting(UpdateProcessor):
@@ -440,7 +479,7 @@ class _RecordedEvents(EventProcessor):
def _posthog_splitting_pinning_and_gating_hire_on_email() -> Posthog:
- """Local definitions: pinning is a 50% split, hire-experts needs an email."""
+ """Local definitions: pinning is a 50% split, generic-trigger-agents needs an email."""
client = Posthog("phc-test", secret_key="phx-test", enable_local_evaluation=False)
client.feature_flags = [
{
@@ -451,7 +490,7 @@ def _posthog_splitting_pinning_and_gating_hire_on_email() -> Posthog:
},
{
"id": 2,
- "key": HIRE_EXPERTS,
+ "key": GENERIC_TRIGGER_AGENTS,
"active": True,
"filters": {
"groups": [
diff --git a/autogpt_platform/backend/backend/api/features/graph_executions/activity_gate.py b/autogpt_platform/backend/backend/api/features/graph_executions/activity_gate.py
deleted file mode 100644
index cc7a2dfbd4..0000000000
--- a/autogpt_platform/backend/backend/api/features/graph_executions/activity_gate.py
+++ /dev/null
@@ -1,38 +0,0 @@
-"""Feature-flag gate for AI-generated activity summaries on executions.
-
-Summaries are persisted regardless of the flag, so every route that returns
-executions has to scrub them when `AI_ACTIVITY_STATUS` is off for the user.
-"""
-
-from typing import TypeVar
-
-from backend.data import execution as execution_db
-from backend.util.feature_flag import Flag, is_feature_enabled
-
-ExecutionT = TypeVar("ExecutionT", bound=execution_db.GraphExecutionMeta)
-
-
-async def hide_activity_summaries_if_disabled(
- executions: list[ExecutionT], user_id: str
-) -> list[ExecutionT]:
- """Hide activity summaries and scores if AI_ACTIVITY_STATUS feature is disabled."""
- if await is_feature_enabled(Flag.AI_ACTIVITY_STATUS, user_id):
- return executions
- return [_without_activity_features(execution) for execution in executions]
-
-
-async def hide_activity_summary_if_disabled(
- execution: ExecutionT, user_id: str
-) -> ExecutionT:
- """Hide activity summary and score for a single execution if AI_ACTIVITY_STATUS feature is disabled."""
- if await is_feature_enabled(Flag.AI_ACTIVITY_STATUS, user_id):
- return execution
- return _without_activity_features(execution)
-
-
-def _without_activity_features(execution: ExecutionT) -> ExecutionT:
- if not execution.stats:
- return execution
- return execution.model_copy(
- update={"stats": execution.stats.without_activity_features()}
- )
diff --git a/autogpt_platform/backend/backend/api/features/graph_executions/routes.py b/autogpt_platform/backend/backend/api/features/graph_executions/routes.py
index 813b1d1102..523d398633 100644
--- a/autogpt_platform/backend/backend/api/features/graph_executions/routes.py
+++ b/autogpt_platform/backend/backend/api/features/graph_executions/routes.py
@@ -7,10 +7,6 @@ from autogpt_libs.auth.models import RequestContext
from fastapi import APIRouter, Body, HTTPException, Path, Query, Response, Security
from starlette.status import HTTP_204_NO_CONTENT, HTTP_404_NOT_FOUND
-from backend.api.features.graph_executions.activity_gate import (
- hide_activity_summaries_if_disabled,
- hide_activity_summary_if_disabled,
-)
from backend.api.features.graph_executions.model import (
ExecutionShareRequest,
ExecutionShareResponse,
@@ -99,11 +95,7 @@ async def list_graphs_executions(
organization_id=ctx.org_id,
)
- # Apply feature flags to filter out disabled features
- filtered_executions = await hide_activity_summaries_if_disabled(
- paginated_result.executions, user_id
- )
- return filtered_executions
+ return paginated_result.executions
@router.get(
@@ -166,21 +158,17 @@ async def list_graph_executions(
organization_id=ctx.org_id,
)
- # Apply feature flags to filter out disabled features
- filtered_executions = await hide_activity_summaries_if_disabled(
- paginated_result.executions, user_id
- )
onboarding = await get_user_onboarding(user_id)
if (
onboarding.onboardingAgentExecutionId
and onboarding.onboardingAgentExecutionId
- in [exec.id for exec in filtered_executions]
+ in [exec.id for exec in paginated_result.executions]
and OnboardingStep.GET_RESULTS not in onboarding.completedSteps
):
await complete_onboarding_step(user_id, OnboardingStep.GET_RESULTS)
return execution_db.GraphExecutionsPaginated(
- executions=filtered_executions, pagination=paginated_result.pagination
+ executions=paginated_result.executions, pagination=paginated_result.pagination
)
@@ -217,8 +205,6 @@ async def get_graph_execution(
status_code=HTTP_404_NOT_FOUND, detail=f"Graph #{graph_id} not found"
)
- # Apply feature flags to filter out disabled features
- result = await hide_activity_summary_if_disabled(result, user_id)
onboarding = await get_user_onboarding(user_id)
if (
onboarding.onboardingAgentExecutionId == graph_exec_id
diff --git a/autogpt_platform/backend/backend/api/features/graph_executions/routes_test.py b/autogpt_platform/backend/backend/api/features/graph_executions/routes_test.py
index 5a5cccad6b..e8997f60c3 100644
--- a/autogpt_platform/backend/backend/api/features/graph_executions/routes_test.py
+++ b/autogpt_platform/backend/backend/api/features/graph_executions/routes_test.py
@@ -311,25 +311,22 @@ def _paginated(*executions):
)
-def test_list_all_executions_applies_the_activity_gate(
- mocker: pytest_mock.MockFixture,
-) -> None:
- """The gate is what keeps flag-disabled activity summaries out of the
- response; bypassing it leaks them to every caller."""
- mocker.patch(
- "backend.api.features.graph_executions.routes.execution_db"
- ".get_graph_executions_paginated",
- AsyncMock(return_value=_paginated()),
+def test_list_all_executions_preserves_activity_and_owner_scope(mocker, test_user_id):
+ execution = execution_db.GraphExecutionMeta.model_construct(
+ id="exec-1",
+ stats=execution_db.GraphExecutionStats(
+ activity_status="Finished the report", correctness_score=0.9
+ ),
)
- gate = mocker.patch(
- "backend.api.features.graph_executions.routes.hide_activity_summaries_if_disabled",
- AsyncMock(return_value=[]),
+ query = mocker.patch(
+ "backend.api.features.graph_executions.routes.execution_db.get_graph_executions_paginated",
+ AsyncMock(return_value=_paginated(execution)),
)
-
response = client.get("/executions")
-
assert response.status_code == 200
- gate.assert_awaited_once()
+ assert response.json()[0]["stats"]["activity_status"] == "Finished the report"
+ assert query.await_args.kwargs["user_id"] == test_user_id
+ assert query.await_args.kwargs["organization_id"] == "test-org"
def test_list_all_executions_is_not_scoped_to_a_graph(
@@ -342,10 +339,6 @@ def test_list_all_executions_is_not_scoped_to_a_graph(
".get_graph_executions_paginated",
AsyncMock(return_value=_paginated()),
)
- mocker.patch(
- "backend.api.features.graph_executions.routes.hide_activity_summaries_if_disabled",
- AsyncMock(return_value=[]),
- )
client.get("/executions")
@@ -360,10 +353,6 @@ def test_list_graph_executions_forwards_pagination(
".get_graph_executions_paginated",
AsyncMock(return_value=_paginated()),
)
- mocker.patch(
- "backend.api.features.graph_executions.routes.hide_activity_summaries_if_disabled",
- AsyncMock(return_value=[]),
- )
mocker.patch(
"backend.api.features.graph_executions.routes.get_user_onboarding",
AsyncMock(return_value=Mock(onboardingAgentExecutionId=None)),
diff --git a/autogpt_platform/backend/backend/api/features/home/briefing.py b/autogpt_platform/backend/backend/api/features/home/briefing.py
index 73eeada68e..5367c28780 100644
--- a/autogpt_platform/backend/backend/api/features/home/briefing.py
+++ b/autogpt_platform/backend/backend/api/features/home/briefing.py
@@ -81,38 +81,6 @@ def compose_briefing(
)
-def without_summaries(content: BriefingContent) -> BriefingContent:
- """Strip the AI-written text out of a stored briefing.
-
- Summaries are persisted regardless of `AI_ACTIVITY_STATUS`, and the live
- path scrubs them per-execution when the flag is off — so the persisted path
- has to scrub them too, or the card would leak what the gate hides.
-
- An item without a summary carries no AI text at all: its `title`/`detail`
- already came from the non-AI fallback, and for a failure that detail is the
- run's own error — which the live gate keeps (it drops only
- `activity_status` and `correctness_score`). Clearing those too would
- downgrade a real error to the generic retry line the moment home switched
- to the persisted row.
- """
- return content.model_copy(
- update={
- # The narrative is written *from* those summaries, so it is the
- # same AI text one paragraph up — dropping the items but keeping
- # the lede would leak exactly what the gate hides.
- "narrative": None,
- "run_items": [
- (
- item.model_copy(update={"summary": None, "title": "", "detail": ""})
- if item.summary
- else item
- )
- for item in content.run_items
- ],
- }
- )
-
-
def _briefing(
*,
generated_at: datetime,
diff --git a/autogpt_platform/backend/backend/api/features/home/briefing_test.py b/autogpt_platform/backend/backend/api/features/home/briefing_test.py
index 1294ab148c..47db1d591b 100644
--- a/autogpt_platform/backend/backend/api/features/home/briefing_test.py
+++ b/autogpt_platform/backend/backend/api/features/home/briefing_test.py
@@ -9,7 +9,7 @@ from backend.copilot.briefing.generate import compose_briefing as compose_job_br
from backend.copilot.briefing.models import BriefingContent, BriefingRunItem
from backend.data.execution import ExecutionStatus, GraphExecutionMeta
-from .briefing import compose_briefing, without_summaries
+from .briefing import compose_briefing
from .helpers import AgentRef
from .models import AUTOPILOT_BRIEFING_AUTHOR, HomeBriefingAuthor
@@ -454,34 +454,6 @@ def test_a_row_written_before_the_composer_was_unified_falls_back_to_the_agent()
assert outcome.expert is None
-def test_without_summaries_drops_the_ai_written_text() -> None:
- stripped = without_summaries(_stored(_stored_item("stored-run")))
-
- item = stripped.run_items[0]
- assert (item.summary, item.title, item.detail) == (None, "", "")
- assert item.agent_name == "Inbox triage"
-
-
-def test_without_summaries_keeps_an_error_the_ai_never_wrote() -> None:
- """The live gate drops only `activity_status`/`correctness_score`, so a
- failure with no summary keeps showing its real error. The persisted path
- must not downgrade that same failure to the generic retry line."""
- failure = _stored_item("broke", status="FAILED").model_copy(
- update={
- "summary": None,
- "title": "Inbox triage needs a retry",
- "detail": "SMTP connection refused",
- }
- )
-
- item = without_summaries(_stored(failure)).run_items[0]
-
- assert (item.title, item.detail) == (
- "Inbox triage needs a retry",
- "SMTP connection refused",
- )
-
-
def test_persisted_briefing_counts_runs_the_job_did_not_list() -> None:
"""`run_items` is capped at 10 by the job. A 12-completion night must
still report 12 completed, with the unlisted ones falling into routine."""
@@ -642,12 +614,3 @@ def test_the_live_brief_is_authored_by_autopilot_too() -> None:
)
assert briefing.author.kind == "autopilot"
-
-
-def test_without_summaries_drops_the_narrative() -> None:
- """The narrative is written from the summaries, so the same gate hides it."""
- stored = _stored(_stored_item("stored-run")).model_copy(
- update={"narrative": "I read all 12 of your emails."}
- )
-
- assert without_summaries(stored).narrative is None
diff --git a/autogpt_platform/backend/backend/api/features/home/service.py b/autogpt_platform/backend/backend/api/features/home/service.py
index 9e878ecae2..68424c94d0 100644
--- a/autogpt_platform/backend/backend/api/features/home/service.py
+++ b/autogpt_platform/backend/backend/api/features/home/service.py
@@ -10,9 +10,6 @@ from pydantic import BaseModel, ValidationError
from backend.api.features.experts import experts_db
from backend.api.features.experts.models import Expert
-from backend.api.features.graph_executions.activity_gate import (
- hide_activity_summaries_if_disabled,
-)
from backend.api.features.graph_executions.review.model import PendingHumanReviewModel
from backend.api.features.library import db as library_db
from backend.copilot import db as chat_db
@@ -33,11 +30,9 @@ from backend.data.execution_cost_summary import (
)
from backend.executor.scheduler import CopilotTurnJobInfo, GraphExecutionJobInfo
from backend.util.clients import get_scheduler_client
-from backend.util.feature_flag import Flag, is_feature_enabled
from backend.util.settings import Settings
from backend.util.timezone_utils import get_user_timezone_or_utc
-from .briefing import without_summaries
from .compose import compose_home_dashboard
from .models import HomeDashboardResponse
@@ -155,9 +150,7 @@ async def _persisted_briefing(
record.id,
)
return None
- if await is_feature_enabled(Flag.AI_ACTIVITY_STATUS, user_id):
- return content
- return without_summaries(content)
+ return content
async def _load_home_source_data(
@@ -213,9 +206,7 @@ async def _load_home_source_data(
user = user_task.result()
return HomeSourceData(
experts=experts_task.result(),
- executions=await hide_activity_summaries_if_disabled(
- executions_task.result(), user_id
- ),
+ executions=executions_task.result(),
reviews=reviews_task.result(),
cost_summary=cost_summary_task.result(),
schedules=schedules_task.result(),
@@ -264,10 +255,6 @@ async def _get_pending_questions(*, user_id: str) -> list[ChatSessionInfo]:
# Fail-soft like schedules and credits: a chat that was deleted or whose
# metadata no longer parses must cost the user one row, not the page.
try:
- # Question items ship with the expert-team surface; without the flag
- # the Home page stays exactly what it was.
- if not await is_feature_enabled(Flag.HIRE_EXPERTS, user_id, default=False):
- return []
return await chat_db.get_sessions_with_pending_question(user_id)
except Exception:
logger.warning(
@@ -281,11 +268,8 @@ async def _get_work_events(
*, user_id: str, since: datetime
) -> list[activity_db.ActivityEvent]:
# Fail-soft like schedules and credits: a broken audit read costs the
- # Recent work card, not the page. Ships with the expert-team surface,
- # so it is gated exactly like pending questions.
+ # Recent work card, not the page.
try:
- if not await is_feature_enabled(Flag.HIRE_EXPERTS, user_id, default=False):
- return []
return await activity_db.list_activity_events(
user_id,
since=since,
diff --git a/autogpt_platform/backend/backend/api/features/home/service_test.py b/autogpt_platform/backend/backend/api/features/home/service_test.py
index 36382bb46d..c832ba22fb 100644
--- a/autogpt_platform/backend/backend/api/features/home/service_test.py
+++ b/autogpt_platform/backend/backend/api/features/home/service_test.py
@@ -9,7 +9,6 @@ from backend.copilot.briefing.models import BriefingContent, BriefingRunItem
from backend.copilot.scheduled_chats.service import PausedScheduledChat
from backend.data.execution import ExecutionStatus, GraphExecutionMeta
from backend.data.execution_cost_summary import UserExecutionCostSummary
-from backend.util.feature_flag import Flag
from .service import _get_pending_questions, build_home_dashboard
@@ -87,12 +86,7 @@ def home_dependencies(mocker: MockerFixture):
"backend.api.features.home.service.briefing_db.get_briefing_for_date",
AsyncMock(return_value=None),
)
- # The flag-gated sources must be mocked even though the gates default to
- # off: several tests patch `service.is_feature_enabled` module-wide to
- # True, which opens these gates too. Left unmocked, they then run real
- # Prisma queries on this test's function-scoped event loop — the closed
- # loop leaves a dead connection in the shared engine pool that panics the
- # query engine when a later (session-loop) test starts a transaction.
+ # Keep owner-scoped Home sources on the same fake database boundary.
mocker.patch(
"backend.api.features.home.service.chat_db.get_sessions_with_pending_question",
AsyncMock(return_value=[]),
@@ -149,14 +143,6 @@ def _patch_stored_briefing(mocker: MockerFixture, content: object) -> None:
async def test_briefing_anchors_on_todays_persisted_row(
mocker: MockerFixture, home_dependencies
) -> None:
- mocker.patch(
- "backend.api.features.graph_executions.activity_gate.is_feature_enabled",
- AsyncMock(return_value=True),
- )
- mocker.patch(
- "backend.api.features.home.service.is_feature_enabled",
- AsyncMock(return_value=True),
- )
_patch_stored_briefing(mocker, _stored_briefing().model_dump(mode="json"))
dashboard = await build_home_dashboard(user_id="user-1")
@@ -179,10 +165,6 @@ async def test_briefing_rejects_a_row_with_negative_totals(
"""The counts drive what the card claims happened, and a stored row is
otherwise taken as canonical — a negative total is a corrupt row, so it
has to fail validation and drop home onto the live path."""
- mocker.patch(
- "backend.api.features.graph_executions.activity_gate.is_feature_enabled",
- AsyncMock(return_value=True),
- )
corrupt = _stored_briefing().model_dump(mode="json") | {"completed_total": -3}
_patch_stored_briefing(mocker, corrupt)
@@ -199,14 +181,6 @@ async def test_briefing_anchors_on_a_row_the_job_could_not_deliver(
"""`delivered_at=None` means the content was stored but the thread post
failed. The job redelivers that same stored content, so it is still the
canonical story — going live here would drift from the pending message."""
- mocker.patch(
- "backend.api.features.graph_executions.activity_gate.is_feature_enabled",
- AsyncMock(return_value=True),
- )
- mocker.patch(
- "backend.api.features.home.service.is_feature_enabled",
- AsyncMock(return_value=True),
- )
mocker.patch(
"backend.api.features.home.service.briefing_db.get_briefing_for_date",
AsyncMock(
@@ -228,10 +202,6 @@ async def test_briefing_anchors_on_a_row_the_job_could_not_deliver(
async def test_briefing_falls_back_to_live_when_the_stored_row_is_malformed(
mocker: MockerFixture, home_dependencies
) -> None:
- mocker.patch(
- "backend.api.features.graph_executions.activity_gate.is_feature_enabled",
- AsyncMock(return_value=True),
- )
_patch_stored_briefing(mocker, {"unexpected": "shape"})
dashboard = await build_home_dashboard(user_id="user-1")
@@ -246,10 +216,6 @@ async def test_briefing_falls_back_to_live_when_the_lookup_raises(
) -> None:
"""A briefing the page cannot read is not worth a 500 — /home is the
landing page, and every other tile on it is still fine."""
- mocker.patch(
- "backend.api.features.graph_executions.activity_gate.is_feature_enabled",
- AsyncMock(return_value=True),
- )
mocker.patch(
"backend.api.features.home.service.briefing_db.get_briefing_for_date",
AsyncMock(side_effect=Exception("database is down")),
@@ -266,10 +232,6 @@ async def test_briefing_is_live_when_no_row_exists_yet(
mocker: MockerFixture, home_dependencies
) -> None:
"""A user who signed up after 9am has no briefing to anchor on."""
- mocker.patch(
- "backend.api.features.graph_executions.activity_gate.is_feature_enabled",
- AsyncMock(return_value=True),
- )
dashboard = await build_home_dashboard(user_id="user-1")
@@ -296,10 +258,6 @@ async def test_briefing_date_comes_from_the_requests_own_clock(
mocker.patch(
"backend.api.features.home.service.briefing_db.get_briefing_for_date", lookup
)
- mocker.patch(
- "backend.api.features.graph_executions.activity_gate.is_feature_enabled",
- AsyncMock(return_value=True),
- )
dashboard = await build_home_dashboard(user_id="user-1")
@@ -307,69 +265,20 @@ async def test_briefing_date_comes_from_the_requests_own_clock(
assert dashboard.generated_at == just_before_midnight
-async def test_persisted_summaries_are_scrubbed_when_the_activity_flag_is_off(
- mocker: MockerFixture, home_dependencies
-) -> None:
- """Summaries are stored regardless of the flag, so the persisted path has
- to scrub them too — otherwise the card leaks what the gate hides."""
- mocker.patch(
- "backend.api.features.graph_executions.activity_gate.is_feature_enabled",
- AsyncMock(return_value=False),
- )
- mocker.patch(
- "backend.api.features.home.service.is_feature_enabled",
- AsyncMock(return_value=False),
- )
- _patch_stored_briefing(mocker, _stored_briefing().model_dump(mode="json"))
-
- dashboard = await build_home_dashboard(user_id="user-1")
-
- assert dashboard.briefing.source == "persisted"
- assert dashboard.briefing.outcomes[0].title == "Inbox triage finished"
- assert dashboard.briefing.outcomes[0].summary == "Completed successfully."
- # The hybrid response also appends the live run; a one-sided scrub that
- # covered only the stored half would still leak through that one.
- assert dashboard.briefing.outcomes[1].title == "Workflow task finished"
- assert dashboard.briefing.outcomes[1].summary == "Completed successfully."
-
-
@pytest.mark.asyncio
async def test_activity_summary_surfaces_when_flag_enabled(
mocker: MockerFixture, home_dependencies
) -> None:
- mocker.patch(
- "backend.api.features.graph_executions.activity_gate.is_feature_enabled",
- AsyncMock(return_value=True),
- )
dashboard = await build_home_dashboard(user_id="user-1")
assert dashboard.briefing.outcomes[0].title == "Booked the flight."
-async def test_activity_summary_hidden_when_flag_disabled(
- mocker: MockerFixture, home_dependencies
-) -> None:
- mocker.patch(
- "backend.api.features.graph_executions.activity_gate.is_feature_enabled",
- AsyncMock(return_value=False),
- )
-
- dashboard = await build_home_dashboard(user_id="user-1")
-
- assert dashboard.briefing.outcomes[0].title == "Workflow task finished"
-
-
@pytest.mark.asyncio
async def test_schedules_stay_owner_scoped_inside_an_organization(
mocker: MockerFixture, home_dependencies
) -> None:
- mocker.patch(
- "backend.api.features.graph_executions.activity_gate.is_feature_enabled",
- AsyncMock(return_value=True),
- )
scheduler = MagicMock()
scheduler.get_execution_schedules = AsyncMock(return_value=[])
mocker.patch(
@@ -394,10 +303,6 @@ async def test_schedules_stay_owner_scoped_inside_an_organization(
async def test_scheduler_and_credit_failures_degrade_instead_of_failing_the_page(
mocker: MockerFixture, home_dependencies
) -> None:
- mocker.patch(
- "backend.api.features.graph_executions.activity_gate.is_feature_enabled",
- AsyncMock(return_value=True),
- )
scheduler = MagicMock()
scheduler.get_execution_schedules = AsyncMock(side_effect=RuntimeError("scheduler"))
mocker.patch(
@@ -455,40 +360,13 @@ async def test_a_paused_chat_read_that_fails_costs_only_those_items(
assert dashboard.attention == []
-class TestPendingQuestionsFlagGate:
- """Question items ship with the expert-team surface: without the
- hire-experts flag, Home must not just return an empty list but must
- never reach into chat_db at all — a return-value-only assertion would
- still pass if someone deleted the flag check and the DB happened to
- return nothing (e.g. no sessions yet)."""
+class TestPendingQuestions:
+ """Home reads the user's pending expert questions without a rollout gate."""
@pytest.mark.asyncio
- async def test_flag_off_returns_empty_and_never_touches_chat_db(
+ async def test_reads_pending_questions_from_chat_db(
self, mocker: MockerFixture
) -> None:
- is_enabled = mocker.patch(
- "backend.api.features.home.service.is_feature_enabled",
- AsyncMock(return_value=False),
- )
- get_sessions = mocker.patch(
- "backend.api.features.home.service.chat_db.get_sessions_with_pending_question",
- AsyncMock(return_value=["should never be reached"]),
- )
-
- result = await _get_pending_questions(user_id="user-1")
-
- assert result == []
- get_sessions.assert_not_awaited()
- is_enabled.assert_awaited_once_with(Flag.HIRE_EXPERTS, "user-1", default=False)
-
- @pytest.mark.asyncio
- async def test_flag_on_reads_pending_questions_from_chat_db(
- self, mocker: MockerFixture
- ) -> None:
- mocker.patch(
- "backend.api.features.home.service.is_feature_enabled",
- AsyncMock(return_value=True),
- )
get_sessions = mocker.patch(
"backend.api.features.home.service.chat_db.get_sessions_with_pending_question",
AsyncMock(return_value=["session-info"]),
@@ -544,10 +422,6 @@ class TestPooledOrgBalanceGate:
ctx: RequestContext,
expected_balance: int | None,
) -> None:
- mocker.patch(
- "backend.api.features.graph_executions.activity_gate.is_feature_enabled",
- AsyncMock(return_value=True),
- )
credit_model = MagicMock()
credit_model.get_credits = AsyncMock(return_value=100)
get_credit_model = mocker.patch(
@@ -570,10 +444,6 @@ class TestPooledOrgBalanceGate:
) -> None:
"""A personal org's one membership row is always isOwner, so the gate
never fires there and the owner still sees their user wallet."""
- mocker.patch(
- "backend.api.features.graph_executions.activity_gate.is_feature_enabled",
- AsyncMock(return_value=True),
- )
credit_model = MagicMock()
credit_model.get_credits = AsyncMock(return_value=100)
get_credit_model = mocker.patch(
diff --git a/autogpt_platform/backend/backend/api/features/memory/routes.py b/autogpt_platform/backend/backend/api/features/memory/routes.py
index 45e8a38e07..88aa6ef802 100644
--- a/autogpt_platform/backend/backend/api/features/memory/routes.py
+++ b/autogpt_platform/backend/backend/api/features/memory/routes.py
@@ -32,7 +32,6 @@ from backend.api.features.memory.models import (
MemoryFactListResponse,
MemoryScopeOverview,
)
-from backend.copilot.graphiti.config import is_enabled_for_user
from backend.copilot.graphiti.falkordb_driver import AutoGPTFalkorDriver, open_driver
from backend.copilot.graphiti.memory_model import MemoryForgetFailureCode
from backend.copilot.graphiti.recall import live_fact_predicate
@@ -66,15 +65,10 @@ def _is_missing_graph_error(exc: BaseException) -> bool:
async def _resolve_scope(user_id: str, expert_id: str | None) -> MemoryScope:
"""Resolve the caller-owned memory scope for the request.
- Memory must be enabled for the caller, and an expert scope must name an
- active expert the caller owns — archived experts 404 here, matching the
+ An expert scope must name an active expert the caller owns — archived
+ experts 404 here, matching the
settings page's active-experts-only dropdown.
"""
- if not await is_enabled_for_user(user_id):
- raise HTTPException(
- status_code=403, detail="Memory is not enabled for your account"
- )
-
if expert_id is None:
try:
return MemoryScope.for_user(user_id)
diff --git a/autogpt_platform/backend/backend/api/features/memory/routes_test.py b/autogpt_platform/backend/backend/api/features/memory/routes_test.py
index e585b68bb6..e07e044d8c 100644
--- a/autogpt_platform/backend/backend/api/features/memory/routes_test.py
+++ b/autogpt_platform/backend/backend/api/features/memory/routes_test.py
@@ -37,14 +37,6 @@ def setup_app_auth(mock_jwt_user):
app.dependency_overrides.clear()
[email protected](autouse=True)
-def memory_enabled():
- with patch(
- f"{_MOCK_MODULE}.is_enabled_for_user", new=AsyncMock(return_value=True)
- ) as mock:
- yield mock
-
-
def _driver_returning(*query_results) -> AsyncMock:
driver = AsyncMock()
driver.execute_query.side_effect = [(r, None, None) for r in query_results]
@@ -85,10 +77,18 @@ class TestOverview:
assert body["episodes"] == 5
driver.close.assert_awaited_once()
- def test_disabled_memory_is_403(self, memory_enabled) -> None:
- memory_enabled.return_value = False
- resp = client.get("/memory/overview")
- assert resp.status_code == 403
+ def test_memory_is_available_without_a_flag_provider(self) -> None:
+ driver = _driver_returning([{"c": 0}], [{"c": 0}], [{"c": 0}])
+ with (
+ patch(f"{_MOCK_MODULE}.open_driver", return_value=driver),
+ patch(
+ "backend.util.feature_flag.is_feature_enabled",
+ new=AsyncMock(side_effect=RuntimeError("provider unavailable")),
+ ) as flags,
+ ):
+ resp = client.get("/memory/overview")
+ assert resp.status_code == 200
+ flags.assert_not_called()
def test_fact_count_only_counts_live_edges(self) -> None:
"""Counted with recall's own live-fact test, so the number shown is
diff --git a/autogpt_platform/backend/backend/api/features/onboarding_dump/routes.py b/autogpt_platform/backend/backend/api/features/onboarding_dump/routes.py
index cc93e4a675..8e7da1c48a 100644
--- a/autogpt_platform/backend/backend/api/features/onboarding_dump/routes.py
+++ b/autogpt_platform/backend/backend/api/features/onboarding_dump/routes.py
@@ -1,9 +1,4 @@
-"""Onboarding brain-dump endpoints.
-
-Everything here is user-scoped and gated on ``ONBOARDING_BRAIN_DUMP`` — a
-stale frontend must not be able to start writing recordings after the flag
-is turned back off.
-"""
+"""Authenticated, user-scoped onboarding brain-dump endpoints."""
import logging
from typing import Annotated
@@ -11,7 +6,7 @@ from typing import Annotated
import autogpt_libs.auth as autogpt_auth_lib
import fastapi
from autogpt_libs.auth.dependencies import get_user_id
-from fastapi import APIRouter, Depends, Form, Security, UploadFile
+from fastapi import APIRouter, Form, Security, UploadFile
from fastapi.responses import RedirectResponse
from prisma.enums import BrainDumpInputMode, BrainDumpStatus
@@ -31,34 +26,15 @@ from backend.api.features.onboarding_dump.models import (
UploadPartResponse,
)
from backend.api.features.store.exceptions import VirusDetectedError, VirusScanError
-from backend.util.feature_flag import Flag, is_feature_enabled
logger = logging.getLogger(__name__)
-async def require_brain_dump_flag(
- user_id: Annotated[str, Security(get_user_id)],
-) -> None:
- """Gate every endpoint on the brain-dump flag, fail-closed.
-
- Deliberately not ``create_feature_flag_dependency``: that helper
- short-circuits to 404 whenever LaunchDarkly has no SDK key, which is
- every local dev and test environment — and it does so *before*
- consulting the ``FORCE_FLAG_ONBOARDING_BRAIN_DUMP`` override, so the
- documented way to switch the feature on locally could never work.
- ``is_feature_enabled`` checks the env override first and still
- defaults to False when LaunchDarkly is unreachable.
- """
- if not await is_feature_enabled(Flag.ONBOARDING_BRAIN_DUMP, user_id):
- raise fastapi.HTTPException(status_code=404, detail="Feature not available")
-
-
router = APIRouter(
prefix="/onboarding/brain-dump",
tags=["onboarding", "brain-dump"],
dependencies=[
Security(autogpt_auth_lib.requires_user),
- Depends(require_brain_dump_flag),
],
)
diff --git a/autogpt_platform/backend/backend/api/features/onboarding_dump/routes_test.py b/autogpt_platform/backend/backend/api/features/onboarding_dump/routes_test.py
index d3ddd8577c..201990469c 100644
--- a/autogpt_platform/backend/backend/api/features/onboarding_dump/routes_test.py
+++ b/autogpt_platform/backend/backend/api/features/onboarding_dump/routes_test.py
@@ -158,12 +158,6 @@ class DumpStore:
self.row.greetingSeen = True
-# ``require_brain_dump_flag`` runs the real ``is_feature_enabled``, which
-# consults this env override before LaunchDarkly — so the gate is driven
-# here exactly the way it is driven locally, with no mock in the path.
-FLAG_ENV_VAR = "FORCE_FLAG_ONBOARDING_BRAIN_DUMP"
-
-
@pytest.fixture(autouse=True)
def setup_app_auth(mock_jwt_user):
app.dependency_overrides[get_jwt_payload] = mock_jwt_user["get_jwt_payload"]
@@ -171,11 +165,6 @@ def setup_app_auth(mock_jwt_user):
app.dependency_overrides.clear()
[email protected](autouse=True)
-def flag_on(monkeypatch: pytest.MonkeyPatch) -> None:
- monkeypatch.setenv(FLAG_ENV_VAR, "true")
-
-
@pytest.fixture(autouse=True)
def personalization_admission(mocker: MockerFixture) -> AsyncMock:
return mocker.patch(
@@ -671,30 +660,9 @@ def test_intro_returns_greeting_and_prompts_before_completion(dumps: DumpStore):
assert all(p["title"] and p["prompt"] for p in body["prompts"])
-def test_recommended_experts_are_withheld_while_the_team_flag_is_off(
- dumps: DumpStore,
-):
- """The route is gated on the brain-dump flag, the team on its own.
-
- A user without ``ONBOARDING_EXPERT_TEAM`` gets a final answer with no
- team rather than a section that never resolves.
- """
- upload_part()
- finalize()
-
- response = client.get(RECOMMENDED_EXPERTS_URL)
-
- assert response.status_code == 200
- assert response.json() == {"ready": True, "team": None}
-
-
def test_recommended_experts_returns_the_stored_team(
dumps: DumpStore, mocker: MockerFixture
):
- mocker.patch(
- "backend.api.features.onboarding_dump.service.is_feature_enabled",
- new=AsyncMock(return_value=True),
- )
upload_part()
finalize()
assert dumps.row is not None
@@ -754,39 +722,3 @@ def test_recommended_providers_returns_the_stored_picks(dumps: DumpStore):
{"provider": "github", "reason": "You mentioned chasing issues."}
],
}
-
-
- "call",
- [
- lambda: upload_part(),
- lambda: finalize(),
- lambda: client.get(STATUS_URL),
- lambda: client.get(RECORDING_URL, follow_redirects=False),
- lambda: client.delete(DISCARD_URL),
- lambda: client.get(INTRO_URL),
- lambda: client.post(INTRO_COMPLETE_URL),
- lambda: client.get(RECOMMENDED_URL),
- lambda: client.get(RECOMMENDED_EXPERTS_URL),
- ],
- ids=[
- "parts",
- "finalize",
- "status",
- "recording",
- "discard",
- "intro",
- "complete",
- "recommended-providers",
- "recommended-experts",
- ],
-)
-def test_every_endpoint_is_404_when_the_flag_is_off(
- monkeypatch: pytest.MonkeyPatch, call
-):
- monkeypatch.setenv(FLAG_ENV_VAR, "false")
-
- response = call()
-
- assert response.status_code == 404
- assert response.json()["detail"] == "Feature not available"
diff --git a/autogpt_platform/backend/backend/api/features/onboarding_dump/service.py b/autogpt_platform/backend/backend/api/features/onboarding_dump/service.py
index c93110c33e..bc2f2bb082 100644
--- a/autogpt_platform/backend/backend/api/features/onboarding_dump/service.py
+++ b/autogpt_platform/backend/backend/api/features/onboarding_dump/service.py
@@ -51,7 +51,6 @@ from backend.data.understanding import (
get_business_understanding,
upsert_business_understanding,
)
-from backend.util.feature_flag import Flag, is_feature_enabled
from backend.util.virus_scanner import scan_content_safe
logger = logging.getLogger(__name__)
@@ -507,15 +506,6 @@ async def _run_expert_recommendations(
a row left with a null column is "still running" to the reader, and
the client would poll it until its own ceiling.
"""
- if not await _expert_team_enabled(user_id):
- # Flag off: recorded rather than skipped, so the reader can tell
- # "the feature was off" apart from a job that died — and so no
- # roster read or LLM call is paid for a team nobody will see.
- await _store_team(
- user_id, recording_id, ExpertRecommendations(source="disabled")
- )
- return
-
user_role, pain_points = wizard_context
team = await recommend_experts.generate_expert_recommendations(
transcript,
@@ -539,17 +529,6 @@ async def _store_team(
)
-async def _expert_team_enabled(user_id: str) -> bool:
- """Whether the expert-team feature is on for ``user_id``.
-
- ``ONBOARDING_EXPERT_TEAM`` is a child of ``HIRE_EXPERTS``: a user who
- cannot hire must not be shown hire cards.
- """
- return await is_feature_enabled(
- Flag.HIRE_EXPERTS, user_id, default=False
- ) and await is_feature_enabled(Flag.ONBOARDING_EXPERT_TEAM, user_id, default=False)
-
-
async def _safe_understanding(user_id: str) -> tuple[str | None, list[str]]:
"""``(user_role, pain_points)`` from the signup wizard's answers.
@@ -578,7 +557,7 @@ async def get_recommended_experts(user_id: str) -> RecommendedExpertsResponse:
"""The team section's content, polled by the onboarding loading screen.
``ready=false`` only while the job is still running; every other
- state — flag off, no dump, a dump the job never got to — resolves to
+ state — no dump, a dump the job never got to — resolves to
a final answer here rather than leaving the client polling.
"""
dump = await db.get_dump(user_id)
@@ -591,12 +570,10 @@ async def _team_for_intro(
) -> tuple[ExpertRecommendations | None, bool]:
"""``(team, pending)`` for one user, shared by /intro and this reader.
- The invariant both surfaces rely on: with the flag on, a team that is
+ The invariant both surfaces rely on: a team that is
not pending is always an object — possibly with no experts — so the
"raise your own" door is always there to render.
"""
- if not await _expert_team_enabled(user_id):
- return None, False
if dump is None or _nothing_to_reflect(dump):
# Path B and every other take with nothing to read: the job never
# ran, and the wizard's answers are the whole basis for a team.
@@ -615,8 +592,7 @@ async def _team_for_intro(
logger.warning("Brain dump team: stored value unusable: %s", e)
return await _fallback_team(user_id), False
if team.source == "disabled":
- # Written while the flag was off, and it is on now. Recomputing
- # costs one roster read and strands nobody behind a flag flip.
+ # Legacy rows written before team recommendations were available.
return await _fallback_team(user_id), False
return team, False
@@ -766,7 +742,7 @@ async def get_intro_card(user_id: str) -> IntroCardResponse:
path="A",
greeting="",
greeting_pending=True,
- team_pending=await _expert_team_enabled(user_id),
+ team_pending=True,
)
if await _retire_greeting_if_chatted(user_id):
diff --git a/autogpt_platform/backend/backend/api/features/onboarding_dump/service_test.py b/autogpt_platform/backend/backend/api/features/onboarding_dump/service_test.py
index 9034f45853..cd53411806 100644
--- a/autogpt_platform/backend/backend/api/features/onboarding_dump/service_test.py
+++ b/autogpt_platform/backend/backend/api/features/onboarding_dump/service_test.py
@@ -28,7 +28,6 @@ from backend.api.features.onboarding_dump import (
from backend.api.features.onboarding_dump.models import (
ExpertRecommendations,
RecommendedExpert,
- RecommendedExpertsResponse,
)
from backend.data.understanding import BusinessUnderstanding, BusinessUnderstandingInput
@@ -1345,15 +1344,6 @@ def _stored_team(dumps: DumpStore) -> dict:
return dumps.row.recommendedExperts
-def team_flag(mocker: MockerFixture) -> AsyncMock:
- """Both flags on. ``ONBOARDING_EXPERT_TEAM`` is a child of
- ``HIRE_EXPERTS``, so the reads are separate and both must pass."""
- mock = AsyncMock(return_value=True)
- mocker.patch.object(service, "is_feature_enabled", new=mock)
- return mock
-
-
@pytest.fixture
def templates(mocker: MockerFixture) -> AsyncMock:
mock = AsyncMock(return_value=TEMPLATES)
@@ -1382,39 +1372,9 @@ def generate_team(mocker: MockerFixture) -> AsyncMock:
return mock
-async def test_the_flag_being_off_costs_no_llm_call_and_no_roster_read(
- dumps: DumpStore,
- mocker: MockerFixture,
- templates: AsyncMock,
- generate_team: AsyncMock,
-):
- """A dark feature must not bill for itself.
-
- The result is still written: a null column reads as "still running",
- and the client would poll it to its own ceiling.
- """
- mocker.patch.object(
- service, "is_feature_enabled", new=AsyncMock(return_value=False)
- )
- await start_voice_take(dumps)
-
- await finalize_voice()
-
- generate_team.assert_not_awaited()
- templates.assert_not_awaited()
- assert _stored_team(dumps) == {
- "diagnosis": "",
- "experts": [],
- "raise_suggestion": None,
- "source": "disabled",
- }
-
-
@pytest.mark.asyncio
async def test_the_generated_team_is_stored_with_the_wizard_answers(
dumps: DumpStore,
- team_flag: AsyncMock,
templates: AsyncMock,
generate_team: AsyncMock,
extraction: dict[str, AsyncMock],
@@ -1438,7 +1398,6 @@ async def test_the_generated_team_is_stored_with_the_wizard_answers(
@pytest.mark.asyncio
async def test_a_failed_team_job_still_stores_an_answer(
dumps: DumpStore,
- team_flag: AsyncMock,
templates: AsyncMock,
generate_team: AsyncMock,
):
@@ -1461,26 +1420,9 @@ async def test_a_failed_team_job_still_stores_an_answer(
assert generate_team.await_args.kwargs["templates"] == []
-async def test_the_team_is_withheld_entirely_while_the_flag_is_off(
- dumps: DumpStore, mocker: MockerFixture
-):
- mocker.patch.object(
- service, "is_feature_enabled", new=AsyncMock(return_value=False)
- )
- await start_voice_take(dumps)
-
- response = await service.get_recommended_experts(USER_ID)
- card = await service.get_intro_card(USER_ID)
-
- assert response == RecommendedExpertsResponse(ready=True, team=None)
- assert card.team is None
- assert card.team_pending is False
-
-
@pytest.mark.asyncio
async def test_the_team_is_pending_while_the_job_is_still_running(
- dumps: DumpStore, team_flag: AsyncMock, templates: AsyncMock
+ dumps: DumpStore, templates: AsyncMock
):
await start_voice_take(dumps)
await dumps.update_dump(
@@ -1499,7 +1441,7 @@ async def test_the_team_is_pending_while_the_job_is_still_running(
@pytest.mark.asyncio
async def test_a_terminal_dump_with_no_stored_team_falls_back(
- dumps: DumpStore, team_flag: AsyncMock, templates: AsyncMock
+ dumps: DumpStore, templates: AsyncMock
):
"""The job died with the process, so nothing is coming.
@@ -1524,7 +1466,7 @@ async def test_a_terminal_dump_with_no_stored_team_falls_back(
@pytest.mark.asyncio
async def test_a_stored_team_is_served_as_written(
- dumps: DumpStore, team_flag: AsyncMock, templates: AsyncMock
+ dumps: DumpStore, templates: AsyncMock
):
await start_voice_take(dumps)
await dumps.update_dump(
@@ -1552,7 +1494,7 @@ async def test_a_stored_team_is_served_as_written(
@pytest.mark.asyncio
async def test_a_malformed_stored_team_falls_back_rather_than_500s(
- dumps: DumpStore, team_flag: AsyncMock, templates: AsyncMock
+ dumps: DumpStore, templates: AsyncMock
):
await start_voice_take(dumps)
await dumps.update_dump(
@@ -1572,7 +1514,7 @@ async def test_a_malformed_stored_team_falls_back_rather_than_500s(
@pytest.mark.asyncio
async def test_a_team_written_while_the_flag_was_off_is_recomputed(
- dumps: DumpStore, team_flag: AsyncMock, templates: AsyncMock
+ dumps: DumpStore, templates: AsyncMock
):
"""A flag flip must not strand the user with an empty section.
@@ -1597,9 +1539,7 @@ async def test_a_team_written_while_the_flag_was_off_is_recomputed(
@pytest.mark.asyncio
-async def test_a_skipped_dump_still_gets_a_team(
- dumps: DumpStore, team_flag: AsyncMock, templates: AsyncMock
-):
+async def test_a_skipped_dump_still_gets_a_team(dumps: DumpStore, templates: AsyncMock):
"""Path B has no transcript, so the job never ran for it.
The raise door has to be reachable anyway, which means the section
@@ -1618,7 +1558,6 @@ async def test_a_skipped_dump_still_gets_a_team(
@pytest.mark.asyncio
async def test_the_intro_card_carries_the_stored_team(
dumps: DumpStore,
- team_flag: AsyncMock,
templates: AsyncMock,
generate_team: AsyncMock,
):
@@ -1634,39 +1573,22 @@ async def test_the_intro_card_carries_the_stored_team(
@pytest.mark.asyncio
- "hire_enabled,team_enabled",
- [(False, False), (False, True), (True, False), (True, True)],
-)
-async def test_pending_greeting_only_waits_for_an_enabled_team(
- dumps: DumpStore,
- team_flag: AsyncMock,
- templates: AsyncMock,
- hire_enabled: bool,
- team_enabled: bool,
+async def test_pending_greeting_waits_for_the_team(
+ dumps: DumpStore, templates: AsyncMock
):
- team_flag.side_effect = lambda flag, *args, **kwargs: (
- hire_enabled if flag == service.Flag.HIRE_EXPERTS else team_enabled
- )
await start_voice_take(dumps)
await dumps.update_dump(
- USER_ID,
- RECORDING_ID,
- status=BrainDumpStatus.extracting,
- transcript=TRANSCRIPT,
+ USER_ID, RECORDING_ID, status=BrainDumpStatus.extracting, transcript=TRANSCRIPT
)
-
card = await service.get_intro_card(USER_ID)
-
assert card.greeting_pending is True
- assert card.team_pending is (hire_enabled and team_enabled)
+ assert card.team_pending is True
assert card.team is None
@pytest.mark.asyncio
async def test_team_uses_signup_snapshot_and_stays_pending_until_its_job_finishes(
dumps: DumpStore,
- team_flag: AsyncMock,
templates: AsyncMock,
generate_team: AsyncMock,
extraction: dict[str, AsyncMock],
diff --git a/autogpt_platform/backend/backend/api/features/store/skill_routes.py b/autogpt_platform/backend/backend/api/features/store/skill_routes.py
index 8ffa16d51e..8a1cfbd965 100644
--- a/autogpt_platform/backend/backend/api/features/store/skill_routes.py
+++ b/autogpt_platform/backend/backend/api/features/store/skill_routes.py
@@ -7,33 +7,15 @@ from fastapi import Depends, Path, Query, Security
from backend.api.features.experts import experts_db
from backend.copilot.rate_limit import enforce_payment_paywall
from backend.copilot.tools.skills import SkillLimitError, SkillOwnedError
-from backend.util.feature_flag import Flag, is_feature_enabled
from . import skill_db, skill_model, skill_submission_db
-# Browse is anonymous, and LaunchDarkly needs a context key: a non-UUID key is
-# evaluated as an anonymous context, which with the flag off answers False.
-_ANONYMOUS_FLAG_KEY = "anonymous"
-
# This endpoint is a source viewer for someone deciding to install or approve a
# package, not a file server: a file past this is refused rather than streamed.
MAX_VIEWABLE_FILE_BYTES = 256 * 1024
-async def require_skills_hub_flag(
- user_id: str | None = Security(autogpt_libs.auth.get_optional_user_id),
-) -> None:
- """Gate every skills route on the skills-hub flag, fail-closed.
-
- Deliberately not ``create_feature_flag_dependency``: that helper 404s
- whenever LaunchDarkly has no SDK key, before consulting the
- ``FORCE_FLAG_SKILLS_HUB`` override every local environment relies on.
- """
- if not await is_feature_enabled(Flag.SKILLS_HUB, user_id or _ANONYMOUS_FLAG_KEY):
- raise fastapi.HTTPException(status_code=404, detail="Feature not available")
-
-
-router = fastapi.APIRouter(dependencies=[Depends(require_skills_hub_flag)])
+router = fastapi.APIRouter()
@router.get(
diff --git a/autogpt_platform/backend/backend/api/features/store/skill_routes_test.py b/autogpt_platform/backend/backend/api/features/store/skill_routes_test.py
index 75db424795..6ef68ec10c 100644
--- a/autogpt_platform/backend/backend/api/features/store/skill_routes_test.py
+++ b/autogpt_platform/backend/backend/api/features/store/skill_routes_test.py
@@ -1,20 +1,17 @@
-"""The skills-hub gate in front of the marketplace skill routes."""
+"""Public skill browsing and authenticated owner-scoped installation."""
import fastapi
import fastapi.testclient
import pytest
+from backend.util.models import Pagination
+
from . import skill_model, skill_routes, skill_submission_db
app = fastapi.FastAPI()
app.include_router(skill_routes.router, prefix="/api/store/skills")
client = fastapi.testclient.TestClient(app)
-# ``require_skills_hub_flag`` runs the real ``is_feature_enabled``, which
-# consults this env override before LaunchDarkly — so the gate is driven here
-# exactly the way it is driven locally, with no mock in the path.
-FLAG_ENV_VAR = "FORCE_FLAG_SKILLS_HUB"
-
@pytest.fixture
def authenticated(mock_jwt_user):
@@ -25,57 +22,21 @@ def authenticated(mock_jwt_user):
app.dependency_overrides.clear()
- "call",
- [
- lambda: client.get("/api/store/skills"),
- lambda: client.get("/api/store/skills/any-slug"),
- lambda: client.post("/api/store/skills/any-slug/install"),
- lambda: client.post("/api/store/skills/submissions"),
- lambda: client.get("/api/store/skills/submissions"),
- lambda: client.put("/api/store/skills/submissions/any-version"),
- ],
- ids=["browse", "detail", "install", "submit", "my-submissions", "edit"],
-)
-def test_every_endpoint_is_404_when_the_flag_is_off(
- monkeypatch: pytest.MonkeyPatch, call
-):
- monkeypatch.setenv(FLAG_ENV_VAR, "false")
-
- response = call()
-
- assert response.status_code == 404
- assert response.json()["detail"] == "Feature not available"
-
-
-def test_install_still_needs_auth_when_the_flag_is_on(
+def test_install_requires_authentication(
monkeypatch: pytest.MonkeyPatch,
):
- """The gate takes an optional user, so it must not stand in for auth."""
- monkeypatch.setenv(FLAG_ENV_VAR, "true")
+ """Public browsing does not authorize installation."""
response = client.post("/api/store/skills/any-slug/install")
assert response.status_code == 401
-async def test_the_gate_opens_when_the_flag_is_on(monkeypatch: pytest.MonkeyPatch):
- """Without this the 404s above would also pass on a permanently shut gate.
-
- Called directly rather than through the router: past the gate the handler
- reaches Prisma, which the sync TestClient drives on the wrong event loop.
- """
- monkeypatch.setenv(FLAG_ENV_VAR, "true")
-
- assert await skill_routes.require_skills_hub_flag(user_id=None) is None
-
-
def test_submissions_is_a_route_of_its_own_not_a_skill_slug(
monkeypatch: pytest.MonkeyPatch, mocker, authenticated
):
"""`/{slug}` is declared after `/submissions`, so the placeholder cannot
swallow it — FastAPI matches in declaration order."""
- monkeypatch.setenv(FLAG_ENV_VAR, "true")
listed = mocker.patch.object(
skill_submission_db, "list_my_skill_submissions", return_value=[]
)
@@ -92,7 +53,6 @@ def test_submissions_is_a_route_of_its_own_not_a_skill_slug(
def test_install_targets_the_expert_the_caller_named(
monkeypatch: pytest.MonkeyPatch, mocker, authenticated, test_user_id, expert_id
):
- monkeypatch.setenv(FLAG_ENV_VAR, "true")
mocker.patch.object(
skill_routes.experts_db, "owns_private_active_expert", return_value=True
)
@@ -115,7 +75,6 @@ def test_install_onto_someone_elses_expert_is_a_404_that_writes_nothing(
monkeypatch: pytest.MonkeyPatch, mocker, authenticated, test_user_id
):
"""A 403 would confirm the expert exists, so an unowned id reads as missing."""
- monkeypatch.setenv(FLAG_ENV_VAR, "true")
owns = mocker.patch.object(
skill_routes.experts_db, "owns_private_active_expert", return_value=False
)
@@ -129,3 +88,35 @@ def test_install_onto_someone_elses_expert_is_a_404_that_writes_nothing(
assert response.json()["detail"] == "Expert 'not-mine' not found"
owns.assert_awaited_once_with(test_user_id, "not-mine")
install.assert_not_awaited()
+
+
+def test_public_skills_remain_available_with_a_retired_false_override(
+ monkeypatch, mocker
+):
+ monkeypatch.setenv("FORCE_FLAG_SKILLS_HUB", "false")
+ listed = mocker.patch.object(
+ skill_routes.skill_db,
+ "get_marketplace_skills",
+ return_value=skill_model.MarketplaceSkillsResponse(
+ skills=[],
+ pagination=Pagination(
+ total_items=0, total_pages=0, current_page=1, page_size=20
+ ),
+ ),
+ )
+ response = client.get("/api/store/skills")
+ assert response.status_code == 200
+ listed.assert_awaited_once()
+
+
+ "method,path",
+ [
+ ("post", "/api/store/skills/any-slug/install"),
+ ("post", "/api/store/skills/submissions"),
+ ("get", "/api/store/skills/submissions"),
+ ("put", "/api/store/skills/submissions/any-version"),
+ ],
+)
+def test_private_skill_operations_require_auth_after_flag_retirement(method, path):
+ assert client.request(method, path).status_code == 401
diff --git a/autogpt_platform/backend/backend/api/paywall_routes_test.py b/autogpt_platform/backend/backend/api/paywall_routes_test.py
index a0be895574..119eb908b0 100644
--- a/autogpt_platform/backend/backend/api/paywall_routes_test.py
+++ b/autogpt_platform/backend/backend/api/paywall_routes_test.py
@@ -390,10 +390,6 @@ def test_the_open_lists_name_only_routes_that_exist():
def test_an_account_without_a_plan_gets_402_from_a_closed_route(
call: str, mock_jwt_user, paywalled_user, mocker
):
- mocker.patch(
- "backend.api.features.store.skill_routes.is_feature_enabled",
- new=mocker.AsyncMock(return_value=True),
- )
app.dependency_overrides[get_jwt_payload] = mock_jwt_user["get_jwt_payload"]
try:
method, path = call.split(" ", 1)
diff --git a/autogpt_platform/backend/backend/copilot/baseline/provider_out_of_credits_test.py b/autogpt_platform/backend/backend/copilot/baseline/provider_out_of_credits_test.py
index 106f944086..75f40fd000 100644
--- a/autogpt_platform/backend/backend/copilot/baseline/provider_out_of_credits_test.py
+++ b/autogpt_platform/backend/backend/copilot/baseline/provider_out_of_credits_test.py
@@ -6,7 +6,8 @@ plain sentence, the turn is retryable, and nothing offers to "switch
connection" as if it were their own limit.
"""
-from collections.abc import Iterator
+import asyncio
+from collections.abc import AsyncIterator, Iterator
from unittest.mock import AsyncMock, MagicMock
import httpx
@@ -17,7 +18,11 @@ from backend.copilot.baseline import service
from backend.copilot.context import set_execution_context
from backend.copilot.model import ChatMessage, ChatSession
from backend.copilot.model_router import ResolvedModel
-from backend.copilot.response_model import StreamError, StreamProviderFailure
+from backend.copilot.response_model import (
+ StreamError,
+ StreamProviderFailure,
+ StreamStatus,
+)
_OPENROUTER_402_BODY = {
"message": "Insufficient credits. This account never purchased credits. "
@@ -38,6 +43,11 @@ def _openrouter_402() -> openai.APIStatusError:
)
+async def _no_answered_cards(*_: object, **__: object) -> AsyncIterator[StreamStatus]:
+ return
+ yield
+
+
@pytest.fixture
def baseline_io(monkeypatch: pytest.MonkeyPatch) -> Iterator[list[ChatSession]]:
persisted: list[ChatSession] = []
@@ -55,15 +65,21 @@ def baseline_io(monkeypatch: pytest.MonkeyPatch) -> Iterator[list[ChatSession]]:
)
for name, value in {
"drain_pending_safe": [],
+ "drain_pending_messages": [],
"resolve_model_route": ResolvedModel(
model="anthropic/claude-sonnet-4-6", source="env"
),
"_build_system_prompt": ("System prompt", None),
- "is_enabled_for_user": False,
- "is_feature_enabled": False,
+ "download_transcript": None,
+ "build_skills_update_notice": "",
+ "inject_user_context": "hello",
+ "active_mode": None,
+ "_fetch_graphiti_context": "",
+ "enqueue_conversation_turn": None,
"persist_and_record_usage": None,
}.items():
monkeypatch.setattr(service, name, AsyncMock(return_value=value))
+ monkeypatch.setattr(service, "resolve_answered", _no_answered_cards)
monkeypatch.setattr(service, "_get_main_client", MagicMock())
monkeypatch.setattr(service, "upsert_chat_session", AsyncMock(side_effect=save))
monkeypatch.setattr(
@@ -77,6 +93,7 @@ def baseline_io(monkeypatch: pytest.MonkeyPatch) -> Iterator[list[ChatSession]]:
async def _run_turn() -> tuple[list[object], ChatSession]:
session = ChatSession.new("user-1", dry_run=False)
+ session.title = "Existing task"
session.messages.append(ChatMessage(role="user", content="hello"))
events = [
event
@@ -94,7 +111,8 @@ async def _run_turn() -> tuple[list[object], ChatSession]:
async def test_platform_402_shows_the_platform_message(
baseline_io: list[ChatSession],
) -> None:
- events, session = await _run_turn()
+ async with asyncio.timeout(10):
+ events, session = await _run_turn()
[error] = [e for e in events if isinstance(e, StreamError)]
assert error.code == "provider_unavailable"
diff --git a/autogpt_platform/backend/backend/copilot/baseline/service.py b/autogpt_platform/backend/backend/copilot/baseline/service.py
index c57963668c..85c55f6612 100644
--- a/autogpt_platform/backend/backend/copilot/baseline/service.py
+++ b/autogpt_platform/backend/backend/copilot/baseline/service.py
@@ -54,7 +54,6 @@ from backend.copilot.expert_context import build_expert_identity_suffix
from backend.copilot.expert_kickoff import is_expert_kickoff_turn
from backend.copilot.gate import active_mode
from backend.copilot.gate.held import resolve_answered
-from backend.copilot.graphiti.config import is_enabled_for_user
from backend.copilot.graphiti.context import fetch_warm_context
from backend.copilot.graphiti.context_marker import append_injected_memory_block
from backend.copilot.graphiti.context_refresh import join_refresh, start_refresh
@@ -181,7 +180,6 @@ from backend.copilot.transcript import (
from backend.copilot.transcript_builder import TranscriptBuilder
from backend.util import json as util_json
from backend.util.exceptions import NotFoundError
-from backend.util.feature_flag import Flag, is_feature_enabled
from backend.util.llm.provider_billing import (
PROVIDER_UNAVAILABLE_CODE,
PROVIDER_UNAVAILABLE_MESSAGE,
@@ -2055,18 +2053,11 @@ async def stream_chat_completion_baseline(
message_id = str(uuid.uuid4())
# Append tool documentation, technical notes, and Graphiti memory instructions
- graphiti_enabled = await is_enabled_for_user(user_id)
+ graphiti_enabled = bool(user_id)
graphiti_supplement = get_graphiti_supplement() if graphiti_enabled else ""
auto_mode_supplement = approval_mode_supplement(await active_mode(user_id, session))
- # The whole expert-team surface rides the hire-experts flag, failing
- # closed for anonymous turns. Resolved here rather than at the
- # tool-filtering site below so the delegation rules can be gated on the
- # same boolean — a flag-off turn must not be told to call tools its
- # ``execute_tool`` gate will refuse.
- experts_enabled = bool(user_id) and await is_feature_enabled(
- Flag.HIRE_EXPERTS, user_id, default=False
- )
+ experts_enabled = bool(user_id)
delegation_supplement = get_delegation_supplement() if experts_enabled else ""
oversight_supplement = get_expert_oversight_supplement(
experts_enabled=experts_enabled, expert_id=session.expert_id
@@ -3086,7 +3077,7 @@ async def stream_chat_completion_baseline(
_ingest_task.add_done_callback(_background_tasks.discard)
# --- Skill learning: record this turn as a learning source ---
- # Independent of Graphiti; flag-gated and never raises.
+ # Independent of Graphiti; honors the user's learning preferences.
if user_id and message and is_user_message:
_capture_task = asyncio.create_task(
capture_chat_turn(
diff --git a/autogpt_platform/backend/backend/copilot/baseline/service_cancellation_test.py b/autogpt_platform/backend/backend/copilot/baseline/service_cancellation_test.py
index 2e1cf3a02b..8cf9b42ee0 100644
--- a/autogpt_platform/backend/backend/copilot/baseline/service_cancellation_test.py
+++ b/autogpt_platform/backend/backend/copilot/baseline/service_cancellation_test.py
@@ -161,8 +161,8 @@ def baseline_io(monkeypatch: pytest.MonkeyPatch) -> Iterator[list[ChatSession]]:
model="anthropic/claude-sonnet-4-6", source="env"
),
"_build_system_prompt": ("System prompt", None),
- "is_enabled_for_user": False,
- "is_feature_enabled": False,
+ "_fetch_graphiti_context": "",
+ "enqueue_conversation_turn": None,
"persist_and_record_usage": None,
}.items():
monkeypatch.setattr(service, name, AsyncMock(return_value=value))
diff --git a/autogpt_platform/backend/backend/copilot/baseline/service_unit_test.py b/autogpt_platform/backend/backend/copilot/baseline/service_unit_test.py
index 959c7f000e..285ff28b7a 100644
--- a/autogpt_platform/backend/backend/copilot/baseline/service_unit_test.py
+++ b/autogpt_platform/backend/backend/copilot/baseline/service_unit_test.py
@@ -3207,15 +3207,8 @@ class _StopAfterExpertsGate(Exception):
``experts_enabled`` — before any LLM call would be attempted."""
-async def _run_baseline_until_experts_gate(
- *, user_id: str | None, hire_experts_enabled: bool
-) -> AsyncMock:
- """Drive the real generator up to (and one statement past) the
- hire-experts flag check, with every other I/O dependency stubbed out.
-
- Returns the ``is_feature_enabled`` mock so callers can assert whether
- (and how) it was called.
- """
+async def _run_baseline_until_experts_gate(*, user_id: str | None) -> AsyncMock:
+ """Capture expert authorization before the generator can make a provider call."""
session = ChatSession.new("owner-1", dry_run=False)
session.title = "already titled" # skip the async title-generation task
@@ -3248,18 +3241,14 @@ async def _run_baseline_until_experts_gate(
"backend.copilot.baseline.service._build_system_prompt",
new=AsyncMock(return_value=("system prompt", None)),
),
- patch(
- "backend.copilot.baseline.service.is_enabled_for_user",
- new=AsyncMock(return_value=False),
- ),
- patch(
- "backend.copilot.baseline.service.is_feature_enabled",
- new=AsyncMock(return_value=hire_experts_enabled),
- ) as is_feature_enabled_mock,
patch(
"backend.copilot.baseline.service.build_builder_system_prompt_suffix",
new=AsyncMock(side_effect=_StopAfterExpertsGate),
),
+ patch(
+ "backend.copilot.baseline.service.get_expert_oversight_supplement",
+ return_value="",
+ ) as oversight_mock,
pytest.raises(_StopAfterExpertsGate),
):
async for _ in stream_chat_completion_baseline(
@@ -3270,7 +3259,7 @@ async def _run_baseline_until_experts_gate(
):
pass
- return is_feature_enabled_mock
+ return oversight_mock
class _StopAtAttachments(Exception):
@@ -3320,15 +3309,11 @@ async def test_execution_context_is_set_before_attachments_are_prepared() -> Non
new=AsyncMock(return_value=("system prompt", None)),
),
patch(
- "backend.copilot.baseline.service.is_enabled_for_user",
- new=AsyncMock(return_value=False),
- ),
- patch(
- "backend.copilot.baseline.service.is_feature_enabled",
- new=AsyncMock(return_value=False),
+ "backend.copilot.baseline.service.build_builder_system_prompt_suffix",
+ new=AsyncMock(return_value=""),
),
patch(
- "backend.copilot.baseline.service.build_builder_system_prompt_suffix",
+ "backend.copilot.baseline.service._fetch_graphiti_context",
new=AsyncMock(return_value=""),
),
patch(
@@ -3361,26 +3346,12 @@ async def test_execution_context_is_set_before_attachments_are_prepared() -> Non
assert seen == [("user-1", session)]
-class TestBaselineExpertsFlagGuard:
- """``experts_enabled = bool(user_id) and await is_feature_enabled(...)``:
- an anonymous turn (``user_id=None``) must fail closed WITHOUT resolving
- the flag at all — a bare ``await is_feature_enabled(...)`` would await
- None as a positional arg and/or silently enable the team surface for
- turns with no user."""
-
+class TestBaselineExpertsAuthorization:
@pytest.mark.asyncio
- async def test_anonymous_turn_never_calls_the_hire_experts_flag(self) -> None:
- is_feature_enabled_mock = await _run_baseline_until_experts_gate(
- user_id=None, hire_experts_enabled=True
- )
- is_feature_enabled_mock.assert_not_awaited()
-
- @pytest.mark.asyncio
- async def test_authenticated_turn_resolves_the_hire_experts_flag(self) -> None:
- is_feature_enabled_mock = await _run_baseline_until_experts_gate(
- user_id="user-1", hire_experts_enabled=True
- )
- is_feature_enabled_mock.assert_awaited_once()
+ @pytest.mark.parametrize("user_id,expected", [(None, False), ("user-1", True)])
+ async def test_expert_tools_require_authentication(self, user_id, expected):
+ oversight = await _run_baseline_until_experts_gate(user_id=user_id)
+ oversight.assert_called_once_with(experts_enabled=expected, expert_id=None)
class TestBaselineToolExecutorForwardsDisabledGroups:
@@ -3492,15 +3463,6 @@ async def test_follow_up_turn_wires_the_refresh_with_turn_state() -> None:
"backend.copilot.baseline.service._build_system_prompt",
new=AsyncMock(return_value=("system prompt", None)),
),
- # The Graphiti gate: on for this turn, so the refresh must be wired.
- patch(
- "backend.copilot.baseline.service.is_enabled_for_user",
- new=AsyncMock(return_value=True),
- ),
- patch(
- "backend.copilot.baseline.service.is_feature_enabled",
- new=AsyncMock(return_value=False),
- ),
patch(
"backend.copilot.baseline.service.build_builder_system_prompt_suffix",
new=AsyncMock(return_value=""),
@@ -3658,8 +3620,6 @@ async def _run_baseline_turn(
f"{_BASELINE}._build_system_prompt",
dict(new=AsyncMock(return_value=("system prompt", None))),
),
- (f"{_BASELINE}.is_enabled_for_user", dict(new=AsyncMock(return_value=True))),
- (f"{_BASELINE}.is_feature_enabled", dict(new=AsyncMock(return_value=False))),
(
f"{_BASELINE}.build_builder_system_prompt_suffix",
dict(new=AsyncMock(return_value="")),
diff --git a/autogpt_platform/backend/backend/copilot/baseline/warm_context_marker_test.py b/autogpt_platform/backend/backend/copilot/baseline/warm_context_marker_test.py
index 44aea0bc3b..6480b177e6 100644
--- a/autogpt_platform/backend/backend/copilot/baseline/warm_context_marker_test.py
+++ b/autogpt_platform/backend/backend/copilot/baseline/warm_context_marker_test.py
@@ -44,8 +44,6 @@ async def test_baseline_follow_up_marks_only_the_injected_block() -> None:
),
"get_or_create_sandbox": None,
"_build_system_prompt": ("system prompt", None),
- "is_enabled_for_user": True,
- "is_feature_enabled": False,
"build_builder_system_prompt_suffix": "",
"build_budget_ctx": "",
"build_session_context": "",
diff --git a/autogpt_platform/backend/backend/copilot/billing_e2e/baseline_turns.py b/autogpt_platform/backend/backend/copilot/billing_e2e/baseline_turns.py
index 15469f5226..2421c9c69c 100644
--- a/autogpt_platform/backend/backend/copilot/billing_e2e/baseline_turns.py
+++ b/autogpt_platform/backend/backend/copilot/billing_e2e/baseline_turns.py
@@ -2,7 +2,7 @@
A real ``AsyncOpenAI`` client streams from the fake provider, and the
baseline's own usage and cost parsing reads what it sends. Stubbed:
-persistence, transcript storage, the system prompt, flag lookups and the
+persistence, transcript storage, memory, the system prompt and the
copilot's tools, which answer the provider's tool call with a canned result.
"""
@@ -59,8 +59,10 @@ class BaselineTurns:
"clear_pending_question": AsyncMock(),
"resolve_answered": _no_answered_cards,
"build_turn_budget_block": AsyncMock(return_value=""),
- "is_enabled_for_user": AsyncMock(return_value=False),
- "is_feature_enabled": AsyncMock(return_value=False),
+ "_fetch_graphiti_context": AsyncMock(return_value=""),
+ "_enqueue_graphiti_turn": AsyncMock(),
+ "capture_chat_turn": AsyncMock(),
+ "build_expert_identity_suffix": AsyncMock(return_value=""),
}
for name, value in stubs.items():
monkeypatch.setattr(baseline, name, value)
diff --git a/autogpt_platform/backend/backend/copilot/briefing/generate.py b/autogpt_platform/backend/backend/copilot/briefing/generate.py
index 7c802bfe6c..8786ea5bdd 100644
--- a/autogpt_platform/backend/backend/copilot/briefing/generate.py
+++ b/autogpt_platform/backend/backend/copilot/briefing/generate.py
@@ -23,7 +23,6 @@ from backend.data.db_accessors import (
from backend.data.execution import ExecutionStatus, GraphExecutionMeta
from backend.data.user import is_user_banned
from backend.util.clients import get_database_manager_async_client
-from backend.util.feature_flag import Flag, evaluate_feature_flag, is_feature_enabled
from backend.util.funnel_analytics import emit_funnel_event
from backend.util.posthog_events import PostHogEvent
from backend.util.timezone_utils import get_user_timezone_or_utc
@@ -247,13 +246,6 @@ async def _compose_fresh_briefing(
# Written here, once, rather than at render time: the thread post and the
# home card must show the same paragraph, and home must not pay for an LLM
# call on every poll. `None` on failure — the briefing ships either way.
- #
- # Gated at the point of generation, not just of display: the narrative is
- # AI-written text derived from the run summaries `AI_ACTIVITY_STATUS`
- # governs, so a flag-off user must neither be billed for it nor see it in
- # the thread — home's `without_summaries` only covers the card.
- if not await is_feature_enabled(Flag.AI_ACTIVITY_STATUS, user_id):
- return content
try:
narrative = await compose_narrative(user_id, content)
except UsageActivationUnavailable:
@@ -265,17 +257,6 @@ async def _compose_fresh_briefing(
async def generate_and_deliver_briefing(user_id: str) -> BriefingResult:
- enabled, authoritative = await evaluate_feature_flag(
- Flag.HIRE_EXPERTS, user_id, default=False
- )
- if not enabled:
- # Only a flag that actually evaluated may unregister the cron (see
- # ``execute_morning_briefing``). A failed read yields False too, and
- # would delete every user's schedule on one bad boot or DB blip.
- if not authoritative:
- return {"status": "skipped", "reason": "flag_unavailable"}
- return {"status": "skipped", "reason": "flag_disabled"}
-
if await is_user_banned(user_id):
return {"status": "skipped", "reason": "banned"}
if await is_user_paywalled(user_id):
diff --git a/autogpt_platform/backend/backend/copilot/briefing/generate_test.py b/autogpt_platform/backend/backend/copilot/briefing/generate_test.py
index f448df0c46..2aadba9ac6 100644
--- a/autogpt_platform/backend/backend/copilot/briefing/generate_test.py
+++ b/autogpt_platform/backend/backend/copilot/briefing/generate_test.py
@@ -12,7 +12,6 @@ from backend.copilot.briefing.render import render_briefing_markdown
from backend.data.execution import ExecutionStatus, GraphExecutionMeta
from backend.data.pro_activation import UsageActivationState
from backend.util import posthog_client
-from backend.util.feature_flag import Flag
NOW = datetime(2026, 8, 7, 9, 0, tzinfo=timezone.utc)
@@ -274,26 +273,11 @@ def test_markdown_has_three_sections_and_links():
assert "(/library/agents/lib-1?activeTab=runs&activeItem=run-1)" in md
-async def test_generate_skips_when_flag_off(monkeypatch):
- from backend.copilot.briefing import generate
-
- async def flag_off(*a, **kw):
- return False, True
-
- monkeypatch.setattr(generate, "evaluate_feature_flag", flag_off)
- result = await generate.generate_and_deliver_briefing("user-1")
- assert result == {"status": "skipped", "reason": "flag_disabled"}
-
-
@pytest.mark.asyncio
async def test_generate_skips_a_paywalled_user_before_reading_anything(
monkeypatch, paid_user
):
paid_user.return_value = True
- monkeypatch.setattr(
- generate_module, "evaluate_feature_flag", AsyncMock(return_value=(True, True))
- )
db = MagicMock()
monkeypatch.setattr(generate_module, "user_db", lambda: db)
result = await generate_module.generate_and_deliver_briefing("user-1")
@@ -302,20 +286,6 @@ async def test_generate_skips_a_paywalled_user_before_reading_anything(
db.get_user_by_id.assert_not_called()
-async def test_generate_reports_an_unevaluated_flag_separately(monkeypatch):
- """A flag read that FAILED yields False, same as a real "off". Only the
- latter may unregister the cron, so the two must not share a reason."""
- from backend.copilot.briefing import generate
-
- async def flag_unreadable(*a, **kw):
- return False, False
-
- monkeypatch.setattr(generate, "evaluate_feature_flag", flag_unreadable)
- result = await generate.generate_and_deliver_briefing("user-1")
- assert result == {"status": "skipped", "reason": "flag_unavailable"}
-
-
@pytest.fixture
def funnel(monkeypatch):
"""The funnel emitter is a module-level call now, not a client method."""
@@ -330,9 +300,6 @@ async def test_generate_skips_a_banned_owner_before_any_work(monkeypatch):
from backend.copilot.briefing import generate
- monkeypatch.setattr(
- generate, "evaluate_feature_flag", AsyncMock(return_value=(True, True))
- )
monkeypatch.setattr(generate, "is_user_banned", AsyncMock(return_value=True))
get_user = AsyncMock()
monkeypatch.setattr(generate, "user_db", lambda: MagicMock(get_user_by_id=get_user))
@@ -350,10 +317,6 @@ async def test_generate_skips_when_already_delivered(monkeypatch):
from backend.copilot.briefing import generate
- monkeypatch.setattr(generate, "is_feature_enabled", AsyncMock(return_value=True))
- monkeypatch.setattr(
- generate, "evaluate_feature_flag", AsyncMock(return_value=(True, True))
- )
user = MagicMock()
user.timezone = "UTC"
monkeypatch.setattr(
@@ -383,11 +346,6 @@ async def test_generate_delivers_and_composes_briefing(monkeypatch):
fake_datetime.now.return_value = fixed_now
monkeypatch.setattr(generate, "datetime", fake_datetime)
- monkeypatch.setattr(generate, "is_feature_enabled", AsyncMock(return_value=True))
- monkeypatch.setattr(
- generate, "evaluate_feature_flag", AsyncMock(return_value=(True, True))
- )
-
user = MagicMock()
user.timezone = "UTC"
monkeypatch.setattr(
@@ -486,10 +444,6 @@ def _patch_generate_env(monkeypatch, generate, client):
fake_datetime = MagicMock(wraps=datetime)
fake_datetime.now.return_value = fixed_now
monkeypatch.setattr(generate, "datetime", fake_datetime)
- monkeypatch.setattr(generate, "is_feature_enabled", AsyncMock(return_value=True))
- monkeypatch.setattr(
- generate, "evaluate_feature_flag", AsyncMock(return_value=(True, True))
- )
user = MagicMock()
user.timezone = "UTC"
monkeypatch.setattr(
@@ -615,11 +569,6 @@ async def test_generate_keeps_library_link_when_workflow_has_no_library_agent_id
fake_datetime.now.return_value = fixed_now
monkeypatch.setattr(generate, "datetime", fake_datetime)
- monkeypatch.setattr(generate, "is_feature_enabled", AsyncMock(return_value=True))
- monkeypatch.setattr(
- generate, "evaluate_feature_flag", AsyncMock(return_value=(True, True))
- )
-
user = MagicMock()
user.timezone = "UTC"
monkeypatch.setattr(
@@ -817,10 +766,6 @@ async def test_generate_writes_recomposed_content_back_to_an_unreadable_row(
fake_datetime = MagicMock(wraps=datetime)
fake_datetime.now.return_value = NOW
monkeypatch.setattr(generate, "datetime", fake_datetime)
- monkeypatch.setattr(generate, "is_feature_enabled", AsyncMock(return_value=True))
- monkeypatch.setattr(
- generate, "evaluate_feature_flag", AsyncMock(return_value=(True, True))
- )
user = MagicMock()
user.timezone = "UTC"
@@ -887,10 +832,6 @@ async def test_generate_stops_reprocessing_an_unreadable_row_with_nothing_to_say
fake_datetime = MagicMock(wraps=datetime)
fake_datetime.now.return_value = NOW
monkeypatch.setattr(generate, "datetime", fake_datetime)
- monkeypatch.setattr(generate, "is_feature_enabled", AsyncMock(return_value=True))
- monkeypatch.setattr(
- generate, "evaluate_feature_flag", AsyncMock(return_value=(True, True))
- )
user = MagicMock()
user.timezone = "UTC"
@@ -958,10 +899,6 @@ async def test_generate_bounds_the_execution_query(monkeypatch):
fake_datetime = MagicMock(wraps=datetime)
fake_datetime.now.return_value = NOW
monkeypatch.setattr(generate, "datetime", fake_datetime)
- monkeypatch.setattr(generate, "is_feature_enabled", AsyncMock(return_value=True))
- monkeypatch.setattr(
- generate, "evaluate_feature_flag", AsyncMock(return_value=(True, True))
- )
user = MagicMock()
user.timezone = "UTC"
@@ -1189,43 +1126,6 @@ def test_briefing_without_a_narrative_renders_unchanged():
assert render_briefing_markdown(content).splitlines()[2] == "**What ran**"
-async def test_ai_summary_flag_off_skips_generation_entirely(
- monkeypatch, stub_narrative
-):
- """The gate is on generation, not just on display.
-
- Home's `without_summaries` hides the lede from the card, but the thread
- post reads the same stored row — so a flag-off user must never be billed
- for a narrative, nor have one posted to them.
- """
- stub_narrative.return_value = "Should never be written."
- client = MagicMock(
- get_briefing_for_date=AsyncMock(return_value=None),
- create_briefing=AsyncMock(return_value=MagicMock(id="briefing-1")),
- append_plain_session_message=AsyncMock(return_value="session-1"),
- mark_briefing_delivered=AsyncMock(),
- )
- _patch_fresh_compose_env(monkeypatch, generate_module, client)
- monkeypatch.setattr(
- generate_module,
- "is_feature_enabled",
- AsyncMock(side_effect=lambda flag, *a, **k: flag is Flag.HIRE_EXPERTS),
- )
- monkeypatch.setattr(
- generate_module, "evaluate_feature_flag", AsyncMock(return_value=(True, True))
- )
-
- result = await generate_module.generate_and_deliver_briefing("user-1")
-
- assert result["status"] == "delivered"
- stub_narrative.assert_not_awaited()
- assert client.create_briefing.await_args.args[2]["narrative"] is None
- posted = client.append_plain_session_message.await_args.kwargs["content"]
- assert "Should never be written." not in posted
- assert "**What ran**" in posted
-
-
@pytest.mark.parametrize(
"narrative",
[
diff --git a/autogpt_platform/backend/backend/copilot/briefing/scheduling.py b/autogpt_platform/backend/backend/copilot/briefing/scheduling.py
index 1793035b72..2380150bfa 100644
--- a/autogpt_platform/backend/backend/copilot/briefing/scheduling.py
+++ b/autogpt_platform/backend/backend/copilot/briefing/scheduling.py
@@ -16,10 +16,10 @@ timezone and only rewrites the job when it actually differs — re-adding an
existing cron would reset a pending ``next_run_time`` and drop that day's
briefing.
-**Hot-path cost.** This helper runs on every chat turn. The LaunchDarkly
-gate runs first (in-process cached), then the Redis marker short-circuits
-the rest. Only the first call after the marker expires pays for the
-timezone lookup (a DB read) and the scheduler RPC.
+**Hot-path cost.** This helper runs on every chat turn. A Redis marker read
+short-circuits the common case before any timezone lookup or scheduler RPC.
+Without a marker, it resolves the timezone (a DB read), registers the cron,
+and writes the marker.
Failures are logged at WARN and swallowed — ``ensure_morning_briefing_scheduled``
is fired via ``asyncio.create_task`` from the hot chat-stream request path
@@ -33,7 +33,6 @@ import logging
from backend.data.db_accessors import user_db
from backend.data.model import USER_TIMEZONE_NOT_SET
from backend.data.redis_client import get_redis_async
-from backend.util.feature_flag import Flag, is_feature_enabled
logger = logging.getLogger(__name__)
@@ -180,8 +179,6 @@ async def ensure_morning_briefing_scheduled(user_id: str) -> None:
try:
if not user_id:
return
- if not await is_feature_enabled(Flag.HIRE_EXPERTS, user_id, default=False):
- return
# Marker next: one Redis GET is the rest of the cost of the common
# case. Resolving the timezone is a DB read, and this runs on
@@ -197,9 +194,7 @@ async def ensure_morning_briefing_scheduled(user_id: str) -> None:
# resolves the real timezone.
return
- # Lazy client handle, mirroring dream/scheduling.py: a flag-off
- # user never even constructs the scheduler client, and the lazy
- # import avoids a circular import during process bootstrap.
+ # The lazy import avoids a circular import during process bootstrap.
from backend.util.clients import get_scheduler_client
await get_scheduler_client().add_morning_briefing_schedule(
diff --git a/autogpt_platform/backend/backend/copilot/briefing/scheduling_test.py b/autogpt_platform/backend/backend/copilot/briefing/scheduling_test.py
index a783905eea..b244d98f34 100644
--- a/autogpt_platform/backend/backend/copilot/briefing/scheduling_test.py
+++ b/autogpt_platform/backend/backend/copilot/briefing/scheduling_test.py
@@ -3,8 +3,7 @@
Single-job counterpart to ``backend/copilot/dream/scheduling_test.py``.
Contracts pinned here:
- 1. Empty ``user_id`` → no-op, no flag check, no RPC.
- 2. Flag off → no-op, no timezone lookup, no RPC.
+ 1. Empty ``user_id`` → no-op, no RPC.
3. Timezone lookup failure is "unknown", not "UTC" — skip the cycle
rather than risk re-registering onto UTC.
4. First call (no marker) registers the cron and writes the marker.
@@ -39,7 +38,6 @@ from .scheduling import (
# Paths used by the helper — patched at the module level since the helper
# does lazy imports of the scheduler client + Redis client to avoid
# bootstrap circular imports (same pattern as backend/copilot/dream).
-_PATH_FLAG = "backend.copilot.briefing.scheduling.is_feature_enabled"
_PATH_TZ = "backend.copilot.briefing.scheduling._resolve_user_timezone"
_PATH_READ_TZ = "backend.copilot.briefing.scheduling._read_registration_marker"
_PATH_WRITE_TZ = "backend.copilot.briefing.scheduling._write_registration_marker"
@@ -70,31 +68,17 @@ def _mock_scheduler_client(*, fail: bool = False) -> MagicMock:
@pytest.mark.asyncio
async def test_empty_user_id_no_op():
- flag_mock = AsyncMock(return_value=True)
- with patch(_PATH_FLAG, new=flag_mock):
+ with patch(_PATH_TZ, new=AsyncMock()) as lookup, patch(_PATH_CLIENT) as client:
await ensure_morning_briefing_scheduled("")
-
- flag_mock.assert_not_called()
+ lookup.assert_not_awaited()
+ client.assert_not_called()
# ---------------------------------------------------------------------------
-# Flag gate
+# Registration prerequisites
# ---------------------------------------------------------------------------
-async def test_flag_off_no_op():
- client = _mock_scheduler_client()
- tz_mock = AsyncMock(return_value="UTC")
- with patch(_PATH_FLAG, new=AsyncMock(return_value=False)), patch(
- _PATH_TZ, new=tz_mock
- ), patch(_PATH_CLIENT, return_value=client):
- await ensure_morning_briefing_scheduled("abc")
-
- tz_mock.assert_not_called()
- client.add_morning_briefing_schedule.assert_not_called()
-
-
# ---------------------------------------------------------------------------
# Timezone lookup failure — "unknown" must not become "UTC"
# ---------------------------------------------------------------------------
@@ -104,12 +88,11 @@ async def test_flag_off_no_op():
async def test_timezone_lookup_failure_skips_registration():
client = _mock_scheduler_client()
write_spy = AsyncMock()
- with patch(_PATH_FLAG, new=AsyncMock(return_value=True)), patch(
- _PATH_TZ, new=AsyncMock(return_value=None)
- ), patch(_PATH_READ_TZ, new=AsyncMock(return_value=None)), patch(
- _PATH_WRITE_TZ, new=write_spy
- ), patch(
- _PATH_CLIENT, return_value=client
+ with (
+ patch(_PATH_TZ, new=AsyncMock(return_value=None)),
+ patch(_PATH_READ_TZ, new=AsyncMock(return_value=None)),
+ patch(_PATH_WRITE_TZ, new=write_spy),
+ patch(_PATH_CLIENT, return_value=client),
):
await ensure_morning_briefing_scheduled("abc")
@@ -126,12 +109,11 @@ async def test_timezone_lookup_failure_skips_registration():
async def test_first_call_registers_and_writes_marker():
client = _mock_scheduler_client()
write_spy = AsyncMock()
- with patch(_PATH_FLAG, new=AsyncMock(return_value=True)), patch(
- _PATH_TZ, new=AsyncMock(return_value="America/New_York")
- ), patch(_PATH_READ_TZ, new=AsyncMock(return_value=None)), patch(
- _PATH_WRITE_TZ, new=write_spy
- ), patch(
- _PATH_CLIENT, return_value=client
+ with (
+ patch(_PATH_TZ, new=AsyncMock(return_value="America/New_York")),
+ patch(_PATH_READ_TZ, new=AsyncMock(return_value=None)),
+ patch(_PATH_WRITE_TZ, new=write_spy),
+ patch(_PATH_CLIENT, return_value=client),
):
await ensure_morning_briefing_scheduled("abc")
@@ -150,10 +132,10 @@ async def test_first_call_registers_and_writes_marker():
async def test_existing_marker_skips_timezone_lookup_and_registration():
client = _mock_scheduler_client()
tz_mock = AsyncMock(return_value="America/New_York")
- with patch(_PATH_FLAG, new=AsyncMock(return_value=True)), patch(
- _PATH_TZ, new=tz_mock
- ), patch(_PATH_READ_TZ, new=AsyncMock(return_value="America/New_York")), patch(
- _PATH_CLIENT, return_value=client
+ with (
+ patch(_PATH_TZ, new=tz_mock),
+ patch(_PATH_READ_TZ, new=AsyncMock(return_value="America/New_York")),
+ patch(_PATH_CLIENT, return_value=client),
):
await ensure_morning_briefing_scheduled("abc")
@@ -170,12 +152,11 @@ async def test_existing_marker_skips_timezone_lookup_and_registration():
async def test_cleared_marker_reregisters_on_current_timezone():
client = _mock_scheduler_client()
write_spy = AsyncMock()
- with patch(_PATH_FLAG, new=AsyncMock(return_value=True)), patch(
- _PATH_TZ, new=AsyncMock(return_value="Europe/Paris")
- ), patch(_PATH_READ_TZ, new=AsyncMock(return_value=None)), patch(
- _PATH_WRITE_TZ, new=write_spy
- ), patch(
- _PATH_CLIENT, return_value=client
+ with (
+ patch(_PATH_TZ, new=AsyncMock(return_value="Europe/Paris")),
+ patch(_PATH_READ_TZ, new=AsyncMock(return_value=None)),
+ patch(_PATH_WRITE_TZ, new=write_spy),
+ patch(_PATH_CLIENT, return_value=client),
):
await ensure_morning_briefing_scheduled("abc")
@@ -193,28 +174,18 @@ async def test_cleared_marker_reregisters_on_current_timezone():
@pytest.mark.asyncio
async def test_scheduler_rpc_failure_is_swallowed_and_logged(caplog):
client = _mock_scheduler_client(fail=True)
- with patch(_PATH_FLAG, new=AsyncMock(return_value=True)), patch(
- _PATH_TZ, new=AsyncMock(return_value="UTC")
- ), patch(_PATH_READ_TZ, new=AsyncMock(return_value=None)), patch(
- _PATH_WRITE_TZ, new=AsyncMock()
- ), patch(
- _PATH_CLIENT, return_value=client
- ), caplog.at_level(
- logging.WARNING, logger=scheduling.logger.name
+ with (
+ patch(_PATH_TZ, new=AsyncMock(return_value="UTC")),
+ patch(_PATH_READ_TZ, new=AsyncMock(return_value=None)),
+ patch(_PATH_WRITE_TZ, new=AsyncMock()),
+ patch(_PATH_CLIENT, return_value=client),
+ caplog.at_level(logging.WARNING, logger=scheduling.logger.name),
):
await ensure_morning_briefing_scheduled("abc") # must not raise
assert any(r.levelno == logging.WARNING for r in caplog.records)
-async def test_unexpected_flag_check_error_is_swallowed():
- with patch(
- _PATH_FLAG, new=AsyncMock(side_effect=ConnectionError("LD unreachable"))
- ):
- await ensure_morning_briefing_scheduled("abc") # must not raise
-
-
# ---------------------------------------------------------------------------
# _resolve_user_timezone — copied logic, behaviors pinned
# ---------------------------------------------------------------------------
diff --git a/autogpt_platform/backend/backend/copilot/dream/registry.py b/autogpt_platform/backend/backend/copilot/dream/registry.py
index fe55c77f5d..82d05a423d 100644
--- a/autogpt_platform/backend/backend/copilot/dream/registry.py
+++ b/autogpt_platform/backend/backend/copilot/dream/registry.py
@@ -79,6 +79,7 @@ async def ensure_scope_scheduled(
was already registered (no RPC made), ``{"skipped": True, "reason": ...}``
when it was not registered (flag off, ``scope_paused``, ``scope_wiped``,
``scope_changed``, ``timezone_lookup_failed``, ``registry_unavailable``,
+ ``flag_unavailable``,
``registration_failed``, ``record_failed``), otherwise the scheduler's
own result.
"""
@@ -102,7 +103,7 @@ async def ensure_scope_scheduled(
# can read the real timezone.
return results | skip_all(enabled, "timezone_lookup_failed")
return results | await register_scope_jobs(
- scope, enabled, row, user_timezone, force_refresh
+ scope, enabled, row, user_timezone, force_refresh, results
)
@@ -204,9 +205,9 @@ async def reregister_user(user_id: str) -> dict[str, dict[str, Any]]:
The account always goes through, row or not: its crons may predate the
registry and still run in the old timezone. Each expert with a row
follows: paused ones are skipped and take the new timezone when they
- resume, wiped ones are skipped for good. An owner with every dream flag
- off costs no database call, as with :func:`ensure_scope_scheduled`.
- Keyed by scope key.
+ resume, wiped ones are skipped for good. Community maintenance remains
+ scheduled independently of the dream and skill-learning flags. Keyed by
+ scope key.
"""
try:
account = MemoryScope.for_user(user_id)
diff --git a/autogpt_platform/backend/backend/copilot/dream/registry_backfill_test.py b/autogpt_platform/backend/backend/copilot/dream/registry_backfill_test.py
index 213dd74bb2..8538a90587 100644
--- a/autogpt_platform/backend/backend/copilot/dream/registry_backfill_test.py
+++ b/autogpt_platform/backend/backend/copilot/dream/registry_backfill_test.py
@@ -18,8 +18,8 @@ from .registry_backfill import BackfillFailure, BackfillReport, backfill_schedul
REGISTERED = {"community_rebuild": {"id": "c"}, "dream_nightly_batch": {"id": "n"}}
ALREADY = {"community_rebuild": None, "dream_nightly_batch": None}
-FLAGS_OFF = {
- "community_rebuild": {"skipped": True, "reason": "graphiti_communities_disabled"},
+STOPPED = {
+ "community_rebuild": {"skipped": True, "reason": "scope_paused"},
"dream_nightly_batch": {"skipped": True, "reason": "dream_pass_disabled"},
}
FAILED = {
@@ -188,7 +188,7 @@ async def test_force_re_registers_every_scope(backfill):
@pytest.mark.asyncio
async def test_outcomes_are_counted_per_scope(backfill):
- backfill.ensure.side_effect = [FLAGS_OFF, FAILED]
+ backfill.ensure.side_effect = [STOPPED, FAILED]
backfill.pause.return_value = False
report = await backfill_schedules()
@@ -282,9 +282,9 @@ def test_classify_puts_failure_before_any_success():
assert registry_backfill._classify(REGISTERED) == "registered"
assert registry_backfill._classify(FAILED) == "failed"
assert registry_backfill._classify(ALREADY) == "already_scheduled"
- assert registry_backfill._classify(FLAGS_OFF) == "skipped"
+ assert registry_backfill._classify(STOPPED) == "skipped"
partly = {
"community_rebuild": None,
- "dream_nightly_batch": FLAGS_OFF["dream_nightly_batch"],
+ "dream_nightly_batch": STOPPED["dream_nightly_batch"],
}
assert registry_backfill._classify(partly) == "already_scheduled"
diff --git a/autogpt_platform/backend/backend/copilot/dream/registry_deadline_test.py b/autogpt_platform/backend/backend/copilot/dream/registry_deadline_test.py
index 0cbb51ed19..0f40df12b1 100644
--- a/autogpt_platform/backend/backend/copilot/dream/registry_deadline_test.py
+++ b/autogpt_platform/backend/backend/copilot/dream/registry_deadline_test.py
@@ -161,7 +161,7 @@ async def test_a_slow_resume_is_cut_off_as_a_whole_not_per_call(env, monkeypatch
(env.db, "record_scope_jobs"),
(env.scheduler, "add_scope_community_rebuild_schedule"),
(env.scheduler, "add_scope_nightly_batch_schedule"),
- (scope_jobs, "is_feature_enabled"),
+ (scope_jobs, "evaluate_feature_flag"),
(registry, "resolve_user_timezone"),
):
monkeypatch.setattr(owner, name, _slowed(getattr(owner, name), step))
@@ -184,14 +184,17 @@ def _slowed(call: Callable[..., Awaitable[Any]], seconds: float):
@pytest.mark.asyncio
async def test_a_new_expert_registration_is_bounded_when_flags_hang(env, monkeypatch):
hang = Hang()
- monkeypatch.setattr(scope_jobs, "is_feature_enabled", hang.forever)
+ monkeypatch.setattr(scope_jobs, "evaluate_feature_flag", hang.forever)
started = time.monotonic()
await registry.ensure_expert_scheduled(USER, "expert-1")
assert time.monotonic() - started < PROMPT
- assert hang.started == hang.cancelled == 2
- assert env.db.rows == {}
+ assert hang.started == hang.cancelled == 1
+ assert env.db.rows[EXPERT.scope_key].community_job_id == (
+ f"community_rebuild_{EXPERT.scope_key}"
+ )
+ assert env.db.rows[EXPERT.scope_key].nightly_job_id is None
@pytest.mark.asyncio
diff --git a/autogpt_platform/backend/backend/copilot/dream/registry_fakes_test.py b/autogpt_platform/backend/backend/copilot/dream/registry_fakes_test.py
index ed0804d09d..df18b4f283 100644
--- a/autogpt_platform/backend/backend/copilot/dream/registry_fakes_test.py
+++ b/autogpt_platform/backend/backend/copilot/dream/registry_fakes_test.py
@@ -269,7 +269,6 @@ class RegistryEnv:
self.scheduler = FakeScheduler()
self.crons = FakeCronStore(self.scheduler)
self.flags = {
- Flag.GRAPHITI_COMMUNITIES_ENABLED: True,
Flag.DREAM_PASS_ENABLED: True,
}
self.timezone: str | None = PARIS
@@ -290,8 +289,8 @@ def install_registry_env(monkeypatch: pytest.MonkeyPatch) -> RegistryEnv:
"""Point the registry modules at a fresh set of fakes."""
env = RegistryEnv()
- async def flag(flag: Flag, user_id: str) -> bool:
- return env.flags.get(flag, False)
+ async def flag(flag: Flag, user_id: str) -> tuple[bool, bool]:
+ return env.flags.get(flag, False), True
async def owner_timezone(user_id: str) -> str | None:
return env.timezone
@@ -299,7 +298,7 @@ def install_registry_env(monkeypatch: pytest.MonkeyPatch) -> RegistryEnv:
for module in (registry, scope_jobs, scope_crons, scope_reconcile):
monkeypatch.setattr(module, "memory_schedule_db", lambda: env.db)
monkeypatch.setattr(scope_jobs, "get_scheduler_client", lambda: env.scheduler)
- monkeypatch.setattr(scope_jobs, "is_feature_enabled", flag)
+ monkeypatch.setattr(scope_jobs, "evaluate_feature_flag", flag)
monkeypatch.setattr(registry, "resolve_user_timezone", owner_timezone)
# Every walk starts at the first scope, so a test sees key order.
monkeypatch.setattr(scope_reconcile._Place, "last", "")
diff --git a/autogpt_platform/backend/backend/copilot/dream/registry_flag_off_test.py b/autogpt_platform/backend/backend/copilot/dream/registry_flag_off_test.py
index c36ea10cc0..f9a5e08bf0 100644
--- a/autogpt_platform/backend/backend/copilot/dream/registry_flag_off_test.py
+++ b/autogpt_platform/backend/backend/copilot/dream/registry_flag_off_test.py
@@ -2,8 +2,7 @@
the scope's recorded crons in place, and pause or wipe removes them. Their
bodies check the flag at run time and do nothing; the scheduler's tests pin
that (``TestSkillLearningScopeGate::test_the_flag_off_still_short_circuits``,
-``TestExecuteNightlyBatchSyncRuntimeGate``,
-``TestExecuteCommunityRebuildRuntimeGate``). Cleaning them up on flag-off
+``TestExecuteNightlyBatchSyncRuntimeGate``). Cleaning them up on flag-off
needs generation-aware intent, which is left for later.
Fakes come from ``registry_fakes_test.py``.
@@ -44,9 +43,7 @@ def env(monkeypatch: pytest.MonkeyPatch) -> RegistryEnv:
@pytest.mark.asyncio
async def test_turning_learning_off_leaves_its_cron_recorded(env):
- """A learning-only account: the ensure after the flag went off returns
- before it reads the row, and the reconcile keeps the cron the row
- records."""
+ """Community maintenance does not erase the recorded learning cron."""
await registry.ensure_scope_scheduled(ACCOUNT)
env.flags[LEARN] = False
@@ -58,7 +55,7 @@ async def test_turning_learning_off_leaves_its_cron_recorded(env):
}
assert env.db.rows[USER].learning_job_id == LEARNING
reports = [await env.reconcile() for _ in range(3)]
- assert env.scheduler.jobs == {LEARNING: PARIS}
+ assert env.scheduler.jobs == {f"community_rebuild_{USER}": PARIS, LEARNING: PARIS}
assert all(
not (report.dropped or report.removed or report.restored) for report in reports
)
@@ -74,12 +71,16 @@ async def test_turning_learning_off_with_the_dream_on_leaves_both_recorded(env):
row = env.db.rows[USER]
assert (row.nightly_job_id, row.learning_job_id) == (NIGHTLY, LEARNING)
- assert env.scheduler.jobs == {NIGHTLY: PARIS, LEARNING: PARIS}
+ assert env.scheduler.jobs == {
+ f"community_rebuild_{USER}": PARIS,
+ NIGHTLY: PARIS,
+ LEARNING: PARIS,
+ }
@pytest.mark.asyncio
async def test_turning_the_dream_off_leaves_an_experts_crons_recorded(env):
- env.flags = {DREAM: True, Flag.GRAPHITI_COMMUNITIES_ENABLED: True}
+ env.flags = {DREAM: True}
await registry.ensure_scope_scheduled(EXPERT)
env.flags = {}
@@ -106,7 +107,7 @@ async def test_a_stop_removes_the_crons_of_a_flag_turned_off(env, state):
@pytest.mark.asyncio
-async def test_every_flag_off_costs_no_database_call(env):
+async def test_other_flags_off_preserves_learning_when_registry_is_unavailable(env):
await registry.ensure_scope_scheduled(ACCOUNT)
env.flags = {}
env.db.fail = True
@@ -114,7 +115,7 @@ async def test_every_flag_off_costs_no_database_call(env):
result = await registry.ensure_scope_scheduled(ACCOUNT)
assert {r["reason"] for r in result.values()} == {
- "graphiti_communities_disabled",
+ "registry_unavailable",
"dream_pass_disabled",
"skill_learning_disabled",
}
diff --git a/autogpt_platform/backend/backend/copilot/dream/registry_learning_test.py b/autogpt_platform/backend/backend/copilot/dream/registry_learning_test.py
index fbcdb27cc8..982a43be9e 100644
--- a/autogpt_platform/backend/backend/copilot/dream/registry_learning_test.py
+++ b/autogpt_platform/backend/backend/copilot/dream/registry_learning_test.py
@@ -52,7 +52,7 @@ async def test_learning_alone_registers_and_records_the_accounts_cron(env):
"skipped": True,
"reason": "dream_pass_disabled",
}
- assert env.scheduler.jobs == {LEARNING: PARIS}
+ assert env.scheduler.jobs == {f"community_rebuild_{USER}": PARIS, LEARNING: PARIS}
row = env.db.rows[USER]
assert (row.state, row.learning_job_id, row.nightly_job_id) == (
ACTIVE,
@@ -186,7 +186,7 @@ async def test_a_timezone_change_reaches_an_owner_with_only_learning_on(env):
results = await registry.reregister_user(USER)
assert results[USER]["skill_learning_nightly"]["id"] == LEARNING
- assert env.scheduler.jobs == {LEARNING: TOKYO}
+ assert env.scheduler.jobs == {f"community_rebuild_{USER}": TOKYO, LEARNING: TOKYO}
def _backfill_finds(monkeypatch: pytest.MonkeyPatch, learning_owners: list[str]):
@@ -229,7 +229,7 @@ async def test_the_backfill_adopts_a_graphless_accounts_legacy_learning_cron(
assert (report.accounts, report.learning_accounts) == (1, 1)
assert env.db.rows[USER].learning_job_id == LEARNING
- assert env.scheduler.jobs == {LEARNING: PARIS}
+ assert env.scheduler.jobs == {f"community_rebuild_{USER}": PARIS, LEARNING: PARIS}
@pytest.mark.asyncio
diff --git a/autogpt_platform/backend/backend/copilot/dream/registry_lifecycle_test.py b/autogpt_platform/backend/backend/copilot/dream/registry_lifecycle_test.py
index 9e7cb23ac0..ead5ec0bba 100644
--- a/autogpt_platform/backend/backend/copilot/dream/registry_lifecycle_test.py
+++ b/autogpt_platform/backend/backend/copilot/dream/registry_lifecycle_test.py
@@ -245,7 +245,7 @@ async def test_a_resume_that_cannot_write_the_row_reports_only_enabled_crons_fai
"""The backfill lists every cron a resume reports unavailable as a
failure: a cron the owner's flags turn off is reported as its flag says,
as an ensure would, not as a failure."""
- env.flags[Flag.GRAPHITI_COMMUNITIES_ENABLED] = False
+ env.flags[Flag.DREAM_PASS_ENABLED] = False
monkeypatch.setattr(
env.db, "set_scope_state", AsyncMock(side_effect=ConnectionError("db down"))
)
@@ -255,9 +255,9 @@ async def test_a_resume_that_cannot_write_the_row_reports_only_enabled_crons_fai
assert resumed == {
"community_rebuild": {
"skipped": True,
- "reason": "graphiti_communities_disabled",
+ "reason": "registry_unavailable",
},
- "dream_nightly_batch": {"skipped": True, "reason": "registry_unavailable"},
+ "dream_nightly_batch": {"skipped": True, "reason": "dream_pass_disabled"},
}
@@ -339,7 +339,7 @@ async def test_timezone_change_re_registers_every_active_scope(env):
@pytest.mark.asyncio
-async def test_timezone_change_of_a_flag_off_owner_costs_no_database_call(env):
+async def test_timezone_change_still_requires_the_community_registry(env):
env.flags = {}
env.db.fail = True # any read would raise
@@ -347,7 +347,7 @@ async def test_timezone_change_of_a_flag_off_owner_costs_no_database_call(env):
assert set(results) == {USER}
assert {r["reason"] for r in results[USER].values()} == {
- "graphiti_communities_disabled",
+ "registry_unavailable",
"dream_pass_disabled",
"skill_learning_disabled",
}
diff --git a/autogpt_platform/backend/backend/copilot/dream/registry_test.py b/autogpt_platform/backend/backend/copilot/dream/registry_test.py
index 475d8b95ad..0abf4c17c6 100644
--- a/autogpt_platform/backend/backend/copilot/dream/registry_test.py
+++ b/autogpt_platform/backend/backend/copilot/dream/registry_test.py
@@ -15,7 +15,7 @@ import pytest
from backend.util.feature_flag import Flag
-from . import registry, scope_crons, scope_jobs
+from . import registry, registry_backfill, scope_crons, scope_jobs
from .registry_fakes_test import (
ACCOUNT,
ACTIVE,
@@ -35,6 +35,63 @@ def env(monkeypatch: pytest.MonkeyPatch) -> RegistryEnv:
return install_registry_env(monkeypatch)
+async def test_community_registers_without_a_flag_provider(env, monkeypatch):
+ flag = AsyncMock(return_value=(False, False))
+ monkeypatch.setattr(scope_jobs, "evaluate_feature_flag", flag)
+ env.flags = {}
+
+ result = await registry.ensure_scope_scheduled(ACCOUNT)
+
+ assert result["community_rebuild"]["id"] == f"community_rebuild_{USER}"
+ assert env.db.rows[USER].nightly_job_id is None
+ assert env.db.rows[USER].learning_job_id is None
+ assert result["dream_nightly_batch"]["reason"] == "flag_unavailable"
+ assert result["skill_learning_nightly"]["reason"] == "flag_unavailable"
+ assert registry_backfill._classify(result) == "registered"
+ assert [call.args[0] for call in flag.await_args_list] == [
+ Flag.DREAM_PASS_ENABLED,
+ Flag.DREAM_SKILL_LEARNING_ENABLED,
+ ]
+
+
[email protected]("provider_raises", [False, True])
+async def test_community_refresh_preserves_unknown_dream_and_learning_intent(
+ env, monkeypatch, provider_raises
+):
+ env.flags[Flag.DREAM_SKILL_LEARNING_ENABLED] = True
+ await registry.ensure_scope_scheduled(ACCOUNT)
+ for job_id in (f"dream_nightly_batch_{USER}", f"skill_learning_nightly_{USER}"):
+ del env.scheduler.jobs[job_id]
+ del env.scheduler.scopes[job_id]
+ await env.reconcile()
+ assert len(env.scheduler.tagged) == 2
+ env.timezone = TOKYO
+ monkeypatch.setattr(
+ scope_jobs,
+ "evaluate_feature_flag",
+ AsyncMock(
+ return_value=(False, False),
+ side_effect=(
+ RuntimeError("provider unavailable") if provider_raises else None
+ ),
+ ),
+ )
+ env.flags = {}
+
+ result = await registry.ensure_scope_scheduled(ACCOUNT, force_refresh=True)
+
+ row = env.db.rows[USER]
+ assert result["dream_nightly_batch"]["reason"] == "flag_unavailable"
+ assert result["skill_learning_nightly"]["reason"] == "flag_unavailable"
+ assert row.nightly_job_id == f"dream_nightly_batch_{USER}"
+ assert row.learning_job_id == f"skill_learning_nightly_{USER}"
+ report = await env.reconcile()
+ assert report.dropped == []
+ assert set(env.scheduler.jobs.values()) == {TOKYO}
+
+
@pytest.mark.asyncio
async def test_ensure_registers_both_crons_under_the_legacy_account_ids(env):
result = await registry.ensure_scope_scheduled(ACCOUNT)
@@ -88,7 +145,7 @@ async def test_an_expert_write_registers_the_expert_not_the_account(env):
@pytest.mark.asyncio
-async def test_flags_off_cost_no_read_and_no_rpc(env):
+async def test_other_flags_off_still_requires_community_registry(env):
env.flags = {}
env.db.fail = True # any read would raise
@@ -97,7 +154,7 @@ async def test_flags_off_cost_no_read_and_no_rpc(env):
assert result == {
"community_rebuild": {
"skipped": True,
- "reason": "graphiti_communities_disabled",
+ "reason": "registry_unavailable",
},
"dream_nightly_batch": {"skipped": True, "reason": "dream_pass_disabled"},
"skill_learning_nightly": {
@@ -110,13 +167,13 @@ async def test_flags_off_cost_no_read_and_no_rpc(env):
@pytest.mark.asyncio
async def test_one_flag_off_still_registers_the_other(env):
- env.flags[Flag.GRAPHITI_COMMUNITIES_ENABLED] = False
+ env.flags[Flag.DREAM_PASS_ENABLED] = False
result = await registry.ensure_scope_scheduled(ACCOUNT)
- assert result["community_rebuild"]["reason"] == "graphiti_communities_disabled"
- assert env.db.rows[USER].nightly_job_id == f"dream_nightly_batch_{USER}"
- assert env.db.rows[USER].community_job_id is None
+ assert result["dream_nightly_batch"]["reason"] == "dream_pass_disabled"
+ assert env.db.rows[USER].community_job_id == f"community_rebuild_{USER}"
+ assert env.db.rows[USER].nightly_job_id is None
@pytest.mark.asyncio
diff --git a/autogpt_platform/backend/backend/copilot/dream/scheduling.py b/autogpt_platform/backend/backend/copilot/dream/scheduling.py
index b391790325..8065bc9f37 100644
--- a/autogpt_platform/backend/backend/copilot/dream/scheduling.py
+++ b/autogpt_platform/backend/backend/copilot/dream/scheduling.py
@@ -20,14 +20,10 @@ is ``registry.py``'s job; this module only says what the crons are. Adding a
future cron (P8 cross-scope insight, ...) is a row in
:data:`DREAM_SYSTEM_JOBS` plus a job-id column on ``MemoryScopeSchedule``.
-Three layers of flag gating, all on the scope owner's flags:
-
- 1. **Registry** — the cheapest gate; runs before any database read, so
- a flag-off user costs neither a query nor a scheduler RPC.
- 2. **Scheduler ``@expose`` method** — defense-in-depth for direct
- callers (admin endpoint, ad-hoc scripts) that bypass the registry.
- 3. **Job body** — if the flag flips off after registration, the job
- still fires but short-circuits before the work runs.
+Community rebuilds are part of memory maintenance. Dream passes and skill
+learning retain their independent flags, checked by the registry, scheduler
+registration methods and job bodies. Every cron still checks scope lifecycle
+and owner restrictions before running.
"""
from __future__ import annotations
@@ -71,8 +67,8 @@ class DreamSystemJob:
job_id_prefix: str
"""Job ids are ``f"{job_id_prefix}_{scope_key}"``."""
- flag: Flag
- """LD feature flag gate, evaluated for the scope's owner."""
+ flag: Flag | None
+ """Optional feature flag gate, evaluated for the scope's owner."""
skip_reason: str
"""The ``reason`` recorded when the flag is off, so "why does this scope
@@ -128,8 +124,8 @@ DREAM_SYSTEM_JOBS: list[DreamSystemJob] = [
DreamSystemJob(
name="Community rebuild",
job_id_prefix=COMMUNITY_REBUILD_JOB_PREFIX,
- flag=Flag.GRAPHITI_COMMUNITIES_ENABLED,
- skip_reason="graphiti_communities_disabled",
+ flag=None,
+ skip_reason="",
row_field="community_job_id",
register=_register_community_rebuild,
),
diff --git a/autogpt_platform/backend/backend/copilot/dream/scheduling_test.py b/autogpt_platform/backend/backend/copilot/dream/scheduling_test.py
index 7ce1cfbc3e..b451d58c36 100644
--- a/autogpt_platform/backend/backend/copilot/dream/scheduling_test.py
+++ b/autogpt_platform/backend/backend/copilot/dream/scheduling_test.py
@@ -3,7 +3,7 @@
Contracts pinned here:
1. Table shape — 3 rows (community, nightly batch, skill learning),
- distinct flags, distinct registry columns; skill learning is the
+ distinct registry columns; community maintenance has no flag and skill learning is the
account's alone.
2. Job ids are keyed by scope, and the account's are the per-user ids
the crons had before they were per scope.
@@ -62,13 +62,8 @@ def test_each_job_has_its_own_registry_column():
assert fields == ["community_job_id", "nightly_job_id", "learning_job_id"]
-def test_community_and_nightly_batch_have_distinct_flags():
- """Community rebuild and nightly batch are independent features
- behind separate LD flags. A user can have one enabled without
- the other. (Skill learning's own flag is pinned below.)"""
- assert dream_system_job("community_rebuild").flag == (
- Flag.GRAPHITI_COMMUNITIES_ENABLED
- )
+def test_community_is_ungated_and_nightly_batch_keeps_its_flag():
+ assert dream_system_job("community_rebuild").flag is None
assert dream_system_job("dream_nightly_batch").flag == Flag.DREAM_PASS_ENABLED
diff --git a/autogpt_platform/backend/backend/copilot/dream/scope_jobs.py b/autogpt_platform/backend/backend/copilot/dream/scope_jobs.py
index 465d0278e0..1a3a6a51f9 100644
--- a/autogpt_platform/backend/backend/copilot/dream/scope_jobs.py
+++ b/autogpt_platform/backend/backend/copilot/dream/scope_jobs.py
@@ -24,7 +24,7 @@ from backend.copilot.graphiti.scope import MemoryScope
from backend.data.db_accessors import memory_schedule_db
from backend.data.memory_schedule import MemoryScopeSchedule
from backend.util.clients import get_scheduler_client
-from backend.util.feature_flag import is_feature_enabled
+from backend.util.feature_flag import evaluate_feature_flag
from .deadline import within_deadline
from .scheduling import DREAM_SYSTEM_JOBS, DreamSystemJob, jobs_for
@@ -38,13 +38,19 @@ async def flag_gate(scope: MemoryScope) -> tuple[dict[str, Any], list[DreamSyste
results: dict[str, Any] = {}
enabled: list[DreamSystemJob] = []
for job in jobs_for(scope):
+ if job.flag is None:
+ enabled.append(job)
+ continue
try:
- on = await within_deadline(
- is_feature_enabled(job.flag, scope.owner_user_id)
+ on, authoritative = await within_deadline(
+ evaluate_feature_flag(job.flag, scope.owner_user_id)
)
except Exception:
logger.warning(f"Flag check failed for {job.name}", exc_info=True)
- results[job.job_id_prefix] = skipped("registration_failed")
+ results[job.job_id_prefix] = skipped("flag_unavailable")
+ continue
+ if not authoritative:
+ results[job.job_id_prefix] = skipped("flag_unavailable")
continue
if on:
enabled.append(job)
@@ -59,6 +65,7 @@ async def register_scope_jobs(
row: MemoryScopeSchedule | None,
user_timezone: str,
force_refresh: bool,
+ skipped_jobs: dict[str, Any],
) -> dict[str, Any]:
"""Claim the scope's row if it has none, register every enabled cron
that is missing or was registered in another timezone, and record the
@@ -74,7 +81,7 @@ async def register_scope_jobs(
failure = await _record_timezone(scope, row, user_timezone)
if failure is not None:
return skip_all(enabled, failure)
- outcomes: dict[str, Any] = {}
+ outcomes: dict[str, Any] = dict(skipped_jobs)
for job in enabled:
if not stale and recorded_job_id(row, job) is not None:
outcomes[job.job_id_prefix] = None
@@ -244,7 +251,10 @@ def _next_job_id(
"""Keep failed registration intent so reconciliation can retry it."""
if _registered(outcome):
return outcome["id"]
- if outcome and outcome.get("reason") == "registration_failed":
+ if outcome and outcome.get("reason") in (
+ "registration_failed",
+ "flag_unavailable",
+ ):
return recorded_job_id(row, job)
return None if stale else recorded_job_id(row, job)
diff --git a/autogpt_platform/backend/backend/copilot/dream/scope_reconcile_jobstore_test.py b/autogpt_platform/backend/backend/copilot/dream/scope_reconcile_jobstore_test.py
index 9edf5f6959..02f5f97b66 100644
--- a/autogpt_platform/backend/backend/copilot/dream/scope_reconcile_jobstore_test.py
+++ b/autogpt_platform/backend/backend/copilot/dream/scope_reconcile_jobstore_test.py
@@ -640,7 +640,8 @@ async def test_a_take_back_racing_a_new_registration_is_repaired_next_pass(
report = await asyncio.wait_for(scope_reconcile.reconcile(crons), TIMEOUT)
- assert report.restored == [learning]
+ assert report.restored == [_COMMUNITY, learning]
+ assert str(_job(service, _COMMUNITY).trigger.timezone) == TOKYO
restored = _job(service, learning)
assert str(restored.trigger.timezone) == TOKYO
assert env.db.rows[USER].learning_job_id == learning
diff --git a/autogpt_platform/backend/backend/copilot/dream/scope_reconcile_test.py b/autogpt_platform/backend/backend/copilot/dream/scope_reconcile_test.py
index 9df05bbfe6..7d4f340237 100644
--- a/autogpt_platform/backend/backend/copilot/dream/scope_reconcile_test.py
+++ b/autogpt_platform/backend/backend/copilot/dream/scope_reconcile_test.py
@@ -169,8 +169,9 @@ async def test_a_pass_registers_what_the_row_records_and_reads_no_flag(
env.db.update(EXPERT.scope_key, community_job_id=None)
env.db.update(OTHER_EXPERT.scope_key, community_job_id=None, nightly_job_id=None)
_lose_every_cron(env)
- flags = AsyncMock(return_value=False)
- monkeypatch.setattr(scope_jobs, "is_feature_enabled", flags)
+ flags = AsyncMock(return_value=(False, True))
+ monkeypatch.setattr(scope_jobs, "evaluate_feature_flag", flags)
+ monkeypatch.setattr(scope_reconcile, "evaluate_feature_flag", flags, raising=False)
report = await env.reconcile()
diff --git a/autogpt_platform/backend/backend/copilot/eval/style/assembly.py b/autogpt_platform/backend/backend/copilot/eval/style/assembly.py
index 64f8fa3c90..356c9030da 100644
--- a/autogpt_platform/backend/backend/copilot/eval/style/assembly.py
+++ b/autogpt_platform/backend/backend/copilot/eval/style/assembly.py
@@ -50,10 +50,8 @@ BASELINE_PATH = STYLE_DIR / "baseline.json"
# runs under, the judge's own prompt, and the rules that decide which rows are
# scored at all.
HARNESS_MODULES = ("generation.py", "runner.py", "scorer.py")
-# The state every scored turn is sent in. An expert exists only because
-# hire-experts was on when it was hired, so that is the state its writing is
-# measured in; turning the flag off afterwards leaves a session this check
-# does not cover, which the baseline records rather than implies.
+# Historical score files record this field; authenticated expert sessions
+# always have delegation available.
DELEGATION_ENABLED = True
@@ -127,10 +125,7 @@ def user_prefix(expert: Expert | None, roster: list[Expert]) -> str:
# eval fixture has no account. ``<standing_work>`` is static text every
# Otto turn carries, so leaving it out here would make this check pass
# while production and the harness disagreed.
- return (
- render_team_context(roster, delegation_enabled=DELEGATION_ENABLED)
- + render_account_standing_work_block()
- )
+ return render_team_context(roster) + render_account_standing_work_block()
# ``<expert_computer>`` is only rendered when E2B actually backs the
# sandbox, so it is empty wherever E2B is unconfigured — which is why its
# absence here went unnoticed: CI has no E2B and both sides read "".
@@ -139,7 +134,6 @@ def user_prefix(expert: Expert | None, roster: list[Expert]) -> str:
+ render_expert_computer_block()
+ render_team_context(
roster,
- delegation_enabled=DELEGATION_ENABLED,
exclude_expert_id=expert.id,
)
)
@@ -148,7 +142,7 @@ def user_prefix(expert: Expert | None, roster: list[Expert]) -> str:
def chat_system_prompt(expert: Expert | None) -> str:
"""The SDK engine's system prompt for an expert session (the assembly in
``sdk/service.py``) with the flags such a session has on in production:
- cloud sandbox, hire-experts, memory. ``None`` is plain Otto."""
+ cloud sandbox and memory. ``None`` is plain Otto."""
suffix = render_expert_identity_suffix(expert) if expert else ""
return (
CACHEABLE_SYSTEM_PROMPT
diff --git a/autogpt_platform/backend/backend/copilot/eval/style/assembly_test.py b/autogpt_platform/backend/backend/copilot/eval/style/assembly_test.py
index 4b6d287757..94de2f472b 100644
--- a/autogpt_platform/backend/backend/copilot/eval/style/assembly_test.py
+++ b/autogpt_platform/backend/backend/copilot/eval/style/assembly_test.py
@@ -126,10 +126,6 @@ async def test_user_prefix_is_the_production_first_turn_context():
db.list_experts = AsyncMock(return_value=roster)
with (
patch("backend.copilot.expert_context.experts_db", MagicMock(return_value=db)),
- patch(
- "backend.copilot.expert_context.is_feature_enabled",
- AsyncMock(return_value=True),
- ),
):
assert await build_expert_context("user", max_.id) == user_prefix(max_, roster)
assert await build_expert_context("user", None) == user_prefix(None, roster)
@@ -168,9 +164,7 @@ def test_the_control_prompt_carries_autopilots_oversight_block():
@requires_roster
def test_the_baseline_records_which_delegation_state_it_measured():
- """hire-experts off renders a different team rule, drops the delegation
- supplement and hides the expert tools, so a score means nothing without
- the state it was measured in."""
+ """Historical score files preserve the delegation state they measured."""
assert load_baseline().delegation_enabled is DELEGATION_ENABLED
experts, fixtures, rubric = roster_experts(), load_fixtures(), load_rubric()
parts = fingerprint_parts(
diff --git a/autogpt_platform/backend/backend/copilot/eval/style/generation.py b/autogpt_platform/backend/backend/copilot/eval/style/generation.py
index 26d16709a0..6d0323a5c8 100644
--- a/autogpt_platform/backend/backend/copilot/eval/style/generation.py
+++ b/autogpt_platform/backend/backend/copilot/eval/style/generation.py
@@ -112,7 +112,7 @@ def _expert_disabled_groups(expert: Expert | None) -> list[ToolGroup]:
def expert_tools(expert: Expert | None) -> list[ChatCompletionToolParam]:
- """Production's tool surface for the session (hire-experts on, memory on):
+ """Production's tool surface for an authenticated session:
an expert loses the staffing tools, plain Otto the expert-only ones."""
return get_available_tools(disabled_groups=_expert_disabled_groups(expert))
diff --git a/autogpt_platform/backend/backend/copilot/eval/style/models.py b/autogpt_platform/backend/backend/copilot/eval/style/models.py
index a3316b1bbe..822328e7e6 100644
--- a/autogpt_platform/backend/backend/copilot/eval/style/models.py
+++ b/autogpt_platform/backend/backend/copilot/eval/style/models.py
@@ -159,8 +159,8 @@ class Baseline(BaseModel):
ts: str
chat_model: str
judge_model: str
- # Which production state these scores describe: hire-experts on or off
- # changes the team-context rule, the delegation supplement and the tools.
+ # Retained for historical score files produced before delegation was
+ # available to every authenticated account.
delegation_enabled: bool = True
cost_usd: float
note: str = ""
diff --git a/autogpt_platform/backend/backend/copilot/expert_context.py b/autogpt_platform/backend/backend/copilot/expert_context.py
index 81883330e9..bcd50125e8 100644
--- a/autogpt_platform/backend/backend/copilot/expert_context.py
+++ b/autogpt_platform/backend/backend/copilot/expert_context.py
@@ -31,7 +31,6 @@ from backend.blocks.desktop._api import DISPLAY, SHARED_PATH, WORKSPACE_PATH
from backend.copilot.config import ChatConfig
from backend.data.db_accessors import experts_db
from backend.util.exceptions import ExpertNotFoundError
-from backend.util.feature_flag import Flag, is_feature_enabled
logger = logging.getLogger(__name__)
@@ -238,25 +237,13 @@ async def build_expert_context(
if not user_id:
return ""
try:
- # ``delegate_to_expert`` is hidden from the tool schema and refused by
- # execute_tool when the hire-experts flag is off, so the roster block
- # must not tell the model to call it. Same boolean the engines use to
- # gate the delegation supplement and the tool groups.
- delegation_enabled = await is_feature_enabled(
- Flag.HIRE_EXPERTS, user_id, default=False
- )
if expert_id:
return await _expert_session_context(
user_id,
expert_id,
- delegation_enabled=delegation_enabled,
include_teammates=include_teammates,
)
- team = await _team_context(user_id, delegation_enabled=delegation_enabled)
- if not delegation_enabled:
- # ``expert_resources`` is hidden without the flag, and naming a
- # tool the turn cannot execute is worse than saying nothing.
- return team
+ team = await _team_context(user_id)
return (
team
+ render_account_standing_work_block()
@@ -271,7 +258,6 @@ async def _expert_session_context(
user_id: str,
expert_id: str,
*,
- delegation_enabled: bool,
include_teammates: bool,
) -> str:
async def _load_teammates() -> str:
@@ -282,7 +268,6 @@ async def _expert_session_context(
try:
return await _team_context(
user_id,
- delegation_enabled=delegation_enabled,
exclude_expert_id=expert_id,
)
except Exception as e:
@@ -476,7 +461,6 @@ def render_expert_computer_block() -> str:
async def _team_context(
user_id: str,
*,
- delegation_enabled: bool,
exclude_expert_id: str | None = None,
) -> str:
"""Roster block for the first user message.
@@ -489,13 +473,9 @@ async def _team_context(
normal, and the delegated turn runs under the teammate's own identity,
memory, and budget rather than being ghost-written.
- With the hire-experts flag off the roster still helps the model route a
- request, but the rule falls back to pointing at the expert's thread —
- naming a tool the turn cannot execute is worse than saying nothing.
-
An empty roster on a plain session is the Head-of-AI moment: instead of
saying nothing, hand the model the hiring roster so it can propose a
- first teammate. The flag and the template read are paid only there — an
+ first teammate. The template read is paid only there — an
expert session's empty teammate list is just a solo roster, not a user
without a team.
"""
@@ -504,15 +484,10 @@ async def _team_context(
if (
not any(e.id != exclude_expert_id for e in experts)
and exclude_expert_id is None
- and delegation_enabled
- and await is_feature_enabled(
- Flag.ONBOARDING_EXPERT_TEAM, user_id, default=False
- )
):
hiring_roster = await experts_db().list_templates()
return render_team_context(
experts,
- delegation_enabled=delegation_enabled,
exclude_expert_id=exclude_expert_id,
hiring_roster=hiring_roster,
)
@@ -521,13 +496,12 @@ async def _team_context(
def render_team_context(
experts: list[Expert],
*,
- delegation_enabled: bool,
exclude_expert_id: str | None = None,
hiring_roster: list[Expert] | None = None,
) -> str:
"""Pure renderer; ``hiring_roster`` is the template list for the
- Head-of-AI block and is only passed when the caller already checked the
- flag and found nobody hired. ``None`` keeps the empty roster silent."""
+ Head-of-AI block and is only passed when the caller found nobody hired. ``None`` keeps the empty roster silent.
+ """
teammates = [e for e in experts if e.id != exclude_expert_id]
if not teammates:
if hiring_roster is None:
@@ -536,7 +510,6 @@ def render_team_context(
lines = "\n".join(_team_line(e) for e in teammates)
rule = _team_rule(
- delegation_enabled=delegation_enabled,
exclude_expert_id=exclude_expert_id,
)
header = (
@@ -547,20 +520,7 @@ def render_team_context(
return f"<team_context>\n{header}\n{lines}\n{rule}\n</team_context>\n\n"
-def _team_rule(*, delegation_enabled: bool, exclude_expert_id: str | None) -> str:
- if not delegation_enabled:
- if exclude_expert_id is None:
- return (
- "When a request clearly matches an expert's domain, suggest "
- "opening that expert's thread (by expert id) instead of "
- "handling it here; never silently answer as an expert."
- )
- return (
- "These are your teammates. When a task needs their skills or "
- "workflows rather than yours, tell the user which teammate owns "
- "it and point them at that expert's thread. Never impersonate a "
- "teammate or guess at their domain yourself."
- )
+def _team_rule(*, exclude_expert_id: str | None) -> str:
if exclude_expert_id is None:
return (
"When a request clearly matches an expert's domain, you may hand "
diff --git a/autogpt_platform/backend/backend/copilot/expert_context_test.py b/autogpt_platform/backend/backend/copilot/expert_context_test.py
index d9ab479f51..4be30988ec 100644
--- a/autogpt_platform/backend/backend/copilot/expert_context_test.py
+++ b/autogpt_platform/backend/backend/copilot/expert_context_test.py
@@ -31,39 +31,10 @@ from backend.copilot.expert_context import (
build_expert_identity_suffix,
)
from backend.copilot.rate_limit import SubscriptionTier
-from backend.util.feature_flag import Flag
_EC = "backend.copilot.expert_context"
-def _flag_mock(**overrides: bool) -> AsyncMock:
- """``is_feature_enabled`` stub answering per flag.
-
- Defaults mirror production for an existing user: hire-experts on, the
- onboarding-team child flag off. Pass ``ONBOARDING_EXPERT_TEAM=True`` to
- opt a test into the Head-of-AI cohort.
- """
- enabled = {Flag.HIRE_EXPERTS: True, Flag.ONBOARDING_EXPERT_TEAM: False}
- enabled |= {Flag[name]: value for name, value in overrides.items()}
-
- async def is_enabled(flag: Flag, _user_id: str, default: bool = False) -> bool:
- return enabled.get(flag, default)
-
- return AsyncMock(side_effect=is_enabled)
-
-
[email protected](autouse=True)
-def hire_experts_flag_on():
- """Pin the hire-experts flag on.
-
- ``build_expert_context`` reads it to decide whether the roster block may
- name ``delegate_to_expert``; without pinning it these tests would follow
- whatever LaunchDarkly (or a local ``FORCE_FLAG_`` override) says.
- """
- with patch(f"{_EC}.is_feature_enabled", _flag_mock()):
- yield
-
-
# SHA-256 of _CACHEABLE_SYSTEM_PROMPT. The prompt cache contract requires this
# constant to stay byte-identical; re-pin it only for a deliberate prompt edit.
# Last re-pinned for the merge of the memory stack (the marked <temporal_context>
@@ -493,20 +464,17 @@ class TestBuildExpertContextExpertSession:
assert "<team_context>" not in result
@pytest.mark.asyncio
- async def test_solo_expert_in_onboarding_cohort_gets_no_hiring_roster(self):
+ async def test_solo_expert_gets_no_hiring_roster(self):
"""An expert session's empty teammate list is a solo roster, not a
- user without a team: even with the onboarding-team flag on it must
- not be handed the Head-of-AI block or pay for the template read."""
+ user without a team: it must not be handed the Head-of-AI block or
+ pay for the template read."""
from backend.copilot.expert_context import build_expert_context
mock_db = MagicMock()
mock_db.get_expert = AsyncMock(return_value=_expert())
mock_db.list_experts = AsyncMock(return_value=[_expert()])
mock_db.list_templates = AsyncMock(return_value=[_template()])
- with (
- patch(f"{_EC}.is_feature_enabled", _flag_mock(ONBOARDING_EXPERT_TEAM=True)),
- patch(f"{_EC}.experts_db", MagicMock(return_value=mock_db)),
- ):
+ with (patch(f"{_EC}.experts_db", MagicMock(return_value=mock_db)),):
result = await build_expert_context("user-1", "exp-1")
assert "<team_context>" not in result
@@ -605,46 +573,6 @@ class TestBuildExpertContextPlainSession:
assert "delegate_to_expert" in result
assert "Never delegate silently." in result
- @pytest.mark.asyncio
- async def test_flag_off_roster_never_names_the_delegation_tool(self):
- """``delegate_to_expert`` is hidden from the schema and refused by
- execute_tool when hire-experts is off, so a roster block that still
- told the model to call it would prepend a broken instruction to every
- first message of a user who had already hired experts."""
- from backend.copilot.expert_context import build_expert_context
-
- mock_db = MagicMock()
- mock_db.list_experts = AsyncMock(return_value=[_expert()])
- with (
- patch(f"{_EC}.is_feature_enabled", AsyncMock(return_value=False)),
- patch(f"{_EC}.experts_db", MagicMock(return_value=mock_db)),
- ):
- result = await build_expert_context("user-1", None)
-
- assert "<team_context>" in result
- assert "Maria" in result
- assert "delegate_to_expert" not in result
- assert "opening that expert's thread" in result
-
- @pytest.mark.asyncio
- async def test_flag_off_teammate_block_never_names_the_delegation_tool(self):
- from backend.copilot.expert_context import build_expert_context
-
- mock_db = MagicMock()
- mock_db.get_expert = AsyncMock(return_value=_expert())
- mock_db.list_experts = AsyncMock(
- return_value=[_expert(), _expert(expert_id="exp-2", name="Otto")]
- )
- with (
- patch(f"{_EC}.is_feature_enabled", AsyncMock(return_value=False)),
- patch(f"{_EC}.experts_db", MagicMock(return_value=mock_db)),
- ):
- result = await build_expert_context("user-1", "exp-1")
-
- assert "<team_context>" in result
- assert "Otto" in result
- assert "delegate_to_expert" not in result
-
@pytest.mark.asyncio
async def test_team_context_is_byte_identical_regardless_of_metrics(self):
"""The roster block renders only name/role/id/workflow names — the
@@ -676,25 +604,22 @@ class TestBuildExpertContextPlainSession:
assert results[0] == results[1]
@pytest.mark.asyncio
- async def test_no_experts_renders_no_roster(self):
- """A teamless account still gets the standing-work instruction — it is
- the account most likely to be in a plain Otto chat asking for something
- weekly — but nothing that would describe a team it does not have."""
+ async def test_no_experts_keeps_standing_work_and_offers_a_team(self):
from backend.copilot.expert_context import build_expert_context
mock_db = MagicMock()
mock_db.list_experts = AsyncMock(return_value=[])
+ mock_db.list_templates = AsyncMock(return_value=[])
mock_db.list_routines = AsyncMock(return_value=[])
with patch(f"{_EC}.experts_db", MagicMock(return_value=mock_db)):
result = await build_expert_context("user-1", None)
-
- assert "<team_context>" not in result
+ assert "<team_context>" in result
+ assert "<standing_work>" in result
assert "<routines>" not in result
- assert result.strip().startswith("<standing_work>")
@pytest.mark.asyncio
- async def test_no_experts_with_team_flag_renders_head_of_ai_block(self):
- """Flag-on, nothing hired: Otto gets the roster and its
+ async def test_no_experts_renders_head_of_ai_block(self):
+ """Nothing hired: Otto gets the roster and its
Head-of-AI brief instead of silence, so a recurring-work request can
turn into a hire proposal."""
from backend.copilot.expert_context import build_expert_context
@@ -712,10 +637,7 @@ class TestBuildExpertContextPlainSession:
mock_db = MagicMock()
mock_db.list_experts = AsyncMock(return_value=[])
mock_db.list_templates = AsyncMock(return_value=templates)
- with (
- patch(f"{_EC}.is_feature_enabled", _flag_mock(ONBOARDING_EXPERT_TEAM=True)),
- patch(f"{_EC}.experts_db", MagicMock(return_value=mock_db)),
- ):
+ with (patch(f"{_EC}.experts_db", MagicMock(return_value=mock_db)),):
result = await build_expert_context("user-1", None)
assert "<team_context>" in result
@@ -735,43 +657,18 @@ class TestBuildExpertContextPlainSession:
assert "<campaigns>" not in result
@pytest.mark.asyncio
- async def test_no_experts_with_team_flag_and_empty_roster_offers_raise(self):
+ async def test_empty_roster_offers_raise(self):
from backend.copilot.expert_context import build_expert_context
mock_db = MagicMock()
mock_db.list_experts = AsyncMock(return_value=[])
mock_db.list_templates = AsyncMock(return_value=[])
- with (
- patch(f"{_EC}.is_feature_enabled", _flag_mock(ONBOARDING_EXPERT_TEAM=True)),
- patch(f"{_EC}.experts_db", MagicMock(return_value=mock_db)),
- ):
+ with (patch(f"{_EC}.experts_db", MagicMock(return_value=mock_db)),):
result = await build_expert_context("user-1", None)
assert "<team_context>" in result
assert "Roster: none available yet — offer to raise a custom expert." in result
- @pytest.mark.asyncio
- async def test_no_experts_flag_on_but_delegation_off_returns_empty(self):
- """``hire_expert`` rides the same tool group as ``delegate_to_expert``
- — with hire-experts off the block would name a tool the turn cannot
- execute."""
- from backend.copilot.expert_context import build_expert_context
-
- mock_db = MagicMock()
- mock_db.list_experts = AsyncMock(return_value=[])
- mock_db.list_templates = AsyncMock(return_value=[_template()])
- with (
- patch(
- f"{_EC}.is_feature_enabled",
- _flag_mock(HIRE_EXPERTS=False, ONBOARDING_EXPERT_TEAM=True),
- ),
- patch(f"{_EC}.experts_db", MagicMock(return_value=mock_db)),
- ):
- result = await build_expert_context("user-1", None)
-
- assert result == ""
- mock_db.list_templates.assert_not_called()
-
@pytest.mark.asyncio
async def test_template_lookup_failure_returns_empty(self):
from backend.copilot.expert_context import build_expert_context
@@ -779,10 +676,7 @@ class TestBuildExpertContextPlainSession:
mock_db = MagicMock()
mock_db.list_experts = AsyncMock(return_value=[])
mock_db.list_templates = AsyncMock(side_effect=RuntimeError("db down"))
- with (
- patch(f"{_EC}.is_feature_enabled", _flag_mock(ONBOARDING_EXPERT_TEAM=True)),
- patch(f"{_EC}.experts_db", MagicMock(return_value=mock_db)),
- ):
+ with (patch(f"{_EC}.experts_db", MagicMock(return_value=mock_db)),):
result = await build_expert_context("user-1", None)
assert result == ""
@@ -1401,22 +1295,6 @@ class TestRoutinesBlock:
assert "`tool:schedule_routine`" in result
assert "`tool:list_routines`" in result
- @pytest.mark.asyncio
- async def test_the_flag_that_hides_the_tools_hides_the_instruction(self):
- """Routines ride the ``expert_resources`` group. With the flag off the
- tools are not declared, and naming a tool the turn cannot call is worse
- than saying nothing."""
- from backend.copilot.expert_context import build_expert_context
-
- with (
- patch(f"{_EC}.experts_db", MagicMock(return_value=self._db([]))),
- patch(f"{_EC}.is_feature_enabled", _flag_mock(HIRE_EXPERTS=False)),
- ):
- result = await build_expert_context("user-1", None)
-
- assert "<standing_work>" not in result
- assert "schedule_routine" not in result
-
@pytest.mark.asyncio
async def test_the_accounts_own_routines_are_listed_to_it(self):
result = await self._otto_context([self._routine()])
diff --git a/autogpt_platform/backend/backend/copilot/gate/held_engines_test.py b/autogpt_platform/backend/backend/copilot/gate/held_engines_test.py
index c529345453..a7905dc3bd 100644
--- a/autogpt_platform/backend/backend/copilot/gate/held_engines_test.py
+++ b/autogpt_platform/backend/backend/copilot/gate/held_engines_test.py
@@ -81,7 +81,8 @@ async def test_the_sdk_engine_opens_its_turn_with_the_held_result():
folded.append(list(pending))
raise _StopAtFold
- patches, _, _ = _make_patches(hire_experts_enabled=False)
+ patches, mcp_server = _make_patches()
+ mcp_server.side_effect = None
session = _make_session()
envelope = root_envelope("turn-2", session_id=session.session_id)
with contextlib.ExitStack() as stack:
@@ -102,17 +103,24 @@ async def test_the_sdk_engine_opens_its_turn_with_the_held_result():
new=persist,
)
)
+ stack.enter_context(
+ patch(
+ "backend.copilot.sdk.service.build_session_context",
+ new=AsyncMock(return_value=""),
+ )
+ )
with contextlib.suppress(_StopAtFold):
- async for chunk in stream_chat_completion_sdk(
- session_id=session.session_id,
- message="hello",
- is_user_message=True,
- user_id="test-user",
- session=session,
- envelope=envelope,
- ):
- if chunk is _RUNNING:
- order.append("streamed")
+ async with asyncio.timeout(10):
+ async for chunk in stream_chat_completion_sdk(
+ session_id=session.session_id,
+ message="hello",
+ is_user_message=True,
+ user_id="test-user",
+ session=session,
+ envelope=envelope,
+ ):
+ if chunk is _RUNNING:
+ order.append("streamed")
set_execution_context(None, None)
context.assert_called()
@@ -150,18 +158,19 @@ async def test_the_baseline_engine_opens_its_turn_with_the_held_result():
with _baseline_patches(resolve, persist, model_loop):
try:
- async for chunk in stream_chat_completion_baseline(
- session_id=session.session_id,
- message=None,
- is_user_message=False,
- user_id="user-1",
- session=session,
- envelope=root_envelope("turn-2", session_id=session.session_id),
- ):
- if chunk is _RUNNING:
- order.append("streamed")
- except Exception:
- pass # what the turn does after the model's first call is not under test
+ async with asyncio.timeout(10):
+ async for chunk in stream_chat_completion_baseline(
+ session_id=session.session_id,
+ message=None,
+ is_user_message=False,
+ user_id="user-1",
+ session=session,
+ envelope=root_envelope("turn-2", session_id=session.session_id),
+ ):
+ if chunk is _RUNNING:
+ order.append("streamed")
+ except _StopAtFold:
+ pass
finally:
set_execution_context(None, None)
@@ -231,7 +240,8 @@ async def test_a_sdk_turn_that_ends_early_keeps_the_results_of_calls_it_ran(stop
yield _RUNNING_SECOND
deliver(_SECOND)
- patches, _, _ = _make_patches(hire_experts_enabled=False)
+ patches, mcp_server = _make_patches()
+ mcp_server.side_effect = None
session = _make_session()
with contextlib.ExitStack() as stack:
for target, kwargs in patches:
@@ -239,6 +249,12 @@ async def test_a_sdk_turn_that_ends_early_keeps_the_results_of_calls_it_ran(stop
stack.enter_context(
patch("backend.copilot.sdk.service.resolve_answered", new=resolve)
)
+ stack.enter_context(
+ patch(
+ "backend.copilot.sdk.service.build_session_context",
+ new=AsyncMock(return_value=""),
+ )
+ )
stack.enter_context(
patch(
"backend.copilot.sdk.service.drain_pending_safe",
@@ -371,8 +387,17 @@ def _baseline_patches(resolve, persist, model_loop) -> Iterator[None]:
f"{svc}._build_system_prompt",
new=AsyncMock(return_value=("system prompt", None)),
),
- patch(f"{svc}.is_enabled_for_user", new=AsyncMock(return_value=False)),
- patch(f"{svc}.is_feature_enabled", new=AsyncMock(return_value=False)),
+ patch(f"{svc}._fetch_graphiti_context", new=AsyncMock(return_value="")),
+ patch.multiple(
+ svc,
+ enqueue_conversation_turn=AsyncMock(),
+ capture_chat_turn=AsyncMock(),
+ persist_and_record_usage=AsyncMock(),
+ upsert_chat_session=AsyncMock(),
+ upload_transcript=AsyncMock(),
+ active_mode=AsyncMock(return_value=None),
+ build_turn_budget_block=AsyncMock(return_value=""),
+ ),
patch(
f"{svc}.build_builder_system_prompt_suffix",
new=AsyncMock(return_value=""),
diff --git a/autogpt_platform/backend/backend/copilot/graphiti/AGENTS.md b/autogpt_platform/backend/backend/copilot/graphiti/AGENTS.md
index ba14967d31..754f1df6c4 100644
--- a/autogpt_platform/backend/backend/copilot/graphiti/AGENTS.md
+++ b/autogpt_platform/backend/backend/copilot/graphiti/AGENTS.md
@@ -36,15 +36,15 @@ Runtime prompt instructions live in `prompting.py:get_graphiti_supplement()`.
## Dream Schedules
-A memory scope (the account, or one hired expert) that has been registered has one `MemoryScopeSchedule` row, and while that row is ACTIVE, the crons whose flag is on: `dream_nightly_batch_{scope_key}` (daily, 03:00 owner-local) and `community_rebuild_{scope_key}` (weekly, 04:00 owner-local on Mondays: APScheduler reads the `0` in `0 4 * * 0` as Monday). The account's scope key is its user id, so its job ids predate the table. The table decides whether a scope is scheduled; `copilot/dream/registry.py` keeps it in step:
+A memory scope (the account, or one hired expert) that has been registered has one `MemoryScopeSchedule` row. While that row is ACTIVE, the scope runs weekly community maintenance, `community_rebuild_{scope_key}` (weekly, 04:00 owner-local on Mondays: APScheduler reads the `0` in `0 4 * * 0` as Monday), and the independently flag-gated nightly dream, `dream_nightly_batch_{scope_key}` (daily, 03:00 owner-local). The account's scope key is its user id, so its job ids predate the table. The table decides whether a scope is scheduled; `copilot/dream/registry.py` keeps it in step:
-- **Registration.** Ingest registers a scope when its group's queue is created: the group's first write in a process, and again whenever the queue comes back after retiring (60 s idle), with at most one registration in flight per group. A hire or raise registers the expert in the background. Registration never reactivates a PAUSED or WIPED scope, and writes nothing while all applicable flags are off (dream, community, and account-only skill learning), so a scope that was never registered or paused has no row.
+- **Registration.** Ingest registers a scope when its group's queue is created: the group's first write in a process, and again whenever the queue comes back after retiring (60 s idle), with at most one registration in flight per group. A hire or raise registers the expert in the background. Registration never reactivates a PAUSED or WIPED scope. Community maintenance needs no feature flag; the dream and account-only skill learning keep their independent gates.
- **Lifecycle.** Archive and a schedule pause (including a budget breach) pause the expert's scope and remove its crons; the resume route and a revive resume a PAUSED scope (or register one that has no row). A lifecycle change the deadline cuts off is not retried: the cron gate still keeps an archived or paused expert's crons from running, and a later lifecycle change or the backfill settles the row (an ordinary registration does not look at the expert's lifecycle). `mark_wiped` is a seam for the wipe work: nothing calls it yet and it does not erase the graph. No registry operation takes a scope out of WIPED: registration and resume skip it, and pause or archive leave it WIPED (a pause only moves an ACTIVE or PAUSED row, checked in the same statement), so the wipe work decides what brings one back.
- **Reconcile.** Registration, pause and resume act on events, and two of them can interleave: a pause's takedown that lands after a later resume registered the same deterministic job ids, or a registration that read the row before a timezone change and lands after it. Each can leave an ACTIVE row whose recorded crons the scheduler lacks or runs in the wrong timezone, which an ensure, trusting the recorded ids, never notices. On each scheduler start and then every 30 minutes, the scheduler runs `reconcile_memory_scope_crons` (`copilot/dream/scope_reconcile.py`). It lists its dream-system crons (inside the pass's 20-minute ceiling, the database stopping the query after 60 s) and every registry row, paged, then settles each scope out of step, on the row as read again right before. Every cron an ACTIVE row records that the scheduler lacks, or runs in another timezone, is registered in the row's timezone and tagged as the reconcile's (` (reconciled)` on the job's name). A tagged cron its row does not record, or whose row is not ACTIVE or gone, is removed, before the scope's crons are repaired and whatever that repair does: so a restore that raced a delete or a pause (the account's delete RPCs have the registry forget the cron before they remove it, and keep it, failing, when the forget fails), failed partway, was cancelled or finished after its pass, leaves at worst a tagged cron the next pass that reaches the scope takes away, even while the scope's repair keeps failing. An untagged cron the row does not record is the registry's (an account's from before the registry, a registration whose record failed) and is left alone, and no flag is read. Every cron of a PAUSED or WIPED row, or of an expert with no row, is removed; an account's untagged crons with no row are left, as the cron gate lets them run. Every change is idempotent (a removal that finds the job already gone is no error). Each of the pass's own jobstore writes gives up after 10 s on a row another transaction holds (`jobstore.WRITE_TIMEOUT`: a transaction-local `lock_timeout` and `statement_timeout`; the scheduler's other writes are not limited), failing only that scope. A pass walks the scopes as a ring from just after the last scope a pass in this process took (a random one after the process starts), taking each as its place before it works it, so a pass cut off at its ceiling, even inside a scope's work, hands the rest of the ring to the next, and a restart can't keep repairing the same first scopes. The place is the process's own: APScheduler 3 can't share a jobstore between processes, so production runs one scheduler, and during a rollout two each walk on their own. So a lost, stale or stray cron is put right once the walk next reaches its scope, not within a fixed 30 minutes. The job lives in a process-local `MemoryJobStore`, registered after start with an immediate next run; it never enters the shared SQL job table. During a rolling deploy each new scheduler runs its own pass; overlapping passes replay bounded, idempotent work. Expert crons use a separate callable reference so old binaries park them rather than execute incompatible kwargs. A new-code listing that includes a parked row restores its SQL next-run timestamp from the readable payload, guarded by unchanged id, payload and NULL column. The memory-prefix listing, schedule-index reconciliation at startup/daily, and all-jobs cache can recover rows this way. Explicitly paused payloads stay paused. An overdue recovered cron coalesces missed runs subject to its misfire grace; an old pod can park it again until the overlap ends. A registration whose record finds the row no longer ACTIVE reports `scope_changed` and takes nothing down (a takedown there could take a concurrent resume's crons): the gate holds the scope, and the reconcile removes its crons. The cron gate itself only skips a straggler's run; removing it is the reconcile's job, and so is restoring the crons a resume landing inside a pause's takedown lost.
- **Timezone.** A timezone change re-registers every scope of the user in the new zone. The new timezone is recorded before cron replacement. A failed replacement retains the existing recorded job id so reconciliation can detect the old timezone and retry; a first registration that fails still has no id. A failure to record timezone intent is retried by a later registration or backfill.
- **Deadlines.** Every registry call to the DatabaseManager, the scheduler, the flag backend or the user lookup runs under a 10 s deadline (`copilot/dream/deadline.py`), built on `asyncio.timeout` so a deadline nested in another still holds on Python 3.11. On timeout the call's cancellation is requested; a timeout does not prove the call had no effect, since the server may already have acted on it. The API hooks bound the whole change, so the memory part of a request ends when that deadline requests cancellation, plus the cancelled call's cleanup and any time the event loop itself is blocked, and a cron whose registry gate cannot answer in time skips that run. Background registration (ingest, hire, raise) and the backfill pay the deadline per call, so during an outage the backfill's run time grows with the number of scopes.
-Existing deployments fill the table with `poetry run memory-schedule-backfill` (`--dry-run` only counts; `--force` re-registers every cron, e.g. after jobs were lost from the scheduler). It discovers accounts with a `user_*` FalkorDB graph and a user row, accounts with skill-learning sources, and existing ACTIVE account rows; it ensures those accounts, resumes or registers every live hired expert, pauses paused and archived ones, and prints a JSON report that lists each failed scope with its cron and reason; it exits 1 if anything failed. Re-running is safe; it registers nothing twice, but pauses the paused experts again (a state write and a remove call each). It needs Postgres, FalkorDB, the scheduler service and the flag backend, so run it where the backend services' environment is set; registration uses `dream-pass-enabled`, `graphiti-communities-enabled`, and the independent account-only `dream-skill-learning-enabled` flag. Force refresh does not override WIPED or paused account state. Flag-off cron bodies skip work while recorded intent remains available to reconciliation.
+Existing deployments fill the table with `poetry run memory-schedule-backfill` (`--dry-run` only counts; `--force` re-registers every cron, e.g. after jobs were lost from the scheduler). It discovers accounts with a `user_*` FalkorDB graph and a user row, accounts with skill-learning sources, and existing ACTIVE account rows; it ensures those accounts, resumes or registers every live hired expert, pauses paused and archived ones, and prints a JSON report that lists each failed scope with its cron and reason; it exits 1 if anything failed. Re-running is safe; it registers nothing twice, but pauses the paused experts again (a state write and a remove call each). It needs Postgres, FalkorDB and the scheduler service, so run it where the backend services' environment is set. Normal non-local runs also initialize the configured feature-flag backend: the dream uses `dream-pass-enabled` and account-only skill learning uses the independent `dream-skill-learning-enabled` flag. If flag evaluation is unavailable, community registration proceeds without a flag, while dream and skill-learning registration are skipped as `flag_unavailable`. Existing recorded cron intent is preserved, including during timezone changes; reconciliation can still restore those crons. Force refresh does not override WIPED or paused account state. Dream and learning cron bodies skip work while their flag is off.
**Deploy order.** Apply both registry migrations and deploy the DatabaseManager and scheduler services first, then the writers (REST API, copilot-executor), then run the backfill: newer writers get a 404 from an older scheduler's scope RPCs, and a newer scheduler's cron gate skips every memory run, the account's included, while an older DatabaseManager cannot answer the registry. Rolling scheduler overlap can temporarily park expert crons; the new scheduler recovers them on a later listing, including its startup/periodic reconciliation. Account cron references and kwargs remain backward-compatible. For rollback, stop or remove expert crons before reverting all schedulers: old binaries leave them parked, and no new reader remains to recover them. The process-local reconcile needs no persistent system-job repair. Backfill follows service deployment and is needed for dormant-scope adoption, not as a prerequisite for the additive schema deployment.
diff --git a/autogpt_platform/backend/backend/copilot/graphiti/config.py b/autogpt_platform/backend/backend/copilot/graphiti/config.py
index 03a8c0fe6a..683a8dfa7a 100644
--- a/autogpt_platform/backend/backend/copilot/graphiti/config.py
+++ b/autogpt_platform/backend/backend/copilot/graphiti/config.py
@@ -46,7 +46,7 @@ _LOCAL_EMBEDDER_MODEL = "nomic-embed-text"
class GraphitiConfig(BaseSettings):
"""Configuration for Graphiti memory integration.
- All fields use the ``GRAPHITI_`` env-var prefix, e.g. ``GRAPHITI_ENABLED``.
+ All fields use the ``GRAPHITI_`` env-var prefix, e.g. ``GRAPHITI_FALKORDB_HOST``.
LLM/embedder keys fall back to the Otto-dedicated keys
(``CHAT_API_KEY`` / ``CHAT_OPENAI_API_KEY``) so that memory costs are
tracked under Otto, then to the platform-wide OpenRouter / OpenAI
@@ -395,42 +395,3 @@ class _LazyConfigProxy:
graphiti_config = _LazyConfigProxy() # type: ignore[assignment]
-
-
-async def is_enabled_for_user(user_id: str | None) -> bool:
- """Check if Graphiti memory is enabled for a specific user.
-
- Gated solely by LaunchDarkly flag ``graphiti-memory``
- (Flag.GRAPHITI_MEMORY). When LD is not configured, defaults to False.
- """
- if not user_id:
- return False
-
- from backend.util.feature_flag import Flag, is_feature_enabled
-
- return await is_feature_enabled(
- Flag.GRAPHITI_MEMORY,
- user_id,
- default=False,
- )
-
-
-async def is_communities_enabled_for_user(user_id: str | None) -> bool:
- """Check if per-user community-detection rebuilds are enabled.
-
- Distinct from ``is_enabled_for_user`` — a user can have Graphiti
- memory enabled (writes + reads work) without the weekly Leiden
- rebuild + LLM summarization running on their graph. Gated by
- ``Flag.GRAPHITI_COMMUNITIES_ENABLED``; defaults False so the cost
- only lands behind explicit opt-in.
- """
- if not user_id:
- return False
-
- from backend.util.feature_flag import Flag, is_feature_enabled
-
- return await is_feature_enabled(
- Flag.GRAPHITI_COMMUNITIES_ENABLED,
- user_id,
- default=False,
- )
diff --git a/autogpt_platform/backend/backend/copilot/graphiti/config_test.py b/autogpt_platform/backend/backend/copilot/graphiti/config_test.py
index ee3378f296..38a938425c 100644
--- a/autogpt_platform/backend/backend/copilot/graphiti/config_test.py
+++ b/autogpt_platform/backend/backend/copilot/graphiti/config_test.py
@@ -1,10 +1,8 @@
-from unittest.mock import AsyncMock, patch
-
import pytest
from backend.copilot.config import ChatConfig
-from .config import GraphitiConfig, is_enabled_for_user
+from .config import GraphitiConfig
_ENV_VARS_TO_CLEAR = (
"GRAPHITI_FALKORDB_HOST",
@@ -262,25 +260,3 @@ class TestApplyLocalGraphitiModels:
cfg = GraphitiConfig()
assert cfg.llm_model == model
assert cfg.reranker_model == model
-
-
-class TestIsEnabledForUser:
- @pytest.mark.asyncio
- async def test_none_user_returns_false(self) -> None:
- result = await is_enabled_for_user(None)
- assert result is False
-
- @pytest.mark.asyncio
- async def test_empty_user_returns_false(self) -> None:
- result = await is_enabled_for_user("")
- assert result is False
-
- @pytest.mark.asyncio
- async def test_delegates_to_feature_flag(self) -> None:
- with patch(
- "backend.util.feature_flag.is_feature_enabled",
- new_callable=AsyncMock,
- return_value=True,
- ):
- result = await is_enabled_for_user("some-user-id")
- assert result is True
diff --git a/autogpt_platform/backend/backend/copilot/graphiti/context.py b/autogpt_platform/backend/backend/copilot/graphiti/context.py
index f9ac620e13..cfdabf63a8 100644
--- a/autogpt_platform/backend/backend/copilot/graphiti/context.py
+++ b/autogpt_platform/backend/backend/copilot/graphiti/context.py
@@ -158,8 +158,7 @@ def _spawn_ratification_hits(scope: MemoryScope, edges: list[EntityEdge]) -> Non
Imports lazily so the dream/ratification module isn't pulled into
every retrieval boot path; keeps the cold-start cost zero for
- users on the rare GRAPHITI_MEMORY=on / DREAM_PASS_ENABLED=off
- combination.
+ users whose independent DREAM_PASS_ENABLED flag is off.
"""
edge_uuids = [edge.uuid for edge in edges]
if not edge_uuids:
diff --git a/autogpt_platform/backend/backend/copilot/graphiti/ingest_recall_integration_test.py b/autogpt_platform/backend/backend/copilot/graphiti/ingest_recall_integration_test.py
index 417a251e6a..94a9dad269 100644
--- a/autogpt_platform/backend/backend/copilot/graphiti/ingest_recall_integration_test.py
+++ b/autogpt_platform/backend/backend/copilot/graphiti/ingest_recall_integration_test.py
@@ -215,9 +215,6 @@ async def test_a_forget_marker_the_extraction_invents_is_never_saved(
assert is_live(edge) and not is_forgotten(edge)
patch_recall_boundaries(mocker, driver, stub_graphiti_client)
- mocker.patch.object(
- graphiti_forget, "is_enabled_for_user", AsyncMock(return_value=True)
- )
user, session = scope.owner_user_id, ChatSession.new(
scope.owner_user_id, dry_run=False
)
diff --git a/autogpt_platform/backend/backend/copilot/graphiti/recall_hard_forget_integration_test.py b/autogpt_platform/backend/backend/copilot/graphiti/recall_hard_forget_integration_test.py
index 56684a3ee0..1de1f5e101 100644
--- a/autogpt_platform/backend/backend/copilot/graphiti/recall_hard_forget_integration_test.py
+++ b/autogpt_platform/backend/backend/copilot/graphiti/recall_hard_forget_integration_test.py
@@ -306,8 +306,6 @@ async def test_a_soft_forget_can_still_be_made_permanent_from_chat(
alice, bob = edges[ALICE[2]], edges[BOB[2]]
await retract(scope, [alice])
assert (await edge_row(driver, alice))["fact"] == FORGOTTEN_FACT
- enabled = AsyncMock(return_value=True)
- mocker.patch.object(graphiti_forget, "is_enabled_for_user", enabled)
session = ChatSession.new(scope.owner_user_id, dry_run=False)
search = graphiti_forget.MemoryForgetSearchTool()
diff --git a/autogpt_platform/backend/backend/copilot/graphiti/recall_inflight_read_integration_test.py b/autogpt_platform/backend/backend/copilot/graphiti/recall_inflight_read_integration_test.py
index 6f151d23fc..2e4c1423d2 100644
--- a/autogpt_platform/backend/backend/copilot/graphiti/recall_inflight_read_integration_test.py
+++ b/autogpt_platform/backend/backend/copilot/graphiti/recall_inflight_read_integration_test.py
@@ -205,9 +205,6 @@ async def test_forget_search_rechecks_live_candidates_after_forgotten_search(
) -> None:
driver, scope = scope_graph
alice = await _alice_and_bob(driver, scope, stub_graphiti_client)
- mocker.patch.object(
- graphiti_forget, "is_enabled_for_user", mocker.AsyncMock(return_value=True)
- )
search = graphiti_forget.search_forgotten_facts
def pause(reached: asyncio.Event, release: asyncio.Event):
diff --git a/autogpt_platform/backend/backend/copilot/graphiti/recall_integration_fixtures.py b/autogpt_platform/backend/backend/copilot/graphiti/recall_integration_fixtures.py
index cf161cd8d7..63c17015bf 100644
--- a/autogpt_platform/backend/backend/copilot/graphiti/recall_integration_fixtures.py
+++ b/autogpt_platform/backend/backend/copilot/graphiti/recall_integration_fixtures.py
@@ -19,7 +19,6 @@ from graphiti_core.llm_client.client import LLMClient
from graphiti_core.nodes import EpisodeType
from pytest_mock import MockerFixture
-from backend.api.features.memory import routes as memory_routes
from backend.copilot.tools import graphiti_search
from . import ingest, recall
@@ -44,7 +43,7 @@ def patch_recall_boundaries(
mocker: MockerFixture, driver: AutoGPTFalkorDriver, build_client: BuildClient
) -> None:
"""Search through a stubbed-LLM Graphiti on the test graph, count hits in
- memory, and report memory as enabled for the settings routes and tools."""
+ memory for the settings routes and tools."""
client = build_client(driver, {})
mocker.patch.object(
recall, "get_graphiti_client", mocker.AsyncMock(return_value=client)
@@ -53,9 +52,6 @@ def patch_recall_boundaries(
"backend.data.redis_client.get_redis_async",
mocker.AsyncMock(return_value=FakeRedis()),
)
- enabled = mocker.AsyncMock(return_value=True)
- mocker.patch.object(memory_routes, "is_enabled_for_user", enabled)
- mocker.patch.object(graphiti_search, "is_enabled_for_user", enabled)
def model_of(client: Graphiti) -> LLMClient:
diff --git a/autogpt_platform/backend/backend/copilot/graphiti/scope_lock_integration_test.py b/autogpt_platform/backend/backend/copilot/graphiti/scope_lock_integration_test.py
index bc99907c33..7aa0a10c85 100644
--- a/autogpt_platform/backend/backend/copilot/graphiti/scope_lock_integration_test.py
+++ b/autogpt_platform/backend/backend/copilot/graphiti/scope_lock_integration_test.py
@@ -106,12 +106,10 @@ async def test_the_chat_tool_tries_a_busy_forget_once_more(
return tries[-1]
session = ChatSession.new(scope.owner_user_id, dry_run=False)
- enabled = AsyncMock(return_value=True)
with (
patch.object(recall_forget, "FORGET_LOCK_WAIT_SECONDS", 0.3),
patch.object(graphiti_forget, "_BUSY_RETRY_SECONDS", 0.1),
patch.object(graphiti_forget, "retract", then_the_ingestion_finishes),
- patch.object(graphiti_forget, "is_enabled_for_user", enabled),
):
response = await MemoryForgetConfirmTool()._execute(
scope.owner_user_id, session, uuids=[alice]
diff --git a/autogpt_platform/backend/backend/copilot/learning/memory_link.py b/autogpt_platform/backend/backend/copilot/learning/memory_link.py
index 4d80ffcbf2..d7cd9cb157 100644
--- a/autogpt_platform/backend/backend/copilot/learning/memory_link.py
+++ b/autogpt_platform/backend/backend/copilot/learning/memory_link.py
@@ -13,7 +13,6 @@ from __future__ import annotations
import logging
-from backend.copilot.graphiti.config import is_enabled_for_user
from backend.copilot.graphiti.ingest import enqueue_episode
from backend.copilot.graphiti.memory_model import (
MemoryEnvelope,
@@ -52,8 +51,6 @@ def build_reference_envelope(version: SkillVersionRecord) -> MemoryEnvelope:
async def link_version_to_memory(user_id: str, version: SkillVersionRecord) -> bool:
"""Best-effort; returns whether an episode was queued. Never raises."""
try:
- if not await is_enabled_for_user(user_id):
- return False
envelope = build_reference_envelope(version)
# ``dream_`` name prefix: the dream pass must not treat our own
# write as new user activity worth a paid consolidation pass.
diff --git a/autogpt_platform/backend/backend/copilot/learning/memory_link_test.py b/autogpt_platform/backend/backend/copilot/learning/memory_link_test.py
index 87f4da0a69..4bcbbad511 100644
--- a/autogpt_platform/backend/backend/copilot/learning/memory_link_test.py
+++ b/autogpt_platform/backend/backend/copilot/learning/memory_link_test.py
@@ -4,7 +4,7 @@ the account's for an account skill, the expert's for an expert's, through
argument)."""
from datetime import datetime, timezone
-from unittest.mock import AsyncMock, patch
+from unittest.mock import patch
import pytest
@@ -43,10 +43,7 @@ def _version(expert_id: str | None) -> SkillVersionRecord:
@pytest.mark.asyncio
@pytest.mark.parametrize("expert_id", [None, "expert-1"], ids=["account", "expert"])
async def test_a_learned_version_is_linked_in_its_own_scope(expert_id):
- with (
- patch.object(memory_link, "is_enabled_for_user", AsyncMock(return_value=True)),
- patch.object(memory_link, "enqueue_episode", autospec=True) as enqueue,
- ):
+ with (patch.object(memory_link, "enqueue_episode", autospec=True) as enqueue,):
enqueue.return_value = True
linked = await memory_link.link_version_to_memory("user-1", _version(expert_id))
diff --git a/autogpt_platform/backend/backend/copilot/sdk/expert_tool_gate_test.py b/autogpt_platform/backend/backend/copilot/sdk/expert_tool_gate_test.py
index b637517405..5bed9a5ecf 100644
--- a/autogpt_platform/backend/backend/copilot/sdk/expert_tool_gate_test.py
+++ b/autogpt_platform/backend/backend/copilot/sdk/expert_tool_gate_test.py
@@ -1,36 +1,13 @@
-"""SDK-engine coverage for the hire-experts flag guard and tool hiding.
-
-``stream_chat_completion_sdk`` resolves ``experts_enabled = bool(user_id)
-and await is_feature_enabled(Flag.HIRE_EXPERTS, user_id, default=False)``
-and feeds the result into ``expert_tool_disabled_groups`` (tested directly
-in ``handoff_to_expert_test.py``) before registering tools with the MCP
-server. This file proves the SDK call SITE wires that correctly:
-
- * an anonymous turn (``user_id=None``) must fail closed WITHOUT ever
- resolving the flag — deleting the ``bool(user_id) and`` guard would
- still (accidentally) work most of the time, but would await
- ``is_feature_enabled`` with a ``None`` user_id.
- * the resulting disabled groups actually reach ``create_copilot_mcp_server``
- as hidden tool names — the enforcement point for the SDK engine (which
- never calls ``execute_tool`` per-call; hidden tools are simply never
- registered with the MCP server).
-
-Reuses the same mocking shape as ``retry_scenarios_test.py``'s
-``TestStreamChatCompletionRetryIntegration`` (independently duplicated here
-rather than imported, since these are private test helpers local to that
-module) — a single-message session takes the "no --resume" short-circuit in
-``_restore_cli_session_for_turn`` for free, so ``download_transcript`` /
-``strip_for_upload`` need no mocks.
-"""
+"""Expert tools remain authenticated after retiring the rollout gate."""
from __future__ import annotations
+import asyncio
import contextlib
from datetime import UTC, datetime
from unittest.mock import AsyncMock, MagicMock, patch
import pytest
-from claude_agent_sdk import ResultMessage
from backend.copilot.budget_gate import AutoContinueGate
from backend.copilot.model import ChatMessage, ChatSession, ChatSessionMetadata
@@ -58,51 +35,25 @@ def _make_session() -> ChatSession:
return ChatSession(
session_id="test-session-id",
user_id="test-user",
+ title="Already titled",
usage=[],
started_at=datetime.now(UTC),
updated_at=datetime.now(UTC),
messages=[ChatMessage(role="user", content="hello")],
# Stated, not defaulted: the staffing tools this file asserts on are
# also hidden off an interactive origin, so a session that left it
- # unset would pass the flag-off case for the wrong reason.
+ # unset would hide staffing tools for the wrong reason.
metadata=ChatSessionMetadata(origin="interactive"),
)
-def _make_client_mock():
- """A ClaudeSDKClient async-context-manager mock that streams one
- successful ``ResultMessage`` and nothing else."""
- result_msg = ResultMessage(
- subtype="success",
- result="done",
- duration_ms=100,
- duration_api_ms=50,
- is_error=False,
- num_turns=1,
- session_id="test-session-id",
- )
+class _ToolRegistrationReached(Exception):
+ pass
- async def _receive():
- yield result_msg
- client = MagicMock()
- client.receive_response = _receive
- client.query = AsyncMock()
- client._transport = MagicMock()
- client._transport.write = AsyncMock()
-
- cm = AsyncMock()
- cm.__aenter__.return_value = client
- cm.__aexit__.return_value = None
- return cm
-
-
-def _make_patches(*, hire_experts_enabled: bool):
- """Patch list for a full (mocked) SDK turn, plus a fresh mock for
- ``create_copilot_mcp_server`` and ``is_feature_enabled`` the caller can
- read after the turn."""
- mcp_server_mock = MagicMock(return_value=MagicMock())
- is_feature_enabled_mock = AsyncMock(return_value=hire_experts_enabled)
+def _make_patches():
+ """Capture registration and stop before any provider is constructed."""
+ mcp_server_mock = MagicMock(side_effect=_ToolRegistrationReached)
patches = [
(f"{_SVC}.get_chat_session", dict(new_callable=AsyncMock)),
@@ -125,7 +76,9 @@ def _make_patches(*, hire_experts_enabled: bool):
),
(
f"{_SVC}.ClaudeSDKClient",
- dict(side_effect=lambda *a, **kw: _make_client_mock()),
+ dict(
+ side_effect=AssertionError("Provider construction is outside this test")
+ ),
),
(f"{_SVC}.create_copilot_mcp_server", dict(new=mcp_server_mock)),
(f"{_SVC}.create_security_hooks", dict(return_value=MagicMock())),
@@ -134,7 +87,17 @@ def _make_patches(*, hire_experts_enabled: bool):
(f"{_SVC}.build_sdk_env", dict(return_value={})),
(f"{_SVC}._resolve_sdk_model", dict(return_value=None)),
(f"{_SVC}.set_execution_context", {}),
- (f"{_SVC}.is_feature_enabled", dict(new=is_feature_enabled_mock)),
+ (
+ f"{_SVC}._fetch_graphiti_context",
+ {"new": AsyncMock(side_effect=lambda user_id, *_: (bool(user_id), ""))},
+ ),
+ (
+ f"{_SVC}.inject_user_context",
+ {"new_callable": AsyncMock, "return_value": "hello"},
+ ),
+ (f"{_SVC}._enqueue_graphiti_turn", {"new_callable": AsyncMock}),
+ (f"{_SVC}.capture_chat_turn", {"new_callable": AsyncMock}),
+ (f"{_SVC}.persist_and_record_usage", {"new_callable": AsyncMock}),
(
f"{_SVC}.config",
dict(
@@ -171,13 +134,12 @@ def _make_patches(*, hire_experts_enabled: bool):
),
(f"{_SVC}.drain_pending_safe", dict(new_callable=AsyncMock, return_value=[])),
]
- return patches, mcp_server_mock, is_feature_enabled_mock
+ return patches, mcp_server_mock
async def _run_sdk_turn(
*,
user_id: str | None,
- hire_experts_enabled: bool,
expert_id: str | None = None,
extra_patches: list[tuple[str, dict]] | None = None,
):
@@ -185,54 +147,47 @@ async def _run_sdk_turn(
session = _make_session()
session.expert_id = expert_id
- patches, mcp_server_mock, is_feature_enabled_mock = _make_patches(
- hire_experts_enabled=hire_experts_enabled
- )
+ patches, mcp_server_mock = _make_patches()
patches += extra_patches or []
events = []
- with contextlib.ExitStack() as stack:
+ with contextlib.ExitStack() as stack, pytest.raises(_ToolRegistrationReached):
for target, kwargs in patches:
stack.enter_context(patch(target, **kwargs))
- async for event in stream_chat_completion_sdk(
- session_id=session.session_id,
- message="hello",
- is_user_message=True,
- user_id=user_id,
- session=session,
- ):
- events.append(event)
+ async with asyncio.timeout(10):
+ async for event in stream_chat_completion_sdk(
+ session_id=session.session_id,
+ message="hello",
+ is_user_message=True,
+ user_id=user_id,
+ session=session,
+ ):
+ events.append(event)
assert any(
isinstance(e, StreamStart) for e in events
), f"Turn did not complete far enough to reach tool registration: {events}"
- return mcp_server_mock, is_feature_enabled_mock
+ return mcp_server_mock
-class TestSdkExpertsFlagGuard:
+class TestSdkExpertsAuthorization:
@pytest.mark.asyncio
- async def test_anonymous_turn_never_calls_the_hire_experts_flag(self) -> None:
- mcp_server_mock, is_feature_enabled_mock = await _run_sdk_turn(
- user_id=None, hire_experts_enabled=True
- )
+ async def test_anonymous_turn_hides_expert_tools(self) -> None:
+ mcp_server_mock = await _run_sdk_turn(user_id=None)
- is_feature_enabled_mock.assert_not_awaited()
hidden = mcp_server_mock.call_args.kwargs["hidden_tool_names"]
- # Flag off (fails closed for anonymous turns): every expert-team
- # group is hidden — staffing, expert-session, and delegation tools.
+ # Anonymous turns cannot use expert or memory tools.
+ assert "memory_store" in hidden
assert "hire_expert" in hidden
assert "update_expert_soul" in hidden
assert "delegate_to_expert" in hidden
@pytest.mark.asyncio
- async def test_authenticated_turn_with_flag_on_only_hides_staffing_tools(
+ async def test_authenticated_plain_turn_keeps_staffing_tools(
self,
) -> None:
- mcp_server_mock, is_feature_enabled_mock = await _run_sdk_turn(
- user_id="test-user", hire_experts_enabled=True
- )
+ mcp_server_mock = await _run_sdk_turn(user_id="test-user")
- is_feature_enabled_mock.assert_awaited_once()
hidden = mcp_server_mock.call_args.kwargs["hidden_tool_names"]
# Plain Otto session (no session.expert_id): loses the
# expert-session tools, keeps the staffing ("expert_admin") tools.
@@ -254,7 +209,6 @@ class TestSdkComputerNoteWiring:
supplement = MagicMock(return_value="")
await _run_sdk_turn(
user_id=None,
- hire_experts_enabled=False,
expert_id=expert_id,
extra_patches=[
(f"{_SVC}.get_sdk_supplement", dict(new=supplement)),
diff --git a/autogpt_platform/backend/backend/copilot/sdk/responsiveness_test.py b/autogpt_platform/backend/backend/copilot/sdk/responsiveness_test.py
index fc8d73b66b..3e3a33aef6 100644
--- a/autogpt_platform/backend/backend/copilot/sdk/responsiveness_test.py
+++ b/autogpt_platform/backend/backend/copilot/sdk/responsiveness_test.py
@@ -40,29 +40,16 @@ def _make_session(
# ---------------------------------------------------------------------------
-async def test_fetch_graphiti_context_returns_disabled_when_flag_off():
- """When LD flag is off, return (False, "") without fetching warm context."""
- session = _make_session("user-1")
- with patch(
- "backend.copilot.sdk.service.is_enabled_for_user",
- new=AsyncMock(return_value=False),
- ):
- enabled, ctx = await _fetch_graphiti_context("user-1", session, "hello")
- assert enabled is False
- assert ctx == ""
-
-
@pytest.mark.asyncio
async def test_fetch_graphiti_context_skips_warm_for_anonymous_users():
"""Anonymous turns (no user_id) skip warm context even when enabled."""
session = _make_session("user-1")
with patch(
- "backend.copilot.sdk.service.is_enabled_for_user",
- new=AsyncMock(return_value=True),
- ):
+ "backend.copilot.sdk.service.fetch_warm_context", new=AsyncMock()
+ ) as fetch:
enabled, ctx = await _fetch_graphiti_context(None, session, "hello")
- assert enabled is True
+ fetch.assert_not_awaited()
+ assert enabled is False
assert ctx == ""
@@ -70,11 +57,7 @@ async def test_fetch_graphiti_context_skips_warm_for_anonymous_users():
async def test_fetch_graphiti_context_skips_warm_on_followup_turns():
"""Sessions with prior history skip warm context — it's a turn-1 only feature."""
session = _make_session("user-1", n_messages=3)
- with patch(
- "backend.copilot.sdk.service.is_enabled_for_user",
- new=AsyncMock(return_value=True),
- ):
- enabled, ctx = await _fetch_graphiti_context("user-1", session, "follow-up")
+ enabled, ctx = await _fetch_graphiti_context("user-1", session, "follow-up")
assert enabled is True
assert ctx == ""
@@ -85,10 +68,6 @@ async def test_fetch_graphiti_context_loads_warm_context_on_first_turn():
session = _make_session("user-1")
fetch_mock = AsyncMock(return_value="<warm_facts>important fact</warm_facts>")
with (
- patch(
- "backend.copilot.sdk.service.is_enabled_for_user",
- new=AsyncMock(return_value=True),
- ),
patch(
"backend.copilot.sdk.service.fetch_warm_context",
new=fetch_mock,
@@ -105,10 +84,6 @@ async def test_fetch_graphiti_context_uses_expert_session_scope():
session = _make_session("user-1", expert_id="expert-1")
fetch_mock = AsyncMock(return_value="expert context")
with (
- patch(
- "backend.copilot.sdk.service.is_enabled_for_user",
- new=AsyncMock(return_value=True),
- ),
patch(
"backend.copilot.sdk.service.fetch_warm_context",
new=fetch_mock,
@@ -194,10 +169,6 @@ async def test_fetch_graphiti_context_handles_empty_warm_context():
"""``fetch_warm_context`` returning ``None`` collapses to empty string."""
session = _make_session("user-1")
with (
- patch(
- "backend.copilot.sdk.service.is_enabled_for_user",
- new=AsyncMock(return_value=True),
- ),
patch(
"backend.copilot.sdk.service.fetch_warm_context",
new=AsyncMock(return_value=None),
@@ -215,10 +186,6 @@ async def test_fetch_graphiti_context_handles_none_message():
session = _make_session("user-1")
fetch_mock = AsyncMock(return_value="ctx")
with (
- patch(
- "backend.copilot.sdk.service.is_enabled_for_user",
- new=AsyncMock(return_value=True),
- ),
patch(
"backend.copilot.sdk.service.fetch_warm_context",
new=fetch_mock,
diff --git a/autogpt_platform/backend/backend/copilot/sdk/retry_scenarios_test.py b/autogpt_platform/backend/backend/copilot/sdk/retry_scenarios_test.py
index ea5547e343..33a23ab3b7 100644
--- a/autogpt_platform/backend/backend/copilot/sdk/retry_scenarios_test.py
+++ b/autogpt_platform/backend/backend/copilot/sdk/retry_scenarios_test.py
@@ -85,6 +85,7 @@ from .conftest import build_test_transcript as _build_transcript
from .service import (
_MAX_STREAM_ATTEMPTS,
_build_query_message,
+ _fetch_graphiti_context,
_maybe_prepend_skills_update,
_reduce_context,
_seed_transcript,
@@ -1068,6 +1069,11 @@ def _make_sdk_patches(
f"{_SVC}._build_system_prompt",
dict(new_callable=AsyncMock, return_value=("system prompt", None)),
),
+ (
+ f"{_SVC}._fetch_graphiti_context",
+ {"new": AsyncMock(side_effect=lambda user_id, *_: (bool(user_id), ""))},
+ ),
+ (f"{_SVC}._enqueue_graphiti_turn", {"new_callable": AsyncMock}),
(
f"{_SVC}.download_transcript",
dict(
@@ -1313,7 +1319,6 @@ class TestFollowUpWarmContextCallSite:
"backend.copilot.graphiti.context_refresh.refresh_warm_context",
dict(new=refresh),
),
- (f"{_SVC}.is_enabled_for_user", dict(new=AsyncMock(return_value=True))),
# The turn's own memory ingestion is not under test here. It runs
# as a task the turn's finally block spawns, which can outlive
# these patches, so it is not spawned at all.
@@ -1844,12 +1849,12 @@ class TestFirstTurnWarmContextIsEphemeral:
"backend.copilot.graphiti.context_refresh.refresh_warm_context",
dict(new=refresh),
),
- # The first turn's setup fetch (``_fetch_graphiti_context``).
+ # Exercise the real setup fetch instead of the shared empty stub.
+ (f"{_SVC}._fetch_graphiti_context", dict(new=_fetch_graphiti_context)),
(
f"{_SVC}.fetch_warm_context",
dict(new=AsyncMock(return_value=first_block)),
),
- (f"{_SVC}.is_enabled_for_user", dict(new=AsyncMock(return_value=True))),
(f"{_SVC}._graphiti_ingest_allowed", dict(return_value=False)),
# The rest of the first turn's prefix, without its network reads.
(
diff --git a/autogpt_platform/backend/backend/copilot/sdk/service.py b/autogpt_platform/backend/backend/copilot/sdk/service.py
index ced6ceea0e..5a5aba6338 100644
--- a/autogpt_platform/backend/backend/copilot/sdk/service.py
+++ b/autogpt_platform/backend/backend/copilot/sdk/service.py
@@ -99,7 +99,6 @@ from backend.util.llm.provider_billing import (
is_provider_out_of_credits,
report_provider_out_of_credits,
)
-from backend.util.feature_flag import Flag, is_feature_enabled
from backend.util.prompt import (
DEFAULT_COMPRESSION_RESERVE,
estimate_token_count,
@@ -121,7 +120,6 @@ from ..constants import (
)
from ..session_cleanup import prune_orphan_tool_calls
from ..context import encode_cwd_for_cli, get_workspace_manager
-from ..graphiti.config import is_enabled_for_user
from ..hidden_rows import visible_to_model
from ..model_normalize import normalize_model_for_transport
from backend.data.llm_registry.llm_models import MODEL_DATE_SUFFIX_RE
@@ -5391,14 +5389,7 @@ async def stream_chat_completion_sdk( # pyright: ignore[reportGeneralTypeIssues
auto_mode_supplement = approval_mode_supplement(
await active_mode(user_id, session)
)
- # The whole expert-team surface rides the hire-experts flag, failing
- # closed for anonymous turns. Resolved here rather than at the
- # tool-hiding site below so the delegation rules can be gated on the
- # same boolean — a flag-off turn must not be told to call tools that
- # were never registered with the MCP server.
- experts_enabled = bool(user_id) and await is_feature_enabled(
- Flag.HIRE_EXPERTS, user_id, default=False
- )
+ experts_enabled = bool(user_id)
delegation_supplement = get_delegation_supplement() if experts_enabled else ""
oversight_supplement = get_expert_oversight_supplement(
experts_enabled=experts_enabled, expert_id=session.expert_id
@@ -6962,7 +6953,7 @@ async def stream_chat_completion_sdk( # pyright: ignore[reportGeneralTypeIssues
# --- Skill learning: record this turn as a learning source ---
# Independent of Graphiti: a memory-service failure must not change
# what the nightly learner can consider. Fire-and-forget; the
- # helper is flag-gated and never raises.
+ # helper honors the user's learning preferences and never raises.
if expert_identity_validated and user_id and message and is_user_message:
_capture_task = asyncio.create_task(
capture_chat_turn(
@@ -7212,7 +7203,7 @@ async def _fetch_graphiti_context(
session: ChatSession,
message: str | None,
) -> tuple[bool, str]:
- """Check Graphiti flag and fetch warm context in one shot.
+ """Fetch warm context for authenticated users.
Returns ``(graphiti_enabled, warm_ctx)`` where ``warm_ctx`` is a
pre-loaded fact bundle for the first turn's query (not the system
@@ -7222,8 +7213,7 @@ async def _fetch_graphiti_context(
never stored in the user's message. Skips the fetch on follow-up turns
(history > 1 message) and when the user is anonymous.
"""
- enabled = await is_enabled_for_user(user_id)
- if not enabled:
+ if not user_id:
return False, ""
if not (user_id and len(session.messages) <= 1):
return True, ""
diff --git a/autogpt_platform/backend/backend/copilot/stream_drift/conftest.py b/autogpt_platform/backend/backend/copilot/stream_drift/conftest.py
index 1d0ea4e7b0..a2e358e6be 100644
--- a/autogpt_platform/backend/backend/copilot/stream_drift/conftest.py
+++ b/autogpt_platform/backend/backend/copilot/stream_drift/conftest.py
@@ -55,8 +55,8 @@ def baseline_offline(monkeypatch: pytest.MonkeyPatch) -> Iterator[None]:
),
"_build_system_prompt": ("System prompt", None),
"build_turn_budget_block": "",
- "is_enabled_for_user": False,
- "is_feature_enabled": False,
+ "_fetch_graphiti_context": "",
+ "enqueue_conversation_turn": None,
"persist_and_record_usage": None,
"download_transcript": None,
}.items():
diff --git a/autogpt_platform/backend/backend/copilot/tools/__init__.py b/autogpt_platform/backend/backend/copilot/tools/__init__.py
index 6b2ffb1f3e..836c5d94c7 100644
--- a/autogpt_platform/backend/backend/copilot/tools/__init__.py
+++ b/autogpt_platform/backend/backend/copilot/tools/__init__.py
@@ -242,7 +242,7 @@ DEFERRED_TOOL_NAMES: frozenset[str] = frozenset(TOOL_REGISTRY) - EAGER_CORE
# Capability groups a tool may belong to. The service layer can hide all
# tools in a group when the backing capability isn't available to this user
-# (e.g. Graphiti memory behind a feature flag), so the model doesn't reach
+# (e.g. memory on an anonymous turn), so the model doesn't reach
# for tools whose backend is off and then hit opaque runtime errors. Add
# a new group by extending ``ToolGroup`` and registering its members in
# ``TOOL_GROUPS`` below.
@@ -276,7 +276,7 @@ TOOL_GROUPS: dict[str, ToolGroup] = {
"read_expert_chat": "expert_admin",
# Delegation works from either side of ``session.expert_id`` (Otto
# and expert sessions alike), so it has its own group: the engines
- # disable it only when the user's hire-experts flag is off.
+ # disable it only for unauthenticated turns.
"delegate_to_expert": "delegation",
# A consult is read-only and costs one bounded completion, but it is
# meaningless without teammates to ask, so it rides the same gate.
@@ -300,8 +300,7 @@ TOOL_GROUPS: dict[str, ToolGroup] = {
"revoke_expert_credential": "expert_admin",
# Only an expert has someone to ask.
"request_credential_grant": "experts",
- # Read-only, but it shares the same gate: with the flag off there is no
- # team to list.
+ # Team reads require an authenticated owner.
"list_team": "delegation",
}
@@ -316,7 +315,7 @@ def expert_tool_disabled_groups(
) -> list[ToolGroup]:
"""Expert-team groups to disable for a turn — shared by both engines.
- Without the hire-experts flag every team tool is hidden. With it, the
+ For unauthenticated turns every team tool is hidden. Otherwise, the
split follows the session role: an expert session loses the staffing
tools (``expert_admin``), a plain Otto session loses the
expert-session tools (``experts``).
diff --git a/autogpt_platform/backend/backend/copilot/tools/capability_tools_test.py b/autogpt_platform/backend/backend/copilot/tools/capability_tools_test.py
index d1206a5040..813a94f517 100644
--- a/autogpt_platform/backend/backend/copilot/tools/capability_tools_test.py
+++ b/autogpt_platform/backend/backend/copilot/tools/capability_tools_test.py
@@ -66,11 +66,13 @@ def _clean_context():
@pytest.fixture(autouse=True)
def _no_experts():
- """Expert entries are per user and read from the database; with
- hire-experts off the layer is empty (``expert_capabilities_test`` covers it)."""
+ """Keep capability-only tests independent of the expert database."""
with patch(
- "backend.copilot.tools.session_registry.is_feature_enabled",
- AsyncMock(return_value=False),
+ "backend.copilot.tools.session_registry.experts_db",
+ return_value=MagicMock(
+ list_experts=AsyncMock(return_value=[]),
+ list_templates=AsyncMock(return_value=[]),
+ ),
):
yield
diff --git a/autogpt_platform/backend/backend/copilot/tools/expert_capabilities_test.py b/autogpt_platform/backend/backend/copilot/tools/expert_capabilities_test.py
index 972bfd2ed4..f653de100d 100644
--- a/autogpt_platform/backend/backend/copilot/tools/expert_capabilities_test.py
+++ b/autogpt_platform/backend/backend/copilot/tools/expert_capabilities_test.py
@@ -89,7 +89,6 @@ def team():
db.with_bundled_skills = AsyncMock(side_effect=lambda templates, _user: templates)
_hireable_roster.cache_clear()
with (
- patch(f"{_SR}.is_feature_enabled", AsyncMock(return_value=True)),
patch(f"{_SR}.experts_db", MagicMock(return_value=db)),
patch(f"{_SR}.is_skills_feature_enabled", AsyncMock(return_value=False)),
patch(
diff --git a/autogpt_platform/backend/backend/copilot/tools/graphiti_forget.py b/autogpt_platform/backend/backend/copilot/tools/graphiti_forget.py
index 286631f720..f3c875c691 100644
--- a/autogpt_platform/backend/backend/copilot/tools/graphiti_forget.py
+++ b/autogpt_platform/backend/backend/copilot/tools/graphiti_forget.py
@@ -18,7 +18,6 @@ from typing import Any
from graphiti_core.edges import EntityEdge
-from backend.copilot.graphiti.config import is_enabled_for_user
from backend.copilot.graphiti.memory_model import (
ForgetResult,
MemoryForgetFailure,
@@ -118,12 +117,6 @@ class MemoryForgetSearchTool(BaseTool):
session_id=session.session_id,
)
- if not await is_enabled_for_user(user_id):
- return ErrorResponse(
- message="Memory features are not enabled for your account.",
- session_id=session.session_id,
- )
-
if not query:
return ErrorResponse(
message="A search query is required to find memories to forget.",
@@ -238,12 +231,6 @@ class MemoryForgetConfirmTool(BaseTool):
session_id=session.session_id,
)
- if not await is_enabled_for_user(user_id):
- return ErrorResponse(
- message="Memory features are not enabled for your account.",
- session_id=session.session_id,
- )
-
if not uuids:
return ErrorResponse(
message="At least one UUID is required. Use tool:memory_forget_search first.",
diff --git a/autogpt_platform/backend/backend/copilot/tools/graphiti_forget_retry_test.py b/autogpt_platform/backend/backend/copilot/tools/graphiti_forget_retry_test.py
index fe427f4a97..f623d7bed3 100644
--- a/autogpt_platform/backend/backend/copilot/tools/graphiti_forget_retry_test.py
+++ b/autogpt_platform/backend/backend/copilot/tools/graphiti_forget_retry_test.py
@@ -20,10 +20,6 @@ from backend.copilot.tools.models import MemoryForgetConfirmResponse
_MODULE = "backend.copilot.tools.graphiti_forget"
-async def _enabled(_user_id: str) -> bool:
- return True
-
-
class TestForgetConfirmWhenMemoryIsBusy:
"""A forget that found memory busy wrote nothing: the tool waits five
seconds and tries once more, then reports it."""
@@ -35,7 +31,6 @@ class TestForgetConfirmWhenMemoryIsBusy:
sleep = AsyncMock()
session = ChatSession.new("user-abc", dry_run=False)
with (
- patch(f"{_MODULE}.is_enabled_for_user", _enabled),
patch(f"{_MODULE}.retract", retract),
patch(f"{_MODULE}.asyncio.sleep", sleep),
):
@@ -54,7 +49,6 @@ class TestForgetConfirmWhenMemoryIsBusy:
retract = AsyncMock(return_value=busy)
session = ChatSession.new("user-abc", dry_run=False)
with (
- patch(f"{_MODULE}.is_enabled_for_user", _enabled),
patch(f"{_MODULE}.retract", retract),
patch(f"{_MODULE}.asyncio.sleep", AsyncMock()),
):
@@ -74,7 +68,6 @@ class TestForgetConfirmWhenMemoryIsBusy:
sleep = AsyncMock()
session = ChatSession.new("user-abc", dry_run=False)
with (
- patch(f"{_MODULE}.is_enabled_for_user", _enabled),
patch(f"{_MODULE}.retract", retract),
patch(f"{_MODULE}.asyncio.sleep", sleep),
):
diff --git a/autogpt_platform/backend/backend/copilot/tools/graphiti_forget_test.py b/autogpt_platform/backend/backend/copilot/tools/graphiti_forget_test.py
index 225db763b8..98b3683350 100644
--- a/autogpt_platform/backend/backend/copilot/tools/graphiti_forget_test.py
+++ b/autogpt_platform/backend/backend/copilot/tools/graphiti_forget_test.py
@@ -37,10 +37,6 @@ from backend.copilot.tools.models import (
_MODULE = "backend.copilot.tools.graphiti_forget"
-async def _enabled(_user_id: str) -> bool:
- return True
-
-
@pytest.fixture(autouse=True)
def lock_redis(mocker) -> FakeRedis:
"""The real ``retract`` takes the graph's write lock; keep it in memory."""
@@ -67,10 +63,7 @@ class TestExpertMemoryScope:
async def test_forget_search_uses_expert_memory_group(self) -> None:
search_facts = AsyncMock(return_value=[])
session = ChatSession.new("user-abc", dry_run=False, expert_id="expert-1")
- with (
- patch(f"{_MODULE}.is_enabled_for_user", _enabled),
- patch(f"{_MODULE}.search_facts", search_facts),
- ):
+ with (patch(f"{_MODULE}.search_facts", search_facts),):
await MemoryForgetSearchTool()._execute(
"user-abc", session, query="private fact"
)
@@ -83,10 +76,7 @@ class TestExpertMemoryScope:
async def test_forget_confirm_uses_expert_memory_group(self) -> None:
retract = AsyncMock(return_value=ForgetResult())
session = ChatSession.new("user-abc", dry_run=False, expert_id="expert-1")
- with (
- patch(f"{_MODULE}.is_enabled_for_user", _enabled),
- patch(f"{_MODULE}.retract", retract),
- ):
+ with (patch(f"{_MODULE}.retract", retract),):
await MemoryForgetConfirmTool()._execute(
"user-abc", session, uuids=["private-edge"]
)
@@ -116,10 +106,7 @@ class TestForgetSearchCandidates:
attributes={"status": status} if status else {},
)
session = ChatSession.new("user-abc", dry_run=False)
- with (
- patch(f"{_MODULE}.is_enabled_for_user", _enabled),
- patch(f"{_MODULE}.search_facts", AsyncMock(return_value=[edge])),
- ):
+ with (patch(f"{_MODULE}.search_facts", AsyncMock(return_value=[edge])),):
response = await MemoryForgetSearchTool()._execute(
"user-abc", session, query="atlas"
)
@@ -162,7 +149,6 @@ class TestForgetSearchForgottenCandidates:
session = ChatSession.new("user-abc", dry_run=False)
search_forgotten = AsyncMock(return_value=forgotten)
with (
- patch(f"{_MODULE}.is_enabled_for_user", _enabled),
patch(f"{_MODULE}.search_facts", AsyncMock(return_value=live)),
patch(f"{_MODULE}.search_forgotten_facts", search_forgotten),
patch(f"{_MODULE}.recheck", AsyncMock(return_value=(live, []))),
@@ -295,10 +281,7 @@ class TestForgetConfirmModes:
async def test_hard_delete_asks_for_a_hard_retract(self) -> None:
retract = AsyncMock(return_value=ForgetResult(deleted=["e1"]))
session = ChatSession.new("user-abc", dry_run=False)
- with (
- patch(f"{_MODULE}.is_enabled_for_user", _enabled),
- patch(f"{_MODULE}.retract", retract),
- ):
+ with (patch(f"{_MODULE}.retract", retract),):
response = await MemoryForgetConfirmTool()._execute(
"user-abc", session, uuids=["e1"], hard_delete=True
)
@@ -313,10 +296,7 @@ class TestForgetConfirmModes:
"""The user hears of the dream's facts the forget retracted too."""
result = ForgetResult(deleted=["e1"], derived=["d1", "d2", "d3"])
session = ChatSession.new("user-abc", dry_run=False)
- with (
- patch(f"{_MODULE}.is_enabled_for_user", _enabled),
- patch(f"{_MODULE}.retract", AsyncMock(return_value=result)),
- ):
+ with (patch(f"{_MODULE}.retract", AsyncMock(return_value=result)),):
response = await MemoryForgetConfirmTool()._execute(
"user-abc", session, uuids=["e1"]
)
@@ -331,10 +311,7 @@ class TestForgetConfirmModes:
@pytest.mark.asyncio
async def test_unavailable_graph_is_an_error_response(self) -> None:
session = ChatSession.new("user-abc", dry_run=False)
- with (
- patch(f"{_MODULE}.is_enabled_for_user", _enabled),
- patch(f"{_MODULE}.retract", AsyncMock(side_effect=OSError("refused"))),
- ):
+ with (patch(f"{_MODULE}.retract", AsyncMock(side_effect=OSError("refused"))),):
response = await MemoryForgetConfirmTool()._execute(
"user-abc", session, uuids=["e1"]
)
@@ -358,7 +335,6 @@ class TestForgetFailuresAreActionable:
driver = _mock_driver([], []) # the lookup finds nothing, nothing names it
session = ChatSession.new("user-abc", dry_run=False)
with (
- patch(f"{_MODULE}.is_enabled_for_user", _enabled),
patch(
"backend.copilot.graphiti.recall_forget.open_driver",
MagicMock(return_value=driver),
@@ -397,7 +373,6 @@ class TestForgetFailuresAreActionable:
)
session = ChatSession.new("user-abc", dry_run=False)
with (
- patch(f"{_MODULE}.is_enabled_for_user", _enabled),
patch(
"backend.copilot.graphiti.recall_forget.open_driver",
MagicMock(return_value=driver),
@@ -428,7 +403,6 @@ class TestForgetFailuresAreActionable:
)
session = ChatSession.new("user-abc", dry_run=False)
with (
- patch(f"{_MODULE}.is_enabled_for_user", _enabled),
patch(
"backend.copilot.graphiti.recall_forget.open_driver",
MagicMock(return_value=driver),
diff --git a/autogpt_platform/backend/backend/copilot/tools/graphiti_search.py b/autogpt_platform/backend/backend/copilot/tools/graphiti_search.py
index 7f413d51ed..a1b55b2a58 100644
--- a/autogpt_platform/backend/backend/copilot/tools/graphiti_search.py
+++ b/autogpt_platform/backend/backend/copilot/tools/graphiti_search.py
@@ -6,7 +6,6 @@ from typing import Any
from graphiti_core.edges import EntityEdge
-from backend.copilot.graphiti.config import is_enabled_for_user
from backend.copilot.graphiti.recall import recent_episodes, search_facts
from backend.copilot.graphiti.recall_recheck import recheck
from backend.copilot.graphiti.recall_render import episode_scope, render, render_episode
@@ -87,12 +86,6 @@ class MemorySearchTool(BaseTool):
session_id=session.session_id,
)
- if not await is_enabled_for_user(user_id):
- return ErrorResponse(
- message="Memory features are not enabled for your account.",
- session_id=session.session_id,
- )
-
if not query:
return ErrorResponse(
message="A search query is required.",
diff --git a/autogpt_platform/backend/backend/copilot/tools/graphiti_search_test.py b/autogpt_platform/backend/backend/copilot/tools/graphiti_search_test.py
index 2b2bf9040a..9402cf20ec 100644
--- a/autogpt_platform/backend/backend/copilot/tools/graphiti_search_test.py
+++ b/autogpt_platform/backend/backend/copilot/tools/graphiti_search_test.py
@@ -60,7 +60,6 @@ async def _search(
record_recall = MagicMock(return_value="hit-coroutine")
spawn = MagicMock()
with (
- patch(f"{_MODULE}.is_enabled_for_user", AsyncMock(return_value=True)),
patch(f"{_MODULE}.search_facts", search_facts),
patch(f"{_MODULE}.recent_episodes", recent_episodes),
patch(f"{_MODULE}.recheck", recheck),
@@ -159,7 +158,6 @@ async def test_scope_filter_drops_other_scopes_even_for_long_envelopes() -> None
async def test_search_failure_is_reported_not_raised() -> None:
session = ChatSession.new("user-1", dry_run=False)
with (
- patch(f"{_MODULE}.is_enabled_for_user", AsyncMock(return_value=True)),
patch(f"{_MODULE}.search_facts", AsyncMock(side_effect=RuntimeError("down"))),
patch(f"{_MODULE}.recent_episodes", AsyncMock(return_value=[])),
):
diff --git a/autogpt_platform/backend/backend/copilot/tools/graphiti_store.py b/autogpt_platform/backend/backend/copilot/tools/graphiti_store.py
index 50c272c52d..800ed7c710 100644
--- a/autogpt_platform/backend/backend/copilot/tools/graphiti_store.py
+++ b/autogpt_platform/backend/backend/copilot/tools/graphiti_store.py
@@ -3,7 +3,6 @@
import logging
from typing import Any
-from backend.copilot.graphiti.config import is_enabled_for_user
from backend.copilot.graphiti.ingest import (
MAX_EPISODE_BODY_BYTES,
enqueue_episode,
@@ -179,12 +178,6 @@ class MemoryStoreTool(BaseTool):
session_id=session.session_id,
)
- if not await is_enabled_for_user(user_id):
- return ErrorResponse(
- message="Memory features are not enabled for your account.",
- session_id=session.session_id,
- )
-
if not name or not content:
return ErrorResponse(
message="Both 'name' and 'content' are required.",
diff --git a/autogpt_platform/backend/backend/copilot/tools/graphiti_store_test.py b/autogpt_platform/backend/backend/copilot/tools/graphiti_store_test.py
index d7d58ab7fa..2fc6e05c3f 100644
--- a/autogpt_platform/backend/backend/copilot/tools/graphiti_store_test.py
+++ b/autogpt_platform/backend/backend/copilot/tools/graphiti_store_test.py
@@ -50,11 +50,6 @@ class TestMemoryStoreTool:
mock_enqueue = AsyncMock(return_value=True)
with (
- patch(
- "backend.copilot.tools.graphiti_store.is_enabled_for_user",
- new_callable=AsyncMock,
- return_value=True,
- ),
patch(
"backend.copilot.tools.graphiti_store.enqueue_episode",
mock_enqueue,
@@ -87,14 +82,19 @@ class TestMemoryStoreTool:
assert result.session_id == "test-session"
@pytest.mark.asyncio
- async def test_store_feature_disabled_returns_error(self):
+ async def test_store_does_not_depend_on_a_flag_provider(self):
tool = MemoryStoreTool()
session = _make_session()
- with patch(
- "backend.copilot.tools.graphiti_store.is_enabled_for_user",
- new_callable=AsyncMock,
- return_value=False,
+ with (
+ patch(
+ "backend.util.feature_flag.is_feature_enabled",
+ new=AsyncMock(side_effect=RuntimeError("provider unavailable")),
+ ) as flags,
+ patch(
+ "backend.copilot.tools.graphiti_store.enqueue_episode",
+ new=AsyncMock(return_value=True),
+ ) as enqueue,
):
result = await tool._execute(
user_id="user-1",
@@ -103,25 +103,21 @@ class TestMemoryStoreTool:
content="likes python",
)
- assert isinstance(result, ErrorResponse)
- assert "not enabled" in result.message
+ assert isinstance(result, MemoryStoreResponse)
+ enqueue.assert_awaited_once()
+ flags.assert_not_called()
@pytest.mark.asyncio
async def test_store_missing_name_returns_error(self):
tool = MemoryStoreTool()
session = _make_session()
- with patch(
- "backend.copilot.tools.graphiti_store.is_enabled_for_user",
- new_callable=AsyncMock,
- return_value=True,
- ):
- result = await tool._execute(
- user_id="user-1",
- session=session,
- name="",
- content="likes python",
- )
+ result = await tool._execute(
+ user_id="user-1",
+ session=session,
+ name="",
+ content="likes python",
+ )
assert isinstance(result, ErrorResponse)
assert "'name' and 'content' are required" in result.message
@@ -131,17 +127,12 @@ class TestMemoryStoreTool:
tool = MemoryStoreTool()
session = _make_session()
- with patch(
- "backend.copilot.tools.graphiti_store.is_enabled_for_user",
- new_callable=AsyncMock,
- return_value=True,
- ):
- result = await tool._execute(
- user_id="user-1",
- session=session,
- name="pref",
- content="",
- )
+ result = await tool._execute(
+ user_id="user-1",
+ session=session,
+ name="pref",
+ content="",
+ )
assert isinstance(result, ErrorResponse)
assert "'name' and 'content' are required" in result.message
@@ -151,17 +142,12 @@ class TestMemoryStoreTool:
tool = MemoryStoreTool()
session = _make_session()
- with patch(
- "backend.copilot.tools.graphiti_store.is_enabled_for_user",
- new_callable=AsyncMock,
- return_value=True,
- ):
- result = await tool._execute(
- user_id="user-1",
- session=session,
- name="",
- content="",
- )
+ result = await tool._execute(
+ user_id="user-1",
+ session=session,
+ name="",
+ content="",
+ )
assert isinstance(result, ErrorResponse)
assert "'name' and 'content' are required" in result.message
@@ -174,11 +160,6 @@ class TestMemoryStoreTool:
mock_enqueue = AsyncMock()
with (
- patch(
- "backend.copilot.tools.graphiti_store.is_enabled_for_user",
- new_callable=AsyncMock,
- return_value=True,
- ),
patch(
"backend.copilot.tools.graphiti_store.enqueue_episode",
mock_enqueue,
@@ -214,11 +195,6 @@ class TestMemoryStoreTool:
mock_enqueue = AsyncMock()
with (
- patch(
- "backend.copilot.tools.graphiti_store.is_enabled_for_user",
- new_callable=AsyncMock,
- return_value=True,
- ),
patch(
"backend.copilot.tools.graphiti_store.enqueue_episode",
mock_enqueue,
@@ -247,11 +223,6 @@ class TestMemoryStoreTool:
mock_enqueue = AsyncMock(return_value=True)
with (
- patch(
- "backend.copilot.tools.graphiti_store.is_enabled_for_user",
- new_callable=AsyncMock,
- return_value=True,
- ),
patch(
"backend.copilot.tools.graphiti_store.enqueue_episode",
mock_enqueue,
@@ -275,11 +246,6 @@ class TestMemoryStoreTool:
mock_enqueue = AsyncMock(return_value=True)
with (
- patch(
- "backend.copilot.tools.graphiti_store.is_enabled_for_user",
- new_callable=AsyncMock,
- return_value=True,
- ),
patch(
"backend.copilot.tools.graphiti_store.enqueue_episode",
mock_enqueue,
@@ -305,11 +271,6 @@ class TestMemoryStoreTool:
mock_enqueue = AsyncMock()
with (
- patch(
- "backend.copilot.tools.graphiti_store.is_enabled_for_user",
- new_callable=AsyncMock,
- return_value=True,
- ),
patch(
"backend.copilot.tools.graphiti_store.enqueue_episode",
mock_enqueue,
@@ -337,11 +298,6 @@ class TestMemoryStoreTool:
mock_enqueue = AsyncMock()
with (
- patch(
- "backend.copilot.tools.graphiti_store.is_enabled_for_user",
- new_callable=AsyncMock,
- return_value=True,
- ),
patch(
"backend.copilot.tools.graphiti_store.enqueue_episode",
mock_enqueue,
@@ -367,11 +323,6 @@ class TestMemoryStoreTool:
session = _make_session()
with (
- patch(
- "backend.copilot.tools.graphiti_store.is_enabled_for_user",
- new_callable=AsyncMock,
- return_value=True,
- ),
patch(
"backend.copilot.tools.graphiti_store.enqueue_episode",
new_callable=AsyncMock,
@@ -403,11 +354,6 @@ class TestMemoryStoreTool:
mock_enqueue = AsyncMock()
with (
- patch(
- "backend.copilot.tools.graphiti_store.is_enabled_for_user",
- new_callable=AsyncMock,
- return_value=True,
- ),
patch(
"backend.copilot.tools.graphiti_store.enqueue_episode",
mock_enqueue,
@@ -438,11 +384,6 @@ class TestMemoryStoreTool:
mock_enqueue = AsyncMock()
with (
- patch(
- "backend.copilot.tools.graphiti_store.is_enabled_for_user",
- new_callable=AsyncMock,
- return_value=True,
- ),
patch(
"backend.copilot.tools.graphiti_store.enqueue_episode",
mock_enqueue,
@@ -467,11 +408,6 @@ class TestMemoryStoreTool:
mock_enqueue = AsyncMock()
with (
- patch(
- "backend.copilot.tools.graphiti_store.is_enabled_for_user",
- new_callable=AsyncMock,
- return_value=True,
- ),
patch(
"backend.copilot.tools.graphiti_store.enqueue_episode",
mock_enqueue,
diff --git a/autogpt_platform/backend/backend/copilot/tools/helpers.py b/autogpt_platform/backend/backend/copilot/tools/helpers.py
index ffef4bfaf0..ce2405510c 100644
--- a/autogpt_platform/backend/backend/copilot/tools/helpers.py
+++ b/autogpt_platform/backend/backend/copilot/tools/helpers.py
@@ -51,8 +51,8 @@ from backend.integrations.credentials_store import provider_matches
from backend.integrations.creds_manager import IntegrationCredentialsManager
from backend.integrations.providers import ProviderName
from backend.util.exceptions import BlockError, InsufficientBalanceError
-from backend.util.feature_flag import Flag, is_feature_enabled
from backend.util.request import HTTPClientError
+from backend.util.settings import Settings
from backend.util.timezone_utils import get_user_timezone_or_utc
from backend.util.type import coerce_inputs_to_schema
@@ -1436,15 +1436,10 @@ async def check_spend_approval(
async def metered_expert_id(user_id: str, expert_id: str | None) -> str | None:
- """The expert whose spend counters a chat block charge lands on; None
- keeps the pre-SECRT-2599 behaviour of not counting chat block spend.
-
- Narrower than the scope id ``execute_block`` takes: the flag gates who
- gets metered, never whose file scope a ``workspace://`` input resolves in.
- """
+ """The expert to meter when billing is enabled, independently of file scope."""
if expert_id is None:
return None
- if not await is_feature_enabled(Flag.EXPERT_SPEND_APPROVAL, user_id):
+ if not Settings().config.enable_credit:
return None
return expert_id
diff --git a/autogpt_platform/backend/backend/copilot/tools/run_block_test.py b/autogpt_platform/backend/backend/copilot/tools/run_block_test.py
index bf414c0882..a32b9081b6 100644
--- a/autogpt_platform/backend/backend/copilot/tools/run_block_test.py
+++ b/autogpt_platform/backend/backend/copilot/tools/run_block_test.py
@@ -1720,7 +1720,7 @@ class TestSpendApproval:
return block
@staticmethod
- def _patches(block, gate, *, cost: int = 5, flag: bool = True):
+ def _patches(block, gate, *, cost: int = 5, billing_enabled: bool = True):
credit = MagicMock(
get_credits=AsyncMock(return_value=1_000), spend_credits=AsyncMock()
)
@@ -1741,8 +1741,8 @@ class TestSpendApproval:
patch("backend.copilot.tools.helpers.credit_db", return_value=credit),
patch("backend.copilot.tools.helpers.workspace_db", return_value=workspace),
patch(
- "backend.copilot.tools.helpers.is_feature_enabled",
- AsyncMock(return_value=flag),
+ "backend.copilot.tools.helpers.Settings",
+ return_value=MagicMock(config=MagicMock(enable_credit=billing_enabled)),
),
]
@@ -1796,11 +1796,11 @@ class TestSpendApproval:
gate.spend_approval_required.assert_not_awaited()
@pytest.mark.asyncio(loop_scope="session")
- @pytest.mark.parametrize("flag", [True, False])
- async def test_below_threshold_meters_only_with_the_flag_but_always_scopes(
- self, flag
+ @pytest.mark.parametrize("billing_enabled", [True, False])
+ async def test_below_threshold_meters_only_when_billing_enabled_but_always_scopes(
+ self, billing_enabled
):
- """The flag gates who is metered, never whose file scope the block
+ """Billing controls who is metered, never whose file scope the block
runs in — ``workspace://`` inputs resolve against the session's expert
either way."""
session = make_session(user_id=_TEST_USER_ID, expert_id="expert-1")
@@ -1818,12 +1818,14 @@ class TestSpendApproval:
with patch(
"backend.copilot.tools.helpers.add_weekly_spend", AsyncMock()
) as add_spend:
- response = await self._run(session, block, gate, flag=flag)
+ response = await self._run(
+ session, block, gate, billing_enabled=billing_enabled
+ )
assert isinstance(response, BlockOutputResponse)
assert block.executed
assert captured["ctx"].expert_id == "expert-1"
- if flag:
+ if billing_enabled:
add_spend.assert_awaited_once_with("expert-1", 5)
else:
add_spend.assert_not_awaited()
diff --git a/autogpt_platform/backend/backend/copilot/tools/session_registry.py b/autogpt_platform/backend/backend/copilot/tools/session_registry.py
index 8ffb966d83..6da0696972 100644
--- a/autogpt_platform/backend/backend/copilot/tools/session_registry.py
+++ b/autogpt_platform/backend/backend/copilot/tools/session_registry.py
@@ -28,7 +28,6 @@ from backend.copilot.capabilities.sources import (
from backend.copilot.model import ChatSession
from backend.data.db_accessors import experts_db
from backend.util.cache import cached
-from backend.util.feature_flag import Flag, is_feature_enabled
from .skills import SKILLS_INDEX_CACHE_TTL_S, is_skills_feature_enabled, list_all_skills
@@ -132,11 +131,9 @@ async def session_expert_entries(
user_id: str, session: ChatSession
) -> list[CapabilityEntry]:
"""Roster templates this session may hire and the teammates it may hand
- work to; ``[]`` when hire-experts is off or a read fails, so an experts
+ work to; ``[]`` when a read fails, so an experts
hiccup never takes capability search down with it."""
try:
- if not await is_feature_enabled(Flag.HIRE_EXPERTS, user_id, default=False):
- return []
team = await experts_db().list_experts(user_id, with_metrics=False)
templates = await _hireable_roster(user_id) if may_hire(session) else []
except Exception:
diff --git a/autogpt_platform/backend/backend/copilot/tools/skill_write_config_test.py b/autogpt_platform/backend/backend/copilot/tools/skill_write_config_test.py
new file mode 100644
index 0000000000..868ca18f31
--- /dev/null
+++ b/autogpt_platform/backend/backend/copilot/tools/skill_write_config_test.py
@@ -0,0 +1,141 @@
+from datetime import UTC, datetime
+from unittest.mock import AsyncMock
+
+import pytest
+
+from backend.copilot.tools import skills
+from backend.data.skill_capacity import SKILL_ORIGIN_MARKETPLACE
+from backend.data.workspace import WorkspaceFile
+from backend.data.workspace_skill import WorkspaceSkillPublication, WorkspaceSkillWrite
+from backend.util import workspace, workspace_storage
+from backend.util.settings import Config
+
+
+def package_writes(monkeypatch):
+ manager = workspace.WorkspaceManager("owner", "workspace")
+ database = AsyncMock()
+ database.get_workspace_total_size.return_value = 0
+ database.get_workspace_file_by_path.return_value = None
+ database.list_workspace_files.return_value = []
+ publisher = AsyncMock()
+ publisher.publish_workspace_skill_file.side_effect = _published
+ storage = AsyncMock()
+ storage.store.return_value = "test://package"
+ monkeypatch.setattr(workspace_storage, "_local_storage", storage)
+ monkeypatch.setattr(workspace, "workspace_db", lambda: database)
+ monkeypatch.setattr(workspace, "workspace_skill_db", lambda: publisher)
+ limit = AsyncMock(return_value=10_000_000)
+ monkeypatch.setattr(workspace, "get_workspace_storage_limit_bytes", limit)
+ scan = AsyncMock()
+ monkeypatch.setattr(workspace, "scan_content_safe", scan)
+ monkeypatch.setattr(manager, "_schedule_embedding", lambda *_: None)
+ monkeypatch.setattr(
+ skills, "_acquire_skill_write_lock", AsyncMock(return_value=None)
+ )
+ monkeypatch.setattr(
+ skills, "_get_user_skill_manager", AsyncMock(return_value=manager)
+ )
+ monkeypatch.setattr(
+ skills, "_list_user_skills_from_workspace", AsyncMock(return_value=[])
+ )
+ monkeypatch.setattr(skills, "invalidate_skills_index_cache", AsyncMock())
+ monkeypatch.setenv("PRIVATE_USER_DATA_BUCKET", "")
+ monkeypatch.setenv("MEDIA_GCS_BUCKET_NAME", "")
+ monkeypatch.setenv("BEHAVE_AS", "local")
+ monkeypatch.setenv("MAX_FILE_SIZE_MB", "2")
+ return database, publisher, storage, limit, scan
+
+
+def _published(write: WorkspaceSkillWrite) -> WorkspaceSkillPublication:
+ return WorkspaceSkillPublication(
+ status="stored",
+ file=WorkspaceFile(
+ id=write.file_id,
+ workspace_id=write.workspace_id,
+ name=write.name,
+ path=write.path,
+ storage_path=write.storage_path,
+ mime_type=write.mime_type,
+ size_bytes=write.size_bytes,
+ created_at=datetime.now(UTC),
+ updated_at=datetime.now(UTC),
+ ),
+ )
+
+
+async def _write_batch(files: list[skills.SkillFile] | None = None):
+ return await skills.store_user_skills(
+ "owner",
+ [
+ skills.SkillWrite(
+ name=f"skill-{i}", description="Example", body="body", files=files
+ )
+ for i in range(3)
+ ],
+ origin=SKILL_ORIGIN_MARKETPLACE,
+ notify_updates=False,
+ )
+
+
+async def test_skill_batch_reads_configuration_once_and_checks_each_write(
+ monkeypatch, package_writes
+):
+ database, publisher, storage, limit, scan = package_writes
+ reads = []
+ initialize = Config.__init__
+
+ def record_config(self, *args, **kwargs):
+ reads.append(None)
+ initialize(self, *args, **kwargs)
+
+ monkeypatch.setattr(Config, "__init__", record_config)
+
+ outcomes = await _write_batch()
+
+ assert all(isinstance(outcome, skills.StoredSkill) for outcome in outcomes)
+ assert len(reads) == 1
+ assert [
+ call.args[0].path
+ for call in publisher.publish_workspace_skill_file.await_args_list
+ ] == [f"/skills/skill-{i}/SKILL.md" for i in range(3)]
+ assert limit.await_count == database.get_workspace_total_size.await_count == 3
+ assert scan.await_count == storage.store.await_count == 3
+
+
+async def test_later_skill_batch_observes_a_changed_file_size_limit(
+ monkeypatch, package_writes
+):
+ _, publisher, _, _, _ = package_writes
+
+ files = [
+ skills.SkillFile(relative_path="guide.txt", content=b"x" * (1024 * 1024 + 1))
+ ]
+ outcomes = await _write_batch(files)
+ assert all(isinstance(outcome, skills.StoredSkill) for outcome in outcomes)
+
+ monkeypatch.setenv("MAX_FILE_SIZE_MB", "1")
+ refused = await _write_batch(files)
+
+ assert all(isinstance(outcome, ValueError) for outcome in refused)
+ assert all("1MB limit" in str(outcome) for outcome in refused)
+ assert publisher.publish_workspace_skill_file.await_count == 3
+
+
+async def test_skill_batch_rechecks_quota_before_each_package(package_writes):
+ _, publisher, _, limit, _ = package_writes
+ limit.side_effect = [10_000_000, 1, 10_000_000]
+
+ first, second, third = await _write_batch()
+
+ assert isinstance(first, skills.StoredSkill)
+ assert isinstance(second, ValueError)
+ assert "Storage limit exceeded" in str(second)
+ assert isinstance(third, skills.StoredSkill)
+ assert [
+ call.args[0].path
+ for call in publisher.publish_workspace_skill_file.await_args_list
+ ] == ["/skills/skill-0/SKILL.md", "/skills/skill-2/SKILL.md"]
diff --git a/autogpt_platform/backend/backend/copilot/tools/skills.py b/autogpt_platform/backend/backend/copilot/tools/skills.py
index 1250b0e6d4..e95a6b33e7 100644
--- a/autogpt_platform/backend/backend/copilot/tools/skills.py
+++ b/autogpt_platform/backend/backend/copilot/tools/skills.py
@@ -98,6 +98,7 @@ from backend.data.workspace_scope import (
from backend.executor.cluster_lock import AsyncClusterLock
from backend.util.exceptions import ConflictError
from backend.util.feature_flag import Flag, is_feature_enabled
+from backend.util.settings import Config
from backend.util.workspace import SkillPackageFile, WorkspaceManager
from backend.util.workspace_storage import compute_file_checksum
@@ -1155,7 +1156,8 @@ async def store_user_skills(
) -> list[StoredSkill | Exception]:
""":func:`store_user_skill` for several skills under one write lock and
one listing of the owner's folder; returns each write's outcome in order,
- so one bad skill fails alone."""
+ so one bad skill fails alone. File/storage configuration is read once
+ per batch; each package still checks the current storage quota."""
outcomes: list[StoredSkill | Exception | None] = []
prepared: list[tuple[int, _PreparedSkill]] = []
for write in writes:
@@ -1178,6 +1180,7 @@ async def store_user_skills(
owners = {s.name for s in existing if s.origin == SKILL_ORIGIN_USER}
copies = {s.name: s for s in existing if _keeps_install(s.origin, s.baseline)}
stored: list[tuple[int, str]] = []
+ config: Config | None = None
for index, skill in prepared:
# A batch outlasts one lease, so renew it before each skill. Once
# it is lost another writer may hold the key: finish best-effort,
@@ -1211,8 +1214,17 @@ async def store_user_skills(
)
)
is_new = skill.parsed.name not in same_origin
+ if config is None:
+ config = Config()
checksums = await _write_skill(
- manager, skill, expert_id, origin, same_origin, owners, copies
+ manager,
+ skill,
+ expert_id,
+ origin,
+ same_origin,
+ owners,
+ copies,
+ config,
)
except Exception as e:
outcomes[index] = e
@@ -1519,6 +1531,7 @@ async def _write_skill(
same_origin: set[str],
owners: set[str],
copies: Mapping[str, ParsedSkill],
+ config: Config,
) -> frozenset[str]:
"""Write one prepared package; return the SHA-256 of every file written.
@@ -1592,6 +1605,7 @@ async def _write_skill(
files=changed,
removed_paths=sorted(f.path for f in stale if f.path not in written),
scanned_checksums=skill.scanned_checksums,
+ config=config,
)
checksums.add(compute_file_checksum(skill_md))
return frozenset(checksums)
diff --git a/autogpt_platform/backend/backend/copilot/tools/skills_test.py b/autogpt_platform/backend/backend/copilot/tools/skills_test.py
index 59c761a3b2..ab4deecf21 100644
--- a/autogpt_platform/backend/backend/copilot/tools/skills_test.py
+++ b/autogpt_platform/backend/backend/copilot/tools/skills_test.py
@@ -281,7 +281,7 @@ class _FakeWorkspaceManager:
self.scanned[path] = frozenset(scanned_checksums)
async def write_skill_package(
- self, *, root, files, removed_paths, scanned_checksums=()
+ self, *, root, files, removed_paths, scanned_checksums=(), config=None
):
"""All or nothing, as the real manager's single transaction is: a
failure part-way puts every file back as it was."""
diff --git a/autogpt_platform/backend/backend/data/memory_schedule_db_test.py b/autogpt_platform/backend/backend/data/memory_schedule_db_test.py
index 17779c51ac..27899f0ba9 100644
--- a/autogpt_platform/backend/backend/data/memory_schedule_db_test.py
+++ b/autogpt_platform/backend/backend/data/memory_schedule_db_test.py
@@ -188,7 +188,9 @@ def _lifecycle_boundaries(monkeypatch: pytest.MonkeyPatch) -> FakeScheduler:
"""Everything but Postgres: the scheduler, flags, the timezone lookup
and the triggers the lifecycle functions touch."""
scheduler = FakeScheduler()
- monkeypatch.setattr(scope_jobs, "is_feature_enabled", AsyncMock(return_value=True))
+ monkeypatch.setattr(
+ scope_jobs, "evaluate_feature_flag", AsyncMock(return_value=(True, True))
+ )
monkeypatch.setattr(scope_jobs, "get_scheduler_client", lambda: scheduler)
monkeypatch.setattr(
registry, "resolve_user_timezone", AsyncMock(return_value="UTC")
diff --git a/autogpt_platform/backend/backend/executor/activity_status_generator.py b/autogpt_platform/backend/backend/executor/activity_status_generator.py
index 621e3fea3b..2e68058826 100644
--- a/autogpt_platform/backend/backend/executor/activity_status_generator.py
+++ b/autogpt_platform/backend/backend/executor/activity_status_generator.py
@@ -22,7 +22,6 @@ from backend.data.platform_cost import PlatformCostEntry, usd_to_microdollars
from backend.executor.cost_tracking import schedule_platform_cost_log
from backend.util.clients import get_openai_client, openrouter_helper_cost_provider
from backend.util.exceptions import ExecutionFailureReason
-from backend.util.feature_flag import Flag, is_feature_enabled
from backend.util.truncate import truncate
if TYPE_CHECKING:
@@ -250,7 +249,6 @@ async def generate_activity_status_for_execution(
user_id: str,
execution_status: ExecutionStatus | None = None,
model_name: str = _DEFAULT_MODEL_NAME,
- skip_feature_flag: bool = False,
system_prompt: str = DEFAULT_SYSTEM_PROMPT,
user_prompt: str = DEFAULT_USER_PROMPT,
skip_existing: bool = True,
@@ -267,10 +265,9 @@ async def generate_activity_status_for_execution(
graph_version: The graph version
execution_stats: Execution statistics
db_client: Database client for fetching data
- user_id: User ID for LaunchDarkly feature flag evaluation
+ user_id: Owner of the execution
execution_status: The overall execution status (COMPLETED, FAILED, TERMINATED)
model_name: AI model to use for generation (default: gpt-4o-mini)
- skip_feature_flag: Whether to skip LaunchDarkly feature flag check
system_prompt: Custom system prompt template (default: DEFAULT_SYSTEM_PROMPT)
user_prompt: Custom user prompt template with placeholders (default: DEFAULT_USER_PROMPT)
skip_existing: Whether to skip if activity_status and correctness_score already exist
@@ -279,13 +276,6 @@ async def generate_activity_status_for_execution(
Activity status response with activity_status and correctness_score, or
None if generation is disabled or skipped
"""
- # Check LaunchDarkly feature flag for AI activity status generation with full context support
- if not skip_feature_flag and not await is_feature_enabled(
- Flag.AI_ACTIVITY_STATUS, user_id
- ):
- logger.debug("AI activity status generation is disabled via LaunchDarkly")
- return None
-
# Check if we should skip existing data (for admin regeneration option).
if (
skip_existing
diff --git a/autogpt_platform/backend/backend/executor/activity_status_generator_test.py b/autogpt_platform/backend/backend/executor/activity_status_generator_test.py
index c97b68c2c3..0d37274dbc 100644
--- a/autogpt_platform/backend/backend/executor/activity_status_generator_test.py
+++ b/autogpt_platform/backend/backend/executor/activity_status_generator_test.py
@@ -471,10 +471,6 @@ class TestGenerateActivityStatusForExecution:
"backend.executor.activity_status_generator.get_openai_client",
return_value=client,
),
- patch(
- "backend.executor.activity_status_generator.is_feature_enabled",
- return_value=True,
- ),
):
mock_get_block.side_effect = lambda block_id: mock_blocks.get(block_id)
@@ -536,10 +532,6 @@ class TestGenerateActivityStatusForExecution:
"backend.executor.activity_status_generator.get_openai_client",
return_value=client,
),
- patch(
- "backend.executor.activity_status_generator.is_feature_enabled",
- return_value=True,
- ),
patch(
"backend.executor.activity_status_generator.schedule_platform_cost_log"
) as mock_schedule_log,
@@ -616,10 +608,6 @@ class TestGenerateActivityStatusForExecution:
"backend.executor.activity_status_generator.get_openai_client",
return_value=client,
),
- patch(
- "backend.executor.activity_status_generator.is_feature_enabled",
- return_value=True,
- ),
patch(
"backend.executor.activity_status_generator.schedule_platform_cost_log"
) as mock_schedule_log,
@@ -670,10 +658,6 @@ class TestGenerateActivityStatusForExecution:
"backend.executor.activity_status_generator.get_openai_client",
return_value=client,
),
- patch(
- "backend.executor.activity_status_generator.is_feature_enabled",
- return_value=True,
- ),
patch(
"backend.executor.activity_status_generator.schedule_platform_cost_log"
) as mock_schedule_log,
@@ -731,10 +715,6 @@ class TestGenerateActivityStatusForExecution:
"backend.executor.activity_status_generator.get_openai_client",
return_value=client,
),
- patch(
- "backend.executor.activity_status_generator.is_feature_enabled",
- return_value=True,
- ),
):
mock_get_block.side_effect = lambda block_id: mock_blocks.get(block_id)
@@ -783,10 +763,6 @@ class TestGenerateActivityStatusForExecution:
"backend.executor.activity_status_generator.get_openai_client",
return_value=client,
),
- patch(
- "backend.executor.activity_status_generator.is_feature_enabled",
- return_value=True,
- ),
patch(
"backend.executor.activity_status_generator.schedule_platform_cost_log"
) as mock_schedule_log,
@@ -853,10 +829,6 @@ class TestGenerateActivityStatusForExecution:
"backend.executor.activity_status_generator.get_openai_client",
return_value=client,
),
- patch(
- "backend.executor.activity_status_generator.is_feature_enabled",
- return_value=True,
- ),
):
mock_get_block.side_effect = lambda block_id: mock_blocks.get(block_id)
@@ -873,27 +845,6 @@ class TestGenerateActivityStatusForExecution:
assert result["correctness_score"] == 0.6
assert create_mock.await_count == 2
- @pytest.mark.asyncio
- async def test_generate_status_feature_disabled(self, mock_execution_stats):
- """Test activity status generation when feature is disabled."""
- mock_db_client = AsyncMock()
-
- with patch(
- "backend.executor.activity_status_generator.is_feature_enabled",
- return_value=False,
- ):
- result = await generate_activity_status_for_execution(
- graph_exec_id="test_exec",
- graph_id="test_graph",
- graph_version=1,
- execution_stats=mock_execution_stats,
- db_client=mock_db_client,
- user_id="test_user",
- )
-
- assert result is None
- mock_db_client.get_node_executions.assert_not_called()
-
@pytest.mark.asyncio
async def test_generate_status_no_openrouter_key(self, mock_execution_stats):
"""Test activity status generation when no OpenRouter key is configured.
@@ -908,10 +859,6 @@ class TestGenerateActivityStatusForExecution:
"backend.executor.activity_status_generator.get_openai_client",
return_value=None,
),
- patch(
- "backend.executor.activity_status_generator.is_feature_enabled",
- return_value=True,
- ),
):
result = await generate_activity_status_for_execution(
graph_exec_id="test_exec",
@@ -939,10 +886,6 @@ class TestGenerateActivityStatusForExecution:
"backend.executor.activity_status_generator.get_openai_client",
return_value=client,
),
- patch(
- "backend.executor.activity_status_generator.is_feature_enabled",
- return_value=True,
- ),
):
result = await generate_activity_status_for_execution(
graph_exec_id="test_exec",
@@ -984,10 +927,6 @@ class TestGenerateActivityStatusForExecution:
"backend.executor.activity_status_generator.get_openai_client",
return_value=client,
),
- patch(
- "backend.executor.activity_status_generator.is_feature_enabled",
- return_value=True,
- ),
):
mock_get_block.side_effect = lambda block_id: mock_blocks.get(block_id)
@@ -1047,10 +986,6 @@ class TestIntegration:
"backend.executor.activity_status_generator.get_openai_client",
return_value=client,
),
- patch(
- "backend.executor.activity_status_generator.is_feature_enabled",
- return_value=True,
- ),
):
mock_get_block.side_effect = lambda block_id: mock_blocks.get(block_id)
@@ -1068,34 +1003,6 @@ class TestIntegration:
assert result["correctness_score"] == 0.3
create_mock.assert_awaited_once()
- @pytest.mark.asyncio
- async def test_manager_integration_with_disabled_feature(
- self, mock_execution_stats
- ):
- """Test that when feature returns None, manager doesn't set activity_status."""
- mock_db_client = AsyncMock()
-
- with patch(
- "backend.executor.activity_status_generator.is_feature_enabled",
- return_value=False,
- ):
- result = await generate_activity_status_for_execution(
- graph_exec_id="test_exec",
- graph_id="test_graph",
- graph_version=1,
- execution_stats=mock_execution_stats,
- db_client=mock_db_client,
- user_id="test_user",
- )
-
- # Should return None when disabled
- assert result is None
-
- # Verify no database calls were made
- mock_db_client.get_node_executions.assert_not_called()
- mock_db_client.get_graph_metadata.assert_not_called()
- mock_db_client.get_graph.assert_not_called()
-
class TestDeterministicFailureResponse:
"""Tests for structured failures that skip LLM analysis."""
@@ -1170,7 +1077,6 @@ class TestDeterministicFailureResponse:
db_client=mock_db_client,
user_id="test_user",
execution_status=ExecutionStatus.FAILED,
- skip_feature_flag=True,
)
assert result is None
@@ -1196,7 +1102,6 @@ class TestDeterministicFailureResponse:
db_client=mock_db_client,
user_id="test_user",
execution_status=ExecutionStatus.FAILED,
- skip_feature_flag=True,
)
assert result is not None
@@ -1235,7 +1140,6 @@ class TestDeterministicFailureResponse:
execution_stats=stats,
db_client=mock_db_client,
user_id="test_user",
- skip_feature_flag=True,
skip_existing=skip_existing,
)
diff --git a/autogpt_platform/backend/backend/executor/scheduler.py b/autogpt_platform/backend/backend/executor/scheduler.py
index 40d3be1d1d..cb89154e4e 100644
--- a/autogpt_platform/backend/backend/executor/scheduler.py
+++ b/autogpt_platform/backend/backend/executor/scheduler.py
@@ -1543,32 +1543,17 @@ def execute_community_rebuild(user_id: str, expert_id: str | None = None):
if not _memory_scope_may_fire(scope):
return
result = _rebuild_scope_communities(scope)
- if result is not None and not result.get("error"):
+ if not result.get("error"):
_stamp_scope_run(scope, "community")
-def _rebuild_scope_communities(scope: MemoryScope) -> dict | None:
- """Flag-gated community rebuild of one scope, with its outcome logged.
+def _rebuild_scope_communities(scope: MemoryScope) -> dict:
+ """Community rebuild of one scope, with its outcome logged.
Sync wrapper around the async ``rebuild_communities_for_user`` so it
can run on the APScheduler thread pool. Failures are caught inside
the coroutine; this wrapper logs the outcome.
-
- Runtime flag gate: if ``GRAPHITI_COMMUNITIES_ENABLED`` flipped from
- on→off after the schedule was registered, this returns None instead
- of running. Registration-time gating is in
- ``add_scope_community_rebuild_schedule``; this is the third layer of
- defense (see ``copilot/dream/scheduling.py`` module docstring).
"""
- from backend.copilot.graphiti.config import is_communities_enabled_for_user
-
- if not run_async(is_communities_enabled_for_user(scope.owner_user_id)):
- logger.info(
- "Community rebuild skipped for %s — flag flipped off post-registration",
- scope_label(scope),
- )
- return None
-
result = run_async(
rebuild_communities_for_user(scope.owner_user_id, expert_id=scope.expert_id),
timeout=SCHEDULER_DREAM_OPERATION_TIMEOUT_SECONDS,
@@ -1659,34 +1644,10 @@ def execute_morning_briefing(user_id: str) -> None:
timeout=SCHEDULER_OPERATION_TIMEOUT_SECONDS,
)
logger.info("Morning briefing for user %s: %s", user_id[:12], result)
- if result.get("reason") == "flag_disabled":
- run_async(
- _self_delete_morning_briefing_schedule(user_id),
- timeout=SCHEDULER_OPERATION_TIMEOUT_SECONDS,
- )
except Exception as e:
logger.error("Morning briefing failed for user %s: %s", user_id[:12], e)
-async def _self_delete_morning_briefing_schedule(user_id: str) -> None:
- """Drop a briefing cron whose feature flag has since been turned off.
-
- The registration marker goes with it: left set, it would suppress lazy
- re-registration for the rest of its TTL if the flag comes back on.
- Best-effort — the next daily fire retries the cleanup.
- """
- from backend.copilot.briefing.scheduling import clear_briefing_registration_marker
-
- try:
- await get_scheduler_client().remove_morning_briefing_schedule(user_id=user_id)
- await clear_briefing_registration_marker(user_id)
- except Exception:
- logger.warning(
- f"Failed to remove morning briefing job for user {user_id[:12]}",
- exc_info=True,
- )
-
-
def execute_nightly_batch_sync(
user_id: str, expert_id: str | None = None
) -> "NightlyBatchResult | None":
@@ -4245,9 +4206,7 @@ class Scheduler(AppService):
# --- Graphiti community detection (P-1.7) ---
#
- # Communities are off-by-default behind LD flag ``GRAPHITI_COMMUNITIES_ENABLED``.
- # Registration checks the flag here too (defense in depth: the registry
- # gates first). Rebuilds run weekly at owner-local 04:00 on Mondays
+ # Rebuilds run weekly at owner-local 04:00 on Mondays
# (``0 4 * * 0``: APScheduler counts weekdays from 0 = Monday) to avoid
# the Leiden cost spike during active hours and to stagger from the
# nightly dream at 03:00.
@@ -4272,24 +4231,10 @@ class Scheduler(AppService):
) -> dict:
"""Register the weekly community rebuild of one memory scope.
- Gated by ``Flag.GRAPHITI_COMMUNITIES_ENABLED`` for the scope's
- owner. When the flag is off the call is a no-op — returns a
- structured "skipped" dict so callers see the same shape as a
- successful registration. Only adds the job: the registry row that
+ Only adds the job: the registry row that
lets it fire is ``copilot/dream/registry.py``'s to write.
"""
- from backend.copilot.graphiti.config import is_communities_enabled_for_user
-
user_timezone = user_timezone or "UTC"
- if not run_async(is_communities_enabled_for_user(scope.owner_user_id)):
- logger.info(
- "Community rebuild registration skipped for %s — "
- "GRAPHITI_COMMUNITIES_ENABLED flag is off.",
- scope_label(scope),
- )
- return memory_job_skipped(
- scope, user_timezone, "graphiti_communities_disabled"
- )
job = self._add_memory_job(
*_MEMORY_CRONS[COMMUNITY_REBUILD_JOB_PREFIX],
dream_system_job(COMMUNITY_REBUILD_JOB_PREFIX),
diff --git a/autogpt_platform/backend/backend/executor/scheduler_test.py b/autogpt_platform/backend/backend/executor/scheduler_test.py
index 2ed7ae3df7..290d069df4 100644
--- a/autogpt_platform/backend/backend/executor/scheduler_test.py
+++ b/autogpt_platform/backend/backend/executor/scheduler_test.py
@@ -408,11 +408,15 @@ class TestAddCommunityRebuildSchedule:
fake_job = MagicMock(id="community_rebuild_abc", next_run_time=None)
s.scheduler.add_job.return_value = fake_job
- with patch("backend.executor.scheduler.run_async", return_value=True):
+ with patch(
+ "backend.executor.scheduler.run_async",
+ side_effect=RuntimeError("flag provider unavailable"),
+ ) as flag_read:
result = s.add_community_rebuild_schedule(
user_id="abc", user_timezone="America/New_York"
)
+ flag_read.assert_not_called()
s.scheduler.add_job.assert_called_once()
kwargs = s.scheduler.add_job.call_args.kwargs
# Job id matches the documented per-user convention.
@@ -1014,7 +1018,7 @@ class TestSkillLearningScopeGate:
class TestCommunityRebuildScopeGate:
- def _fire(self, *, gate: bool, result: dict | None, expert_id=None):
+ def _fire(self, *, gate: bool, result: dict, expert_id=None):
from backend.executor.scheduler import execute_community_rebuild
with (
@@ -1049,10 +1053,9 @@ class TestCommunityRebuildScopeGate:
rebuild.assert_called_once_with(scope)
stamp.assert_awaited_once_with(scope, "community")
- def test_an_errored_or_flag_skipped_rebuild_is_not_stamped(self) -> None:
- for result in ({"error": "OpenRouterError: 502"}, None):
- _, stamp = self._fire(gate=True, result=result)
- stamp.assert_not_awaited()
+ def test_an_errored_rebuild_is_not_stamped(self) -> None:
+ _, stamp = self._fire(gate=True, result={"error": "OpenRouterError: 502"})
+ stamp.assert_not_awaited()
class _SchedulerLoop:
@@ -1580,36 +1583,36 @@ class TestExecuteCommunityRebuildWithStatus:
errored_mock.assert_not_called()
-class TestExecuteCommunityRebuildRuntimeGate:
- def test_flag_off_short_circuits_before_rebuild_runs(self) -> None:
+class TestExecuteCommunityRebuild:
+ def test_rebuild_does_not_evaluate_a_feature_flag(self) -> None:
from backend.executor.scheduler import _rebuild_scope_communities
- # First run_async returns False (flag check). If we let the gate
- # pass, a second call would invoke rebuild_communities_for_user;
- # asserting that doesn't happen is the contract.
+ result = {"error": None, "communities_built": 2}
with (
patch(
- "backend.executor.scheduler.run_async", return_value=False
+ "backend.executor.scheduler.run_async", return_value=result
) as run_async_mock,
patch(
- "backend.executor.scheduler.rebuild_communities_for_user"
+ "backend.util.feature_flag.is_feature_enabled",
+ new=AsyncMock(side_effect=RuntimeError("provider unavailable")),
+ ) as flag_mock,
+ patch(
+ "backend.executor.scheduler.rebuild_communities_for_user",
+ new=MagicMock(return_value="rebuild"),
) as rebuild_mock,
):
- assert _rebuild_scope_communities(MemoryScope.for_user("abc")) is None
+ assert _rebuild_scope_communities(MemoryScope.for_user("abc")) == result
run_async_mock.assert_called_once()
- rebuild_mock.assert_not_called()
+ rebuild_mock.assert_called_once_with("abc", expert_id=None)
+ flag_mock.assert_not_called()
def test_an_expert_scope_rebuilds_the_expert_graph(self) -> None:
from backend.executor.scheduler import _rebuild_scope_communities
result = {"error": None, "communities_built": 2}
with (
- patch("backend.executor.scheduler.run_async", side_effect=[True, result]),
- patch(
- "backend.copilot.graphiti.config.is_communities_enabled_for_user",
- new=MagicMock(return_value="flag"),
- ),
+ patch("backend.executor.scheduler.run_async", return_value=result),
patch(
"backend.executor.scheduler.rebuild_communities_for_user",
new=MagicMock(return_value="rebuild"),
diff --git a/autogpt_platform/backend/backend/executor/scheduler_unit_test.py b/autogpt_platform/backend/backend/executor/scheduler_unit_test.py
index c027a9a070..1c4fcc4288 100644
--- a/autogpt_platform/backend/backend/executor/scheduler_unit_test.py
+++ b/autogpt_platform/backend/backend/executor/scheduler_unit_test.py
@@ -58,7 +58,6 @@ from backend.executor.scheduler import (
_reschedule_one_shot_after_plan_unreadable,
_routine_turn_permissions,
_self_delete_copilot_turn_schedule,
- _self_delete_morning_briefing_schedule,
execute_community_rebuild,
execute_nightly_batch_sync,
execute_skill_learning_sync,
@@ -2390,40 +2389,16 @@ class TestMorningBriefingSchedule:
sched._invalidate_jobs_cache.assert_not_called()
assert result["removed"] is False
- def test_job_body_removes_the_schedule_once_the_flag_is_off(self):
- """Without this the cron outlives the feature, firing daily forever
- to return flag_disabled."""
- from backend.executor.scheduler import execute_morning_briefing
-
- with (
- patch(
- "backend.copilot.briefing.generate.generate_and_deliver_briefing",
- new=MagicMock(),
- ),
- patch(
- f"{_SCHEDULER_PATH}.run_async",
- side_effect=[{"status": "skipped", "reason": "flag_disabled"}, None],
- ),
- patch(
- f"{_SCHEDULER_PATH}._self_delete_morning_briefing_schedule",
- new=MagicMock(),
- ) as self_delete,
- ):
- execute_morning_briefing("user-1")
-
- self_delete.assert_called_once_with("user-1")
-
@pytest.mark.parametrize(
"result",
[
{"status": "skipped", "reason": "nothing_to_say"},
{"status": "skipped", "reason": "already_delivered"},
- # An unreachable LaunchDarkly must cost one morning, not the cron.
- {"status": "skipped", "reason": "flag_unavailable"},
+ {"status": "skipped", "reason": "banned"},
{"status": "delivered", "briefing_id": "b-1", "session_id": "s-1"},
],
)
- def test_job_body_keeps_the_schedule_on_every_other_outcome(self, result):
+ def test_job_body_keeps_the_schedule_after_generation(self, result):
from backend.executor.scheduler import execute_morning_briefing
with (
@@ -2431,54 +2406,11 @@ class TestMorningBriefingSchedule:
"backend.copilot.briefing.generate.generate_and_deliver_briefing",
new=MagicMock(),
),
- patch(f"{_SCHEDULER_PATH}.run_async", side_effect=[result]),
- patch(
- f"{_SCHEDULER_PATH}._self_delete_morning_briefing_schedule",
- new=MagicMock(),
- ) as self_delete,
+ patch(f"{_SCHEDULER_PATH}.run_async", return_value=result) as run,
):
execute_morning_briefing("user-1")
- self_delete.assert_not_called()
-
- @pytest.mark.asyncio
- async def test_self_delete_also_clears_the_registration_marker(self):
- """A marker left behind would suppress lazy re-registration for the
- rest of its TTL if the flag is turned back on."""
- client = MagicMock()
- client.remove_morning_briefing_schedule = AsyncMock()
- with (
- patch(f"{_SCHEDULER_PATH}.get_scheduler_client", return_value=client),
- patch(
- "backend.copilot.briefing.scheduling."
- "clear_briefing_registration_marker",
- new=AsyncMock(),
- ) as clear_marker,
- ):
- await _self_delete_morning_briefing_schedule("user-1")
-
- client.remove_morning_briefing_schedule.assert_awaited_once_with(
- user_id="user-1"
- )
- clear_marker.assert_awaited_once_with("user-1")
-
- @pytest.mark.asyncio
- async def test_self_delete_swallows_a_scheduler_rpc_failure(self, caplog):
- """It runs inside a job body; raising here would fail the whole run."""
- client = MagicMock()
- client.remove_morning_briefing_schedule = AsyncMock(
- side_effect=RuntimeError("pyro down")
- )
- with (
- patch(f"{_SCHEDULER_PATH}.get_scheduler_client", return_value=client),
- caplog.at_level(logging.WARNING),
- ):
- await _self_delete_morning_briefing_schedule("user-1")
-
- assert any(
- "Failed to remove morning briefing job" in r.getMessage()
- for r in caplog.records
- )
+ run.assert_called_once()
def test_graph_schedule_listing_can_include_paused_jobs():
diff --git a/autogpt_platform/backend/backend/notifications/lifecycle.py b/autogpt_platform/backend/backend/notifications/lifecycle.py
index 3932a7c126..efa7e7fdd2 100644
--- a/autogpt_platform/backend/backend/notifications/lifecycle.py
+++ b/autogpt_platform/backend/backend/notifications/lifecycle.py
@@ -54,7 +54,6 @@ from backend.notifications.queue import queue_audience_change, queue_notificatio
from backend.notifications.subscriber_fields import audience_event
from backend.notifications.trial import notify_trial, on_trial_subscription_updated
from backend.util.clients import get_database_manager_async_client
-from backend.util.feature_flag import Flag, is_feature_enabled
from backend.util.logging import TruncatedLogger
from backend.util.product_analytics import track_subscription_ended
from backend.util.settings import Settings
@@ -139,11 +138,6 @@ async def on_checkout_completed(session: dict, subscription: dict) -> None:
return
plan = await plan_from_subscription(subscription)
- experts_enabled = False
- try:
- experts_enabled = await is_feature_enabled(Flag.HIRE_EXPERTS, user.id)
- except Exception:
- logger.warning("Could not check Expert access; using the workflow welcome")
try:
await _publish(
NotificationEventModel[SubscriptionWelcomeData](
@@ -153,7 +147,7 @@ async def on_checkout_completed(session: dict, subscription: dict) -> None:
user_name=_greeting_name(user),
plan=plan,
renews_label=format_date(subscription.get("current_period_end")),
- experts_enabled=experts_enabled,
+ experts_enabled=True,
),
)
)
diff --git a/autogpt_platform/backend/backend/notifications/lifecycle_test.py b/autogpt_platform/backend/backend/notifications/lifecycle_test.py
index a114bcc87a..dfbd759eec 100644
--- a/autogpt_platform/backend/backend/notifications/lifecycle_test.py
+++ b/autogpt_platform/backend/backend/notifications/lifecycle_test.py
@@ -121,10 +121,6 @@ def _context(user, claim=True, audience_ok=True):
AsyncMock(return_value=("PRO", "monthly")),
),
patch("backend.notifications.lifecycle.track_subscription_ended"),
- patch(
- "backend.notifications.lifecycle.is_feature_enabled",
- AsyncMock(return_value=False),
- ),
]
@@ -614,15 +610,7 @@ async def test_an_ended_subscription_leaves_the_changelog_without_a_status(
lifecycle_resync.assert_not_awaited()
- "enabled,error",
- [
- (False, None),
- (True, None),
- (False, RuntimeError("Flag lookup failed for [email protected]")),
- ],
-)
-async def test_welcome_matches_the_recipients_expert_access(enabled, error, caplog):
+async def test_welcome_includes_experts_without_a_rollout_lookup():
patches = _context(_User())
patches.append(
patch.object(lifecycle, "_claim_welcome", AsyncMock(return_value=True))
@@ -630,23 +618,14 @@ async def test_welcome_matches_the_recipients_expert_access(enabled, error, capl
for item in patches:
item.start()
try:
- with patch.object(
- lifecycle,
- "is_feature_enabled",
- AsyncMock(return_value=enabled, side_effect=error),
- ) as flag, patch.object(lifecycle, "_release_welcome", AsyncMock()) as released:
+ with patch.object(lifecycle, "_release_welcome", AsyncMock()) as released:
await lifecycle.on_checkout_completed(
{"customer": CUSTOMER}, _subscription()
)
event = lifecycle.queue_notification_async.call_args.args[0]
- assert event.data.experts_enabled is enabled
- flag.assert_awaited_once_with(lifecycle.Flag.HIRE_EXPERTS, "user-1")
+ assert event.data.experts_enabled is True
released.assert_not_awaited()
lifecycle.queue_audience_change.assert_awaited_once()
- if error:
- assert "Could not check Expert access" in caplog.text
- assert "[email protected]" not in caplog.text
- assert "user-1" not in caplog.text
finally:
for item in reversed(patches):
item.stop()
diff --git a/autogpt_platform/backend/backend/util/feature_flag/__init__.py b/autogpt_platform/backend/backend/util/feature_flag/__init__.py
index d8d2c5d9cf..9c03ddccb0 100644
--- a/autogpt_platform/backend/backend/util/feature_flag/__init__.py
+++ b/autogpt_platform/backend/backend/util/feature_flag/__init__.py
@@ -63,7 +63,6 @@ class Flag(str, Enum):
"""
AUTOMOD = "AutoMod"
- AI_ACTIVITY_STATUS = "ai-agent-execution-summary"
ENABLE_PLATFORM_PAYMENT = "enable-platform-payment"
CHAT_MODE_OPTION = "chat-mode-option"
COPILOT_SDK = "copilot-sdk"
@@ -91,28 +90,11 @@ class Flag(str, Enum):
COPILOT_TIER_WORKSPACE_STORAGE_LIMITS = "copilot-tier-workspace-storage-limits"
COPILOT_TIER_STRIPE_PRICES = "copilot-tier-stripe-prices"
CARD_REQUIRED_TRIAL_OFFER = "card-required-trial-offer"
- GRAPHITI_MEMORY = "graphiti-memory"
# Gates Otto voice mode end-to-end. The speech endpoint 404s when
# off so a stale frontend cannot spend TTS budget. Fail-closed.
COPILOT_VOICE_MODE = "copilot-voice-mode"
- # Gates the onboarding voice "brain dump" end-to-end. The upload /
- # finalize / status / download endpoints 404 when off so a stale
- # frontend can't start writing recordings, and the wizard keeps
- # rendering the pillbox step. Fail-closed (default False).
- ONBOARDING_BRAIN_DUMP = "onboarding-brain-dump"
-
- # Gates the per-user weekly community rebuild registered by
- # ``add_community_rebuild_schedule``. Off by default; opt-in canary
- # so the Leiden + LLM-summarization cost doesn't ramp before
- # retrieval-relevance benefit is measured.
- GRAPHITI_COMMUNITIES_ENABLED = "graphiti-communities-enabled"
-
- # Parks expert work for the user's approval once her credit spend in the
- # window reaches the approval threshold (SECRT-2599). Off by default.
- EXPERT_SPEND_APPROVAL = "expert-spend-approval"
-
# --- Dream-system gates (P0) ---
#
# No "enabled-users list" flag — LD's per-flag targeting natively
@@ -129,26 +111,6 @@ class Flag(str, Enum):
# only.
DREAM_PASS_ENABLED = "dream-pass-enabled"
- # Mirror of the frontend `hire-experts` flag (same LaunchDarkly key,
- # so both sides evaluate one cohort switch). Gates the experts
- # surface, including the scheduled morning-briefing job end-to-end:
- # schedule registration, generation, and delivery. Deliberately no
- # independent briefing kill switch — briefings ship to exactly the
- # experts cohort.
- HIRE_EXPERTS = "hire-experts"
-
- # Child of ``HIRE_EXPERTS``: onboarding ends with a team. The brain
- # dump also produces expert recommendations, the copilot greeting
- # grows a team section, and Otto's empty-roster context tells
- # it that it is the Head of AI. Effective only when both are on;
- # fail-closed (default False).
- ONBOARDING_EXPERT_TEAM = "onboarding-expert-team"
-
- # Mirror of the frontend `skills-hub` flag. Gates marketplace skill
- # browse and install end-to-end: the routes 404 when off, so the dark
- # launch is not reachable by URL with the shelf hidden. Fail-closed.
- SKILLS_HUB = "skills-hub"
-
# Per-feature gate for the cascading-expiry helper
# ``invalidate_entity_direct_neighbors`` (P0.3b). When on, the
# dream pass may demote every ``:RELATES_TO`` edge directly
@@ -1055,7 +1017,7 @@ def create_feature_flag_dependency(
Example:
router = APIRouter(
- dependencies=[Depends(create_feature_flag_dependency(Flag.SKILLS_HUB))]
+ dependencies=[Depends(create_feature_flag_dependency(Flag.COPILOT_VOICE_MODE))]
)
"""
diff --git a/autogpt_platform/backend/backend/util/feature_flag/backends_test.py b/autogpt_platform/backend/backend/util/feature_flag/backends_test.py
index 7ca05a5294..d1b07b3cb7 100644
--- a/autogpt_platform/backend/backend/util/feature_flag/backends_test.py
+++ b/autogpt_platform/backend/backend/util/feature_flag/backends_test.py
@@ -139,7 +139,7 @@ class TestPostHogWithoutAKey:
)
value = await ff.get_feature_flag_value(
- Flag.HIRE_EXPERTS.value, user_id, True, attributes=attributes
+ Flag.GENERIC_TRIGGER_AGENTS.value, user_id, True, attributes=attributes
)
assert value is True
@@ -167,7 +167,10 @@ class TestLaunchDarklyBackendLeavesPostHogAlone:
posthog = mocker.patch.object(ph, "evaluate_flag")
ld_client.variation_detail.return_value = served(True)
- assert await evaluate_feature_flag(Flag.HIRE_EXPERTS, "u-1") == (True, True)
+ assert await evaluate_feature_flag(Flag.GENERIC_TRIGGER_AGENTS, "u-1") == (
+ True,
+ True,
+ )
ld_client.variation_detail.assert_called_once()
posthog.assert_not_called()
@@ -217,7 +220,10 @@ class TestPostHogBackend:
use_backend(mocker, FeatureFlagBackend.POSTHOG)
stub_posthog(mocker, value=True)
- assert await evaluate_feature_flag(Flag.HIRE_EXPERTS, "u-1") == (True, True)
+ assert await evaluate_feature_flag(Flag.GENERIC_TRIGGER_AGENTS, "u-1") == (
+ True,
+ True,
+ )
@pytest.mark.asyncio
async def test_a_conclusive_off_is_authoritative(self, mocker, user_context):
@@ -225,21 +231,30 @@ class TestPostHogBackend:
use_backend(mocker, FeatureFlagBackend.POSTHOG)
stub_posthog(mocker, value=False)
- assert await evaluate_feature_flag(Flag.HIRE_EXPERTS, "u-1") == (False, True)
+ assert await evaluate_feature_flag(Flag.GENERIC_TRIGGER_AGENTS, "u-1") == (
+ False,
+ True,
+ )
@pytest.mark.asyncio
async def test_an_unresolved_flag_is_not(self, mocker, user_context):
use_backend(mocker, FeatureFlagBackend.POSTHOG)
stub_posthog(mocker, value=None)
- assert await evaluate_feature_flag(Flag.HIRE_EXPERTS, "u-1") == (False, False)
+ assert await evaluate_feature_flag(Flag.GENERIC_TRIGGER_AGENTS, "u-1") == (
+ False,
+ False,
+ )
@pytest.mark.asyncio
async def test_an_unconfigured_client_is_not(self, mocker, user_context):
use_backend(mocker, FeatureFlagBackend.POSTHOG)
mocker.patch.object(ph, "get_flag_client", return_value=None)
- assert await evaluate_feature_flag(Flag.HIRE_EXPERTS, "u-1") == (False, False)
+ assert await evaluate_feature_flag(Flag.GENERIC_TRIGGER_AGENTS, "u-1") == (
+ False,
+ False,
+ )
@pytest.mark.asyncio
async def test_an_evaluation_that_raises_is_not(self, mocker, user_context):
@@ -247,7 +262,10 @@ class TestPostHogBackend:
client = stub_posthog(mocker, value=True)
client.get_feature_flag_result.side_effect = Exception("evaluation exploded")
- assert await evaluate_feature_flag(Flag.HIRE_EXPERTS, "u-1") == (False, False)
+ assert await evaluate_feature_flag(Flag.GENERIC_TRIGGER_AGENTS, "u-1") == (
+ False,
+ False,
+ )
@pytest.mark.asyncio
async def test_a_degraded_user_context_is_not(self, mocker):
@@ -258,7 +276,10 @@ class TestPostHogBackend:
return_value=(Context.create("u-1"), False),
)
- assert await evaluate_feature_flag(Flag.HIRE_EXPERTS, "u-1") == (True, False)
+ assert await evaluate_feature_flag(Flag.GENERIC_TRIGGER_AGENTS, "u-1") == (
+ True,
+ False,
+ )
@pytest.mark.asyncio
async def test_a_payload_flag_returns_its_payload(self, mocker, user_context):
@@ -275,7 +296,10 @@ class TestPostHogBackend:
use_backend(mocker, FeatureFlagBackend.POSTHOG)
stub_posthog(mocker, value=True, payload={"some": "object"})
- assert await evaluate_feature_flag(Flag.HIRE_EXPERTS, "u-1") == (False, False)
+ assert await evaluate_feature_flag(Flag.GENERIC_TRIGGER_AGENTS, "u-1") == (
+ False,
+ False,
+ )
@pytest.mark.asyncio
async def test_targeting_attributes_are_passed_as_person_properties(self, mocker):
@@ -300,7 +324,7 @@ class TestPostHogBackend:
return_value=(context, True),
)
- await evaluate_feature_flag(Flag.HIRE_EXPERTS, "u-1")
+ await evaluate_feature_flag(Flag.GENERIC_TRIGGER_AGENTS, "u-1")
_, kwargs = client.get_feature_flag_result.call_args
assert kwargs["person_properties"] == {
@@ -389,7 +413,7 @@ class TestPostHogBackend:
@pytest.mark.asyncio
@pytest.mark.parametrize(
"flag_key,events",
- [(PRICING_EXPERIMENT, 1), (Flag.HIRE_EXPERTS.value, 0)],
+ [(PRICING_EXPERIMENT, 1), (Flag.GENERIC_TRIGGER_AGENTS.value, 0)],
)
async def test_only_an_experiment_read_sends_posthog_its_exposure_event(
self, mocker, monkeypatch, flag_key, events
@@ -428,7 +452,7 @@ class TestPostHogBackend:
posthog_client = _posthog_rolled_out_to_dev_only()
mocker.patch.object(ph, "get_flag_client", return_value=posthog_client)
try:
- result = await evaluate_feature_flag(Flag.HIRE_EXPERTS, "u-1")
+ result = await evaluate_feature_flag(Flag.GENERIC_TRIGGER_AGENTS, "u-1")
finally:
posthog_client.shutdown()
@@ -484,7 +508,10 @@ class TestDualBackend:
ld_client.variation_detail.return_value = served(True)
stub_posthog(mocker, value=False)
- assert await evaluate_feature_flag(Flag.HIRE_EXPERTS, "u-1") == (True, True)
+ assert await evaluate_feature_flag(Flag.GENERIC_TRIGGER_AGENTS, "u-1") == (
+ True,
+ True,
+ )
@pytest.mark.asyncio
async def test_a_disagreement_is_logged_as_a_structured_record(
@@ -498,7 +525,7 @@ class TestDualBackend:
with caplog.at_level(
logging.WARNING, logger="backend.util.feature_flag.mismatch"
):
- await evaluate_feature_flag(Flag.HIRE_EXPERTS, user_id)
+ await evaluate_feature_flag(Flag.GENERIC_TRIGGER_AGENTS, user_id)
await drain_shadow_evaluations()
[message] = [
@@ -507,7 +534,7 @@ class TestDualBackend:
if record.name == "backend.util.feature_flag.mismatch"
]
record = _mismatch_record(message)
- assert record["flag"] == Flag.HIRE_EXPERTS.value
+ assert record["flag"] == Flag.GENERIC_TRIGGER_AGENTS.value
assert record["launchdarkly"] == {"value": True, "evaluated": True}
assert record["posthog"] == {"value": False, "evaluated": True}
assert user_id not in message
@@ -524,7 +551,7 @@ class TestDualBackend:
with caplog.at_level(
logging.WARNING, logger="backend.util.feature_flag.mismatch"
):
- await evaluate_feature_flag(Flag.HIRE_EXPERTS, "u-1")
+ await evaluate_feature_flag(Flag.GENERIC_TRIGGER_AGENTS, "u-1")
await drain_shadow_evaluations()
assert not [
@@ -544,7 +571,7 @@ class TestDualBackend:
with caplog.at_level(
logging.WARNING, logger="backend.util.feature_flag.mismatch"
):
- result = await evaluate_feature_flag(Flag.HIRE_EXPERTS, "u-1")
+ result = await evaluate_feature_flag(Flag.GENERIC_TRIGGER_AGENTS, "u-1")
await drain_shadow_evaluations()
assert result == (False, True)
@@ -572,7 +599,7 @@ class TestDualBackend:
logging.WARNING, logger="backend.util.feature_flag.mismatch"
):
for _ in range(3):
- await evaluate_feature_flag(Flag.HIRE_EXPERTS, "u-1")
+ await evaluate_feature_flag(Flag.GENERIC_TRIGGER_AGENTS, "u-1")
await evaluate_feature_flag(Flag.CHAT_MODE_OPTION, "u-1")
await drain_shadow_evaluations()
@@ -582,7 +609,7 @@ class TestDualBackend:
if r.name == "backend.util.feature_flag.mismatch"
]
assert sorted(flags) == sorted(
- [Flag.HIRE_EXPERTS.value, Flag.CHAT_MODE_OPTION.value]
+ [Flag.GENERIC_TRIGGER_AGENTS.value, Flag.CHAT_MODE_OPTION.value]
)
@pytest.mark.asyncio
@@ -597,7 +624,7 @@ class TestDualBackend:
logging.WARNING, logger="backend.util.feature_flag.mismatch"
):
for _ in range(3):
- await evaluate_feature_flag(Flag.HIRE_EXPERTS, "u-1")
+ await evaluate_feature_flag(Flag.GENERIC_TRIGGER_AGENTS, "u-1")
await drain_shadow_evaluations()
assert (
@@ -647,7 +674,7 @@ class TestDualBackend:
ld_client.variation_detail.return_value = served(True)
mocker.patch.object(ph, "evaluate_flag", side_effect=Exception("boom"))
- assert await is_feature_enabled(Flag.HIRE_EXPERTS, "u-1") is True
+ assert await is_feature_enabled(Flag.GENERIC_TRIGGER_AGENTS, "u-1") is True
await drain_shadow_evaluations()
@pytest.mark.asyncio
@@ -740,7 +767,7 @@ class TestDualStaysOffTheRequestPath:
mocker.patch.object(ph, "evaluate_flag", side_effect=slow_posthog)
result = await asyncio.wait_for(
- evaluate_feature_flag(Flag.HIRE_EXPERTS, "u-1"), timeout=5
+ evaluate_feature_flag(Flag.GENERIC_TRIGGER_AGENTS, "u-1"), timeout=5
)
assert result == (True, True)
@@ -760,7 +787,7 @@ class TestDualStaysOffTheRequestPath:
return_value=(Context.create("u-1"), False),
)
- await evaluate_feature_flag(Flag.HIRE_EXPERTS, "u-1")
+ await evaluate_feature_flag(Flag.GENERIC_TRIGGER_AGENTS, "u-1")
await drain_shadow_evaluations()
lookup.assert_called_once_with("u-1")
@@ -780,7 +807,7 @@ class TestDualStaysOffTheRequestPath:
mocker.patch.object(ph, "evaluate_flag", side_effect=never_finishes)
for _ in range(5):
- await evaluate_feature_flag(Flag.HIRE_EXPERTS, "u-1")
+ await evaluate_feature_flag(Flag.GENERIC_TRIGGER_AGENTS, "u-1")
assert len(ff._shadow_evaluations) == 2
for task in list(ff._shadow_evaluations):
@@ -812,7 +839,7 @@ class TestShutdownStopsShadowEvaluations:
return False, True
mocker.patch.object(ph, "evaluate_flag", side_effect=never_finishes)
- await evaluate_feature_flag(Flag.HIRE_EXPERTS, "u-1")
+ await evaluate_feature_flag(Flag.GENERIC_TRIGGER_AGENTS, "u-1")
assert len(ff._shadow_evaluations) == 1
ff.shutdown_feature_flags()
@@ -833,7 +860,9 @@ class TestShutdownStopsShadowEvaluations:
mocker.patch.object(ph, "evaluate_flag", side_effect=never_finishes)
loop = asyncio.new_event_loop()
- loop.run_until_complete(evaluate_feature_flag(Flag.HIRE_EXPERTS, "u-1"))
+ loop.run_until_complete(
+ evaluate_feature_flag(Flag.GENERIC_TRIGGER_AGENTS, "u-1")
+ )
# What an AppService's cleanup does to its loop before flags shut down.
loop.close()
@@ -853,7 +882,10 @@ class TestShutdownStopsShadowEvaluations:
get_client = mocker.patch.object(ph, "get_flag_client")
ff.shutdown_feature_flags()
- assert await evaluate_feature_flag(Flag.HIRE_EXPERTS, "u-1") == (True, True)
+ assert await evaluate_feature_flag(Flag.GENERIC_TRIGGER_AGENTS, "u-1") == (
+ True,
+ True,
+ )
await drain_shadow_evaluations()
get_client.assert_not_called()
@@ -894,9 +926,12 @@ class TestForcedFlagsInEveryBackend:
ff, "get_client", side_effect=Exception("set_config was not called")
)
posthog = mocker.patch.object(ph, "evaluate_flag")
- monkeypatch.setenv("FORCE_FLAG_HIRE_EXPERTS", "true")
+ monkeypatch.setenv("FORCE_FLAG_GENERIC_TRIGGER_AGENTS", "true")
- assert await evaluate_feature_flag(Flag.HIRE_EXPERTS, "u-1") == (True, True)
+ assert await evaluate_feature_flag(Flag.GENERIC_TRIGGER_AGENTS, "u-1") == (
+ True,
+ True,
+ )
posthog.assert_not_called()
@pytest.mark.asyncio
@@ -915,8 +950,11 @@ class TestForcedFlagsInEveryBackend:
mocker.patch.object(ph, "get_flag_client", return_value=None)
monkeypatch.setenv("FORCE_ALL_FLAGS", "true")
- assert await evaluate_feature_flag(Flag.HIRE_EXPERTS, "u-1") == (True, True)
- await ff.create_feature_flag_dependency(Flag.HIRE_EXPERTS)("u-1")
+ assert await evaluate_feature_flag(Flag.GENERIC_TRIGGER_AGENTS, "u-1") == (
+ True,
+ True,
+ )
+ await ff.create_feature_flag_dependency(Flag.GENERIC_TRIGGER_AGENTS)("u-1")
assert await _gated_route()(user_id="u-1") == "served"
@pytest.mark.asyncio
@@ -930,14 +968,20 @@ class TestForcedFlagsInEveryBackend:
mocker.patch.object(ph, "is_configured", return_value=True)
stub_posthog(mocker, value=True)
- assert await evaluate_feature_flag(Flag.HIRE_EXPERTS, "u-1") == (True, True)
- await ff.create_feature_flag_dependency(Flag.HIRE_EXPERTS)("u-1")
+ assert await evaluate_feature_flag(Flag.GENERIC_TRIGGER_AGENTS, "u-1") == (
+ True,
+ True,
+ )
+ await ff.create_feature_flag_dependency(Flag.GENERIC_TRIGGER_AGENTS)("u-1")
assert await _gated_route()(user_id="u-1") == "served"
stub_posthog(mocker, value=False)
- assert await evaluate_feature_flag(Flag.HIRE_EXPERTS, "u-1") == (False, True)
+ assert await evaluate_feature_flag(Flag.GENERIC_TRIGGER_AGENTS, "u-1") == (
+ False,
+ True,
+ )
with pytest.raises(HTTPException) as off:
- await ff.create_feature_flag_dependency(Flag.HIRE_EXPERTS)("u-1")
+ await ff.create_feature_flag_dependency(Flag.GENERIC_TRIGGER_AGENTS)("u-1")
assert off.value.status_code == 404
@@ -960,8 +1004,10 @@ class TestSentryFlagContext:
ld_client.variation_detail.return_value = served(True)
stub_posthog(mocker, value=backend is FeatureFlagBackend.POSTHOG)
- assert await is_feature_enabled(Flag.HIRE_EXPERTS, "u-1") is True
- assert sentry_flags.get() == [{"flag": Flag.HIRE_EXPERTS.value, "result": True}]
+ assert await is_feature_enabled(Flag.GENERIC_TRIGGER_AGENTS, "u-1") is True
+ assert sentry_flags.get() == [
+ {"flag": Flag.GENERIC_TRIGGER_AGENTS.value, "result": True}
+ ]
@pytest.mark.asyncio
@pytest.mark.parametrize("initialized", [True, False])
@@ -982,11 +1028,11 @@ class TestSentryFlagContext:
client.is_initialized.return_value = False
mocker.patch("backend.util.feature_flag.ldclient.get", return_value=client)
- await is_feature_enabled(Flag.HIRE_EXPERTS, "u-1")
+ await is_feature_enabled(Flag.GENERIC_TRIGGER_AGENTS, "u-1")
assert sentry_flags.get() == [
- {"flag": Flag.HIRE_EXPERTS.value, "result": False},
- {"flag": f"{Flag.HIRE_EXPERTS.value}.fallback", "result": True},
+ {"flag": Flag.GENERIC_TRIGGER_AGENTS.value, "result": False},
+ {"flag": f"{Flag.GENERIC_TRIGGER_AGENTS.value}.fallback", "result": True},
]
@pytest.mark.asyncio
@@ -995,13 +1041,15 @@ class TestSentryFlagContext:
):
ld_client.variation_detail.return_value = served("on")
- assert await evaluate_feature_flag(Flag.HIRE_EXPERTS, "u-1", True) == (
+ assert await evaluate_feature_flag(
+ Flag.GENERIC_TRIGGER_AGENTS, "u-1", True
+ ) == (
True,
False,
)
assert sentry_flags.get() == [
- {"flag": Flag.HIRE_EXPERTS.value, "result": True},
- {"flag": f"{Flag.HIRE_EXPERTS.value}.fallback", "result": True},
+ {"flag": Flag.GENERIC_TRIGGER_AGENTS.value, "result": True},
+ {"flag": f"{Flag.GENERIC_TRIGGER_AGENTS.value}.fallback", "result": True},
]
@pytest.mark.asyncio
@@ -1030,17 +1078,21 @@ class TestSentryFlagContext:
ld_client.is_initialized.return_value = initialized
ld_client.variation_detail.return_value = served(answer)
# A stale earlier answer must not be what an error from this route carries.
- sentry_sdk.feature_flags.add_feature_flag(Flag.HIRE_EXPERTS.value, True)
+ sentry_sdk.feature_flags.add_feature_flag(
+ Flag.GENERIC_TRIGGER_AGENTS.value, True
+ )
with pytest.raises(HTTPException):
if gate == "decorator":
await _gated_route()(user_id="u-1")
else:
- await ff.create_feature_flag_dependency(Flag.HIRE_EXPERTS)("u-1")
+ await ff.create_feature_flag_dependency(Flag.GENERIC_TRIGGER_AGENTS)(
+ "u-1"
+ )
assert {f["flag"]: f["result"] for f in sentry_flags.get()} == {
- Flag.HIRE_EXPERTS.value: False,
- f"{Flag.HIRE_EXPERTS.value}.fallback": True,
+ Flag.GENERIC_TRIGGER_AGENTS.value: False,
+ f"{Flag.GENERIC_TRIGGER_AGENTS.value}.fallback": True,
}
@pytest.mark.asyncio
@@ -1054,26 +1106,28 @@ class TestSentryFlagContext:
scope = sentry_sdk.get_current_scope()
previous, scope.span = scope.span, span
try:
- await is_feature_enabled(Flag.HIRE_EXPERTS, "u-1")
+ await is_feature_enabled(Flag.GENERIC_TRIGGER_AGENTS, "u-1")
finally:
scope.span = previous
- assert span._flags == {f"flag.evaluation.{Flag.HIRE_EXPERTS.value}": False}
+ assert span._flags == {
+ f"flag.evaluation.{Flag.GENERIC_TRIGGER_AGENTS.value}": False
+ }
@pytest.mark.asyncio
async def test_a_real_answer_clears_an_earlier_fallback(
self, ld_client, user_context, sentry_flags
):
sentry_sdk.feature_flags.add_feature_flag(
- f"{Flag.HIRE_EXPERTS.value}.fallback", True
+ f"{Flag.GENERIC_TRIGGER_AGENTS.value}.fallback", True
)
ld_client.variation_detail.return_value = served(True)
- await is_feature_enabled(Flag.HIRE_EXPERTS, "u-1")
+ await is_feature_enabled(Flag.GENERIC_TRIGGER_AGENTS, "u-1")
assert {f["flag"]: f["result"] for f in sentry_flags.get()} == {
- f"{Flag.HIRE_EXPERTS.value}.fallback": False,
- Flag.HIRE_EXPERTS.value: True,
+ f"{Flag.GENERIC_TRIGGER_AGENTS.value}.fallback": False,
+ Flag.GENERIC_TRIGGER_AGENTS.value: True,
}
@pytest.mark.asyncio
@@ -1087,7 +1141,10 @@ class TestSentryFlagContext:
)
ld_client.variation_detail.return_value = served(True)
- assert await evaluate_feature_flag(Flag.HIRE_EXPERTS, "u-1") == (True, True)
+ assert await evaluate_feature_flag(Flag.GENERIC_TRIGGER_AGENTS, "u-1") == (
+ True,
+ True,
+ )
@pytest.mark.usefixtures("posthog_events_dropped")
@@ -1273,7 +1330,7 @@ def _posthog_rolled_out_to_dev_only() -> Posthog:
client.feature_flags = [
{
"id": 1,
- "key": Flag.HIRE_EXPERTS.value,
+ "key": Flag.GENERIC_TRIGGER_AGENTS.value,
"active": True,
"filters": {
"groups": [
@@ -1303,7 +1360,7 @@ def _no_remote_flags(*args, **kwargs):
def _gated_route():
"""A route behind the decorator, which holds a raw flag key rather than a Flag."""
- @feature_flag(Flag.HIRE_EXPERTS.value)
+ @feature_flag(Flag.GENERIC_TRIGGER_AGENTS.value)
async def route(user_id: str) -> str:
return "served"
diff --git a/autogpt_platform/backend/backend/util/feature_flag/definition_cache_test.py b/autogpt_platform/backend/backend/util/feature_flag/definition_cache_test.py
index 9a070f3dc8..5b9aa0ea6d 100644
--- a/autogpt_platform/backend/backend/util/feature_flag/definition_cache_test.py
+++ b/autogpt_platform/backend/backend/util/feature_flag/definition_cache_test.py
@@ -431,7 +431,10 @@ class TestLaunchDarklyBackendIsUntouched:
build = mocker.patch.object(ph, "get_flag_definition_cache")
ld_client.variation_detail.return_value = served(True)
- assert await evaluate_feature_flag(Flag.HIRE_EXPERTS, "u-1") == (True, True)
+ assert await evaluate_feature_flag(Flag.GENERIC_TRIGGER_AGENTS, "u-1") == (
+ True,
+ True,
+ )
build.assert_not_called()
diff --git a/autogpt_platform/backend/backend/util/feature_flag/feature_flag_test.py b/autogpt_platform/backend/backend/util/feature_flag/feature_flag_test.py
index c0c3070b42..7f72fda883 100644
--- a/autogpt_platform/backend/backend/util/feature_flag/feature_flag_test.py
+++ b/autogpt_platform/backend/backend/util/feature_flag/feature_flag_test.py
@@ -123,7 +123,6 @@ async def test_is_feature_enabled_exception(mocker):
def test_flag_enum_values():
"""Test that Flag enum has expected values."""
assert Flag.AUTOMOD == "AutoMod"
- assert Flag.AI_ACTIVITY_STATUS == "ai-agent-execution-summary"
@pytest.mark.asyncio
@@ -875,8 +874,10 @@ class TestEvaluateFeatureFlag:
@pytest.fixture(autouse=True)
def no_env_override(self, monkeypatch: pytest.MonkeyPatch):
"""`.env` may force unrelated flags; pin this one to LaunchDarkly."""
- monkeypatch.delenv("FORCE_FLAG_HIRE_EXPERTS", raising=False)
- monkeypatch.delenv("NEXT_PUBLIC_FORCE_FLAG_HIRE_EXPERTS", raising=False)
+ monkeypatch.delenv("FORCE_FLAG_GENERIC_TRIGGER_AGENTS", raising=False)
+ monkeypatch.delenv(
+ "NEXT_PUBLIC_FORCE_FLAG_GENERIC_TRIGGER_AGENTS", raising=False
+ )
@pytest.fixture
def user_context(self, mocker):
@@ -891,19 +892,28 @@ class TestEvaluateFeatureFlag:
self, ld_client, user_context
):
ld_client.variation_detail.return_value = served(False)
- assert await evaluate_feature_flag(Flag.HIRE_EXPERTS, "u-1") == (False, True)
+ assert await evaluate_feature_flag(Flag.GENERIC_TRIGGER_AGENTS, "u-1") == (
+ False,
+ True,
+ )
@pytest.mark.asyncio
async def test_an_uninitialised_client_is_not(self, ld_client, user_context):
ld_client.is_initialized.return_value = False
- assert await evaluate_feature_flag(Flag.HIRE_EXPERTS, "u-1") == (False, False)
+ assert await evaluate_feature_flag(Flag.GENERIC_TRIGGER_AGENTS, "u-1") == (
+ False,
+ False,
+ )
@pytest.mark.asyncio
async def test_an_evaluation_that_raises_is_not(self, ld_client, user_context):
"""The regression this class exists for: a LIVE client can still fail
to produce a value, and that must not read as a real "off"."""
ld_client.variation_detail.side_effect = Exception("evaluation exploded")
- assert await evaluate_feature_flag(Flag.HIRE_EXPERTS, "u-1") == (False, False)
+ assert await evaluate_feature_flag(Flag.GENERIC_TRIGGER_AGENTS, "u-1") == (
+ False,
+ False,
+ )
@pytest.mark.asyncio
async def test_a_degraded_user_context_is_not(self, ld_client, mocker):
@@ -918,7 +928,9 @@ class TestEvaluateFeatureFlag:
)
ld_client.variation_detail.return_value = served(False)
- result = await evaluate_feature_flag(Flag.HIRE_EXPERTS, str(uuid.uuid4()))
+ result = await evaluate_feature_flag(
+ Flag.GENERIC_TRIGGER_AGENTS, str(uuid.uuid4())
+ )
assert result == (False, False)
ld_client.variation_detail.assert_called_once()
@@ -926,7 +938,10 @@ class TestEvaluateFeatureFlag:
@pytest.mark.asyncio
async def test_a_non_boolean_flag_value_is_not(self, ld_client, user_context):
ld_client.variation_detail.return_value = served({"some": "object"})
- assert await evaluate_feature_flag(Flag.HIRE_EXPERTS, "u-1") == (False, False)
+ assert await evaluate_feature_flag(Flag.GENERIC_TRIGGER_AGENTS, "u-1") == (
+ False,
+ False,
+ )
@pytest.mark.asyncio
async def test_an_env_override_answers_without_launchdarkly(
@@ -937,8 +952,11 @@ class TestEvaluateFeatureFlag:
"backend.util.feature_flag.get_client",
side_effect=Exception("set_config was not called"),
)
- monkeypatch.setenv("FORCE_FLAG_HIRE_EXPERTS", "false")
- assert await evaluate_feature_flag(Flag.HIRE_EXPERTS, "u-1") == (False, True)
+ monkeypatch.setenv("FORCE_FLAG_GENERIC_TRIGGER_AGENTS", "false")
+ assert await evaluate_feature_flag(Flag.GENERIC_TRIGGER_AGENTS, "u-1") == (
+ False,
+ True,
+ )
@pytest.mark.asyncio
async def test_is_feature_enabled_still_returns_the_bare_value(
@@ -946,9 +964,9 @@ class TestEvaluateFeatureFlag:
):
"""The refactor must not change what existing callers see."""
ld_client.variation_detail.return_value = served(True)
- assert await is_feature_enabled(Flag.HIRE_EXPERTS, "u-1") is True
+ assert await is_feature_enabled(Flag.GENERIC_TRIGGER_AGENTS, "u-1") is True
ld_client.variation_detail.side_effect = Exception("boom")
- assert await is_feature_enabled(Flag.HIRE_EXPERTS, "u-1") is False
+ assert await is_feature_enabled(Flag.GENERIC_TRIGGER_AGENTS, "u-1") is False
class TestRequestAttributes:
diff --git a/autogpt_platform/backend/backend/util/feature_flag/frontend.py b/autogpt_platform/backend/backend/util/feature_flag/frontend.py
index 07f114ff46..b370c91dc7 100644
--- a/autogpt_platform/backend/backend/util/feature_flag/frontend.py
+++ b/autogpt_platform/backend/backend/util/feature_flag/frontend.py
@@ -39,21 +39,14 @@ class FrontendFlag(str, Enum):
MARKETPLACE_SEARCH_TERMS = "marketplace-search-terms"
ENABLE_PLATFORM_PAYMENT = Flag.ENABLE_PLATFORM_PAYMENT.value
- ARTIFACTS_PAGE = "artifacts-page"
CHAT_MODE_OPTION = Flag.CHAT_MODE_OPTION.value
GENERIC_TRIGGER_AGENTS = Flag.GENERIC_TRIGGER_AGENTS.value
CHAT_WORKSPACE_FILES = "chat-workspace-files"
CHAT_PINNING = "chat-pinning"
TASK_PROGRESS_BAR = "task-progress-bar"
- HIRE_EXPERTS = Flag.HIRE_EXPERTS.value
- SKILLS_HUB = Flag.SKILLS_HUB.value
# Until this is on for everyone, /profile/settings stays un-redirected
# (`useNewSettingsRedirect`) so the toggles stay reachable: flip both together.
SETTINGS_NOTIFICATIONS = "settings-notifications"
- ONBOARDING_BRAIN_DUMP = Flag.ONBOARDING_BRAIN_DUMP.value
- ONBOARDING_EXPERT_TEAM = Flag.ONBOARDING_EXPERT_TEAM.value
- GRAPHITI_MEMORY = Flag.GRAPHITI_MEMORY.value
- GRAPHITI_COMMUNITIES_ENABLED = Flag.GRAPHITI_COMMUNITIES_ENABLED.value
DREAM_PASS_ENABLED = Flag.DREAM_PASS_ENABLED.value
DREAM_PASS_INVALIDATE_ENTITY = Flag.DREAM_PASS_INVALIDATE_ENTITY.value
DREAM_SKILL_LEARNING_ENABLED = Flag.DREAM_SKILL_LEARNING_ENABLED.value
diff --git a/autogpt_platform/backend/backend/util/feature_flag/posthog_test.py b/autogpt_platform/backend/backend/util/feature_flag/posthog_test.py
index 2bb3f2ff63..5c74a9f44f 100644
--- a/autogpt_platform/backend/backend/util/feature_flag/posthog_test.py
+++ b/autogpt_platform/backend/backend/util/feature_flag/posthog_test.py
@@ -175,7 +175,9 @@ class TestInMemoryRead:
remote = mocker.patch.object(client, "_get_flags_decision")
mocker.patch.object(ph, "get_flag_client", return_value=client)
try:
- values = ph.evaluate_flags_in_memory(["hire-experts"], "visitor:v-1", {})
+ values = ph.evaluate_flags_in_memory(
+ ["generic-trigger-agents"], "visitor:v-1", {}
+ )
finally:
client.shutdown()
@@ -187,13 +189,13 @@ class TestInMemoryRead:
)
client.feature_flags = [
_rolled_out("marketplace-search-terms", 100, payload='["Research"]'),
- _rolled_out("hire-experts", 100),
+ _rolled_out("generic-trigger-agents", 100),
_rolled_out("chat-search", 0, payload='["unused"]'),
]
mocker.patch.object(ph, "get_flag_client", return_value=client)
try:
values = ph.evaluate_flags_in_memory(
- ["marketplace-search-terms", "hire-experts", "chat-search"],
+ ["marketplace-search-terms", "generic-trigger-agents", "chat-search"],
"visitor:v-1",
{},
)
@@ -202,7 +204,7 @@ class TestInMemoryRead:
assert values == {
"marketplace-search-terms": ["Research"],
- "hire-experts": True,
+ "generic-trigger-agents": True,
"chat-search": False,
}
@@ -212,7 +214,9 @@ class TestRawRead:
async def test_an_unconfigured_client_returns_the_default(self, mocker):
mocker.patch.object(ph, "get_flag_client", return_value=None)
- assert await ph.evaluate_flag("hire-experts", "u-1", default=True) == (
+ assert await ph.evaluate_flag(
+ "generic-trigger-agents", "u-1", default=True
+ ) == (
True,
False,
)
@@ -223,7 +227,7 @@ class TestRawRead:
client.get_feature_flag_result.return_value = answer(value=False)
mocker.patch.object(ph, "get_flag_client", return_value=client)
- assert await ph.evaluate_flag("hire-experts", "u-1") == (False, True)
+ assert await ph.evaluate_flag("generic-trigger-agents", "u-1") == (False, True)
@pytest.mark.asyncio
async def test_an_unresolved_flag_is_not(self, mocker):
@@ -231,7 +235,9 @@ class TestRawRead:
client.get_feature_flag_result.return_value = answer(value=None)
mocker.patch.object(ph, "get_flag_client", return_value=client)
- assert await ph.evaluate_flag("hire-experts", "u-1", default=True) == (
+ assert await ph.evaluate_flag(
+ "generic-trigger-agents", "u-1", default=True
+ ) == (
True,
False,
)
@@ -259,7 +265,7 @@ class TestRawRead:
)
mocker.patch.object(ph, "get_flag_client", return_value=client)
- assert await ph.evaluate_flag("hire-experts", "u-1") == (False, True)
+ assert await ph.evaluate_flag("generic-trigger-agents", "u-1") == (False, True)
@pytest.mark.asyncio
async def test_a_variant_key_is_returned_as_the_value(self, mocker):
@@ -278,10 +284,10 @@ class TestRawRead:
client.get_feature_flag_result.return_value = answer(value=True)
mocker.patch.object(ph, "get_flag_client", return_value=client)
- await ph.evaluate_flag("hire-experts", "u-1", {"role": "admin"})
+ await ph.evaluate_flag("generic-trigger-agents", "u-1", {"role": "admin"})
args, kwargs = client.get_feature_flag_result.call_args
- assert args == ("hire-experts", "u-1")
+ assert args == ("generic-trigger-agents", "u-1")
assert kwargs["person_properties"] == {"role": "admin"}
@pytest.mark.asyncio
@@ -290,7 +296,9 @@ class TestRawRead:
client.get_feature_flag_result.side_effect = Exception("connection refused")
mocker.patch.object(ph, "get_flag_client", return_value=client)
- assert await ph.evaluate_flag("hire-experts", "u-1", default=True) == (
+ assert await ph.evaluate_flag(
+ "generic-trigger-agents", "u-1", default=True
+ ) == (
True,
False,
)
@@ -318,7 +326,9 @@ class TestRawRead:
ThreadPoolExecutor(max_workers=ph.FLAG_READ_WORKERS)
)
reads = [
- asyncio.create_task(ph.evaluate_flag("hire-experts", f"u-{i}"))
+ asyncio.create_task(
+ ph.evaluate_flag("generic-trigger-agents", f"u-{i}")
+ )
for i in range(ph.FLAG_READ_WORKERS + 1)
]
try:
diff --git a/autogpt_platform/backend/backend/util/workspace.py b/autogpt_platform/backend/backend/util/workspace.py
index 89efcc1d94..a82b4374d8 100644
--- a/autogpt_platform/backend/backend/util/workspace.py
+++ b/autogpt_platform/backend/backend/util/workspace.py
@@ -485,6 +485,8 @@ class WorkspaceManager:
files: Sequence[SkillPackageFile],
removed_paths: Collection[str],
scanned_checksums: Collection[str] = (),
+ *,
+ config: Config | None = None,
) -> WorkspaceFile:
"""Write a skill package as one change: ``root`` is its SKILL.md,
``files`` the other files that changed, and ``removed_paths`` the
@@ -501,13 +503,14 @@ class WorkspaceManager:
removed = [self._resolve_path(path) for path in removed_paths]
for path in [*(item.path for item in package), *removed]:
self._authorize_path(path, write=True)
- await self._require_package_room(package, removed)
+ config = config if config is not None else Config()
+ await self._require_package_room(package, removed, config.max_file_size_mb)
for item in package:
if compute_file_checksum(item.content) not in scanned_checksums:
await scan_content_safe(
item.content, filename=posixpath.basename(item.path)
)
- storage = await get_workspace_storage()
+ storage = await get_workspace_storage(config=config)
stored: list[WorkspaceSkillFile] = []
try:
for item in package:
@@ -567,14 +570,14 @@ class WorkspaceManager:
logger.warning("Failed to clean up unpublished skill blob")
async def _require_package_room(
- self, package: list[SkillPackageFile], removed: list[str]
+ self, package: list[SkillPackageFile], removed: list[str], max_file_size_mb: int
) -> None:
- max_file_size = Config().max_file_size_mb * 1024 * 1024
+ max_file_size = max_file_size_mb * 1024 * 1024
for item in package:
if len(item.content) > max_file_size:
raise ValueError(
f"File too large: {len(item.content)} bytes exceeds "
- f"{Config().max_file_size_mb}MB limit"
+ f"{max_file_size_mb}MB limit"
)
db = workspace_db()
storage_limit, current_usage = await asyncio.gather(
diff --git a/autogpt_platform/backend/backend/util/workspace_storage.py b/autogpt_platform/backend/backend/util/workspace_storage.py
index 67d0ecc40d..84e5897205 100644
--- a/autogpt_platform/backend/backend/util/workspace_storage.py
+++ b/autogpt_platform/backend/backend/util/workspace_storage.py
@@ -189,7 +189,9 @@ _gcs_storages: dict[int, GCSWorkspaceStorage] = {}
_storage_lock = asyncio.Lock()
-async def get_workspace_storage() -> WorkspaceStorageBackend:
+async def get_workspace_storage(
+ *, config: Config | None = None
+) -> WorkspaceStorageBackend:
"""Return a workspace storage backend for the **current** event loop.
* Local storage → single shared instance (no event-loop affinity).
@@ -198,7 +200,7 @@ async def get_workspace_storage() -> WorkspaceStorageBackend:
"""
global _local_storage
- config = Config()
+ config = config if config is not None else Config()
# --- Local storage (shared) ---
bucket_name = config.resolved_private_user_data_bucket
diff --git a/autogpt_platform/backend/schema.prisma b/autogpt_platform/backend/schema.prisma
index 04160a330a..4c3ae028cf 100644
--- a/autogpt_platform/backend/schema.prisma
+++ b/autogpt_platform/backend/schema.prisma
@@ -1504,8 +1504,8 @@ enum ExpertRoutineSession {
PINNED
// One durable thread of its own, minted at the first fire and reused after.
// Per routine, not per expert, so two routines on the same cadence never
- // interleave into one conversation. With `graphiti-memory` off this thread
- // IS the routine's memory, which is why it is the default.
+ // interleave into one conversation. Its conversation history preserves
+ // continuity between runs, which is why it is the default.
THREAD
}
diff --git a/autogpt_platform/backend/scripts/feature_flag_sync_dual_test.py b/autogpt_platform/backend/scripts/feature_flag_sync_dual_test.py
index adae608217..2fc6f12a80 100644
--- a/autogpt_platform/backend/scripts/feature_flag_sync_dual_test.py
+++ b/autogpt_platform/backend/scripts/feature_flag_sync_dual_test.py
@@ -156,8 +156,8 @@ LIMITS = {"daily": 625000, "weekly": 3125000}
MULTIPLIERS = {"MAX": 42.66, "PRO": 5}
EXPORT = [
_flag("AutoMod", [True, False], on=False),
- _flag("artifacts-page", [True, False], fallthrough=0),
- _flag("copilot-voice-mode", [True, False], rules=[([_in_segment("employee")], 0)]),
+ _flag("chat-workspace-files", [True, False], fallthrough=0),
+ _flag("copilot-auto-mode", [True, False], rules=[([_in_segment("employee")], 0)]),
_flag(
"chat-mode-option",
[True, False],
@@ -167,7 +167,7 @@ EXPORT = [
],
),
_flag(
- "ai-agent-execution-summary",
+ "copilot-voice-mode",
[True, False],
targets=[{"values": [TARGETED], "variation": 0}],
rules=[([_clause("email_domain", "in", "agpt.co")], 0)],
@@ -190,7 +190,7 @@ EXPORT = [
]
ANONYMOUS_READS = [
"AutoMod",
- "artifacts-page",
+ "chat-workspace-files",
"copilot-cost-limits",
"copilot-tier-multipliers",
"copilot-model-routing",
@@ -201,10 +201,10 @@ ANONYMOUS_READS = [
# same could not pass for a port that ignores targeting.
ANSWERS: dict[str, dict[str, Any]] = {
"AutoMod": {"*": False},
- "artifacts-page": {"*": True},
- "copilot-voice-mode": {"*": False, "employee": True, "targeted": True},
+ "chat-workspace-files": {"*": True},
+ "copilot-auto-mode": {"*": False, "employee": True, "targeted": True},
"chat-mode-option": {"*": False, "employee": True, "outsider": True},
- "ai-agent-execution-summary": {"*": False, "employee": True, "targeted": True},
+ "copilot-voice-mode": {"*": False, "employee": True, "targeted": True},
"copilot-cost-limits": {"*": LIMITS},
"copilot-tier-multipliers": {"*": MULTIPLIERS, "employee": {}, "targeted": {}},
"copilot-model-routing": {"*": {}},
diff --git a/autogpt_platform/docker-compose.journeys.yml b/autogpt_platform/docker-compose.journeys.yml
index e16955b764..73c738f332 100644
--- a/autogpt_platform/docker-compose.journeys.yml
+++ b/autogpt_platform/docker-compose.journeys.yml
@@ -20,8 +20,8 @@ x-scripted-model-env: &scripted-model-env
CHAT_USE_CLAUDE_CODE_SUBSCRIPTION: "false"
CHAT_BASE_URL: http://scripted_model:4010/api/v1
CHAT_API_KEY: "scripted-model-accepts-any-key" # pragma: allowlist secret
- # Memory (graphiti-memory is a hosted flag) would otherwise send that key to
- # openrouter.ai and api.openai.com. Kept inside the stack, its calls fail
+ # Memory would otherwise send that key to openrouter.ai and api.openai.com.
+ # Kept inside the stack, its calls fail
# fast and the turn goes on without memory, as it does on any failure.
GRAPHITI_LLM_BASE_URL: http://scripted_model:4010/api/v1
GRAPHITI_EMBEDDER_BASE_URL: http://scripted_model:4010/api/v1
diff --git a/autogpt_platform/frontend/.env.default b/autogpt_platform/frontend/.env.default
index 516003d6b9..626d9ce8d8 100644
--- a/autogpt_platform/frontend/.env.default
+++ b/autogpt_platform/frontend/.env.default
@@ -135,16 +135,3 @@ NEXT_PUBLIC_VAPID_PUBLIC_KEY=BBg49iVTWthVbRYphwmZNvZyiSJDqtSO4nmLxDzLKe3Oo9jbtu0
# OpenAI (for voice transcription)
OPENAI_API_KEY=
-
-# Voice brain-dump onboarding step (`onboarding-brain-dump` LaunchDarkly
-# flag). Commented deliberately: an active value here would ship the feature
-# on to every install. Uncomment in your own .env, pair it with
-# FORCE_FLAG_ONBOARDING_BRAIN_DUMP in backend/.env, and restart the dev
-# server — NEXT_PUBLIC_* vars are inlined at build time.
-# NEXT_PUBLIC_FORCE_FLAG_ONBOARDING_BRAIN_DUMP=true
-
-# Expert-first onboarding (`onboarding-expert-team`, child of `hire-experts`):
-# the greeting page proposes a team from the brain dump. Needs both flags
-# on, here and in backend/.env.
-# NEXT_PUBLIC_FORCE_FLAG_HIRE_EXPERTS=true
-# NEXT_PUBLIC_FORCE_FLAG_ONBOARDING_EXPERT_TEAM=true
diff --git a/autogpt_platform/frontend/CONTRIBUTING.md b/autogpt_platform/frontend/CONTRIBUTING.md
index c9baeaf75b..980335e278 100644
--- a/autogpt_platform/frontend/CONTRIBUTING.md
+++ b/autogpt_platform/frontend/CONTRIBUTING.md
@@ -505,8 +505,8 @@ Check a flag in a client component:
```tsx
import { Flag, useGetFlag } from "@/services/feature-flags/use-get-flag";
-export function SkillsPanel() {
- const enabled = useGetFlag(Flag.SKILLS_HUB);
+export function VoiceControls() {
+ const enabled = useGetFlag(Flag.COPILOT_VOICE_MODE);
if (!enabled) return null;
return <div>Feature is enabled!</div>;
}
diff --git a/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/__tests__/brain-dump.test.tsx b/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/__tests__/brain-dump.test.tsx
index c217217bc4..7c15aa1a75 100644
--- a/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/__tests__/brain-dump.test.tsx
+++ b/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/__tests__/brain-dump.test.tsx
@@ -125,8 +125,8 @@ vi.mock("../steps/RoleStep", () => ({
vi.mock("../steps/SubscriptionStep/SubscriptionStep", () => ({
SubscriptionStep: () => <div data-testid="step-subscription" />,
}));
-vi.mock("../steps/PreparingStep", () => ({
- PreparingStep: () => <div data-testid="step-preparing" />,
+vi.mock("../steps/HireStep/HireStep", () => ({
+ HireStep: () => <div data-testid="step-hire" />,
}));
let currentSearchParams = new URLSearchParams();
@@ -161,7 +161,7 @@ vi.mock("@/app/api/__generated__/endpoints/onboarding/onboarding", () => ({
wizardRevision: 0,
wizardProgress: makeProgress({
currentStep: "painPoints",
- completedSteps: ["role"],
+ completedSteps: ["team", "autopilot", "role"],
}),
},
}),
@@ -196,9 +196,6 @@ let mockFlags: Record<string, boolean> = {};
vi.mock("@/services/feature-flags/use-get-flag", () => ({
Flag: {
ENABLE_PLATFORM_PAYMENT: "enable-platform-payment",
- ONBOARDING_BRAIN_DUMP: "onboarding-brain-dump",
- ONBOARDING_EXPERT_TEAM: "onboarding-expert-team",
- HIRE_EXPERTS: "hire-experts",
},
useGetFlag: (flag: string) => mockFlags[flag] ?? false,
useFlagStatus: (flag: string) => ({
@@ -293,7 +290,7 @@ function installBrowserRecordingAPIs() {
});
}
-// Records every brain-dump call so "flag off makes no brain-dump request"
+// Records every brain-dump call so request payloads
// can be asserted, and so request bodies can be inspected.
function recordBrainDumpTraffic() {
const calls: { endpoint: string; body?: unknown }[] = [];
@@ -350,15 +347,6 @@ function finalizeReturns(response: {
return bodies;
}
-function stepDots(container: HTMLElement) {
- return container.querySelectorAll("div.h-1\\.5.rounded-full").length;
-}
-
-function progressWidth(container: HTMLElement) {
- const bar = container.querySelector<HTMLElement>("div.bg-zinc-900");
- return bar?.style.width ?? null;
-}
-
// Lands the wizard on the step the pillboxes / the brain dump share.
function landOnPainPointsStep() {
window.sessionStorage.setItem(
@@ -390,9 +378,8 @@ afterEach(() => {
cleanup();
});
-describe("onboarding brain dump — flag gating", () => {
+describe("onboarding brain dump", () => {
it("explains what to share before choosing Talk or Write", async () => {
- mockFlags = { "onboarding-brain-dump": true };
landOnPainPointsStep();
render(<OnboardingPage />);
@@ -407,8 +394,7 @@ describe("onboarding brain dump — flag gating", () => {
expect(getUserMedia).not.toHaveBeenCalled();
});
- it("renders the brain dump in the pillbox slot when the flag is on", async () => {
- mockFlags = { "onboarding-brain-dump": true };
+ it("renders the brain dump as the personalization step", async () => {
landOnPainPointsStep();
render(<OnboardingPage />);
@@ -419,7 +405,6 @@ describe("onboarding brain dump — flag gating", () => {
});
it("renders Otto as the visual, waiting at rest", async () => {
- mockFlags = { "onboarding-brain-dump": true };
landOnPainPointsStep();
render(<OnboardingPage />);
@@ -429,32 +414,11 @@ describe("onboarding brain dump — flag gating", () => {
expect(screen.getByRole("button", { name: "Talk" })).toBeDefined();
});
- it("leaves the pillboxes untouched and makes no brain-dump request when the flag is off", async () => {
- const calls = recordBrainDumpTraffic();
- mockFlags = {};
- landOnPainPointsStep();
-
- render(<OnboardingPage />);
-
- expect(await screen.findByText(PILLBOX_HEADING)).toBeDefined();
- expect(
- screen.getByText("Pick the tasks you'd love to hand off to your experts"),
- ).toBeDefined();
- expect(screen.queryByText(DUMP_HEADLINE)).toBeNull();
- expect(screen.queryByRole("button", { name: "Talk" })).toBeNull();
- expect(screen.queryByText("Skip for now")).toBeNull();
-
- // Give any stray effect a chance to fire before declaring silence.
- await new Promise((resolve) => setTimeout(resolve, 50));
- expect(calls).toEqual([]);
- });
-
// Guards the assertion above: proves the recorder above is actually wired
// to the brain-dump endpoints, so an empty `calls` means silence rather
// than a handler that never intercepts anything.
- it("records brain-dump traffic when the flag is on and the user acts", async () => {
+ it("records brain-dump traffic when the user acts", async () => {
const calls = recordBrainDumpTraffic();
- mockFlags = { "onboarding-brain-dump": true };
landOnPainPointsStep();
render(<OnboardingPage />);
@@ -472,7 +436,6 @@ describe("onboarding brain dump — typed fallback", () => {
getUserMedia.mockRejectedValue(
new DOMException("denied", "NotAllowedError"),
);
- mockFlags = { "onboarding-brain-dump": true };
landOnPainPointsStep();
render(<OnboardingPage />);
@@ -494,7 +457,6 @@ describe("onboarding brain dump — typed fallback", () => {
});
it("opens the typed composer from the rest state via Write", async () => {
- mockFlags = { "onboarding-brain-dump": true };
landOnPainPointsStep();
render(<OnboardingPage />);
@@ -519,7 +481,6 @@ describe("onboarding brain dump — typed fallback", () => {
describe("onboarding brain dump — skip", () => {
it("posts input_mode 'skipped' and advances the wizard", async () => {
const bodies = finalizeReturns({ status: "completed" });
- mockFlags = { "onboarding-brain-dump": true };
landOnPainPointsStep();
render(<OnboardingPage />);
@@ -533,7 +494,7 @@ describe("onboarding brain dump — skip", () => {
input_mode: "skipped",
});
- expect(await screen.findByTestId("step-preparing")).toBeDefined();
+ expect(await screen.findByTestId("step-hire")).toBeDefined();
expect(window.sessionStorage.getItem(INTRO_PATH_KEY)).toBe("B");
});
});
@@ -556,7 +517,6 @@ describe("onboarding brain dump — finishing a take", () => {
}),
);
const bodies = finalizeReturns({ status: "completed" });
- mockFlags = { "onboarding-brain-dump": true };
landOnPainPointsStep();
render(<OnboardingPage />);
@@ -573,7 +533,7 @@ describe("onboarding brain dump — finishing a take", () => {
await screen.findByRole("button", { name: "Send recording" }),
);
- expect(await screen.findByTestId("step-preparing")).toBeDefined();
+ expect(await screen.findByTestId("step-hire")).toBeDefined();
expect(bodies).toHaveLength(1);
const recordingId = (bodies[0] as { recording_id: string }).recording_id;
// Marked finalized by id, then cleared: an unfinalized row left behind
@@ -604,7 +564,6 @@ describe("onboarding brain dump — finishing a take", () => {
return { status: "completed" as const, input_mode: "voice" as const };
}),
);
- mockFlags = { "onboarding-brain-dump": true };
landOnPainPointsStep();
render(<OnboardingPage />);
@@ -632,7 +591,6 @@ describe("onboarding brain dump — finishing a take", () => {
return { status: null };
}),
);
- mockFlags = { "onboarding-brain-dump": true };
landOnPainPointsStep();
render(<OnboardingPage />);
@@ -723,7 +681,6 @@ describe("onboarding brain dump — recovery", () => {
uploaded: false,
},
];
- mockFlags = { "onboarding-brain-dump": true };
landOnPainPointsStep();
render(<OnboardingPage />);
@@ -756,7 +713,6 @@ describe("onboarding brain dump — recovery", () => {
finalized: false,
};
recordingStoreState.parts = [];
- mockFlags = { "onboarding-brain-dump": true };
landOnPainPointsStep();
render(<OnboardingPage />);
@@ -787,7 +743,6 @@ describe("onboarding brain dump — failure", () => {
status: "failed",
error_code: "transcription_error",
});
- mockFlags = { "onboarding-brain-dump": true };
landOnPainPointsStep();
render(<OnboardingPage />);
@@ -822,7 +777,7 @@ describe("onboarding brain dump — failure", () => {
screen.getByRole("button", { name: "Continue without it" }),
).toBeDefined();
// The wizard must not advance on failure.
- expect(screen.queryByTestId("step-preparing")).toBeNull();
+ expect(screen.queryByTestId("step-hire")).toBeNull();
});
});
@@ -840,7 +795,6 @@ describe("onboarding brain dump — insufficient content", () => {
};
}),
);
- mockFlags = { "onboarding-brain-dump": true };
landOnPainPointsStep();
render(<OnboardingPage />);
@@ -868,7 +822,7 @@ describe("onboarding brain dump — insufficient content", () => {
screen.getByRole("button", { name: "Continue without it" }),
).toBeDefined();
// No accidental advance to the personalized greeting...
- expect(screen.queryByTestId("step-preparing")).toBeNull();
+ expect(screen.queryByTestId("step-hire")).toBeNull();
expect(window.sessionStorage.getItem(INTRO_PATH_KEY)).toBeNull();
// ...and the local parts survive until the user picks a next move.
expect(recordingStoreState.parts).toHaveLength(1);
@@ -891,45 +845,23 @@ describe("onboarding brain dump — insufficient content", () => {
});
describe("onboarding step map integrity", () => {
- it("keeps the step constants identical regardless of the brain-dump flag", () => {
+ it("keeps personalization and hiring before the optional payment step", () => {
expect(PAYWALL_LAST_STEPS).toEqual({
- role: 1,
- painPoints: 2,
- subscription: 3,
- preparing: 4,
+ team: 1,
+ autopilot: 2,
+ role: 3,
+ painPoints: 4,
+ hire: 5,
+ subscription: 6,
+ preparing: 7,
});
expect(NO_PAYWALL_STEPS).toEqual({
- role: 1,
- painPoints: 2,
- preparing: 3,
+ team: 1,
+ autopilot: 2,
+ role: 3,
+ painPoints: 4,
+ hire: 5,
+ preparing: 6,
});
});
-
- it("renders the same screen count and progress with the flag on and off", async () => {
- mockFlags = {};
- landOnPainPointsStep();
- const off = render(<OnboardingPage />);
- await screen.findByText(PILLBOX_HEADING);
- const offDots = stepDots(off.container);
- const offWidth = progressWidth(off.container);
- const offUrl = routerReplace.mock.calls.map((c) => c[0]);
-
- cleanup();
- routerReplace.mockClear();
- useOnboardingWizardStore.getState().reset();
-
- mockFlags = { "onboarding-brain-dump": true };
- landOnPainPointsStep();
- const on = render(<OnboardingPage />);
- await screen.findByText(DUMP_HEADLINE);
- const onDots = stepDots(on.container);
- const onWidth = progressWidth(on.container);
- const onUrl = routerReplace.mock.calls.map((c) => c[0]);
-
- expect(offDots).toBe(2);
- expect(offWidth).toBe(`${(2 / 3) * 100}%`);
- expect(onDots).toBe(offDots);
- expect(onWidth).toBe(offWidth);
- expect(onUrl).toEqual(offUrl);
- });
});
diff --git a/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/__tests__/layout.test.ts b/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/__tests__/layout.test.ts
index 3fae1a072e..f9763dd29d 100644
--- a/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/__tests__/layout.test.ts
+++ b/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/__tests__/layout.test.ts
@@ -2,13 +2,11 @@ import { act, renderHook } from "@testing-library/react";
import { beforeEach, describe, expect, it, vi } from "vitest";
import { Flag } from "@/services/feature-flags/use-get-flag";
import { useOnboardingLayout } from "../useOnboardingLayout";
-
const source = vi.hoisted(() => ({
flags: {} as Record<string, { value: boolean; resolved: boolean }>,
local: false,
paid: false,
}));
-
vi.mock("@/services/feature-flags/flag-source", () => ({
useFlagSource: (key: string) =>
source.flags[key] ?? { value: undefined, resolved: false },
@@ -29,42 +27,23 @@ vi.mock("../usePaidCheckoutStatus", () => ({
ready: true,
}),
}));
-
-const layoutFlags = [
- Flag.ENABLE_PLATFORM_PAYMENT,
- Flag.ONBOARDING_BRAIN_DUMP,
- Flag.ONBOARDING_EXPERT_TEAM,
- Flag.HIRE_EXPERTS,
-];
const initialProps = {
userID: "first-user",
isLoggedIn: true,
isUserLoading: false,
trialConfirmation: { ready: true, active: false },
};
-
beforeEach(() => {
- source.flags = Object.fromEntries(
- layoutFlags.map((flag) => [flag, { value: true, resolved: true }]),
- );
+ source.flags = {
+ [Flag.ENABLE_PLATFORM_PAYMENT]: { value: true, resolved: true },
+ };
source.local = false;
source.paid = false;
});
-
-describe("onboarding layout readiness", () => {
- it.each(layoutFlags)("waits for %s before freezing the layout", (flag) => {
- delete source.flags[flag];
- const { result, rerender } = renderHook(useOnboardingLayout, {
- initialProps,
- });
-
- expect(result.current.isReady).toBe(false);
-
- source.flags[flag] = { value: true, resolved: true };
- rerender(initialProps);
-
+describe("onboarding layout", () => {
+ it("includes team introductions, brain dump, and hiring without rollout flags", () => {
+ const { result } = renderHook(useOnboardingLayout, { initialProps });
expect(result.current.isReady).toBe(true);
- expect(result.current.isBrainDumpEnabled).toBe(true);
expect(result.current.steps).toEqual({
team: 1,
autopilot: 2,
@@ -75,77 +54,72 @@ describe("onboarding layout readiness", () => {
preparing: 7,
});
});
-
- it("keeps the active account's step order after flags change", () => {
+ it("waits only for payment before freezing checkout placement", () => {
+ source.flags = {};
const { result, rerender } = renderHook(useOnboardingLayout, {
initialProps,
});
- const steps = result.current.steps;
-
- source.flags = Object.fromEntries(
- layoutFlags.map((flag) => [flag, { value: false, resolved: true }]),
- );
+ expect(result.current.isReady).toBe(false);
+ source.flags[Flag.ENABLE_PLATFORM_PAYMENT] = {
+ value: true,
+ resolved: true,
+ };
rerender(initialProps);
-
expect(result.current.isReady).toBe(true);
+ expect(result.current.steps.subscription).toBe(6);
+ });
+ it("keeps the active account's payment order after a flag change", () => {
+ const { result, rerender } = renderHook(useOnboardingLayout, {
+ initialProps,
+ });
+ const steps = result.current.steps;
+ source.flags[Flag.ENABLE_PLATFORM_PAYMENT] = {
+ value: false,
+ resolved: true,
+ };
+ rerender(initialProps);
expect(result.current.steps).toEqual(steps);
- expect(result.current.isBrainDumpEnabled).toBe(true);
});
-
- it("uses the existing bounded fallback if a layout flag never resolves", () => {
+ it("uses the bounded payment fallback without dropping personalization", () => {
vi.useFakeTimers();
try {
- delete source.flags[Flag.ONBOARDING_BRAIN_DUMP];
+ source.flags = {};
const { result, unmount } = renderHook(useOnboardingLayout, {
initialProps,
});
expect(result.current.isReady).toBe(false);
-
act(() => vi.advanceTimersByTime(5000));
-
expect(result.current.isReady).toBe(true);
- expect(result.current.isBrainDumpEnabled).toBe(false);
- expect(result.current.steps.hire).toBeUndefined();
- expect(result.current.steps.subscription).toBe(5);
+ expect(result.current.steps).toMatchObject({
+ team: 1,
+ autopilot: 2,
+ painPoints: 4,
+ hire: 5,
+ preparing: 6,
+ });
+ expect(result.current.steps.subscription).toBeUndefined();
unmount();
} finally {
vi.useRealTimers();
}
});
-
- it("waits for the next account's flags instead of retaining the old layout", () => {
+ it("resolves the next account's checkout rather than retaining old payment state", () => {
const { result, rerender } = renderHook(useOnboardingLayout, {
initialProps,
});
- expect(result.current.steps.hire).toBe(5);
-
source.flags = {};
const nextUser = { ...initialProps, userID: "second-user" };
rerender({ ...nextUser, isUserLoading: true });
expect(result.current.isReady).toBe(false);
-
source.flags[Flag.ENABLE_PLATFORM_PAYMENT] = {
- value: true,
+ value: false,
resolved: true,
};
rerender(nextUser);
- expect(result.current.isReady).toBe(false);
-
- source.flags[Flag.ONBOARDING_BRAIN_DUMP] = { value: true, resolved: true };
- source.flags[Flag.ONBOARDING_EXPERT_TEAM] = { value: true, resolved: true };
- source.flags[Flag.HIRE_EXPERTS] = { value: false, resolved: true };
- rerender(nextUser);
-
expect(result.current.isReady).toBe(true);
- expect(result.current.isBrainDumpEnabled).toBe(true);
- expect(result.current.steps).toEqual({
- role: 1,
- painPoints: 2,
- subscription: 3,
- preparing: 4,
- });
+ expect(result.current.steps.hire).toBe(5);
+ expect(result.current.steps.subscription).toBeUndefined();
});
-
it.each([
["unpaid hosted", false, false, false, true],
["paid hosted", false, true, false, false],
@@ -163,7 +137,6 @@ describe("onboarding layout readiness", () => {
trialConfirmation: { ready: true, active: trial },
},
});
-
expect(result.current.isReady).toBe(true);
expect(result.current.isPaymentEnabled).toBe(paywall);
expect(result.current.steps.subscription !== undefined).toBe(paywall);
diff --git a/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/__tests__/page.test.tsx b/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/__tests__/page.test.tsx
index 77f486d824..07cf30e94d 100644
--- a/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/__tests__/page.test.tsx
+++ b/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/__tests__/page.test.tsx
@@ -16,7 +16,7 @@ import {
import OnboardingPage from "../page";
import { useOnboardingWizardStore } from "../store";
import { progressStorageKey } from "../progress";
-import { makeProgress } from "./progress-fixture";
+import { makeProgress as makeBaseProgress } from "./progress-fixture";
vi.mock("../steps/RoleStep", () => ({
RoleStep: () => (
@@ -28,16 +28,6 @@ vi.mock("../steps/RoleStep", () => ({
</button>
),
}));
-vi.mock("../steps/PainPointsStep", () => ({
- PainPointsStep: () => (
- <button
- data-testid="step-painpoints"
- onClick={() => useOnboardingWizardStore.getState().nextStep()}
- >
- Continue
- </button>
- ),
-}));
vi.mock("../steps/BrainDumpStep/BrainDumpStep", () => ({
BrainDumpStep: () => (
<button
@@ -145,9 +135,6 @@ let flags: Record<string, boolean> = {};
vi.mock("@/services/feature-flags/use-get-flag", () => ({
Flag: {
ENABLE_PLATFORM_PAYMENT: "payment",
- ONBOARDING_BRAIN_DUMP: "brain",
- ONBOARDING_EXPERT_TEAM: "team",
- HIRE_EXPERTS: "hire",
},
useGetFlag: (flag: string) => !!flags[flag],
useFlagStatus: (flag: string) => ({ enabled: !!flags[flag], ready: true }),
@@ -213,6 +200,29 @@ afterEach(() => {
vi.unstubAllEnvs();
});
+function makeProgress(overrides: Partial<OnboardingWizardProgress> = {}) {
+ const progress = makeBaseProgress(overrides);
+ return {
+ ...progress,
+ completedSteps: Array.from(
+ new Set([
+ "team",
+ "autopilot",
+ ...progress.completedSteps,
+ ...(["subscription", "connect", "preparing"].includes(
+ progress.currentStep,
+ ) && progress.completedSteps.includes("painPoints")
+ ? ["hire"]
+ : []),
+ ]),
+ ),
+ } as OnboardingWizardProgress;
+}
+async function completePersonalization() {
+ for (const key of ["team", "autopilot", "role", "braindump", "hire"]) {
+ fireEvent.click(await screen.findByTestId(`step-${key}`));
+ }
+}
function atPaywall() {
serverDraft = makeProgress({
currentStep: "subscription",
@@ -223,17 +233,16 @@ function atPaywall() {
describe("onboarding before payment", () => {
it("collects role and pain points before showing the card requirement", async () => {
render(<OnboardingPage />);
- fireEvent.click(await screen.findByTestId("step-role"));
- fireEvent.click(await screen.findByTestId("step-painpoints"));
+ await completePersonalization();
expect(await screen.findByTestId("step-subscription")).toBeDefined();
expect(completeStep).not.toHaveBeenCalled();
expect(submitProfile).not.toHaveBeenCalled();
fireEvent.click(screen.getByRole("button", { name: "Back" }));
- expect(await screen.findByTestId("step-painpoints")).toBeDefined();
+ expect(await screen.findByTestId("step-hire")).toBeDefined();
});
it("keeps the brain dump and real hire step before the paywall", async () => {
- flags = { payment: true, team: true, brain: true, hire: true };
+ flags = { payment: true };
render(<OnboardingPage />);
for (const key of ["team", "autopilot", "role", "braindump", "hire"]) {
fireEvent.click(await screen.findByTestId(`step-${key}`));
@@ -335,14 +344,15 @@ describe("onboarding before payment", () => {
completedSteps: ["role"],
});
render(<OnboardingPage />);
- expect(await screen.findByTestId("step-painpoints")).toBeDefined();
+ expect(await screen.findByTestId("step-braindump")).toBeDefined();
expect(screen.queryByTestId("step-subscription")).toBeNull();
});
- it("restores the earliest incomplete step when optional intro steps become enabled", async () => {
- atPaywall();
- flags.team = true;
- flags.hire = true;
+ it("restores missing intro steps from a legacy draft", async () => {
+ serverDraft = makeBaseProgress({
+ currentStep: "subscription",
+ completedSteps: ["role", "painPoints"],
+ });
render(<OnboardingPage />);
expect(await screen.findByTestId("step-team")).toBeDefined();
});
@@ -357,7 +367,7 @@ describe("onboarding before payment", () => {
JSON.stringify({ state: { role: "Another user" } }),
);
render(<OnboardingPage />);
- expect(await screen.findByTestId("step-role")).toBeDefined();
+ expect(await screen.findByTestId("step-team")).toBeDefined();
expect(useOnboardingWizardStore.getState().role).toBe("");
},
);
@@ -408,8 +418,7 @@ describe("draft recovery", () => {
it("saves each step in the background without holding navigation", async () => {
patchState.mockImplementation(() => new Promise(() => {}));
render(<OnboardingPage />);
- fireEvent.click(await screen.findByTestId("step-role"));
- fireEvent.click(await screen.findByTestId("step-painpoints"));
+ await completePersonalization();
expect(await screen.findByTestId("step-subscription")).toBeDefined();
const localDraft = JSON.parse(
localStorage.getItem(progressStorageKey("u1"))!,
@@ -433,7 +442,7 @@ describe("draft recovery", () => {
);
serverDraft = makeProgress({ role: "Old answer" });
render(<OnboardingPage />);
- expect(await screen.findByTestId("step-painpoints")).toBeDefined();
+ expect(await screen.findByTestId("step-braindump")).toBeDefined();
expect(useOnboardingWizardStore.getState().role).toBe("Design");
await waitFor(() =>
expect(patchState).toHaveBeenCalledWith(
@@ -456,11 +465,13 @@ describe("draft recovery", () => {
it("surfaces save failures while allowing continuation", async () => {
patchState.mockRejectedValue(new Error("offline"));
render(<OnboardingPage />);
- fireEvent.click(await screen.findByTestId("step-role"));
+ for (const key of ["team", "autopilot", "role"])
+ fireEvent.click(await screen.findByTestId(`step-${key}`));
expect(
await screen.findByText(/couldn't save your progress/),
).toBeDefined();
- fireEvent.click(screen.getByTestId("step-painpoints"));
+ fireEvent.click(screen.getByTestId("step-braindump"));
+ fireEvent.click(await screen.findByTestId("step-hire"));
expect(await screen.findByTestId("step-subscription")).toBeDefined();
});
@@ -475,9 +486,9 @@ describe("draft recovery", () => {
serverDraft = null;
patchState.mockClear();
view.rerender(<OnboardingPage />);
- expect(await screen.findByTestId("step-role")).toBeDefined();
+ expect(await screen.findByTestId("step-team")).toBeDefined();
expect(useOnboardingWizardStore.getState().role).toBe("");
- fireEvent.click(screen.getByTestId("step-role"));
+ fireEvent.click(screen.getByTestId("step-team"));
await act(async () => {
await useOnboardingWizardStore.getState().flushProgress?.();
});
@@ -513,7 +524,7 @@ it("ignores a late draft response from an account that has been switched away",
const view = render(<OnboardingPage />);
user = { id: "u2", email: "[email protected]", user_metadata: {} };
view.rerender(<OnboardingPage />);
- expect(await screen.findByTestId("step-role")).toBeDefined();
+ expect(await screen.findByTestId("step-team")).toBeDefined();
await act(async () => {
release?.({
status: 200,
@@ -560,7 +571,7 @@ it("recognizes a successful save whose response was lost before navigation", asy
serverDraft = draft;
revision = 1;
render(<OnboardingPage />);
- expect(await screen.findByTestId("step-painpoints")).toBeDefined();
+ expect(await screen.findByTestId("step-braindump")).toBeDefined();
expect(
screen.queryByRole("button", { name: "Reload latest progress" }),
).toBeNull();
@@ -587,7 +598,7 @@ it("recognizes a successful save whose response was lost before navigation", asy
it("surfaces a revision conflict without overwriting newer server answers", async () => {
patchState.mockRejectedValue({ status: 409 });
render(<OnboardingPage />);
- fireEvent.click(await screen.findByTestId("step-role"));
+ fireEvent.click(await screen.findByTestId("step-team"));
expect(
await screen.findByRole("button", { name: "Reload latest progress" }),
).toBeDefined();
@@ -647,7 +658,8 @@ it.each(["", "Other"])(
expect(completeStep).not.toHaveBeenCalled();
act(() => useOnboardingWizardStore.getState().setRole("Design"));
fireEvent.click(screen.getByTestId("step-role"));
- fireEvent.click(await screen.findByTestId("step-painpoints"));
+ fireEvent.click(await screen.findByTestId("step-braindump"));
+ fireEvent.click(await screen.findByTestId("step-hire"));
fireEvent.click(await screen.findByTestId("step-preparing"));
await waitFor(() => expect(routerReplace).toHaveBeenCalledWith("/home"));
expect(submitProfile).toHaveBeenCalledWith(
@@ -745,7 +757,7 @@ describe("profile saving before completion", () => {
user = { id: "u2", email: "[email protected]", user_metadata: {} };
serverDraft = null;
view.rerender(<OnboardingPage />);
- expect(await screen.findByTestId("step-role")).toBeDefined();
+ expect(await screen.findByTestId("step-team")).toBeDefined();
await act(async () => release?.({ status: 200 }));
expect(completeStep).not.toHaveBeenCalled();
expect(routerReplace).not.toHaveBeenCalledWith("/home");
diff --git a/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/__tests__/progress.test.ts b/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/__tests__/progress.test.ts
index c0c6ff3366..1510ae2747 100644
--- a/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/__tests__/progress.test.ts
+++ b/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/__tests__/progress.test.ts
@@ -14,25 +14,25 @@ it.each([
});
describe("semantic progress", () => {
- it("resumes after an optional hire step disappears", () => {
+ it("resumes at hiring after personalization", () => {
expect(
resumeStep({
progress: makeProgress({
currentStep: "hire",
- completedSteps: ["role", "painPoints"],
+ completedSteps: ["team", "autopilot", "role", "painPoints"],
}),
steps: buildStepLayout({ hasPaywall: true }),
}),
- ).toBe(3);
+ ).toBe(5);
});
it("honors a previous-step URL without allowing an incomplete step to be skipped", () => {
const progress = makeProgress({
currentStep: "subscription",
- completedSteps: ["role", "painPoints"],
+ completedSteps: ["team", "autopilot", "role", "painPoints"],
});
const steps = buildStepLayout({ hasPaywall: true });
- expect(resumeStep({ progress, steps, requestedStep: "role" })).toBe(1);
- expect(resumeStep({ progress, steps, requestedStep: "preparing" })).toBe(3);
+ expect(resumeStep({ progress, steps, requestedStep: "role" })).toBe(3);
+ expect(resumeStep({ progress, steps, requestedStep: "preparing" })).toBe(5);
});
});
diff --git a/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/__tests__/store.test.ts b/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/__tests__/store.test.ts
index 889c62074b..fea3a6a198 100644
--- a/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/__tests__/store.test.ts
+++ b/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/__tests__/store.test.ts
@@ -198,9 +198,7 @@ describe("useOnboardingWizardStore", () => {
describe("buildStepLayout", () => {
it("places the paywall after personalization and hiring", () => {
- expect(
- buildStepLayout({ hasIntro: true, hasHire: true, hasPaywall: true }),
- ).toEqual({
+ expect(buildStepLayout({ hasPaywall: true })).toEqual({
team: 1,
autopilot: 2,
role: 3,
@@ -211,23 +209,15 @@ describe("buildStepLayout", () => {
});
});
- it("leaves the hire step out when it is off", () => {
- expect(buildStepLayout({ hasIntro: true, hasPaywall: true })).toEqual({
+ it("closes with the connection on self-host, never beside a paywall", () => {
+ expect(buildStepLayout({ hasConnect: true })).toEqual({
team: 1,
autopilot: 2,
role: 3,
painPoints: 4,
- subscription: 5,
- preparing: 6,
- });
- });
-
- it("closes with the connection on self-host, never beside a paywall", () => {
- expect(buildStepLayout({ hasConnect: true })).toEqual({
- role: 1,
- painPoints: 2,
- connect: 3,
- preparing: 4,
+ hire: 5,
+ connect: 6,
+ preparing: 7,
});
expect(
buildStepLayout({ hasPaywall: true, hasConnect: true }).connect,
diff --git a/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/__tests__/tracking.test.ts b/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/__tests__/tracking.test.ts
index e091d6a73e..9852adf9fc 100644
--- a/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/__tests__/tracking.test.ts
+++ b/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/__tests__/tracking.test.ts
@@ -29,20 +29,8 @@ describe("onboardingStepKey", () => {
).toBe("preparing");
});
- it("names the intro steps when the layout has them", () => {
- const steps = buildStepLayout({ hasIntro: true, hasPaywall: true });
- expect(onboardingStepKey(steps, 1)).toBe("team");
- expect(onboardingStepKey(steps, 2)).toBe("autopilot");
- expect(onboardingStepKey(steps, 3)).toBe("role");
- expect(onboardingStepKey(steps, 4)).toBe("pain_points");
- expect(onboardingStepKey(steps, 5)).toBeNull();
- expect(onboardingStepKey(steps, 6)).toBe("preparing");
- });
-
it("names the hire step when the layout has it", () => {
const steps = buildStepLayout({
- hasIntro: true,
- hasHire: true,
hasPaywall: true,
});
expect(onboardingStepKey(steps, 5)).toBe("hire");
@@ -54,7 +42,7 @@ describe("onboardingStepKey", () => {
// double-count the top of the funnel.
it("returns null for the subscription step", () => {
expect(
- onboardingStepKey(PAYWALL_LAST_STEPS, PAYWALL_LAST_STEPS.subscription),
+ onboardingStepKey(PAYWALL_LAST_STEPS, PAYWALL_LAST_STEPS.subscription!),
).toBeNull();
});
});
@@ -76,19 +64,16 @@ describe("trackOnboardingStep", () => {
]);
});
- it.each([false, true])(
- "tracks the optional connection step once, with intro=%s",
- (hasIntro) => {
- const steps = buildStepLayout({ hasIntro, hasConnect: true });
- const key = onboardingStepKey(steps, steps.connect!);
- expect(key).toBe("connect");
- if (key) {
- trackOnboardingStep(key);
- trackOnboardingStep(key);
- }
- expect(posthog.capture.mock.calls).toEqual([
- ["onboarding_step_viewed", { step: "connect" }],
- ]);
- },
- );
+ it("tracks the optional connection step once", () => {
+ const steps = buildStepLayout({ hasConnect: true });
+ const key = onboardingStepKey(steps, steps.connect!);
+ expect(key).toBe("connect");
+ if (key) {
+ trackOnboardingStep(key);
+ trackOnboardingStep(key);
+ }
+ expect(posthog.capture.mock.calls).toEqual([
+ ["onboarding_step_viewed", { step: "connect" }],
+ ]);
+ });
});
diff --git a/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/__tests__/wizard-progress.test.tsx b/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/__tests__/wizard-progress.test.tsx
index 225414a7a0..4d41e2f7dc 100644
--- a/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/__tests__/wizard-progress.test.tsx
+++ b/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/__tests__/wizard-progress.test.tsx
@@ -3,7 +3,7 @@ import { afterEach, beforeEach, expect, it, vi } from "vitest";
import { readLocalProgress, writeLocalProgress } from "../progress";
import { PAYWALL_LAST_STEPS, useOnboardingWizardStore } from "../store";
import { useWizardProgress } from "../useWizardProgress";
-import { makeProgress } from "./progress-fixture";
+import { makeProgress as makeBaseProgress } from "./progress-fixture";
const { getState, patchState } = vi.hoisted(() => ({
getState: vi.fn(),
@@ -19,6 +19,17 @@ vi.mock("next/navigation", () => ({
useSearchParams: () => params,
}));
+function makeProgress(overrides: Parameters<typeof makeBaseProgress>[0] = {}) {
+ const draft = makeBaseProgress(overrides);
+ return {
+ ...draft,
+ completedSteps: [
+ "team",
+ "autopilot",
+ ...draft.completedSteps,
+ ] as typeof draft.completedSteps,
+ };
+}
function response(progress = makeProgress(), revision = 4, userID = "u1") {
return {
status: 200,
diff --git a/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/page.tsx b/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/page.tsx
index 4cabb0ec58..ec2a720ebb 100644
--- a/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/page.tsx
+++ b/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/page.tsx
@@ -1,22 +1,21 @@
"use client";
-import { ProgressError } from "./components/ProgressError";
+import { Button } from "@/components/atoms/Button/Button";
+import { Text } from "@/components/atoms/Text/Text";
+import { ErrorCard } from "@/components/molecules/ErrorCard/ErrorCard";
+import { cn } from "@/lib/utils";
+import { ArrowLeft01Icon, Logout03Icon } from "@hugeicons/core-free-icons";
import { ProgressBar } from "./components/ProgressBar";
+import { ProgressError } from "./components/ProgressError";
import { StepIndicator } from "./components/StepIndicator";
import { BrainDumpStep } from "./steps/BrainDumpStep/BrainDumpStep";
-import { PainPointsStep } from "./steps/PainPointsStep";
+import { ConnectStep } from "./steps/ConnectStep/ConnectStep";
+import { HireStep } from "./steps/HireStep/HireStep";
+import { IntroStep } from "./steps/IntroStep/IntroStep";
import { PreparingStep } from "./steps/PreparingStep";
import { RoleStep } from "./steps/RoleStep";
-import { ConnectStep } from "./steps/ConnectStep/ConnectStep";
import { SubscriptionStep } from "./steps/SubscriptionStep/SubscriptionStep";
-import { IntroStep } from "./steps/IntroStep/IntroStep";
-import { HireStep } from "./steps/HireStep/HireStep";
import { useOnboardingWizardStore } from "./store";
import { useOnboardingPage } from "./useOnboardingPage";
-import { ArrowLeft01Icon, Logout03Icon } from "@hugeicons/core-free-icons";
-import { Button } from "@/components/atoms/Button/Button";
-import { Text } from "@/components/atoms/Text/Text";
-import { ErrorCard } from "@/components/molecules/ErrorCard/ErrorCard";
-import { cn } from "@/lib/utils";
export default function OnboardingPage() {
const {
@@ -25,7 +24,6 @@ export default function OnboardingPage() {
handlePreparingComplete,
isPaymentEnabled,
isSelfHostConnectEnabled,
- isBrainDumpEnabled,
steps,
preparingStep,
totalSteps,
@@ -134,8 +132,7 @@ export default function OnboardingPage() {
{currentStep === steps.team && <IntroStep slide="team" />}
{currentStep === steps.autopilot && <IntroStep slide="autopilot" />}
{currentStep === steps.role && <RoleStep />}
- {currentStep === steps.painPoints &&
- (isBrainDumpEnabled ? <BrainDumpStep /> : <PainPointsStep />)}
+ {currentStep === steps.painPoints && <BrainDumpStep />}
{currentStep === steps.hire && <HireStep />}
{isSelfHostConnectEnabled && currentStep === steps.connect && (
<ConnectStep />
@@ -144,10 +141,7 @@ export default function OnboardingPage() {
<SubscriptionStep />
)}
{currentStep === preparingStep && (
- <PreparingStep
- onComplete={handlePreparingComplete}
- isBrainDumpEnabled={isBrainDumpEnabled}
- />
+ <PreparingStep onComplete={handlePreparingComplete} />
)}
</div>
diff --git a/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/PainPointsStep.tsx b/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/PainPointsStep.tsx
deleted file mode 100644
index 0ce4953dd6..0000000000
--- a/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/PainPointsStep.tsx
+++ /dev/null
@@ -1,167 +0,0 @@
-"use client";
-
-import { Button } from "@/components/atoms/Button/Button";
-import { Input } from "@/components/atoms/Input/Input";
-import { Text } from "@/components/atoms/Text/Text";
-import { cn } from "@/lib/utils";
-import { ReactNode } from "react";
-
-import { FadeIn } from "@/components/atoms/FadeIn/FadeIn";
-import { SelectableCard } from "../components/SelectableCard";
-import { usePainPointsStep } from "./usePainPointsStep";
-import { Icon } from "@/components/atoms/Icon/Icon";
-import {
- Analytics01Icon,
- Calendar03Icon,
- CustomerSupportIcon,
- Database01Icon,
- Mail01Icon,
- Megaphone01Icon,
- MicroscopeIcon,
- MoreHorizontalIcon,
- UserSearch01Icon,
-} from "@hugeicons/core-free-icons";
-
-const ICON_SIZE = 20;
-
-const ALL_PAIN_POINTS: { id: string; label: string; icon: ReactNode }[] = [
- {
- id: "Finding leads",
- label: "Finding leads",
- icon: <Icon icon={UserSearch01Icon} size={ICON_SIZE} />,
- },
- {
- id: "Email & outreach",
- label: "Email & outreach",
- icon: <Icon icon={Mail01Icon} size={ICON_SIZE} />,
- },
- {
- id: "Reports & data",
- label: "Reports & data",
- icon: <Icon icon={Analytics01Icon} size={ICON_SIZE} />,
- },
- {
- id: "Customer support",
- label: "Customer support",
- icon: <Icon icon={CustomerSupportIcon} size={ICON_SIZE} />,
- },
- {
- id: "Social media",
- label: "Social media",
- icon: <Icon icon={Megaphone01Icon} size={ICON_SIZE} />,
- },
- {
- id: "CRM & data entry",
- label: "CRM & data entry",
- icon: <Icon icon={Database01Icon} size={ICON_SIZE} />,
- },
- {
- id: "Scheduling",
- label: "Scheduling",
- icon: <Icon icon={Calendar03Icon} size={ICON_SIZE} />,
- },
- {
- id: "Research",
- label: "Research",
- icon: <Icon icon={MicroscopeIcon} size={ICON_SIZE} />,
- },
- {
- id: "Something else",
- label: "Something else",
- icon: <Icon icon={MoreHorizontalIcon} size={ICON_SIZE} />,
- },
-];
-
-function orderPainPoints(topIDs: string[]) {
- const top = topIDs
- .map((id) => ALL_PAIN_POINTS.find((p) => p.id === id))
- .filter((p): p is (typeof ALL_PAIN_POINTS)[number] => p != null);
- const rest = ALL_PAIN_POINTS.filter(
- (p) => !topIDs.includes(p.id) && p.id !== "Something else",
- );
- const somethingElse = ALL_PAIN_POINTS.find((p) => p.id === "Something else")!;
- return [...top, ...rest, somethingElse];
-}
-
-export function PainPointsStep() {
- const {
- topIDs,
- painPoints,
- otherPainPoint,
- togglePainPoint,
- setOtherPainPoint,
- hasSomethingElse,
- atLimit,
- shaking,
- canContinue,
- handleLaunch,
- } = usePainPointsStep();
-
- const orderedPainPoints = orderPainPoints(topIDs);
-
- return (
- <FadeIn>
- <div className="flex w-full flex-col items-center gap-8 px-4">
- <div className="flex max-w-lg flex-col items-center gap-2 px-4 text-center">
- <Text variant="h4">What&apos;s eating your time?</Text>
- <Text variant="body" tone="muted">
- Pick the tasks you&apos;d love to hand off to your experts
- </Text>
- </div>
-
- <div className="flex w-full flex-col items-center gap-4">
- <div className="flex w-full max-w-[100vw] flex-nowrap gap-4 overflow-x-auto px-8 scrollbar-none md:grid md:grid-cols-3 md:overflow-hidden md:px-0">
- {orderedPainPoints.map((p) => (
- <SelectableCard
- key={p.id}
- icon={p.icon}
- label={p.label}
- selected={painPoints.includes(p.id)}
- onClick={() => togglePainPoint(p.id)}
- />
- ))}
- </div>
- <Text
- variant="small"
- tone={atLimit && canContinue ? undefined : "muted"}
- className={cn(
- "transition-colors",
- atLimit && canContinue && "text-green-600",
- shaking && "animate-shake",
- )}
- >
- {shaking
- ? "You've picked 3 — tap one to swap it out"
- : atLimit && canContinue
- ? "3 selected — you're all set!"
- : atLimit && hasSomethingElse
- ? "Tell us what else takes up your time"
- : "Pick up to 3 to start — your experts can help with other tasks later"}
- </Text>
- </div>
-
- {hasSomethingElse && (
- <div className="-mb-5 w-full px-8 md:px-0">
- <Input
- id="other-pain-point"
- label="Other pain point"
- hideLabel
- placeholder="What else takes up your time?"
- value={otherPainPoint}
- onChange={(e) => setOtherPainPoint(e.target.value)}
- autoFocus
- />
- </div>
- )}
-
- <Button
- onClick={handleLaunch}
- disabled={!canContinue}
- className="w-full max-w-xs"
- >
- Continue
- </Button>
- </div>
- </FadeIn>
- );
-}
diff --git a/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/PreparingStep.tsx b/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/PreparingStep.tsx
index 7d8175f8f1..92ea7264cf 100644
--- a/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/PreparingStep.tsx
+++ b/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/PreparingStep.tsx
@@ -10,16 +10,11 @@ import { usePreparingStep } from "./usePreparingStep";
interface Props {
onComplete: () => void;
- isBrainDumpEnabled?: boolean;
}
-export function PreparingStep({
- onComplete,
- isBrainDumpEnabled = false,
-}: Props) {
+export function PreparingStep({ onComplete }: Props) {
const { started, progress, completedItems, checklist } = usePreparingStep({
onComplete,
- isBrainDumpEnabled,
});
return (
diff --git a/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/__tests__/PainPointsStep.test.tsx b/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/__tests__/PainPointsStep.test.tsx
deleted file mode 100644
index 74fac15fe4..0000000000
--- a/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/__tests__/PainPointsStep.test.tsx
+++ /dev/null
@@ -1,153 +0,0 @@
-import {
- render,
- screen,
- fireEvent,
- cleanup,
-} from "@/tests/integrations/test-utils";
-import { afterEach, beforeEach, describe, expect, test, vi } from "vitest";
-import { useOnboardingWizardStore } from "../../store";
-import { PainPointsStep } from "../PainPointsStep";
-
-vi.mock("@/components/atoms/Emoji/Emoji", () => ({
- Emoji: ({ text }: { text: string }) => <span>{text}</span>,
-}));
-
-vi.mock("@/components/atoms/FadeIn/FadeIn", () => ({
- FadeIn: ({ children }: { children: React.ReactNode }) => (
- <div>{children}</div>
- ),
-}));
-
-function getCard(name: RegExp) {
- return screen.getByRole("button", { name });
-}
-
-function clickCard(name: RegExp) {
- fireEvent.click(getCard(name));
-}
-
-function getLaunchButton() {
- return screen.getByRole("button", { name: /continue/i });
-}
-
-afterEach(cleanup);
-
-beforeEach(() => {
- useOnboardingWizardStore.getState().reset();
- useOnboardingWizardStore.getState().setRole("Founder/CEO");
- useOnboardingWizardStore.getState().goToStep(2);
-});
-
-describe("PainPointsStep", () => {
- test("renders all pain point cards", () => {
- render(<PainPointsStep />);
-
- expect(getCard(/finding leads/i)).toBeDefined();
- expect(getCard(/email & outreach/i)).toBeDefined();
- expect(getCard(/reports & data/i)).toBeDefined();
- expect(getCard(/customer support/i)).toBeDefined();
- expect(getCard(/social media/i)).toBeDefined();
- expect(getCard(/something else/i)).toBeDefined();
- });
-
- test("shows default helper text", () => {
- render(<PainPointsStep />);
-
- expect(
- screen.getAllByText(/pick up to 3 to start/i).length,
- ).toBeGreaterThan(0);
- });
-
- test("selecting a card marks it as pressed", () => {
- render(<PainPointsStep />);
-
- clickCard(/finding leads/i);
-
- expect(getCard(/finding leads/i).getAttribute("aria-pressed")).toBe("true");
- });
-
- test("launch button is disabled when nothing is selected", () => {
- render(<PainPointsStep />);
-
- expect(getLaunchButton().hasAttribute("disabled")).toBe(true);
- });
-
- test("launch button is enabled after selecting a pain point", () => {
- render(<PainPointsStep />);
-
- clickCard(/finding leads/i);
-
- expect(getLaunchButton().hasAttribute("disabled")).toBe(false);
- });
-
- test("shows success text when 3 items are selected", () => {
- render(<PainPointsStep />);
-
- clickCard(/finding leads/i);
- clickCard(/email & outreach/i);
- clickCard(/reports & data/i);
-
- expect(screen.getAllByText(/3 selected/i).length).toBeGreaterThan(0);
- });
-
- test("does not select a 4th item when at the limit", () => {
- render(<PainPointsStep />);
-
- clickCard(/finding leads/i);
- clickCard(/email & outreach/i);
- clickCard(/reports & data/i);
- clickCard(/customer support/i);
-
- expect(getCard(/customer support/i).getAttribute("aria-pressed")).toBe(
- "false",
- );
- });
-
- test("can deselect when at the limit and select a different one", () => {
- render(<PainPointsStep />);
-
- clickCard(/finding leads/i);
- clickCard(/email & outreach/i);
- clickCard(/reports & data/i);
-
- clickCard(/finding leads/i);
- expect(getCard(/finding leads/i).getAttribute("aria-pressed")).toBe(
- "false",
- );
-
- clickCard(/customer support/i);
- expect(getCard(/customer support/i).getAttribute("aria-pressed")).toBe(
- "true",
- );
- });
-
- test("shows input when 'Something else' is selected", () => {
- render(<PainPointsStep />);
-
- clickCard(/something else/i);
-
- expect(
- screen.getByPlaceholderText(/what else takes up your time/i),
- ).toBeDefined();
- });
-
- test("launch button is disabled when 'Something else' selected but input empty", () => {
- render(<PainPointsStep />);
-
- clickCard(/something else/i);
-
- expect(getLaunchButton().hasAttribute("disabled")).toBe(true);
- });
-
- test("launch button is enabled when 'Something else' selected and input filled", () => {
- render(<PainPointsStep />);
-
- clickCard(/something else/i);
- fireEvent.change(
- screen.getByPlaceholderText(/what else takes up your time/i),
- { target: { value: "Manual invoicing" } },
- );
-
- expect(getLaunchButton().hasAttribute("disabled")).toBe(false);
- });
-});
diff --git a/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/__tests__/PreparingStep.test.tsx b/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/__tests__/PreparingStep.test.tsx
index 1fa16a2717..0e1e8630ba 100644
--- a/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/__tests__/PreparingStep.test.tsx
+++ b/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/__tests__/PreparingStep.test.tsx
@@ -35,10 +35,10 @@ afterEach(() => {
});
describe("PreparingStep checklist copy", () => {
- it("shows the brain-dump checklist on the dump path (intro path A, flag on)", async () => {
+ it("shows the brain-dump checklist on the dump path (intro path A)", async () => {
setIntroPath("A");
- render(<PreparingStep onComplete={vi.fn()} isBrainDumpEnabled />);
+ render(<PreparingStep onComplete={vi.fn()} />);
for (const item of DUMP_CHECKLIST) {
expect(await screen.findByText(item)).toBeDefined();
@@ -47,10 +47,10 @@ describe("PreparingStep checklist copy", () => {
expect(screen.queryByText("Connecting automation engines")).toBeNull();
});
- it("shows the generic checklist on the skip path (intro path B, flag on)", async () => {
+ it("shows the generic checklist on the skip path (intro path B)", async () => {
setIntroPath("B");
- render(<PreparingStep onComplete={vi.fn()} isBrainDumpEnabled />);
+ render(<PreparingStep onComplete={vi.fn()} />);
for (const item of GENERIC_CHECKLIST) {
expect(await screen.findByText(item)).toBeDefined();
@@ -59,19 +59,8 @@ describe("PreparingStep checklist copy", () => {
expect(screen.queryByText("Briefing Otto on your work")).toBeNull();
});
- it("shows the generic checklist when the brain-dump flag is off, even with a stale path A", async () => {
- setIntroPath("A");
-
- render(<PreparingStep onComplete={vi.fn()} isBrainDumpEnabled={false} />);
-
- for (const item of GENERIC_CHECKLIST) {
- expect(await screen.findByText(item)).toBeDefined();
- }
- expect(screen.queryByText("Reading your brain dump")).toBeNull();
- });
-
it("shows the generic checklist when no intro path was recorded", async () => {
- render(<PreparingStep onComplete={vi.fn()} isBrainDumpEnabled />);
+ render(<PreparingStep onComplete={vi.fn()} />);
for (const item of GENERIC_CHECKLIST) {
expect(await screen.findByText(item)).toBeDefined();
diff --git a/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/__tests__/usePreparingStep.test.ts b/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/__tests__/usePreparingStep.test.ts
index 1b2444b9c9..f487790576 100644
--- a/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/__tests__/usePreparingStep.test.ts
+++ b/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/__tests__/usePreparingStep.test.ts
@@ -33,15 +33,11 @@ function makeWrapper() {
};
}
-function renderPreparing(args: {
- onComplete?: () => void;
- isBrainDumpEnabled?: boolean;
-}) {
+function renderPreparing(args: { onComplete?: () => void }) {
return renderHook(
() =>
usePreparingStep({
onComplete: args.onComplete ?? vi.fn(),
- isBrainDumpEnabled: args.isBrainDumpEnabled ?? false,
}),
{ wrapper: makeWrapper() },
);
@@ -76,25 +72,21 @@ describe("usePreparingStep — checklist copy", () => {
it("uses the honest dump copy only when the user actually dumped", () => {
setIntroPath("A");
- const { result } = renderPreparing({ isBrainDumpEnabled: true });
+ const { result } = renderPreparing({});
expect(result.current.checklist).toEqual(DUMP_CHECKLIST);
});
- it("falls back to the generic copy on the skip path and with the flag off", () => {
+ it("uses the generic copy on the skip path", () => {
setIntroPath("B");
- const skipped = renderPreparing({ isBrainDumpEnabled: true });
+ const skipped = renderPreparing({});
expect(skipped.result.current.checklist).toEqual(GENERIC_CHECKLIST);
-
- setIntroPath("A");
- const flagOff = renderPreparing({ isBrainDumpEnabled: false });
- expect(flagOff.result.current.checklist).toEqual(GENERIC_CHECKLIST);
});
it("does not consume the intro path — the copilot home still needs it", () => {
setIntroPath("A");
- renderPreparing({ isBrainDumpEnabled: true });
+ renderPreparing({});
expect(window.sessionStorage.getItem("autogpt:onboarding-intro-path")).toBe(
"A",
@@ -165,8 +157,7 @@ describe("usePreparingStep — completion", () => {
const stale = vi.fn();
const fresh = vi.fn();
const { rerender } = renderHook(
- ({ onComplete }) =>
- usePreparingStep({ onComplete, isBrainDumpEnabled: false }),
+ ({ onComplete }) => usePreparingStep({ onComplete }),
{ initialProps: { onComplete: stale }, wrapper: makeWrapper() },
);
@@ -194,7 +185,7 @@ describe("usePreparingStep — recommendation gate (dump path)", () => {
it("completes after the full duration once recommendations are ready", async () => {
setIntroPath("A");
const onComplete = vi.fn();
- renderPreparing({ onComplete, isBrainDumpEnabled: true });
+ renderPreparing({ onComplete });
await advance(START_DELAY_MS);
await advance(DUMP_TOTAL_MS - 100);
@@ -210,7 +201,6 @@ describe("usePreparingStep — recommendation gate (dump path)", () => {
const onComplete = vi.fn();
const { result } = renderPreparing({
onComplete,
- isBrainDumpEnabled: true,
});
await advance(START_DELAY_MS);
@@ -229,7 +219,6 @@ describe("usePreparingStep — recommendation gate (dump path)", () => {
const onComplete = vi.fn();
const { result } = renderPreparing({
onComplete,
- isBrainDumpEnabled: true,
});
await advance(START_DELAY_MS);
@@ -253,7 +242,7 @@ describe("usePreparingStep — recommendation gate (dump path)", () => {
setIntroPath("A");
mockRecommendations(false);
const onComplete = vi.fn();
- renderPreparing({ onComplete, isBrainDumpEnabled: true });
+ renderPreparing({ onComplete });
await advance(START_DELAY_MS);
await advance(RECOMMENDATIONS_MAX_WAIT_MS + 1_000);
@@ -265,7 +254,7 @@ describe("usePreparingStep — recommendation gate (dump path)", () => {
setIntroPath("B");
mockRecommendations(false);
const onComplete = vi.fn();
- renderPreparing({ onComplete, isBrainDumpEnabled: true });
+ renderPreparing({ onComplete });
await advance(START_DELAY_MS);
await advance(GENERIC_TOTAL_MS + 200);
diff --git a/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/usePainPointsStep.ts b/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/usePainPointsStep.ts
deleted file mode 100644
index 384a43e80c..0000000000
--- a/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/usePainPointsStep.ts
+++ /dev/null
@@ -1,77 +0,0 @@
-import { useEffect, useRef, useState } from "react";
-import { MAX_PAIN_POINT_SELECTIONS, useOnboardingWizardStore } from "../store";
-
-const ROLE_TOP_PICKS: Record<string, string[]> = {
- "Founder/CEO": [
- "Finding leads",
- "Reports & data",
- "Email & outreach",
- "Scheduling",
- ],
- Operations: ["CRM & data entry", "Scheduling", "Reports & data"],
- "Sales/BD": ["Finding leads", "Email & outreach", "CRM & data entry"],
- Marketing: ["Social media", "Email & outreach", "Research"],
- "Product/PM": ["Research", "Reports & data", "Scheduling"],
- Engineering: ["Research", "Reports & data", "CRM & data entry"],
- "HR/People": ["Scheduling", "Email & outreach", "CRM & data entry"],
-};
-
-export function getTopPickIDs(role: string) {
- return ROLE_TOP_PICKS[role] ?? [];
-}
-
-export function usePainPointsStep() {
- const role = useOnboardingWizardStore((s) => s.role);
- const painPoints = useOnboardingWizardStore((s) => s.painPoints);
- const otherPainPoint = useOnboardingWizardStore((s) => s.otherPainPoint);
- const storeToggle = useOnboardingWizardStore((s) => s.togglePainPoint);
- const setOtherPainPoint = useOnboardingWizardStore(
- (s) => s.setOtherPainPoint,
- );
- const nextStep = useOnboardingWizardStore((s) => s.nextStep);
- const [shaking, setShaking] = useState(false);
- const shakeTimer = useRef<ReturnType<typeof setTimeout> | null>(null);
-
- useEffect(() => {
- return () => {
- if (shakeTimer.current) clearTimeout(shakeTimer.current);
- };
- }, []);
-
- const topIDs = getTopPickIDs(role);
- const hasSomethingElse = painPoints.includes("Something else");
- const atLimit = painPoints.length >= MAX_PAIN_POINT_SELECTIONS;
- const canContinue =
- painPoints.length > 0 &&
- (!hasSomethingElse || Boolean(otherPainPoint.trim()));
-
- function togglePainPoint(id: string) {
- const alreadySelected = painPoints.includes(id);
- if (!alreadySelected && atLimit) {
- if (shakeTimer.current) clearTimeout(shakeTimer.current);
- setShaking(true);
- shakeTimer.current = setTimeout(() => setShaking(false), 600);
- return;
- }
- storeToggle(id);
- }
-
- function handleLaunch() {
- if (canContinue) {
- nextStep();
- }
- }
-
- return {
- topIDs,
- painPoints,
- otherPainPoint,
- togglePainPoint,
- setOtherPainPoint,
- hasSomethingElse,
- atLimit,
- shaking,
- canContinue,
- handleLaunch,
- };
-}
diff --git a/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/usePreparingStep.ts b/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/usePreparingStep.ts
index a123107299..3fb789e9d1 100644
--- a/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/usePreparingStep.ts
+++ b/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/usePreparingStep.ts
@@ -35,13 +35,7 @@ const RECOMMENDATIONS_MAX_WAIT_MS = 15_000;
// reads as "almost there", not "stuck at done".
const WAITING_PROGRESS_CAP = 95;
-export function usePreparingStep({
- onComplete,
- isBrainDumpEnabled,
-}: {
- onComplete: () => void;
- isBrainDumpEnabled: boolean;
-}) {
+export function usePreparingStep({ onComplete }: { onComplete: () => void }) {
const [started, setStarted] = useState(false);
const [completedItems, setCompletedItems] = useState(0);
const [progress, setProgress] = useState(0);
@@ -50,7 +44,7 @@ export function usePreparingStep({
// Only a user who actually dumped gets the honest copy; a skip would
// make "Reading your brain dump" a lie.
- const isDumpPath = isBrainDumpEnabled && peekIntroPath() === "A";
+ const isDumpPath = peekIntroPath() === "A";
const checklist: readonly string[] = isDumpPath
? BRAIN_DUMP_CHECKLIST
: GENERIC_CHECKLIST;
diff --git a/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/store.ts b/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/store.ts
index 600f34a99b..4fecea041c 100644
--- a/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/store.ts
+++ b/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/store.ts
@@ -21,21 +21,18 @@ export interface StepLayout {
}
export function buildStepLayout({
- hasIntro = false,
- hasHire = false,
hasPaywall = false,
hasConnect = false,
}: {
- hasIntro?: boolean;
- hasHire?: boolean;
hasPaywall?: boolean;
hasConnect?: boolean;
}): StepLayout {
const order: (keyof StepLayout)[] = [
- ...(hasIntro ? (["team", "autopilot"] as const) : []),
+ "team",
+ "autopilot",
"role",
"painPoints",
- ...(hasHire ? (["hire"] as const) : []),
+ "hire",
...(hasPaywall ? (["subscription"] as const) : []),
...(!hasPaywall && hasConnect ? (["connect"] as const) : []),
"preparing",
@@ -47,29 +44,9 @@ export function buildStepLayout({
return layout as StepLayout;
}
-// The three layouts without the intro steps, spelled out for tests and for
-// the store's default.
-export const PAYWALL_LAST_STEPS = {
- role: 1,
- painPoints: 2,
- subscription: 3,
- preparing: 4,
-} as const;
-
-export const NO_PAYWALL_STEPS = {
- role: 1,
- painPoints: 2,
- preparing: 3,
-} as const;
-
-// Self-host has no paywall; it asks for a model at the end instead — link
-// the ChatGPT plan you already pay for — once the profile is in.
-export const SELF_HOST_STEPS = {
- role: 1,
- painPoints: 2,
- connect: 3,
- preparing: 4,
-} as const;
+export const PAYWALL_LAST_STEPS = buildStepLayout({ hasPaywall: true });
+export const NO_PAYWALL_STEPS = buildStepLayout({});
+export const SELF_HOST_STEPS = buildStepLayout({ hasConnect: true });
interface OnboardingWizardState {
currentStep: Step;
diff --git a/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/useOnboardingLayout.ts b/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/useOnboardingLayout.ts
index 1338b18ac6..fe3540058d 100644
--- a/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/useOnboardingLayout.ts
+++ b/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/useOnboardingLayout.ts
@@ -1,8 +1,8 @@
import { environment } from "@/services/environment";
import { Flag, useFlagStatus } from "@/services/feature-flags/use-get-flag";
import { useRef } from "react";
-import { usePaidCheckoutStatus } from "./usePaidCheckoutStatus";
import { buildStepLayout, type Step } from "./store";
+import { usePaidCheckoutStatus } from "./usePaidCheckoutStatus";
export function useOnboardingLayout({
userID,
@@ -16,16 +16,11 @@ export function useOnboardingLayout({
trialConfirmation: { ready: boolean; active: boolean | undefined };
}) {
const payment = useFlagStatus(Flag.ENABLE_PLATFORM_PAYMENT);
- const brain = useFlagStatus(Flag.ONBOARDING_BRAIN_DUMP);
- const expertTeam = useFlagStatus(Flag.ONBOARDING_EXPERT_TEAM);
- const hireExperts = useFlagStatus(Flag.HIRE_EXPERTS);
- const flagsReady =
- payment.ready && brain.ready && expertTeam.ready && hireExperts.ready;
+
+ const flagsReady = payment.ready;
const snapshot = useRef<{
userID: string | null;
payment: boolean;
- brain: boolean;
- team: boolean;
} | null>(null);
if (snapshot.current?.userID !== userID) snapshot.current = null;
// Resolve once per account: flag changes must not reorder an active wizard.
@@ -33,8 +28,6 @@ export function useOnboardingLayout({
snapshot.current = {
userID,
payment: payment.enabled,
- brain: brain.enabled,
- team: expertTeam.enabled && hireExperts.enabled,
};
}
const paidConfirmation = usePaidCheckoutStatus(
@@ -43,12 +36,8 @@ export function useOnboardingLayout({
);
const userHasActivePlan = trialConfirmation.active || paidConfirmation.active;
const isPaymentEnabled = !!snapshot.current?.payment && !userHasActivePlan;
- const isBrainDumpEnabled = snapshot.current?.brain ?? false;
- const isExpertTeamEnabled = snapshot.current?.team ?? false;
const isSelfHostConnectEnabled = !isPaymentEnabled && environment.isLocal();
const steps = buildStepLayout({
- hasIntro: isExpertTeamEnabled,
- hasHire: isExpertTeamEnabled && isBrainDumpEnabled,
hasPaywall: isPaymentEnabled,
hasConnect: isSelfHostConnectEnabled,
});
@@ -65,7 +54,5 @@ export function useOnboardingLayout({
paidConfirmation,
isPaymentEnabled,
isSelfHostConnectEnabled,
- isBrainDumpEnabled,
- isExpertTeamEnabled,
};
}
diff --git a/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/useOnboardingPage.ts b/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/useOnboardingPage.ts
index 67c6c882d5..d15840a031 100644
--- a/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/useOnboardingPage.ts
+++ b/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/useOnboardingPage.ts
@@ -6,12 +6,12 @@ import { environment } from "@/services/environment";
import { useTrialCheckoutReturn } from "@/services/trials/useTrialCheckoutReturn";
import { useRouter, useSearchParams } from "next/navigation";
import { useEffect, useRef, useState } from "react";
+import { stepKey } from "./progress";
import { Step, useOnboardingWizardStore } from "./store";
import { onboardingStepKey, trackOnboardingStep } from "./tracking";
-import { stepKey } from "./progress";
-import { useWizardProgress } from "./useWizardProgress";
import { useOnboardingLayout } from "./useOnboardingLayout";
import { useOnboardingProfile } from "./useOnboardingProfile";
+import { useWizardProgress } from "./useWizardProgress";
export function useOnboardingPage() {
const router = useRouter();
@@ -28,8 +28,6 @@ export function useOnboardingPage() {
isReady,
isPaymentEnabled,
isSelfHostConnectEnabled,
- isBrainDumpEnabled,
- isExpertTeamEnabled,
paidConfirmation,
} = useOnboardingLayout({
userID: user?.id ?? null,
@@ -145,8 +143,6 @@ export function useOnboardingPage() {
handlePreparingComplete,
isPaymentEnabled,
isSelfHostConnectEnabled,
- isBrainDumpEnabled,
- isExpertTeamEnabled,
steps,
preparingStep,
totalSteps,
diff --git a/autogpt_platform/frontend/src/app/(platform)/PlatformChrome/PlatformChrome.tsx b/autogpt_platform/frontend/src/app/(platform)/PlatformChrome/PlatformChrome.tsx
index c10ab114ad..896318c928 100644
--- a/autogpt_platform/frontend/src/app/(platform)/PlatformChrome/PlatformChrome.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/PlatformChrome/PlatformChrome.tsx
@@ -5,7 +5,6 @@ import { CSSProperties, ReactNode } from "react";
import { TourSidebar } from "@/app/(public)/tour/chat/components/TourSidebar/TourSidebar";
import { AppSidebar } from "@/components/layout/AppSidebar/AppSidebar";
import { AppSidebarToggleProvider } from "@/components/layout/AppSidebar/components/AppSidebarTrigger/AppSidebarTrigger";
-import { cn } from "@/lib/utils";
import { TopUpPromptProvider } from "@/components/layout/TopUpPrompt/TopUpPromptProvider";
import { ChangelogPopup } from "@/components/molecules/ChangelogPopup/ChangelogPopup";
import {
@@ -14,8 +13,8 @@ import {
SidebarProvider,
SidebarTrigger,
} from "@/components/ui/sidebar";
+import { cn } from "@/lib/utils";
-import { Flag, useGetFlag } from "@/services/feature-flags/use-get-flag";
import { AdminImpersonationBanner } from "../admin/components/AdminImpersonationBanner";
import { GlobalSearchOverlay } from "../components/GlobalSearchModal/GlobalSearchOverlay";
import { PaywallGate } from "../PaywallGate/PaywallGate";
@@ -41,8 +40,6 @@ export function PlatformChrome({ children, persistedSidebarOpen }: Props) {
hasInsetHeaderTitle,
isBuilderRoute,
} = usePlatformChrome();
- // The collapsed-by-default sidebar ships with the brain-dump experience.
- const isBrainDumpEnabled = useGetFlag(Flag.ONBOARDING_BRAIN_DUMP);
const content = (
<TopUpPromptProvider>
@@ -68,7 +65,7 @@ export function PlatformChrome({ children, persistedSidebarOpen }: Props) {
if (showAppSidebar) {
// The browser's cookie stays current across client navigation; the layout's does not.
const openOutsideBuilder =
- getPersistedSidebarOpen() ?? persistedSidebarOpen ?? !isBrainDumpEnabled;
+ getPersistedSidebarOpen() ?? persistedSidebarOpen ?? false;
return (
<SidebarProvider
persistState
diff --git a/autogpt_platform/frontend/src/app/(platform)/PlatformChrome/__tests__/sidebarState.test.tsx b/autogpt_platform/frontend/src/app/(platform)/PlatformChrome/__tests__/sidebarState.test.tsx
index a14354618c..af6fd41612 100644
--- a/autogpt_platform/frontend/src/app/(platform)/PlatformChrome/__tests__/sidebarState.test.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/PlatformChrome/__tests__/sidebarState.test.tsx
@@ -14,7 +14,6 @@ import { SIDEBAR_COOKIE_NAME } from "@/components/ui/sidebar-cookie";
import { PlatformChrome } from "../PlatformChrome";
let pathname = "/home";
-let isBrainDumpEnabled = false;
let isSoulPanelOpen = false;
vi.mock("next/navigation", () => ({
@@ -37,8 +36,7 @@ vi.mock("@/services/feature-flags/use-get-flag", async (importOriginal) => {
>();
return {
...actual,
- useGetFlag: (flag: string) =>
- flag === actual.Flag.ONBOARDING_BRAIN_DUMP ? isBrainDumpEnabled : false,
+ useGetFlag: () => false,
};
});
@@ -122,7 +120,6 @@ function rememberSidebar(open: boolean) {
beforeEach(() => {
pathname = "/home";
- isBrainDumpEnabled = false;
isSoulPanelOpen = false;
setArtifactsPanelOpen(false);
document.cookie = `${SIDEBAR_COOKIE_NAME}=; path=/; max-age=0`;
@@ -136,13 +133,9 @@ afterEach(() => {
});
describe("the app sidebar across reloads", () => {
- it.each([
- { cohort: "brain-dump", brainDump: true, toggledTo: "expanded" },
- { cohort: "default", brainDump: false, toggledTo: "collapsed" },
- ])(
+ it.each([{ cohort: "brain-dump", brainDump: true, toggledTo: "expanded" }])(
"keeps the $cohort cohort's toggle after a reload",
- ({ brainDump, toggledTo }) => {
- isBrainDumpEnabled = brainDump;
+ ({ toggledTo }) => {
const first = load();
fireEvent.click(screen.getByRole("button", { name: "Toggle Sidebar" }));
expect(sidebarState()).toBe(toggledTo);
@@ -154,14 +147,9 @@ describe("the app sidebar across reloads", () => {
},
);
- it.each([
- { cohort: "brain-dump", brainDump: true, expected: "collapsed" },
- { cohort: "default", brainDump: false, expected: "expanded" },
- ])(
+ it.each([{ cohort: "brain-dump", brainDump: true, expected: "collapsed" }])(
"starts the $cohort cohort $expected when nothing is remembered",
- ({ brainDump, expected }) => {
- isBrainDumpEnabled = brainDump;
-
+ ({ expected }) => {
load();
expect(sidebarState()).toBe(expected);
@@ -169,8 +157,6 @@ describe("the app sidebar across reloads", () => {
);
it("falls back to the cookie the server read when the browser has none", () => {
- isBrainDumpEnabled = true;
-
load(true);
expect(sidebarState()).toBe("expanded");
@@ -188,7 +174,6 @@ describe("the app sidebar across reloads", () => {
});
it("does not let the builder's own collapse overwrite the remembered choice", () => {
- isBrainDumpEnabled = true;
rememberSidebar(true);
pathname = "/build";
load().unmount();
diff --git a/autogpt_platform/frontend/src/app/(platform)/admin/marketplace/components/useAdminSkillSubmissions.ts b/autogpt_platform/frontend/src/app/(platform)/admin/marketplace/components/useAdminSkillSubmissions.ts
index a954dd697d..2ca26b75cf 100644
--- a/autogpt_platform/frontend/src/app/(platform)/admin/marketplace/components/useAdminSkillSubmissions.ts
+++ b/autogpt_platform/frontend/src/app/(platform)/admin/marketplace/components/useAdminSkillSubmissions.ts
@@ -38,8 +38,6 @@ export function useAdminSkillSubmissions() {
});
}
- // A 404 here is the skills-hub flag being off, not an empty queue — reporting
- // "nothing to review" would tell an admin the opposite of the truth.
const loaded = query.data?.status === 200 ? query.data.data : null;
return {
diff --git a/autogpt_platform/frontend/src/app/(platform)/artifacts/__tests__/folders.test.tsx b/autogpt_platform/frontend/src/app/(platform)/artifacts/__tests__/folders.test.tsx
index 46496eb5e3..1e19f0c81b 100644
--- a/autogpt_platform/frontend/src/app/(platform)/artifacts/__tests__/folders.test.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/artifacts/__tests__/folders.test.tsx
@@ -20,12 +20,6 @@ import type { WorkspaceFileItem } from "@/app/api/__generated__/models/workspace
import type { WorkspaceFolder } from "@/app/api/__generated__/models/workspaceFolder";
import { FILE_DRAG_MIME } from "../components/WorkspaceFolders/drag";
-vi.mock("@/services/feature-flags/use-get-flag", () => ({
- Flag: { ARTIFACTS_PAGE: "artifacts-page" },
- useGetFlag: () => true,
- useFlagStatus: () => ({ enabled: true, ready: true }),
-}));
-
// The generated default answers with random experts, which would render
// random filter tabs on the page under test.
beforeEach(() => {
diff --git a/autogpt_platform/frontend/src/app/(platform)/artifacts/__tests__/main.test.tsx b/autogpt_platform/frontend/src/app/(platform)/artifacts/__tests__/main.test.tsx
index f18ecc4ec0..c0d2db8c31 100644
--- a/autogpt_platform/frontend/src/app/(platform)/artifacts/__tests__/main.test.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/artifacts/__tests__/main.test.tsx
@@ -19,17 +19,13 @@ import {
import type { ExpertIdentity } from "@/app/api/__generated__/models/expertIdentity";
import type { WorkspaceFileItem } from "@/app/api/__generated__/models/workspaceFileItem";
-const { setFlagStatusMock, uploadFileDirectMock } = vi.hoisted(() => {
+const { uploadFileDirectMock } = vi.hoisted(() => {
return {
- setFlagStatusMock: vi.fn(() => ({ enabled: true, ready: true })),
uploadFileDirectMock: vi.fn(),
};
});
-// Per-test flag overrides must persist across re-renders; restore the default
-// afterward.
afterEach(() => {
- setFlagStatusMock.mockReturnValue({ enabled: true, ready: true });
uploadFileDirectMock.mockReset();
});
@@ -40,15 +36,6 @@ beforeEach(() => {
server.use(getListExpertIdentitiesMockHandler([]));
});
-vi.mock("@/services/feature-flags/use-get-flag", () => ({
- Flag: {
- ARTIFACTS_PAGE: "artifacts-page",
- HIRE_EXPERTS: "hire-experts",
- },
- useGetFlag: () => true,
- useFlagStatus: () => setFlagStatusMock(),
-}));
-
// Uploads go straight to the backend (not through the MSW-mocked proxy), so
// the direct-upload helper is stubbed here.
vi.mock("@/lib/direct-upload", () => ({
@@ -329,29 +316,16 @@ describe("ArtifactsPage - search filter", () => {
});
});
-describe("ArtifactsPage - feature flag gating", () => {
- test("shows the flag-loading skeleton while LaunchDarkly is resolving", async () => {
- setFlagStatusMock.mockReturnValue({ enabled: false, ready: false });
-
+describe("ArtifactsPage availability", () => {
+ test("loads files without waiting for feature flags", async () => {
+ useStorageHandler();
+ useFilesHandler([
+ makeFile({ id: "retired-flag-file", name: "available.pdf" }),
+ ]);
render(<ArtifactsPage />);
-
- expect(await screen.findByTestId("artifacts-flag-loading")).toBeDefined();
+ expect(await screen.findByText("available.pdf")).toBeDefined();
expect(notFoundMock).not.toHaveBeenCalled();
});
-
- test("calls notFound() when the flag is resolved and disabled", () => {
- setFlagStatusMock.mockReturnValueOnce({ enabled: false, ready: true });
- notFoundMock.mockClear();
-
- try {
- render(<ArtifactsPage />);
- } catch {
- // React surfaces the thrown notFound() error; the assertion below is
- // what we actually care about.
- }
-
- expect(notFoundMock).toHaveBeenCalled();
- });
});
describe("ArtifactsPage - new menu", () => {
diff --git a/autogpt_platform/frontend/src/app/(platform)/artifacts/__tests__/office-files.test.tsx b/autogpt_platform/frontend/src/app/(platform)/artifacts/__tests__/office-files.test.tsx
index 7d92943cc5..30ef1c7517 100644
--- a/autogpt_platform/frontend/src/app/(platform)/artifacts/__tests__/office-files.test.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/artifacts/__tests__/office-files.test.tsx
@@ -17,15 +17,6 @@ import {
} from "@/app/api/__generated__/endpoints/workspace/workspace.msw";
import type { WorkspaceFileItem } from "@/app/api/__generated__/models/workspaceFileItem";
-vi.mock("@/services/feature-flags/use-get-flag", () => ({
- Flag: {
- ARTIFACTS_PAGE: "artifacts-page",
- HIRE_EXPERTS: "hire-experts",
- },
- useGetFlag: () => true,
- useFlagStatus: () => ({ enabled: true, ready: true }),
-}));
-
vi.mock("next/navigation", async () => {
const { navigationMock } = await import("./navigation-mock");
return navigationMock();
diff --git a/autogpt_platform/frontend/src/app/(platform)/artifacts/__tests__/selection.test.tsx b/autogpt_platform/frontend/src/app/(platform)/artifacts/__tests__/selection.test.tsx
index c34dbeeb42..a69bb39790 100644
--- a/autogpt_platform/frontend/src/app/(platform)/artifacts/__tests__/selection.test.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/artifacts/__tests__/selection.test.tsx
@@ -18,12 +18,6 @@ import type { WorkspaceFileItem } from "@/app/api/__generated__/models/workspace
import type { WorkspaceFolder } from "@/app/api/__generated__/models/workspaceFolder";
import { FILE_DRAG_MIME } from "../components/WorkspaceFolders/drag";
-vi.mock("@/services/feature-flags/use-get-flag", () => ({
- Flag: { ARTIFACTS_PAGE: "artifacts-page" },
- useGetFlag: () => true,
- useFlagStatus: () => ({ enabled: true, ready: true }),
-}));
-
beforeEach(() => {
server.use(getListExpertIdentitiesMockHandler([]));
});
diff --git a/autogpt_platform/frontend/src/app/(platform)/artifacts/__tests__/url.test.tsx b/autogpt_platform/frontend/src/app/(platform)/artifacts/__tests__/url.test.tsx
index 3a859b7fb6..34f295b523 100644
--- a/autogpt_platform/frontend/src/app/(platform)/artifacts/__tests__/url.test.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/artifacts/__tests__/url.test.tsx
@@ -16,12 +16,6 @@ import {
routerMock,
} from "./navigation-mock";
-vi.mock("@/services/feature-flags/use-get-flag", () => ({
- Flag: { ARTIFACTS_PAGE: "artifacts-page" },
- useGetFlag: () => true,
- useFlagStatus: () => ({ enabled: true, ready: true }),
-}));
-
vi.mock("next/navigation", async () => {
const { navigationMock } = await import("./navigation-mock");
return navigationMock();
diff --git a/autogpt_platform/frontend/src/app/(platform)/artifacts/page.tsx b/autogpt_platform/frontend/src/app/(platform)/artifacts/page.tsx
index 1d5d666282..db7606aacd 100644
--- a/autogpt_platform/frontend/src/app/(platform)/artifacts/page.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/artifacts/page.tsx
@@ -1,18 +1,15 @@
"use client";
-import { useEffect } from "react";
-import { notFound } from "next/navigation";
-import { motion, useReducedMotion } from "framer-motion";
-import type { Transition, Variants } from "framer-motion";
-import { Skeleton } from "@/components/atoms/Skeleton/Skeleton";
-import { Text } from "@/components/atoms/Text/Text";
-import { Flag, useFlagStatus } from "@/services/feature-flags/use-get-flag";
import { useExpertMap } from "@/app/(platform)/copilot/useExpertMap";
-import { ArtifactsSearchBar } from "./components/ArtifactsSearchBar/ArtifactsSearchBar";
+import { Text } from "@/components/atoms/Text/Text";
+import type { Transition, Variants } from "framer-motion";
+import { motion, useReducedMotion } from "framer-motion";
+import { useEffect } from "react";
import { ArtifactsList } from "./components/ArtifactsList/ArtifactsList";
import { getEmptyState } from "./components/ArtifactsList/helpers";
-import { NewMenu } from "./components/NewMenu/NewMenu";
+import { ArtifactsSearchBar } from "./components/ArtifactsSearchBar/ArtifactsSearchBar";
import { ExpertFilter } from "./components/ExpertFilter/ExpertFilter";
+import { NewMenu } from "./components/NewMenu/NewMenu";
import { OriginFilter } from "./components/OriginFilter/OriginFilter";
import { ViewToggle } from "./components/ViewToggle/ViewToggle";
import { FolderBreadcrumb } from "./components/WorkspaceFolders/FolderBreadcrumb";
@@ -44,9 +41,6 @@ const MAIN_CLASS_NAME =
"mx-auto min-h-screen w-full max-w-7xl space-y-6 px-6 pb-20 pt-2 md:px-8";
export default function ArtifactsPage() {
- const { enabled: isEnabled, ready: flagReady } = useFlagStatus(
- Flag.ARTIFACTS_PAGE,
- );
const reduceMotion = useReducedMotion();
const {
folders,
@@ -103,13 +97,6 @@ export default function ArtifactsPage() {
document.title = "Files – AutoGPT Platform";
}, []);
- if (!flagReady) {
- return <ArtifactsPageSkeleton />;
- }
- if (!isEnabled) {
- notFound();
- }
-
const variants = reduceMotion ? REDUCED_SECTION_VARIANTS : SECTION_VARIANTS;
return (
@@ -220,20 +207,3 @@ export default function ArtifactsPage() {
</main>
);
}
-
-function ArtifactsPageSkeleton() {
- return (
- <main className={MAIN_CLASS_NAME} data-testid="artifacts-flag-loading">
- <Skeleton className="h-8 w-48 rounded-md" />
- <Skeleton className="h-4 w-80 rounded-md" />
- <div className="flex flex-col divide-y divide-zinc-100">
- {Array.from({ length: 6 }).map((_, i) => (
- <div key={i} className="flex items-center gap-4 py-3">
- <Skeleton className="h-10 w-10 rounded-xl" />
- <Skeleton className="h-4 w-56" />
- </div>
- ))}
- </div>
- </main>
- );
-}
diff --git a/autogpt_platform/frontend/src/app/(platform)/build/components/BuildTabIntro/BuildTabIntro.tsx b/autogpt_platform/frontend/src/app/(platform)/build/components/BuildTabIntro/BuildTabIntro.tsx
index ca0409a982..604ee1730d 100644
--- a/autogpt_platform/frontend/src/app/(platform)/build/components/BuildTabIntro/BuildTabIntro.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/build/components/BuildTabIntro/BuildTabIntro.tsx
@@ -1,8 +1,8 @@
"use client";
+import { useTutorialStore } from "@/app/(platform)/build/stores/tutorialStore";
import { TabIntroCard } from "@/app/(platform)/components/TabIntroCard/TabIntroCard";
import { useTabIntroCard } from "@/app/(platform)/components/TabIntroCard/useTabIntroCard";
-import { useTutorialStore } from "@/app/(platform)/build/stores/tutorialStore";
import { FlowIcon } from "@hugeicons/core-free-icons";
import { useRouter, useSearchParams } from "next/navigation";
import { startTutorial } from "../FlowEditor/tutorial";
@@ -16,9 +16,12 @@ export function BuildTabIntro() {
// agent. Vetoing the visit leaves the step unrecorded, so a later blank
// /build still gets the introduction.
const isEditingSavedGraph = Boolean(useSearchParams().get("flowID"));
+ const isTutorialRunning = useTutorialStore(
+ (state) => state.isTutorialRunning,
+ );
const { isOpen, dismiss, takeAction } = useTabIntroCard(
"build",
- !isEditingSavedGraph,
+ !isEditingSavedGraph && !isTutorialRunning,
);
const setIsTutorialRunning = useTutorialStore(
(state) => state.setIsTutorialRunning,
diff --git a/autogpt_platform/frontend/src/app/(platform)/components/TabIntroCard/__tests__/tab-intros.test.tsx b/autogpt_platform/frontend/src/app/(platform)/components/TabIntroCard/__tests__/tab-intros.test.tsx
index eaa8ba8d97..5988ceaeb8 100644
--- a/autogpt_platform/frontend/src/app/(platform)/components/TabIntroCard/__tests__/tab-intros.test.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/components/TabIntroCard/__tests__/tab-intros.test.tsx
@@ -1,4 +1,4 @@
-import { render, screen, waitFor } from "@/tests/integrations/test-utils";
+import { act, render, screen, waitFor } from "@/tests/integrations/test-utils";
import userEvent from "@testing-library/user-event";
import { beforeEach, describe, expect, it, vi } from "vitest";
@@ -9,15 +9,6 @@ vi.mock("@/lib/auth/hooks/useAuth", () => ({
useAuth: () => ({ user: { id: "user-1" } }),
}));
-vi.mock("@/services/feature-flags/use-get-flag", () => ({
- Flag: {
- ONBOARDING_BRAIN_DUMP: "onboarding-brain-dump",
- HIRE_EXPERTS: "hire-experts",
- },
- useGetFlag: () => false,
- useFlagStatus: () => ({ enabled: true, ready: true }),
-}));
-
const completeStep = vi.hoisted(() => vi.fn());
vi.mock("@/providers/onboarding/onboarding-provider", () => ({
useOnboarding: () => ({ state: { completedSteps: [] }, completeStep }),
@@ -142,6 +133,15 @@ describe("MarketplaceTabIntro", () => {
});
describe("BuildTabIntro", () => {
+ it("defers its intro while the builder tutorial is running", async () => {
+ useTutorialStore.getState().setIsTutorialRunning(true);
+ render(<BuildTabIntro />);
+ expect(screen.queryByText("Create your own workflows.")).toBeNull();
+ expect(completeStep).not.toHaveBeenCalled();
+ act(() => useTutorialStore.getState().setIsTutorialRunning(false));
+ expect(await screen.findByText("Create your own workflows.")).toBeDefined();
+ expect(completeStep).not.toHaveBeenCalled();
+ });
it("sends the user to Otto from the primary CTA", async () => {
render(<BuildTabIntro />);
expect(await screen.findByText("Create your own workflows.")).toBeDefined();
diff --git a/autogpt_platform/frontend/src/app/(platform)/components/TabIntroCard/__tests__/useTabIntroCard.test.tsx b/autogpt_platform/frontend/src/app/(platform)/components/TabIntroCard/__tests__/useTabIntroCard.test.tsx
index 270ed20641..8c76552372 100644
--- a/autogpt_platform/frontend/src/app/(platform)/components/TabIntroCard/__tests__/useTabIntroCard.test.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/components/TabIntroCard/__tests__/useTabIntroCard.test.tsx
@@ -11,22 +11,6 @@ vi.mock("@/lib/auth/hooks/useAuth", () => ({
useAuth: () => ({ user: authUser.current }),
}));
-const flags = vi.hoisted(() => ({ current: {} as Record<string, boolean> }));
-const flagsReady = vi.hoisted(() => ({ current: true }));
-const flagReadiness = vi.hoisted(() => ({
- current: {} as Record<string, boolean>,
-}));
-vi.mock("@/services/feature-flags/use-get-flag", () => ({
- Flag: {
- ONBOARDING_BRAIN_DUMP: "onboarding-brain-dump",
- HIRE_EXPERTS: "hire-experts",
- },
- useFlagStatus: (flag: string) => ({
- enabled: flags.current[flag] ?? false,
- ready: flagReadiness.current[flag] ?? flagsReady.current,
- }),
-}));
-
const onboarding = vi.hoisted(() => ({
current: {
state: null as { completedSteps: string[] } | null,
@@ -52,9 +36,6 @@ beforeEach(() => {
window.localStorage.clear();
capture.mockReset();
authUser.current = { id: "user-1" };
- flags.current = { "onboarding-brain-dump": true };
- flagsReady.current = true;
- flagReadiness.current = {};
onboarding.current = { state: { completedSteps: [] }, completeStep: vi.fn() };
});
@@ -74,19 +55,6 @@ describe("useTabIntroCard — when it opens", () => {
).toHaveLength(1);
});
- it("stays closed while the flag is off", () => {
- flags.current = {};
-
- expect(renderGate().result.current.isOpen).toBe(false);
- expect(capture).not.toHaveBeenCalled();
- });
-
- it("stays closed until LaunchDarkly has answered", () => {
- flagsReady.current = false;
-
- expect(renderGate().result.current.isOpen).toBe(false);
- });
-
it("stays closed until the onboarding record has loaded", () => {
onboarding.current.state = null;
@@ -163,10 +131,6 @@ describe("useTabIntroCard — when it opens", () => {
describe("useTabIntroCard — workflow migration", () => {
beforeEach(() => {
authUser.current = { id: "user-1", created_at: "2026-09-01T00:00:00Z" };
- flags.current = {
- "onboarding-brain-dump": true,
- "hire-experts": true,
- };
});
it("replaces the old agents intro without recording or showing it", () => {
@@ -178,19 +142,6 @@ describe("useTabIntroCard — workflow migration", () => {
expect(window.localStorage.getItem(SEEN_KEY)).toBeNull();
});
- it("waits for hire-experts before deciding which intro applies", () => {
- flags.current["hire-experts"] = false;
- flagReadiness.current["hire-experts"] = false;
- const { result, rerender } = renderGate();
- expect(result.current.isOpen).toBe(false);
- expect(capture).not.toHaveBeenCalled();
-
- flagReadiness.current["hire-experts"] = true;
- rerender();
-
- expect(result.current.isOpen).toBe(true);
- });
-
it.each(["marketplace", "build"] as const)(
"preserves the %s intro for existing users",
(tab) => {
diff --git a/autogpt_platform/frontend/src/app/(platform)/components/TabIntroCard/useTabIntroCard.ts b/autogpt_platform/frontend/src/app/(platform)/components/TabIntroCard/useTabIntroCard.ts
index d3d46077f5..fef43c7c1b 100644
--- a/autogpt_platform/frontend/src/app/(platform)/components/TabIntroCard/useTabIntroCard.ts
+++ b/autogpt_platform/frontend/src/app/(platform)/components/TabIntroCard/useTabIntroCard.ts
@@ -2,7 +2,6 @@
import { useAuth } from "@/lib/auth/hooks/useAuth";
import { useOnboarding } from "@/providers/onboarding/onboarding-provider";
-import { Flag, useFlagStatus } from "@/services/feature-flags/use-get-flag";
import { trackTabIntro } from "@/services/onboarding/tab-intro-analytics";
import { useEffect, useState } from "react";
import { isPreExpertsUser } from "../WorkflowsMovedNotice/helpers";
@@ -24,15 +23,9 @@ export function useTabIntroCard(tab: TabIntroTab, canShow = true) {
const { user } = useAuth();
const userId = user?.id ?? null;
const { state, completeStep } = useOnboarding();
- // Same gate as the rest of the new onboarding: the tab intros are part of
- // that rollout, so they ship and roll back with it rather than on a flag
- // of their own.
- const { enabled, ready } = useFlagStatus(Flag.ONBOARDING_BRAIN_DUMP);
- const experts = useFlagStatus(Flag.HIRE_EXPERTS);
const isMigrationCohort =
tab === "agents" && isPreExpertsUser(user?.created_at);
- const hasMigrationNotice =
- isMigrationCohort && (!experts.ready || experts.enabled);
+ const hasMigrationNotice = isMigrationCohort;
const step = TAB_INTRO_STEPS[tab];
// Who closed the card in this mounted session, rather than a boolean: a
@@ -46,12 +39,10 @@ export function useTabIntroCard(tab: TabIntroTab, canShow = true) {
//
// The cache read is derived here rather than latched into state so it can
// never lag a render behind the user id, and it sits last so the disabled
- // case never touches localStorage at all.
+ // visit never touches localStorage at all.
const isOpen =
canShow &&
!hasMigrationNotice &&
- ready &&
- Boolean(enabled) &&
userId !== null &&
dismissedFor !== userId &&
state !== null &&
diff --git a/autogpt_platform/frontend/src/app/(platform)/components/WorkflowsMovedNotice/__tests__/tutorialCoexistence.test.tsx b/autogpt_platform/frontend/src/app/(platform)/components/WorkflowsMovedNotice/__tests__/tutorialCoexistence.test.tsx
index 00392bde1c..93677c8a1f 100644
--- a/autogpt_platform/frontend/src/app/(platform)/components/WorkflowsMovedNotice/__tests__/tutorialCoexistence.test.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/components/WorkflowsMovedNotice/__tests__/tutorialCoexistence.test.tsx
@@ -14,8 +14,6 @@ const context = vi.hoisted(() => ({
user: { id: "returning-user", created_at: "2026-09-01T00:00:00Z" },
pathname: "/library",
search: "",
- flags: {} as Record<string, boolean>,
- readiness: {} as Record<string, boolean>,
state: null as { completedSteps: string[] } | null,
noticeWait: null as Promise<void> | null,
completeStep: vi.fn(),
@@ -39,17 +37,6 @@ vi.mock("next/navigation", () => ({
useSearchParams: () => new URLSearchParams(context.search),
useRouter: () => ({ push: context.push }),
}));
-vi.mock("@/services/feature-flags/use-get-flag", () => ({
- Flag: {
- ONBOARDING_BRAIN_DUMP: "onboarding-brain-dump",
- HIRE_EXPERTS: "hire-experts",
- },
- useGetFlag: (flag: string) => context.flags[flag] ?? false,
- useFlagStatus: (flag: string) => ({
- enabled: context.flags[flag] ?? false,
- ready: context.readiness[flag] ?? true,
- }),
-}));
import { AgentsTabIntro } from "@/app/(platform)/library/components/AgentsTabIntro/AgentsTabIntro";
import { MarketplaceTabIntro } from "@/app/(platform)/marketplace/components/MarketplaceTabIntro/MarketplaceTabIntro";
@@ -96,11 +83,6 @@ beforeEach(() => {
context.user = { id: "returning-user", created_at: "2026-09-01T00:00:00Z" };
context.pathname = "/library";
context.search = "";
- context.flags = {
- "onboarding-brain-dump": true,
- "hire-experts": true,
- };
- context.readiness = {};
context.state = { completedSteps: ["ONBOARDING_COMPLETE"] };
context.noticeWait = null;
server.use(
@@ -142,35 +124,6 @@ describe("migration notice with production first-visit tutorials", () => {
expect(context.capture).not.toHaveBeenCalled();
});
- it.each(["flags", "intro record"])(
- "never flashes the agents tutorial when %s arrives first",
- async (first) => {
- context.state = null;
- context.readiness = { "hire-experts": false };
- const { refresh } = renderTogether();
- expect(screen.queryAllByRole("dialog", { hidden: true })).toHaveLength(0);
- if (first === "flags") {
- context.readiness = {};
- refresh();
- await screen.findByRole("dialog", { name: "Your agents have moved" });
- expectOnlyDialog("Your agents have moved");
- context.state = { completedSteps: ["ONBOARDING_COMPLETE"] };
- } else {
- context.state = { completedSteps: ["ONBOARDING_COMPLETE"] };
- refresh();
- expect(screen.queryAllByRole("dialog", { hidden: true })).toHaveLength(
- 0,
- );
- context.readiness = {};
- }
- refresh();
- await screen.findByRole("dialog", { name: "Your agents have moved" });
- expectOnlyDialog("Your agents have moved");
- expect(context.capture).not.toHaveBeenCalled();
- expectNoWrites();
- },
- );
-
it("keeps both dialogs closed while the migration record is delayed", async () => {
let release = () => {};
context.noticeWait = new Promise<void>((resolve) => {
@@ -204,25 +157,6 @@ describe("migration notice with production first-visit tutorials", () => {
expect(context.postedStep).not.toHaveBeenCalled();
});
- it("preserves the old tutorial when delayed hire-experts resolves off", async () => {
- context.flags["hire-experts"] = false;
- context.readiness["hire-experts"] = false;
- const { refresh } = renderTogether();
- expect(screen.queryAllByRole("dialog", { hidden: true })).toHaveLength(0);
- context.readiness["hire-experts"] = true;
- refresh();
- expectOnlyDialog("Your mission control.");
- expectNoWrites();
- await userEvent.click(
- screen.getByRole("button", { name: "See my workflows" }),
- );
- expect(context.completeStep).toHaveBeenCalledExactlyOnceWith(
- "AGENTS_TAB_INTRO",
- );
- expect(context.getState).not.toHaveBeenCalled();
- expect(context.postedStep).not.toHaveBeenCalled();
- });
-
it.each([
[
"/marketplace",
diff --git a/autogpt_platform/frontend/src/app/(platform)/components/WorkflowsMovedNotice/__tests__/useWorkflowsMovedNotice.test.tsx b/autogpt_platform/frontend/src/app/(platform)/components/WorkflowsMovedNotice/__tests__/useWorkflowsMovedNotice.test.tsx
index 143e9448ed..ab83d78fbd 100644
--- a/autogpt_platform/frontend/src/app/(platform)/components/WorkflowsMovedNotice/__tests__/useWorkflowsMovedNotice.test.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/components/WorkflowsMovedNotice/__tests__/useWorkflowsMovedNotice.test.tsx
@@ -26,9 +26,6 @@ const context = vi.hoisted(() => ({
} | null,
pathname: "/copilot",
search: "",
- ready: true,
- flagReadiness: {} as Record<string, boolean>,
- flags: { "hire-experts": true } as Record<string, boolean>,
}));
vi.mock("@/lib/auth/hooks/useAuth", () => ({
useAuth: () => ({ user: context.user }),
@@ -37,16 +34,6 @@ vi.mock("next/navigation", () => ({
usePathname: () => context.pathname,
useSearchParams: () => new URLSearchParams(context.search),
}));
-vi.mock("@/services/feature-flags/use-get-flag", () => ({
- Flag: {
- HIRE_EXPERTS: "hire-experts",
- ONBOARDING_BRAIN_DUMP: "onboarding-brain-dump",
- },
- useFlagStatus: (flag: string) => ({
- enabled: context.flags[flag],
- ready: context.flagReadiness[flag] ?? context.ready,
- }),
-}));
import { useWorkflowsMovedNotice } from "../useWorkflowsMovedNotice";
import { WorkflowsMovedNotice } from "../WorkflowsMovedNotice";
@@ -96,9 +83,7 @@ beforeEach(() => {
context.user = { id: "user-1", created_at: "2026-09-01T00:00:00Z" };
context.pathname = "/copilot";
context.search = "";
- context.ready = true;
- context.flagReadiness = {};
- context.flags = { "hire-experts": true };
+
mockOnboarding();
});
@@ -149,10 +134,9 @@ describe("migration notice eligibility", () => {
});
it.each(["A", "B"] as const)(
- "gives pending welcome path %s priority even when its flag resolves late",
+ "gives pending welcome path %s priority over migration",
async (path) => {
setIntroPath(path);
- context.flagReadiness["onboarding-brain-dump"] = false;
const queryClient = new QueryClient({
defaultOptions: { queries: { retry: false } },
});
@@ -178,11 +162,9 @@ describe("migration notice eligibility", () => {
);
});
expect(result.current.migration.isOpen).toBe(false);
- expect(result.current.welcome.isWelcomeOpen).toBe(false);
- expect(peekIntroPath()).toBe(path);
+ expect(result.current.welcome.isWelcomeOpen).toBe(true);
+ expect(peekIntroPath()).toBeNull();
- context.flags["onboarding-brain-dump"] = true;
- context.flagReadiness["onboarding-brain-dump"] = true;
rerender();
await waitFor(() =>
expect(result.current.welcome.isWelcomeOpen).toBe(true),
@@ -283,16 +265,6 @@ describe("migration notice eligibility", () => {
await waitFor(() => expect(result.current.isOpen).toBe(true));
});
- it("stays closed with hire-experts disabled", () => {
- context.flags["hire-experts"] = false;
- expectDeferred();
- });
-
- it("waits for feature flag readiness", () => {
- context.ready = false;
- expectDeferred();
- });
-
it("waits for auth", () => {
context.user = null;
expectDeferred();
diff --git a/autogpt_platform/frontend/src/app/(platform)/components/WorkflowsMovedNotice/useWorkflowsMovedNotice.ts b/autogpt_platform/frontend/src/app/(platform)/components/WorkflowsMovedNotice/useWorkflowsMovedNotice.ts
index 75bc24aaba..8d8416e67a 100644
--- a/autogpt_platform/frontend/src/app/(platform)/components/WorkflowsMovedNotice/useWorkflowsMovedNotice.ts
+++ b/autogpt_platform/frontend/src/app/(platform)/components/WorkflowsMovedNotice/useWorkflowsMovedNotice.ts
@@ -7,18 +7,17 @@ import {
} from "@/app/api/__generated__/endpoints/onboarding/onboarding";
import { PostV1CompleteOnboardingStepStep } from "@/app/api/__generated__/models/postV1CompleteOnboardingStepStep";
import { useAuth } from "@/lib/auth/hooks/useAuth";
-import { Flag, useFlagStatus } from "@/services/feature-flags/use-get-flag";
import { useQueryClient } from "@tanstack/react-query";
import { usePathname, useSearchParams } from "next/navigation";
import { useEffect, useState } from "react";
-import { useNoticeAdmission } from "./useNoticeAdmission";
import {
- isPreExpertsUser,
hasPendingChatHandoff,
+ isPreExpertsUser,
isWorkflowsMovedNoticeRoute,
peekWorkflowsMovedNoticeSeen,
setWorkflowsMovedNoticeSeen,
} from "./helpers";
+import { useNoticeAdmission } from "./useNoticeAdmission";
const STEP = PostV1CompleteOnboardingStepStep.WORKFLOWS_MOVED;
@@ -27,13 +26,11 @@ export function useWorkflowsMovedNotice(canShow = true) {
const { user } = useAuth();
const userID = user?.id ?? null;
const isSafeLanding = useNoticeLandingRoute();
- const experts = useFlagStatus(Flag.HIRE_EXPERTS);
+
const [dismissedUsers, setDismissedUsers] = useState<string[]>([]);
const isEligible = Boolean(
canShow &&
userID &&
- experts.ready &&
- experts.enabled &&
isPreExpertsUser(user?.created_at) &&
isSafeLanding &&
!dismissedUsers.includes(userID) &&
diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/CopilotPage.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/CopilotPage.tsx
index 0ca6dca5f5..0d2b7cc216 100644
--- a/autogpt_platform/frontend/src/app/(platform)/copilot/CopilotPage.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/CopilotPage.tsx
@@ -3,7 +3,6 @@
import { LowCreditBanner } from "@/components/layout/TopUpPrompt/LowCreditBanner/LowCreditBanner";
import { SidebarProvider } from "@/components/ui/sidebar";
import { useAuth } from "@/lib/auth/hooks/useAuth";
-import { Flag, useGetFlag } from "@/services/feature-flags/use-get-flag";
import dynamic from "next/dynamic";
import { parseAsString, useQueryState } from "nuqs";
import { useState } from "react";
@@ -12,7 +11,6 @@ import { ContextPanelAutoOpen } from "./components/ContextPanel/ContextPanelAuto
import { CopilotModals } from "./components/CopilotModals/CopilotModals";
import { FileDropZone } from "./components/FileDropZone/FileDropZone";
import { NotificationBanner } from "./components/NotificationBanner/NotificationBanner";
-import { NotificationDialog } from "./components/NotificationDialog/NotificationDialog";
import { ScaleLoader } from "./components/ScaleLoader/ScaleLoader";
import { useIsMobile } from "./useIsMobile";
@@ -35,7 +33,7 @@ const ContextPanel = dynamic(
export function CopilotPage() {
const [droppedFiles, setDroppedFiles] = useState<File[]>([]);
const isMobile = useIsMobile();
- const isBrainDumpEnabled = useGetFlag(Flag.ONBOARDING_BRAIN_DUMP);
+
const { isUserLoading, isLoggedIn } = useAuth();
// Read sessionId here purely to key the chat-host subtree. The view still
// remounts on session switch, but the underlying AI SDK Chat runtime now
@@ -75,7 +73,7 @@ export function CopilotPage() {
/>
{isMobile && sessionId && <ContextPanel sessionId={sessionId} mobile />}
{isMobile && <ArtifactPanel mobile />}
- {!isBrainDumpEnabled && <NotificationDialog />}
+
<CopilotModals />
</SidebarProvider>
);
diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/__tests__/CopilotPage.test.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/__tests__/CopilotPage.test.tsx
index eb51e71172..694dbda7bd 100644
--- a/autogpt_platform/frontend/src/app/(platform)/copilot/__tests__/CopilotPage.test.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/__tests__/CopilotPage.test.tsx
@@ -8,6 +8,10 @@ import { useCopilotUIStore } from "../store";
import { afterEach, describe, expect, it, vi } from "vitest";
import { CopilotPage } from "../CopilotPage";
+vi.mock("@/providers/onboarding/onboarding-provider", () => ({
+ default: ({ children }: { children: React.ReactNode }) => <>{children}</>,
+}));
+
// Mock child components that are complex and not under test here
vi.mock("../components/ChatContainer/ChatContainer", () => ({
ChatContainer: () => <div data-testid="chat-container" />,
@@ -18,9 +22,6 @@ vi.mock("../components/DeleteChatDialog/DeleteChatDialog", () => ({
vi.mock("../components/NotificationBanner/NotificationBanner", () => ({
NotificationBanner: () => null,
}));
-vi.mock("../components/NotificationDialog/NotificationDialog", () => ({
- NotificationDialog: () => null,
-}));
vi.mock("../components/RateLimitResetDialog/RateLimitResetDialog", () => ({
RateLimitResetDialog: () => null,
}));
diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/__tests__/autopilot-errors.test.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/__tests__/autopilot-errors.test.tsx
index 0527e9db7d..8fec06d4ca 100644
--- a/autogpt_platform/frontend/src/app/(platform)/copilot/__tests__/autopilot-errors.test.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/__tests__/autopilot-errors.test.tsx
@@ -58,7 +58,7 @@ vi.mock("@/lib/auth/hooks/useAuth", () => ({
}),
}));
-const flagState = vi.hoisted(() => ({ experts: false, billing: false }));
+const flagState = vi.hoisted(() => ({ billing: false }));
const streamPath = vi.hoisted(() => ({ runtime: false }));
@@ -66,17 +66,14 @@ vi.mock("@/services/feature-flags/use-get-flag", () => ({
Flag: {
CHAT_MODE_OPTION: "CHAT_MODE_OPTION",
ENABLE_PLATFORM_PAYMENT: "ENABLE_PLATFORM_PAYMENT",
- HIRE_EXPERTS: "HIRE_EXPERTS",
COPILOT_STREAM_RUNTIME: "copilot-stream-runtime",
},
useGetFlag: (flag: string) =>
flag === "copilot-stream-runtime"
? streamPath.runtime
- : flag === "HIRE_EXPERTS"
- ? flagState.experts
- : flag === "ENABLE_PLATFORM_PAYMENT"
- ? flagState.billing
- : false,
+ : flag === "ENABLE_PLATFORM_PAYMENT"
+ ? flagState.billing
+ : false,
}));
beforeEach(() => {
@@ -84,7 +81,6 @@ beforeEach(() => {
useCopilotStreamStore.getState().resetAll();
useCopilotUIStore.setState({ initialPrompt: null });
window.localStorage.clear();
- flagState.experts = false;
flagState.billing = false;
});
@@ -93,7 +89,6 @@ afterEach(() => {
useCopilotStreamStore.getState().resetAll();
useCopilotUIStore.setState({ initialPrompt: null });
window.localStorage.clear();
- flagState.experts = false;
flagState.billing = false;
});
@@ -214,7 +209,6 @@ describe.each(STREAM_PATHS)("on the %s path", (path) => {
it("clears kickoff recovery state after an HTTP 429", async () => {
const expertId = "3f8b0f7e-9f30-4a3b-a6a1-000000000001";
- flagState.experts = true;
server.use(
http.get("*/api/experts/identities", () =>
HttpResponse.json([
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.tsx
index 572495a3db..55f8db67e4 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
@@ -4,6 +4,7 @@ import {
getPostV2CreateSessionMockHandler,
} from "@/app/api/__generated__/endpoints/chat/chat.msw";
import { getListExpertIdentitiesMockHandler } from "@/app/api/__generated__/endpoints/experts/experts.msw";
+import { makeDashboard } from "@/app/(platform)/home/__tests__/heldItems";
import { server } from "@/mocks/mock-server";
import {
assistantTextChunks,
@@ -11,7 +12,7 @@ import {
} from "@/tests/integrations/copilot-sse";
import { screen, waitFor } from "@testing-library/react";
import userEvent from "@testing-library/user-event";
-import { http } from "msw";
+import { http, HttpResponse } from "msw";
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import { useAutopilotModeStore } from "../autopilotModeStore";
import { resetCopilotChatRegistry } from "../copilotChatRegistry";
@@ -22,7 +23,7 @@ import {
typeAndSend,
} from "./sse-helpers";
-const flags = vi.hoisted(() => ({ autoMode: false, experts: false }));
+const flags = vi.hoisted(() => ({ autoMode: false }));
vi.mock("@/services/feature-flags/use-get-flag", async (importActual) => {
const actual =
@@ -32,11 +33,7 @@ vi.mock("@/services/feature-flags/use-get-flag", async (importActual) => {
return {
...actual,
useGetFlag: (flag: string) =>
- flag === actual.Flag.COPILOT_AUTO_MODE
- ? flags.autoMode
- : flag === actual.Flag.HIRE_EXPERTS
- ? flags.experts
- : false,
+ flag === actual.Flag.COPILOT_AUTO_MODE && flags.autoMode,
};
});
@@ -65,7 +62,11 @@ vi.mock("@/lib/auth/hooks/useAuth", () => ({
beforeEach(() => {
flags.autoMode = true;
- flags.experts = false;
+ server.use(
+ http.get(/\/api\/proxy\/api\/home(?:\?.*)?$/, () =>
+ HttpResponse.json(makeDashboard([])),
+ ),
+ );
});
afterEach(() => {
@@ -184,7 +185,6 @@ describe("AutoPilot mode selector", () => {
expect(bodies[0]).toMatchObject({ autopilot_mode: "ask_first" });
});
it("starts a new expert thread on the expert's default without sending it", async () => {
- flags.experts = true;
const bodies = captureStreamBodies();
const createBodies: Record<string, unknown>[] = [];
server.use(
@@ -224,7 +224,6 @@ describe("AutoPilot mode selector", () => {
});
it("drops a pick left over from an earlier new chat that was never sent", async () => {
- flags.experts = true;
const createBodies: Record<string, unknown>[] = [];
server.use(
getListExpertIdentitiesMockHandler([mariaIdentity("ask_first")]),
@@ -266,7 +265,6 @@ describe("AutoPilot mode selector", () => {
});
it("keeps a thread's stored mode over the expert's default", async () => {
- flags.experts = true;
server.use(
getListExpertIdentitiesMockHandler([mariaIdentity("ask_first")]),
);
diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/__tests__/expert-kickoff.test.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/__tests__/expert-kickoff.test.tsx
index e08e3d49ac..2400e1ae7f 100644
--- a/autogpt_platform/frontend/src/app/(platform)/copilot/__tests__/expert-kickoff.test.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/__tests__/expert-kickoff.test.tsx
@@ -27,10 +27,6 @@ import { useChatSession } from "../useChatSession";
import { useExpertKickoff } from "../useExpertKickoff";
import { useSendMessage } from "../useSendMessage";
-const flagState = vi.hoisted(() => ({
- values: { "hire-experts": true } as Record<string, boolean>,
-}));
-
vi.mock("@/services/feature-flags/use-get-flag", async (importOriginal) => {
const actual =
await importOriginal<
@@ -38,7 +34,7 @@ vi.mock("@/services/feature-flags/use-get-flag", async (importOriginal) => {
>();
return {
...actual,
- useGetFlag: (flag: string) => flagState.values[flag] ?? false,
+ useGetFlag: () => false,
};
});
@@ -64,7 +60,6 @@ function latestKickoffAttemptToken(messages: UIMessage[]) {
beforeEach(() => {
server.resetHandlers();
sendSpy.mockReset();
- flagState.values = { "hire-experts": true };
window.localStorage.clear();
useCopilotUIStore.setState({ adoptedExpertThreads: new Set<string>() });
useCopilotStreamStore.getState().resetAll();
diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/__tests__/expert-send-guard.test.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/__tests__/expert-send-guard.test.tsx
index b6bdceb600..c0d65789e3 100644
--- a/autogpt_platform/frontend/src/app/(platform)/copilot/__tests__/expert-send-guard.test.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/__tests__/expert-send-guard.test.tsx
@@ -16,14 +16,13 @@ const expertMapState = vi.hoisted(() => ({
const sendNewMessage = vi.hoisted(() => vi.fn());
const queueFollowUpMessage = vi.hoisted(() => vi.fn());
-vi.mock("@/services/feature-flags/use-get-flag", () => ({
- Flag: {
- CHAT_MODE_OPTION: "chat-mode-option",
- HIRE_EXPERTS: "hire-experts",
- ONBOARDING_BRAIN_DUMP: "onboarding-brain-dump",
- },
- useGetFlag: (flag: string) => flag === "hire-experts",
-}));
+vi.mock("@/services/feature-flags/use-get-flag", async (importOriginal) => {
+ const actual =
+ await importOriginal<
+ typeof import("@/services/feature-flags/use-get-flag")
+ >();
+ return { ...actual, useGetFlag: () => false };
+});
vi.mock("nuqs", () => ({
parseAsString: {},
diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/__tests__/expert-threads.test.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/__tests__/expert-threads.test.tsx
index df6e0f5495..568ebdf19f 100644
--- a/autogpt_platform/frontend/src/app/(platform)/copilot/__tests__/expert-threads.test.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/__tests__/expert-threads.test.tsx
@@ -47,10 +47,6 @@ function funnelEventNames() {
return capture.mock.calls.map(([event]) => event as string);
}
-const flagState = vi.hoisted(() => ({
- values: { "hire-experts": true } as Record<string, boolean>,
-}));
-
vi.mock("@/services/feature-flags/use-get-flag", async (importOriginal) => {
const actual =
await importOriginal<
@@ -58,7 +54,7 @@ vi.mock("@/services/feature-flags/use-get-flag", async (importOriginal) => {
>();
return {
...actual,
- useGetFlag: (flag: string) => flagState.values[flag] ?? false,
+ useGetFlag: () => false,
};
});
@@ -194,7 +190,6 @@ function makeSession(overrides: Record<string, unknown>) {
afterEach(() => {
cleanup();
server.resetHandlers();
- flagState.values = { "hire-experts": true };
useCopilotUIStore.setState({ adoptedExpertThreads: new Set<string>() });
});
diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/__tests__/expertKickoff.test.ts b/autogpt_platform/frontend/src/app/(platform)/copilot/__tests__/expertKickoff.test.ts
index b0088ffc31..0e58004253 100644
--- a/autogpt_platform/frontend/src/app/(platform)/copilot/__tests__/expertKickoff.test.ts
+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/__tests__/expertKickoff.test.ts
@@ -75,13 +75,12 @@ describe("buildKickoffMessage", () => {
describe("shouldClearKickoffParam", () => {
it("preserves kickoff through a retryable expert-map error and recovery", () => {
- expect(shouldClearKickoffParam(true, false, null)).toBe(false);
- expect(shouldClearKickoffParam(true, true, EXPERT_ID)).toBe(false);
+ expect(shouldClearKickoffParam(false, null)).toBe(false);
+ expect(shouldClearKickoffParam(true, EXPERT_ID)).toBe(false);
});
- it("clears kickoff only when experts are disabled or a loaded map misses it", () => {
- expect(shouldClearKickoffParam(false, false, null)).toBe(true);
- expect(shouldClearKickoffParam(true, true, null)).toBe(true);
+ it("clears kickoff only when the settled roster does not contain the expert", () => {
+ expect(shouldClearKickoffParam(true, null)).toBe(true);
});
});
diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/__tests__/followup-after-local-stream.test.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/__tests__/followup-after-local-stream.test.tsx
index 1c428b0560..1dc167dd05 100644
--- a/autogpt_platform/frontend/src/app/(platform)/copilot/__tests__/followup-after-local-stream.test.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/__tests__/followup-after-local-stream.test.tsx
@@ -22,14 +22,13 @@ const queueFollowUpMessage = vi.hoisted(() => vi.fn());
const queueMessage = vi.hoisted(() => vi.fn());
const toast = vi.hoisted(() => vi.fn());
-vi.mock("@/services/feature-flags/use-get-flag", () => ({
- Flag: {
- CHAT_MODE_OPTION: "chat-mode-option",
- HIRE_EXPERTS: "hire-experts",
- ONBOARDING_BRAIN_DUMP: "onboarding-brain-dump",
- },
- useGetFlag: () => false,
-}));
+vi.mock("@/services/feature-flags/use-get-flag", async (importOriginal) => {
+ const actual =
+ await importOriginal<
+ typeof import("@/services/feature-flags/use-get-flag")
+ >();
+ return { ...actual, useGetFlag: () => false };
+});
vi.mock("nuqs", () => ({
parseAsString: {},
diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/__tests__/low-credit-banner.test.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/__tests__/low-credit-banner.test.tsx
index 8e7dc6bff0..a60f660563 100644
--- a/autogpt_platform/frontend/src/app/(platform)/copilot/__tests__/low-credit-banner.test.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/__tests__/low-credit-banner.test.tsx
@@ -18,9 +18,6 @@ vi.mock("../components/ChatContainer/ChatContainer", () => ({
vi.mock("../components/NotificationBanner/NotificationBanner", () => ({
NotificationBanner: () => null,
}));
-vi.mock("../components/NotificationDialog/NotificationDialog", () => ({
- NotificationDialog: () => null,
-}));
vi.mock("../components/RateLimitResetDialog/RateLimitGate", () => ({
RateLimitGate: () => null,
}));
diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/__tests__/setup-followup-stream.test.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/__tests__/setup-followup-stream.test.tsx
new file mode 100644
index 0000000000..b883ffee4f
--- /dev/null
+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/__tests__/setup-followup-stream.test.tsx
@@ -0,0 +1,211 @@
+import { getGetV2GetSessionMockHandler200 } from "@/app/api/__generated__/endpoints/chat/chat.msw";
+import { getListExpertIdentitiesMockHandler200 } from "@/app/api/__generated__/endpoints/experts/experts.msw";
+import { server } from "@/mocks/mock-server";
+import {
+ assistantTextChunks,
+ createStreamHold,
+ streamSseResponse,
+} from "@/tests/integrations/copilot-sse";
+import { act, screen, waitFor } from "@testing-library/react";
+import userEvent from "@testing-library/user-event";
+import { http, HttpResponse } from "msw";
+import { afterEach, beforeEach, expect, it, vi } from "vitest";
+import {
+ getOrCreateCopilotChatRuntime,
+ resetCopilotChatRegistry,
+} from "../copilotChatRegistry";
+import { useCopilotStreamStore } from "../copilotStreamStore";
+import {
+ renderHost,
+ TEST_BACKEND_BASE_URL,
+ TEST_SESSION_ID,
+ typeAndSend,
+} from "./sse-helpers";
+
+const finishProbeStates = vi.hoisted(() => [] as boolean[]);
+
+vi.mock("../useHydrateOnStreamEnd", async (importActual) => {
+ const actual =
+ await importActual<typeof import("../useHydrateOnStreamEnd")>();
+ return {
+ ...actual,
+ useHydrateOnStreamEnd: (
+ args: Parameters<typeof actual.useHydrateOnStreamEnd>[0],
+ ) => {
+ finishProbeStates.push(args.isFinishProbing);
+ return actual.useHydrateOnStreamEnd(args);
+ },
+ };
+});
+
+vi.mock("@/services/environment", async (importActual) => {
+ const actual = await importActual<typeof import("@/services/environment")>();
+ return {
+ ...actual,
+ environment: {
+ ...actual.environment,
+ getAGPTServerBaseUrl: () => TEST_BACKEND_BASE_URL,
+ },
+ };
+});
+
+vi.mock("../helpers", async (importActual) => {
+ const actual = await importActual<typeof import("../helpers")>();
+ return {
+ ...actual,
+ getCopilotAuthHeaders: async () => ({ "x-test-auth": "yes" }),
+ };
+});
+
+vi.mock("@/lib/auth/hooks/useAuth", () => ({
+ useAuth: () => ({
+ user: { id: "test-user" },
+ isUserLoading: false,
+ isLoggedIn: true,
+ }),
+}));
+
+vi.mock("@/services/feature-flags/use-get-flag", async (importActual) => {
+ const actual =
+ await importActual<
+ typeof import("@/services/feature-flags/use-get-flag")
+ >();
+ return {
+ ...actual,
+ useGetFlag: () => false,
+ useFlagStatus: () => ({ enabled: false, ready: true }),
+ };
+});
+
+beforeEach(() => {
+ finishProbeStates.length = 0;
+ resetCopilotChatRegistry();
+ useCopilotStreamStore.getState().resetAll();
+});
+
+afterEach(() => {
+ resetCopilotChatRegistry();
+ vi.restoreAllMocks();
+ window.sessionStorage.clear();
+});
+
+it.each([false, true])(
+ "sends an expert setup reply once after a pending-message 409 (delayed resume: %s)",
+ async (delayedResume) => {
+ const consoleError = vi.spyOn(console, "error");
+ const expertId = "3f8b0f7e-9f30-4a3b-a6a1-000000000001";
+ const question = "What should I work on first?";
+ const reply = "Prepare the weekly report";
+ const first = createStreamHold(5);
+ const second = createStreamHold(5);
+ const handshake = createStreamHold(0);
+ let resumeRequested = false;
+ let sessionReadAfterSetup = 0;
+ const requests: unknown[] = [];
+ const queueRequest = vi.fn(() =>
+ HttpResponse.json({ detail: "No active turn" }, { status: 409 }),
+ );
+ server.use(
+ getListExpertIdentitiesMockHandler200([
+ {
+ id: expertId,
+ name: "Setup expert",
+ avatar_url: null,
+ role: "Reporting",
+ is_archived: false,
+ },
+ ]),
+ http.post(
+ `${TEST_BACKEND_BASE_URL}/api/chat/sessions/${TEST_SESSION_ID}/stream`,
+ async ({ request }) => {
+ requests.push(await request.json());
+ const isSetup = requests.length === 1;
+ return streamSseResponse(
+ assistantTextChunks(isSetup ? question : "I will prepare it.", {
+ messageId: isSetup ? "setup-questions" : "setup-reply",
+ }),
+ {
+ hold: isSetup ? first.hold : second.hold,
+ abortSignal: request.signal,
+ },
+ );
+ },
+ ),
+ http.post(
+ `${TEST_BACKEND_BASE_URL}/api/chat/sessions/${TEST_SESSION_ID}/messages/pending`,
+ queueRequest,
+ ),
+ http.get(
+ `${TEST_BACKEND_BASE_URL}/api/chat/sessions/${TEST_SESSION_ID}/stream`,
+ async ({ request }) => {
+ resumeRequested = true;
+ await handshake.hold.released;
+ return streamSseResponse([], { abortSignal: request.signal });
+ },
+ ),
+ );
+
+ const host = renderHost({
+ sessionResponse: getGetV2GetSessionMockHandler200(() => ({
+ id: TEST_SESSION_ID,
+ created_at: "2026-05-13T00:00:00Z",
+ updated_at: "2026-05-13T00:00:00Z",
+ user_id: "test-user",
+ chat_status: "idle",
+ messages: [],
+ has_more_messages: false,
+ oldest_sequence: null,
+ expert_id: expertId,
+ active_stream:
+ delayedResume && requests.length > 0 && sessionReadAfterSetup++ === 0
+ ? { turn_id: "setup-turn", last_message_id: "setup-questions" }
+ : null,
+ metadata: { dry_run: false, builder_graph_id: null },
+ })),
+ });
+ try {
+ await typeAndSend("Start setup");
+ await screen.findByText(question, undefined, { timeout: 5_000 });
+ const user = userEvent.setup();
+ await user.type(screen.getByLabelText(/chat message input/i), reply);
+ await user.click(screen.getByRole("button", { name: "Queue message" }));
+ await waitFor(() => expect(queueRequest).toHaveBeenCalledOnce());
+ expect(requests).toHaveLength(1);
+
+ first.release();
+ if (delayedResume) {
+ await waitFor(() => expect(resumeRequested).toBe(true));
+ await waitFor(() => {
+ expect(finishProbeStates).toContain(true);
+ expect(finishProbeStates.at(-1)).toBe(false);
+ });
+ await act(async () => {
+ await new Promise((resolve) => setTimeout(resolve, 100));
+ });
+ expect(requests).toHaveLength(1);
+ handshake.release();
+ }
+ await waitFor(() => expect(requests).toHaveLength(2), { timeout: 5_000 });
+ expect(requests[1]).toMatchObject({ message: reply });
+ await screen.findByText("I will prepare it.");
+ second.release();
+ handshake.release();
+ const { chat } = getOrCreateCopilotChatRuntime(TEST_SESSION_ID);
+ await waitFor(() => expect(chat.status).toBe("ready"));
+ expect(queueRequest).toHaveBeenCalledOnce();
+ expect(requests).toHaveLength(2);
+ expect(chat.error).toBeUndefined();
+ expect(
+ consoleError.mock.calls.filter((args) =>
+ args.some((arg) => arg instanceof TypeError),
+ ),
+ ).toEqual([]);
+ } finally {
+ first.release();
+ second.release();
+ handshake.release();
+ host.unmount();
+ }
+ },
+ 15_000,
+);
diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/__tests__/stable-onsend.test.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/__tests__/stable-onsend.test.tsx
index 074ff4028c..3b6ed319cc 100644
--- a/autogpt_platform/frontend/src/app/(platform)/copilot/__tests__/stable-onsend.test.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/__tests__/stable-onsend.test.tsx
@@ -8,7 +8,6 @@ import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
const streamState = vi.hoisted(() => ({
status: "ready" as "ready" | "submitted" | "streaming" | "error",
}));
-const flags = vi.hoisted(() => ({ brainDump: false }));
const sendNewMessage = vi.hoisted(() => vi.fn());
const completeGreeting = vi.hoisted(() => vi.fn());
@@ -19,11 +18,8 @@ const setPendingFileParts = vi.hoisted(() => vi.fn());
vi.mock("@/services/feature-flags/use-get-flag", () => ({
Flag: {
CHAT_MODE_OPTION: "chat-mode-option",
- HIRE_EXPERTS: "hire-experts",
- ONBOARDING_BRAIN_DUMP: "onboarding-brain-dump",
},
- useGetFlag: (flag: string) =>
- flag === "onboarding-brain-dump" ? flags.brainDump : false,
+ useGetFlag: () => false,
}));
vi.mock("nuqs", () => ({
@@ -141,7 +137,6 @@ import { useCopilotPage } from "../useCopilotPage";
beforeEach(() => {
streamState.status = "ready";
- flags.brainDump = false;
sendNewMessage.mockResolvedValue(undefined);
queueFollowUpMessage.mockResolvedValue(undefined);
useCopilotUIStore.getState().setInitialPrompt(null);
@@ -168,11 +163,9 @@ describe("useCopilotPage — stable onSend", () => {
expect(result.current.onEnqueue).toBe(onSend);
});
- it("sends with the latest render's state from a handler kept since mount", async () => {
+ it("completes the greeting through a handler kept since mount", async () => {
const { result, rerender } = renderHook(() => useCopilotPage());
const keptOnSend = result.current.onSend;
-
- flags.brainDump = true;
rerender();
await keptOnSend("hello");
diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/__tests__/store-selectors.test.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/__tests__/store-selectors.test.tsx
index 81a6a61cc2..aaef9144f0 100644
--- a/autogpt_platform/frontend/src/app/(platform)/copilot/__tests__/store-selectors.test.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/__tests__/store-selectors.test.tsx
@@ -1,19 +1,13 @@
import { getGetV2ListChatConnectionsMockHandler200 } from "@/app/api/__generated__/endpoints/chat/chat.msw";
import { server } from "@/mocks/mock-server";
-import {
- act,
- render,
- renderHook,
- waitFor,
-} from "@/tests/integrations/test-utils";
+import { act, renderHook, waitFor } from "@/tests/integrations/test-utils";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import { NuqsTestingAdapter } from "nuqs/adapters/testing";
-import { Profiler, useState, type ReactNode } from "react";
+import { useState, type ReactNode } from "react";
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import { useChatInput } from "../components/ChatInput/useChatInput";
import { useConnectionPicker } from "../components/ChatInput/components/ConnectionPicker/useConnectionPicker";
import { useLockedTierFallback } from "../components/ChatInput/components/ConnectionPicker/useLockedTierFallback";
-import { NotificationDialog } from "../components/NotificationDialog/NotificationDialog";
import { DEFAULT_PANEL_WIDTH, useCopilotUIStore } from "../store";
import { useSessionDeletion } from "../useSessionDeletion";
import { useWorkflowImportAutoSubmit } from "../useWorkflowImportAutoSubmit";
@@ -65,16 +59,6 @@ function countHookRenders<T>(useHook: () => T) {
return { ...view, counter };
}
-function countComponentCommits(ui: ReactNode) {
- const onRender = vi.fn();
- const view = render(
- <Profiler id="subject" onRender={onRender}>
- {ui}
- </Profiler>,
- );
- return { ...view, onRender };
-}
-
const initialState = useCopilotUIStore.getState();
beforeEach(() => {
@@ -86,7 +70,6 @@ beforeEach(() => {
sessionToDelete: null,
isNotificationsEnabled: false,
isSoundEnabled: true,
- showNotificationDialog: false,
});
});
@@ -171,16 +154,4 @@ describe("copilot UI store readers", () => {
act(() => useCopilotUIStore.getState().setInitialPrompt("Hello Otto"));
await waitFor(() => expect(result.current.value).toBe("Hello Otto"));
});
-
- it("NotificationDialog ignores unrelated writes", async () => {
- const { onRender } = countComponentCommits(<NotificationDialog />);
- await settle();
- onRender.mockClear();
-
- writeUnrelatedField();
- expect(onRender).not.toHaveBeenCalled();
-
- act(() => useCopilotUIStore.getState().setShowNotificationDialog(true));
- expect(onRender).toHaveBeenCalled();
- });
});
diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/__tests__/store.test.ts b/autogpt_platform/frontend/src/app/(platform)/copilot/__tests__/store.test.ts
index b09c7763d6..0f26fd2f9b 100644
--- a/autogpt_platform/frontend/src/app/(platform)/copilot/__tests__/store.test.ts
+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/__tests__/store.test.ts
@@ -248,7 +248,6 @@ describe("useCopilotUIStore", () => {
completedSessionIDs: new Set<string>(),
isNotificationsEnabled: false,
isSoundEnabled: true,
- showNotificationDialog: false,
copilotLlmModel: "standard",
});
});
@@ -472,14 +471,6 @@ describe("useCopilotUIStore", () => {
"true",
);
});
-
- it("shows and hides notification dialog", () => {
- useCopilotUIStore.getState().setShowNotificationDialog(true);
- expect(useCopilotUIStore.getState().showNotificationDialog).toBe(true);
-
- useCopilotUIStore.getState().setShowNotificationDialog(false);
- expect(useCopilotUIStore.getState().showNotificationDialog).toBe(false);
- });
});
});
diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/__tests__/useCopilotPage-store-selectors.test.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/__tests__/useCopilotPage-store-selectors.test.tsx
index eb493a8229..1e7e748e82 100644
--- a/autogpt_platform/frontend/src/app/(platform)/copilot/__tests__/useCopilotPage-store-selectors.test.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/__tests__/useCopilotPage-store-selectors.test.tsx
@@ -8,7 +8,6 @@ import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
const streamState = vi.hoisted(() => ({
status: "ready" as "ready" | "submitted" | "streaming" | "error",
}));
-const flags = vi.hoisted(() => ({ brainDump: false }));
const sendNewMessage = vi.hoisted(() => vi.fn());
const completeGreeting = vi.hoisted(() => vi.fn());
@@ -19,11 +18,8 @@ const setPendingFileParts = vi.hoisted(() => vi.fn());
vi.mock("@/services/feature-flags/use-get-flag", () => ({
Flag: {
CHAT_MODE_OPTION: "chat-mode-option",
- HIRE_EXPERTS: "hire-experts",
- ONBOARDING_BRAIN_DUMP: "onboarding-brain-dump",
},
- useGetFlag: (flag: string) =>
- flag === "onboarding-brain-dump" ? flags.brainDump : false,
+ useGetFlag: () => false,
}));
vi.mock("nuqs", () => ({
@@ -143,7 +139,6 @@ const initialState = useCopilotUIStore.getState();
beforeEach(() => {
streamState.status = "ready";
- flags.brainDump = false;
sendNewMessage.mockResolvedValue(undefined);
useCopilotUIStore.setState({
contextPanelWidth: DEFAULT_PANEL_WIDTH,
diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatContainer/__tests__/fail-closed-expert.test.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatContainer/__tests__/fail-closed-expert.test.tsx
index 600d8b8e90..5297cee945 100644
--- a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatContainer/__tests__/fail-closed-expert.test.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatContainer/__tests__/fail-closed-expert.test.tsx
@@ -16,8 +16,7 @@ vi.mock("@/services/feature-flags/use-get-flag", async (importOriginal) => {
>();
return {
...actual,
- // Only HIRE_EXPERTS is on: useExpertMap runs, artifacts/task-bar stay off.
- useGetFlag: (flag: string) => flag === "hire-experts",
+ useGetFlag: () => false,
};
});
diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/__tests__/useVoiceRecording.test.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/__tests__/useVoiceRecording.test.tsx
index ff72b11173..b007841fbf 100644
--- a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/__tests__/useVoiceRecording.test.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/__tests__/useVoiceRecording.test.tsx
@@ -2,11 +2,6 @@ import { act, renderHook, waitFor } from "@testing-library/react";
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import { useVoiceRecording } from "../useVoiceRecording";
-vi.mock("@/services/feature-flags/use-get-flag", () => ({
- Flag: { ONBOARDING_BRAIN_DUMP: "onboarding-brain-dump" },
- useGetFlag: () => false,
-}));
-
vi.mock("@/components/molecules/Toast/use-toast", () => ({
useToast: () => ({ toast: vi.fn() }),
}));
diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/useVoiceRecording.ts b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/useVoiceRecording.ts
index 5b8d4c3a07..a8d28bbf3f 100644
--- a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/useVoiceRecording.ts
+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/useVoiceRecording.ts
@@ -1,5 +1,6 @@
import { useToast } from "@/components/molecules/Toast/use-toast";
-import { Flag, useGetFlag } from "@/services/feature-flags/use-get-flag";
+import { isKey } from "@/lib/keyboard";
+import { isTouchDevice } from "@/lib/platform";
import React, {
KeyboardEvent,
useCallback,
@@ -7,9 +8,7 @@ import React, {
useRef,
useState,
} from "react";
-import { isKey } from "@/lib/keyboard";
import { downloadRecording } from "../../voice/downloadRecording";
-import { isTouchDevice } from "@/lib/platform";
const MAX_RECORDING_DURATION = 2 * 60 * 1000; // 2 minutes in ms
@@ -54,9 +53,7 @@ export function useVoiceRecording({
const [isSupported, setIsSupported] = useState(false);
// Sending the draft as transcription context ships with the brain-dump
// experience (Path B records a dump on top of Otto's intro text).
- const isBrainDumpEnabled = useGetFlag(Flag.ONBOARDING_BRAIN_DUMP);
- const isBrainDumpEnabledRef = useRef(isBrainDumpEnabled);
- isBrainDumpEnabledRef.current = isBrainDumpEnabled;
+
const valueRef = useRef(value);
useEffect(() => {
@@ -112,7 +109,7 @@ export function useVoiceRecording({
const formData = new FormData();
formData.append("audio", audioBlob);
const draft = valueRef.current.trim();
- if (isBrainDumpEnabledRef.current && draft) {
+ if (draft) {
formData.append("context", draft);
}
diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/EmptySession/EmptySession.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/components/EmptySession/EmptySession.tsx
index 11a398b6f1..ecb3fe4a8e 100644
--- a/autogpt_platform/frontend/src/app/(platform)/copilot/components/EmptySession/EmptySession.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/components/EmptySession/EmptySession.tsx
@@ -1,29 +1,28 @@
"use client";
import { ChatInput } from "@/app/(platform)/copilot/components/ChatInput/ChatInput";
+import { HomeRecap } from "@/app/(platform)/home/components/HomeRecap/HomeRecap";
import { useAuth } from "@/lib/auth/hooks/useAuth";
import { cn } from "@/lib/utils";
import { motion } from "framer-motion";
import type { ComponentProps, ReactNode } from "react";
+import type { WorkspaceAttachment } from "../../helpers/workspaceAttachments";
+import { ConnectionPicker } from "../ChatInput/components/ConnectionPicker/ConnectionPicker";
+import { RecipientChip } from "../ChatInput/components/RecipientChip";
+import { OnboardingIntroCard } from "../OnboardingIntroCard/OnboardingIntroCard";
+import { useOnboardingIntroCard } from "../OnboardingIntroCard/useOnboardingIntroCard";
+import { OnboardingWelcomeDialog } from "../OnboardingWelcomeDialog/OnboardingWelcomeDialog";
import { SEND_AT_RESET_PLACEHOLDER } from "../SendAtReset/helpers";
+import { EmptyHero } from "./components/EmptyHero";
+import { ExpertKickoffLoader } from "./components/ExpertKickoffLoader/ExpertKickoffLoader";
+import { GreetingLoader } from "./components/GreetingLoader";
import {
getExpertInputPlaceholder,
getGreetingName,
getIntroLine,
} from "./helpers";
-import { OnboardingIntroCard } from "../OnboardingIntroCard/OnboardingIntroCard";
-import { OnboardingWelcomeDialog } from "../OnboardingWelcomeDialog/OnboardingWelcomeDialog";
-import { useOnboardingIntroCard } from "../OnboardingIntroCard/useOnboardingIntroCard";
-import { Flag, useGetFlag } from "@/services/feature-flags/use-get-flag";
-import type { WorkspaceAttachment } from "../../helpers/workspaceAttachments";
-import { EmptyHero } from "./components/EmptyHero";
-import { GreetingLoader } from "./components/GreetingLoader";
-import { ExpertKickoffLoader } from "./components/ExpertKickoffLoader/ExpertKickoffLoader";
-import { HomeRecap } from "@/app/(platform)/home/components/HomeRecap/HomeRecap";
-import { RecipientChip } from "../ChatInput/components/RecipientChip";
-import { ConnectionPicker } from "../ChatInput/components/ConnectionPicker/ConnectionPicker";
-import { useRecipientPicker } from "./useRecipientPicker";
import { useHomeComposer } from "./useHomeComposer";
+import { useRecipientPicker } from "./useRecipientPicker";
interface Props {
isCreatingSession: boolean;
@@ -73,8 +72,7 @@ export function EmptySession({
const { user } = useAuth();
const greetingName = getGreetingName(user);
const intro = useOnboardingIntroCard();
- const isBrainDumpEnabled = useGetFlag(Flag.ONBOARDING_BRAIN_DUMP);
- const isExpertsEnabled = useGetFlag(Flag.HIRE_EXPERTS);
+
const {
options,
recipient,
@@ -84,21 +82,18 @@ export function EmptySession({
} = useRecipientPicker();
const isComposerDisabled = isCreatingSession || !!isInteractionLocked;
const introLine = isLoadingRecipient ? null : getIntroLine(selectedExpert);
- const recipientPicker = isExpertsEnabled ? (
+ const recipientPicker = (
<RecipientChip
recipient={recipient}
options={options}
isLoading={isLoadingRecipient}
onSelect={selectRecipient}
/>
- ) : undefined;
+ );
const { inputPlaceholder } = useHomeComposer({
enabled:
- isExpertsEnabled &&
- !intro.isVisible &&
- !intro.isAwaitingGreeting &&
- !isKickoffStarting,
+ !intro.isVisible && !intro.isAwaitingGreeting && !isKickoffStarting,
});
if (isKickoffStarting) {
@@ -117,17 +112,7 @@ export function EmptySession({
<ConnectionPicker className="ml-0" />
</div>
<motion.div
- className={cn(
- "relative z-10 w-full text-center",
- isExpertsEnabled ? "max-w-[1120px]" : "max-w-[52rem]",
- // The whole greeting flow reads top-down like a letter, so it
- // anchors to the top from its first visible frame; the regular
- // hero centers itself. `my-auto` rather than the parent's
- // `items-center`: auto margins collapse to 0 once the content is
- // taller than the scroller, where centering would push the top of
- // the page above the scroll origin and make it unreachable.
- !intro.anchorTop && !isExpertsEnabled && "my-auto",
- )}
+ className={cn("relative z-10 w-full text-center", "max-w-[1120px]")}
initial={{ opacity: 0 }}
animate={{ opacity: 1 }}
transition={{ duration: 0.3 }}
@@ -164,18 +149,15 @@ export function EmptySession({
<div className={cn("mb-6", intro.isVisible && "max-w-[48rem]")}>
<div
className={cn(
- isBrainDumpEnabled
- ? "text-left transition-colors duration-300 ease-out"
- : "w-full px-2",
+ "text-left transition-colors duration-300 ease-out",
// The greeting's prompt card bleeds 1.25rem past the text
// (-mx-5); the composer stretches the same amount so their
// edges line up. No chrome of its own: the composer card is
// the only outline on screen. The regular hero keeps it
// centered.
- isBrainDumpEnabled &&
- (intro.isVisible
- ? "-mx-5 max-w-[50.5rem]"
- : "mx-auto w-full max-w-[42rem]"),
+ intro.isVisible
+ ? "-mx-5 max-w-[50.5rem]"
+ : "mx-auto w-full max-w-[42rem]",
)}
>
{usageNotice && (
@@ -200,7 +182,7 @@ export function EmptySession({
}
className={cn(
"w-full max-md:[&_[data-slot=input-group-control]]:min-h-16",
- isBrainDumpEnabled && "[&_textarea]:min-h-[4.5rem]",
+ "[&_textarea]:min-h-[4.5rem]",
)}
droppedFiles={droppedFiles}
onDroppedFilesConsumed={onDroppedFilesConsumed}
@@ -216,9 +198,7 @@ export function EmptySession({
)}
</div>
- {!intro.isVisible && !intro.isAwaitingGreeting && isExpertsEnabled && (
- <HomeRecap />
- )}
+ {!intro.isVisible && !intro.isAwaitingGreeting && <HomeRecap />}
</motion.div>
</div>
);
diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/EmptySession/__tests__/EmptySession.test.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/components/EmptySession/__tests__/EmptySession.test.tsx
index 4dce86bcfb..86af7ddd12 100644
--- a/autogpt_platform/frontend/src/app/(platform)/copilot/components/EmptySession/__tests__/EmptySession.test.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/components/EmptySession/__tests__/EmptySession.test.tsx
@@ -16,8 +16,6 @@ import { beforeEach, describe, expect, it, vi } from "vitest";
import { EmptySession } from "../EmptySession";
-const flags = vi.hoisted(() => ({ experts: true }));
-
vi.mock("@/lib/auth/hooks/useAuth", () => ({
useAuth: () => ({ user: null, isUserLoading: false, isLoggedIn: true }),
}));
@@ -29,9 +27,9 @@ vi.mock("@/services/feature-flags/use-get-flag", async (importOriginal) => {
>();
return {
...actual,
- useGetFlag: (flag: string) => flag === "hire-experts" && flags.experts,
- useFlagStatus: (flag: string) => ({
- enabled: flag === "hire-experts" && flags.experts,
+ useGetFlag: () => false,
+ useFlagStatus: () => ({
+ enabled: false,
ready: true,
}),
};
@@ -129,7 +127,6 @@ describe("EmptySession — recipient-aware intro", () => {
});
beforeEach(() => {
- flags.experts = true;
server.use(
http.get(/\/api\/proxy\/api\/home(?:\?.*)?$/, () =>
HttpResponse.json(makeDashboard([])),
@@ -139,7 +136,7 @@ beforeEach(() => {
it("shows the task prompt above the home recap", async () => {
renderEmptySession("");
- const prompt = screen.getByPlaceholderText(/What's your role/);
+ const prompt = await screen.findByPlaceholderText(/What's your role/);
const recap = await screen.findByRole("heading", { name: "Your recap" });
expect(
prompt.compareDocumentPosition(recap) & Node.DOCUMENT_POSITION_FOLLOWING,
@@ -167,8 +164,7 @@ it("keeps the prompt usable when the recap fails to load", async () => {
expect(onSend.mock.calls[0][0]).toBe("Plan my day");
});
-it("keeps new tasks available without requesting the recap when experts is off", async () => {
- flags.experts = false;
+it("keeps new tasks and the recap available without a rollout flag", async () => {
const requestedPaths: string[] = [];
function record({ request }: { request: Request }) {
requestedPaths.push(new URL(request.url).pathname);
@@ -179,8 +175,9 @@ it("keeps new tasks available without requesting the recap when experts is off",
expect(
await screen.findByPlaceholderText(/What's your role/),
).toBeDefined();
- expect(screen.queryByRole("heading", { name: "Your recap" })).toBeNull();
- expect(requestedPaths).not.toContain("/api/proxy/api/home");
+ await waitFor(() =>
+ expect(requestedPaths).toContain("/api/proxy/api/home"),
+ );
} finally {
server.events.removeListener("request:start", record);
}
diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/EmptySession/useRecipientPicker.ts b/autogpt_platform/frontend/src/app/(platform)/copilot/components/EmptySession/useRecipientPicker.ts
index e5a574657a..396653d18b 100644
--- a/autogpt_platform/frontend/src/app/(platform)/copilot/components/EmptySession/useRecipientPicker.ts
+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/components/EmptySession/useRecipientPicker.ts
@@ -10,12 +10,7 @@ const AUTOPILOT_RECIPIENT: RecipientOption = {
};
export function useRecipientPicker() {
- const {
- activeExperts,
- activeExpertIds,
- isExpertsEnabled,
- hasExpertsSettled,
- } = useExpertMap();
+ const { activeExperts, activeExpertIds, hasExpertsSettled } = useExpertMap();
const [expertIdParam, setExpertIdParam] = useQueryState(
"expertId",
parseAsString,
@@ -57,10 +52,8 @@ export function useRecipientPicker() {
// fallback is already the right answer. Keyed on "not settled yet" rather
// than "fetching": an initial query that is pending but paused (offline)
// reports `isFetching: false` while it still has no roster to resolve
- // against. Gated on the flag because with experts off the roster never
- // settles and the Otto fallback is the only correct answer.
- isLoadingRecipient:
- isExpertsEnabled && !hasExpertsSettled && !!expertIdParam,
+ // against.
+ isLoadingRecipient: !hasExpertsSettled && !!expertIdParam,
selectRecipient(id: string | null) {
void setExpertIdParam(id);
},
diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/NotificationDialog/NotificationDialog.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/components/NotificationDialog/NotificationDialog.tsx
deleted file mode 100644
index 7d775e699d..0000000000
--- a/autogpt_platform/frontend/src/app/(platform)/copilot/components/NotificationDialog/NotificationDialog.tsx
+++ /dev/null
@@ -1,103 +0,0 @@
-"use client";
-
-import { Button } from "@/components/atoms/Button/Button";
-import { Text } from "@/components/atoms/Text/Text";
-import { Dialog } from "@/components/molecules/Dialog/Dialog";
-import { Key, storage } from "@/services/storage/local-storage";
-import { useEffect, useState } from "react";
-import { useCopilotUIStore } from "../../store";
-import { BellRingIcon } from "@hugeicons/core-free-icons";
-import { Icon } from "@/components/atoms/Icon/Icon";
-
-export function NotificationDialog() {
- const showNotificationDialog = useCopilotUIStore(
- (s) => s.showNotificationDialog,
- );
- const setShowNotificationDialog = useCopilotUIStore(
- (s) => s.setShowNotificationDialog,
- );
- const setNotificationsEnabled = useCopilotUIStore(
- (s) => s.setNotificationsEnabled,
- );
- const isNotificationsEnabled = useCopilotUIStore(
- (s) => s.isNotificationsEnabled,
- );
-
- const [dismissed, setDismissed] = useState(
- () => storage.get(Key.COPILOT_NOTIFICATION_DIALOG_DISMISSED) === "true",
- );
- const [permission, setPermission] = useState(() =>
- typeof Notification !== "undefined" ? Notification.permission : "denied",
- );
-
- // Re-read dismissed flag when notifications are toggled off (e.g. clearCopilotLocalData)
- useEffect(() => {
- if (!isNotificationsEnabled) {
- setDismissed(
- storage.get(Key.COPILOT_NOTIFICATION_DIALOG_DISMISSED) === "true",
- );
- }
- }, [isNotificationsEnabled]);
-
- const shouldShowAuto =
- typeof Notification !== "undefined" &&
- permission === "default" &&
- !dismissed;
-
- const isOpen = showNotificationDialog || shouldShowAuto;
-
- function handleEnable() {
- if (typeof Notification === "undefined") {
- handleDismiss();
- return;
- }
- Notification.requestPermission().then((result) => {
- setPermission(result);
- if (result === "granted") {
- setNotificationsEnabled(true);
- handleDismiss();
- }
- });
- }
-
- function handleDismiss() {
- storage.set(Key.COPILOT_NOTIFICATION_DIALOG_DISMISSED, "true");
- setDismissed(true);
- setShowNotificationDialog(false);
- }
-
- return (
- <Dialog
- title="Stay in the loop"
- styling={{ maxWidth: "28rem", minWidth: "auto" }}
- controlled={{
- isOpen,
- set: async (open) => {
- if (!open) handleDismiss();
- },
- }}
- onClose={handleDismiss}
- >
- <Dialog.Content>
- <div className="flex flex-col items-center gap-4 py-2">
- <div className="flex h-12 w-12 items-center justify-center rounded-full bg-violet-100">
- <Icon icon={BellRingIcon} className="h-6 w-6 text-violet-600" />
- </div>
- <Text variant="body" className="text-center text-neutral-600">
- Your experts can notify you when a response is ready, even if you
- switch tabs or close this page. Enable notifications so you never
- miss one.
- </Text>
- </div>
- <Dialog.Footer className="justify-center">
- <Button variant="secondary" onClick={handleDismiss}>
- Not now
- </Button>
- <Button variant="primary" onClick={handleEnable}>
- Enable notifications
- </Button>
- </Dialog.Footer>
- </Dialog.Content>
- </Dialog>
- );
-}
diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/NotificationDialog/__tests__/NotificationDialog.test.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/components/NotificationDialog/__tests__/NotificationDialog.test.tsx
deleted file mode 100644
index ba2da69f89..0000000000
--- a/autogpt_platform/frontend/src/app/(platform)/copilot/components/NotificationDialog/__tests__/NotificationDialog.test.tsx
+++ /dev/null
@@ -1,137 +0,0 @@
-import {
- cleanup,
- render,
- screen,
- fireEvent,
- waitFor,
-} from "@testing-library/react";
-import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
-import { useCopilotUIStore } from "../../../store";
-import { NotificationDialog } from "../NotificationDialog";
-
-vi.mock("@sentry/nextjs", () => ({
- captureException: vi.fn(),
-}));
-
-vi.mock("@/services/environment", () => ({
- environment: {
- isServerSide: vi.fn(() => false),
- isClientSide: vi.fn(() => true),
- getAGPTServerApiUrl: vi.fn(() => "http://localhost:8006/api"),
- },
-}));
-
-function resetStore() {
- useCopilotUIStore.setState({
- isNotificationsEnabled: false,
- isSoundEnabled: true,
- showNotificationDialog: false,
- });
-}
-
-describe("NotificationDialog", () => {
- beforeEach(() => {
- window.localStorage.clear();
- resetStore();
- });
-
- afterEach(() => {
- cleanup();
- });
-
- it("shows dialog when permission is default and not dismissed", async () => {
- Object.defineProperty(globalThis, "Notification", {
- value: { permission: "default", requestPermission: vi.fn() },
- configurable: true,
- writable: true,
- });
-
- render(<NotificationDialog />);
-
- expect(
- await screen.findByText(/Your experts can notify you/i),
- ).toBeDefined();
- expect(screen.getByText("Enable notifications")).toBeDefined();
- expect(screen.getByText("Not now")).toBeDefined();
- });
-
- it("does not show when already dismissed", () => {
- Object.defineProperty(globalThis, "Notification", {
- value: { permission: "default", requestPermission: vi.fn() },
- configurable: true,
- writable: true,
- });
- window.localStorage.setItem(
- "copilot-notification-dialog-dismissed",
- "true",
- );
-
- render(<NotificationDialog />);
-
- expect(screen.queryByText(/Your experts can notify you/i)).toBeNull();
- });
-
- it("does not show when permission is already granted", () => {
- Object.defineProperty(globalThis, "Notification", {
- value: { permission: "granted", requestPermission: vi.fn() },
- configurable: true,
- writable: true,
- });
-
- render(<NotificationDialog />);
-
- expect(screen.queryByText(/Your experts can notify you/i)).toBeNull();
- });
-
- it("requests permission on Enable click and enables notifications", async () => {
- const requestPermission = vi.fn().mockResolvedValue("granted");
- Object.defineProperty(globalThis, "Notification", {
- value: { permission: "default", requestPermission },
- configurable: true,
- writable: true,
- });
-
- render(<NotificationDialog />);
-
- fireEvent.click(await screen.findByText("Enable notifications"));
-
- await waitFor(() => {
- expect(requestPermission).toHaveBeenCalled();
- expect(useCopilotUIStore.getState().isNotificationsEnabled).toBe(true);
- });
- });
-
- it("dismisses dialog on Not now click", async () => {
- Object.defineProperty(globalThis, "Notification", {
- value: { permission: "default", requestPermission: vi.fn() },
- configurable: true,
- writable: true,
- });
-
- render(<NotificationDialog />);
-
- fireEvent.click(await screen.findByText("Not now"));
-
- await waitFor(() => {
- expect(
- window.localStorage.getItem("copilot-notification-dialog-dismissed"),
- ).toBe("true");
- });
- });
-
- it("shows dialog when showNotificationDialog is set in store", async () => {
- Object.defineProperty(globalThis, "Notification", {
- value: { permission: "denied", requestPermission: vi.fn() },
- configurable: true,
- writable: true,
- });
- // permission is denied and would not auto-show, but store flag overrides
- useCopilotUIStore.setState({ showNotificationDialog: true });
-
- render(<NotificationDialog />);
-
- expect(
- await screen.findByText(/Your experts can notify you/i),
- ).toBeDefined();
- });
-});
diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/OnboardingIntroCard/__tests__/useOnboardingIntroCard.test.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/components/OnboardingIntroCard/__tests__/useOnboardingIntroCard.test.tsx
index b7ba5beca9..59a634bb3e 100644
--- a/autogpt_platform/frontend/src/app/(platform)/copilot/components/OnboardingIntroCard/__tests__/useOnboardingIntroCard.test.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/components/OnboardingIntroCard/__tests__/useOnboardingIntroCard.test.tsx
@@ -18,21 +18,6 @@ vi.mock("@/lib/auth/hooks/useAuth", () => ({
useAuth: () => ({ user: authUser.current }),
}));
-const flags = vi.hoisted(() => ({ current: {} as Record<string, boolean> }));
-const flagsReady = vi.hoisted(() => ({ current: true }));
-vi.mock("@/services/feature-flags/use-get-flag", () => ({
- Flag: {
- ONBOARDING_BRAIN_DUMP: "onboarding-brain-dump",
- ONBOARDING_EXPERT_TEAM: "onboarding-expert-team",
- HIRE_EXPERTS: "hire-experts",
- },
- useGetFlag: (flag: string) => flags.current[flag] ?? false,
- useFlagStatus: (flag: string) => ({
- enabled: flags.current[flag] ?? false,
- ready: flagsReady.current,
- }),
-}));
-
import { useOnboardingIntroCard } from "../useOnboardingIntroCard";
const INTRO_URL =
@@ -93,56 +78,14 @@ beforeEach(() => {
window.localStorage.clear();
capture.mockReset();
authUser.current = { id: "user-1" };
- flags.current = { "onboarding-brain-dump": true };
- flagsReady.current = true;
});
-describe("useOnboardingIntroCard — flag gating", () => {
- it("never asks for an intro while the brain-dump flag is off", async () => {
- flags.current = {};
- const urls = countIntroRequests();
-
- const { result } = renderIntro();
- await waitFor(() => expect(result.current.isVisible).toBe(false));
-
- expect(urls).toEqual([]);
- expect(result.current.greeting).toBe("");
- });
-
- it("releases the composer once LaunchDarkly says the flag is off", async () => {
- // The regression: with the flag off the intro query is disabled, so it
- // never answers — and "no answer yet" was read as "still generating".
- // isAwaitingGreeting stayed true forever and EmptySession hides the
- // composer behind it, so the default
- // flag-off copilot rendered a hero with no way to type.
- flags.current = {};
-
- const { result } = renderIntro();
-
- await waitFor(() => expect(result.current.isAwaitingGreeting).toBe(false));
- expect(result.current.isVisible).toBe(false);
- });
-
- it("renders the plain hero while LaunchDarkly has not answered for a user with no handoff", async () => {
- // Holding on "no answer yet" alone hid the composer on every flag-off
- // /copilot load until LaunchDarkly replied — the flag-off page has to
- // render untouched.
- flags.current = {};
- flagsReady.current = false;
-
- const { result } = renderIntro();
-
- await waitFor(() => expect(result.current.isAwaitingGreeting).toBe(false));
- expect(result.current.isVisible).toBe(false);
- });
-
- it("still holds the composer while LaunchDarkly has not answered for a user coming out of the wizard", async () => {
+describe("useOnboardingIntroCard — availability", () => {
+ it("holds the composer until the wizard welcome has been dismissed", async () => {
// The hold exists to stop the regular hero flashing before the
// greeting page takes over, and the pending overlay is seeded
- // synchronously — so this user is held before the flag resolves.
+ // synchronously — so this user is held before the intro query resolves.
window.sessionStorage.setItem(WELCOME_PENDING_KEY, "1");
- flags.current = {};
- flagsReady.current = false;
const { result } = renderIntro();
@@ -161,7 +104,7 @@ describe("useOnboardingIntroCard — flag gating", () => {
expect(result.current.isVisible).toBe(false);
});
- it("still asks when the cached flag belongs to a different account", async () => {
+ it("still asks when the cached completion belongs to a different account", async () => {
window.localStorage.setItem(GREETING_DONE_KEY, "someone-else");
const urls = countIntroRequests();
@@ -175,11 +118,13 @@ describe("useOnboardingIntroCard — flag gating", () => {
describe("useOnboardingIntroCard — handoff from the wizard", () => {
it("consumes the recorded path once, opens the welcome overlay and reports it", async () => {
setIntroPath("A");
- countIntroRequests();
+ const urls = countIntroRequests({ ...READY_INTRO, greeting_done: true });
const { result } = renderIntro();
await waitFor(() => expect(result.current.isWelcomeOpen).toBe(true));
+ await act(async () => {});
+ expect(urls).toEqual([]);
expect(window.sessionStorage.getItem("autogpt:onboarding-intro-path")).toBe(
null,
);
@@ -204,43 +149,6 @@ describe("useOnboardingIntroCard — handoff from the wizard", () => {
expect(capture).toHaveBeenCalledWith("intro_path", { path: "B" });
});
- it("drops the handoff instead of running it when the flag is off", async () => {
- // The wizard wrote these while the flag was on; a rollback in between
- // must not still buy the user the overlay and its 404-ing polls.
- flags.current = {};
- setIntroPath("B");
- window.sessionStorage.setItem(WELCOME_PENDING_KEY, "1");
- const urls = countIntroRequests();
-
- const { result } = renderIntro();
- await waitFor(() => expect(result.current.isAwaitingGreeting).toBe(false));
-
- expect(result.current.isWelcomeOpen).toBe(false);
- expect(window.sessionStorage.getItem(WELCOME_PENDING_KEY)).toBeNull();
- expect(window.sessionStorage.getItem("autogpt:onboarding-intro-path")).toBe(
- null,
- );
- expect(window.sessionStorage.getItem(MIC_GLOW_KEY)).toBeNull();
- expect(window.sessionStorage.getItem(LATER_DUMP_KEY)).toBeNull();
- expect(capture).not.toHaveBeenCalledWith("intro_path", expect.anything());
- expect(urls).toEqual([]);
- });
-
- it("waits for LaunchDarkly before consuming the handoff", async () => {
- flagsReady.current = false;
- setIntroPath("A");
- countIntroRequests();
-
- const { result } = renderIntro();
- await waitFor(() => expect(result.current).toBeDefined());
-
- expect(result.current.isWelcomeOpen).toBe(false);
- expect(window.sessionStorage.getItem("autogpt:onboarding-intro-path")).toBe(
- "A",
- );
- expect(capture).not.toHaveBeenCalledWith("intro_path", expect.anything());
- });
-
it("shows no overlay for a user who did not just come out of onboarding", async () => {
countIntroRequests();
@@ -263,6 +171,21 @@ describe("useOnboardingIntroCard — handoff from the wizard", () => {
expect(result.current.isAwaitingGreeting).toBe(true);
});
+ it("consumes a saved wizard path without reopening cards this user already saw", async () => {
+ setIntroPath("A");
+ window.localStorage.setItem(CAPABILITY_CARDS_KEY, "user-1");
+ const urls = countIntroRequests();
+ const { result } = renderIntro();
+ await waitFor(() => expect(result.current.isVisible).toBe(true));
+ expect(result.current.isWelcomeOpen).toBe(false);
+ expect(window.sessionStorage.getItem(WELCOME_PENDING_KEY)).toBeNull();
+ expect(
+ window.sessionStorage.getItem("autogpt:onboarding-intro-path"),
+ ).toBeNull();
+ expect(capture).toHaveBeenCalledWith("intro_path", { path: "A" });
+ expect(urls).toHaveLength(1);
+ });
+
it("drops a stale pending overlay for a user who already saw the cards", async () => {
window.sessionStorage.setItem(WELCOME_PENDING_KEY, "1");
window.localStorage.setItem(CAPABILITY_CARDS_KEY, "user-1");
@@ -467,11 +390,6 @@ describe("useOnboardingIntroCard — team selection belongs to the wizard", () =
it.each([false, true])(
"does not poll for a team after the greeting settles (done=%s)",
async (greetingDone) => {
- flags.current = {
- "onboarding-brain-dump": true,
- "onboarding-expert-team": true,
- "hire-experts": true,
- };
const requests = countIntroRequests({
...READY_INTRO,
greeting_done: greetingDone,
diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/OnboardingIntroCard/useOnboardingIntroCard.ts b/autogpt_platform/frontend/src/app/(platform)/copilot/components/OnboardingIntroCard/useOnboardingIntroCard.ts
index 2533e2e0c6..2a5263d10c 100644
--- a/autogpt_platform/frontend/src/app/(platform)/copilot/components/OnboardingIntroCard/useOnboardingIntroCard.ts
+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/components/OnboardingIntroCard/useOnboardingIntroCard.ts
@@ -1,11 +1,11 @@
import { useGetBrainDumpIntro } from "@/app/api/__generated__/endpoints/brain-dump/brain-dump";
import { useAuth } from "@/lib/auth/hooks/useAuth";
-import { Flag, useFlagStatus } from "@/services/feature-flags/use-get-flag";
import { trackBrainDump } from "@/services/onboarding/brain-dump-analytics";
import {
clearWelcomePending,
peekCapabilityCardsSeen,
peekGreetingDone,
+ peekIntroPath,
peekWelcomePending,
setCapabilityCardsSeen,
setGreetingDone,
@@ -29,11 +29,6 @@ const PENDING_GIVE_UP_MS = 120_000;
export function useOnboardingIntroCard() {
const { user } = useAuth();
const userId = user?.id ?? null;
- // The endpoint 404s with the flag off, so without this every copilot
- // visit for every user pays for a request that cannot succeed.
- const { enabled: isBrainDumpEnabled, ready: isFlagReady } = useFlagStatus(
- Flag.ONBOARDING_BRAIN_DUMP,
- );
// localStorage answers first so a returning user never flashes the
// greeting; only when it has no answer do we ask the server. The flag
// is keyed to the user id, so a fresh account on the same browser
@@ -45,7 +40,9 @@ export function useOnboardingIntroCard() {
// reveal animation must start on a page they are actually looking at.
// Seeded from sessionStorage so a refresh keeps the overlay up rather
// than skipping it.
- const [isWelcomeOpen, setIsWelcomeOpen] = useState(peekWelcomePending);
+ const [isWelcomeOpen, setIsWelcomeOpen] = useState(
+ () => peekWelcomePending() || Boolean(peekIntroPath()),
+ );
// The server render can't see localStorage or the intro answer, so it
// always emits the held hero; the first client frame must match it or
@@ -73,17 +70,6 @@ export function useOnboardingIntroCard() {
}, [isWelcomeOpen, userId]);
useEffect(() => {
- // The handoff keys are written by the wizard while the flag is on, so
- // they can outlive it: wait for LaunchDarkly, then either run the
- // handoff or drop it. Consuming it with the flag off would put the
- // overlay and its 404-ing polls in front of a rolled-back user.
- if (!isFlagReady) return;
- if (!isBrainDumpEnabled) {
- takeIntroPath();
- clearWelcomePending();
- setIsWelcomeOpen(false);
- return;
- }
const path = takeIntroPath();
if (!path) return;
if (path === "B") {
@@ -96,13 +82,15 @@ export function useOnboardingIntroCard() {
// consumed by the first real message afterwards.
setIntroAwaitingFollowup();
trackBrainDump("intro_path", { path });
- setWelcomePending();
- setIsWelcomeOpen(true);
- }, [isFlagReady, isBrainDumpEnabled]);
+ if (!peekCapabilityCardsSeen(userId)) {
+ setWelcomePending();
+ setIsWelcomeOpen(true);
+ }
+ }, []);
const { data, isError } = useGetBrainDumpIntro({
query: {
- enabled: Boolean(isBrainDumpEnabled) && !isDone && !isWelcomeOpen,
+ enabled: !isDone && !isWelcomeOpen,
staleTime: Infinity,
gcTime: Infinity,
refetchInterval: (query) => {
@@ -123,12 +111,8 @@ export function useOnboardingIntroCard() {
// subscribes, which flashed the regular hero + composer for a beat
// before the greeting page took over on refresh. A non-200 or a
// failed request counts as an answer so the composer is never held
- // hostage by an unavailable endpoint — and so does a flag we know is
- // off, since that query is disabled and will never answer at all. Wait
- // for LaunchDarkly to actually say so: treating "not answered yet" as
- // off is what flashes the composer before the greeting page arrives.
- const hasIntroAnswer =
- (isFlagReady && !isBrainDumpEnabled) || data !== undefined || isError;
+ // hostage by an unavailable endpoint.
+ const hasIntroAnswer = data !== undefined || isError;
const serverSaysDone = Boolean(intro?.greeting_done);
const isPendingPerServer = Boolean(
intro && !intro.greeting_done && intro.greeting_pending,
@@ -157,11 +141,6 @@ export function useOnboardingIntroCard() {
setIsWelcomeOpen(false);
}
- // Holding the composer is only ever right while this flow is in play:
- // the overlay is up (seeded synchronously from the handoff) or the flag
- // already reads on. Holding on "LaunchDarkly has not answered" alone
- // hid the composer on every flag-off /copilot load until it did.
- const isGreetingExpected = isWelcomeOpen || Boolean(isBrainDumpEnabled);
// `serverSaysDone` as well as `isDone`: the effect that caches the verdict
// runs after render, so a payload that still carries a greeting would
// otherwise flash the card for one paint before it takes effect.
@@ -184,12 +163,10 @@ export function useOnboardingIntroCard() {
// The pre-mount frame counts: the server render cannot know any of
// this, and letting the composer through on that one frame flashed it
// before the greeting page arrived. The loader fades in on a delay, so
- // a flag-off user never sees the orb it renders for that frame.
+ // the first frame does not flash the composer.
isAwaitingGreeting:
!isMounted ||
- (!isDone &&
- isGreetingExpected &&
- (isWelcomeOpen || !hasIntroAnswer || isPendingGeneration)),
+ (!isDone && (isWelcomeOpen || !hasIntroAnswer || isPendingGeneration)),
// Only the greeting itself reads top-down like a letter. The loader
// stays centered — that is the distance the orb travels when the
// greeting lands.
diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/OnboardingWelcomeDialog/OnboardingWelcomeDialog.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/components/OnboardingWelcomeDialog/OnboardingWelcomeDialog.tsx
index 59929ee364..6f0821af4d 100644
--- a/autogpt_platform/frontend/src/app/(platform)/copilot/components/OnboardingWelcomeDialog/OnboardingWelcomeDialog.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/components/OnboardingWelcomeDialog/OnboardingWelcomeDialog.tsx
@@ -5,14 +5,13 @@ import { Button } from "@/components/atoms/Button/Button";
import { GlassPixelBackdrop } from "@/components/atoms/GlassPixelBackdrop/GlassPixelBackdrop";
import { Icon } from "@/components/atoms/Icon/Icon";
import { Text } from "@/components/atoms/Text/Text";
+import { useMeasuredHeight } from "@/components/contextual/IntegrationsPanel/components/ConnectServiceDialog/useMeasuredHeight";
import { useToast } from "@/components/molecules/Toast/use-toast";
-import { Flag, useGetFlag } from "@/services/feature-flags/use-get-flag";
+import { isKey } from "@/lib/keyboard";
import { trackBrainDump } from "@/services/onboarding/brain-dump-analytics";
import {
ArrowLeft01Icon,
- BrainIcon,
ElectricPlugsIcon,
- GraduationCapIcon,
SparklesIcon,
Sun01Icon,
UserGroupIcon,
@@ -20,9 +19,7 @@ import {
import type { IconSvgElement } from "@hugeicons/react";
import { AnimatePresence, motion } from "framer-motion";
import { useEffect, useRef, useState } from "react";
-import { useMeasuredHeight } from "@/components/contextual/IntegrationsPanel/components/ConnectServiceDialog/useMeasuredHeight";
import { ConnectToolsPanel } from "./ConnectToolsPanel";
-import { isKey } from "@/lib/keyboard";
interface Props {
isOpen: boolean;
@@ -39,33 +36,6 @@ interface CapabilityCard {
cta?: { label: string };
}
-const CARDS: CapabilityCard[] = [
- {
- title: "Meet Otto.",
- body: "It does the work. Ask once, or put it on a schedule. It delivers while you do something else.",
- icon: SparklesIcon,
- },
- {
- title: "It works inside your tools.",
- body: "Slack, Gmail, Notion, GitHub and 40+ more. 500+ blocks under the hood.",
- icon: ElectricPlugsIcon,
- cta: { label: "Connect your tools" },
- },
- {
- title: "It learns how you operate.",
- body: "Teach it Skills, like an employee handbook. It keeps its own files, so it never starts from scratch.",
- icon: GraduationCapIcon,
- },
- {
- title: "It remembers everything.",
- body: "Memory beyond any human brain. It even dreams.",
- icon: BrainIcon,
- },
-];
-
-// With the team feature on the deck stops being about Otto's own
-// abilities: Otto is the Head of AI, and what the user is about to
-// meet on the greeting page is a team.
const TEAM_CARDS: CapabilityCard[] = [
{
title: "Meet your Head of AI.",
@@ -114,12 +84,9 @@ export function OnboardingWelcomeDialog({ isOpen, onClose }: Props) {
}),
},
});
- // Child of HIRE_EXPERTS: without hiring there is no team to promise.
- const isExpertTeamFlagOn = useGetFlag(Flag.ONBOARDING_EXPERT_TEAM);
- const isHireExpertsFlagOn = useGetFlag(Flag.HIRE_EXPERTS);
- const isTeamEnabled = Boolean(isExpertTeamFlagOn && isHireExpertsFlagOn);
- const deck = isTeamEnabled ? "team" : "autopilot";
- const cards = isTeamEnabled ? TEAM_CARDS : CARDS;
+
+ const deck = "team";
+ const cards = TEAM_CARDS;
const card = cards[cardIndex];
const isLastCard = cardIndex === cards.length - 1;
@@ -304,11 +271,7 @@ export function OnboardingWelcomeDialog({ isOpen, onClose }: Props) {
size="xs"
onClick={handleNext}
>
- {!isLastCard
- ? "Next"
- : isTeamEnabled
- ? "Meet your team"
- : "Meet Otto"}
+ {!isLastCard ? "Next" : "Meet your team"}
</Button>
</div>
</div>
diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/OnboardingWelcomeDialog/__tests__/connect-flow.test.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/components/OnboardingWelcomeDialog/__tests__/connect-flow.test.tsx
index cc9d8f828e..96797985e8 100644
--- a/autogpt_platform/frontend/src/app/(platform)/copilot/components/OnboardingWelcomeDialog/__tests__/connect-flow.test.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/components/OnboardingWelcomeDialog/__tests__/connect-flow.test.tsx
@@ -24,7 +24,7 @@ vi.mock("@/services/feature-flags/use-get-flag", async (importOriginal) => {
>();
return {
...actual,
- useGetFlag: (flag: string) => flag === actual.Flag.ONBOARDING_BRAIN_DUMP,
+ useGetFlag: () => false,
};
});
diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/OnboardingWelcomeDialog/__tests__/recommended-providers-flag-off.test.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/components/OnboardingWelcomeDialog/__tests__/recommended-providers-empty.test.tsx
similarity index 68%
rename from autogpt_platform/frontend/src/app/(platform)/copilot/components/OnboardingWelcomeDialog/__tests__/recommended-providers-flag-off.test.tsx
rename to autogpt_platform/frontend/src/app/(platform)/copilot/components/OnboardingWelcomeDialog/__tests__/recommended-providers-empty.test.tsx
index 3c45645164..95e114f670 100644
--- a/autogpt_platform/frontend/src/app/(platform)/copilot/components/OnboardingWelcomeDialog/__tests__/recommended-providers-flag-off.test.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/components/OnboardingWelcomeDialog/__tests__/recommended-providers-empty.test.tsx
@@ -3,17 +3,6 @@ import { render, screen } from "@/tests/integrations/test-utils";
import { http, HttpResponse } from "msw";
import { describe, expect, it, vi } from "vitest";
-// With the flag off the recommendation endpoint 404s and is never called,
-// so nothing will ever settle the section on its own — the panel has to
-// treat "flag off" as an answer or it shows an empty list forever.
-vi.mock("@/services/feature-flags/use-get-flag", async (importOriginal) => {
- const actual =
- await importOriginal<
- typeof import("@/services/feature-flags/use-get-flag")
- >();
- return { ...actual, useGetFlag: () => false };
-});
-
import { ConnectToolsPanel } from "../ConnectToolsPanel";
const PROVIDERS_URL =
@@ -23,8 +12,8 @@ const CREDENTIALS_URL =
const RECOMMENDED_URL =
"http://localhost:3000/api/proxy/api/onboarding/brain-dump/recommended-providers";
-describe("ConnectToolsPanel — brain dump flag off", () => {
- it("shows the popular providers without asking for recommendations", async () => {
+describe("ConnectToolsPanel — empty recommendations", () => {
+ it("shows popular providers after recommendations return empty", async () => {
let recommendationRequests = 0;
server.use(
http.get(PROVIDERS_URL, () =>
@@ -52,6 +41,6 @@ describe("ConnectToolsPanel — brain dump flag off", () => {
expect(await screen.findByText("Popular places to start")).toBeDefined();
expect(screen.getByRole("button", { name: /Notion/ })).toBeDefined();
- expect(recommendationRequests).toBe(0);
+ expect(recommendationRequests).toBe(1);
});
});
diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/OnboardingWelcomeDialog/__tests__/recommended-providers.test.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/components/OnboardingWelcomeDialog/__tests__/recommended-providers.test.tsx
index 58e6c8d8b2..f39490e2b2 100644
--- a/autogpt_platform/frontend/src/app/(platform)/copilot/components/OnboardingWelcomeDialog/__tests__/recommended-providers.test.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/components/OnboardingWelcomeDialog/__tests__/recommended-providers.test.tsx
@@ -12,7 +12,7 @@ vi.mock("@/services/feature-flags/use-get-flag", async (importOriginal) => {
>();
return {
...actual,
- useGetFlag: (flag: string) => flag === actual.Flag.ONBOARDING_BRAIN_DUMP,
+ useGetFlag: () => false,
};
});
diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/OnboardingWelcomeDialog/__tests__/useConnectToolsPanel.test.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/components/OnboardingWelcomeDialog/__tests__/useConnectToolsPanel.test.tsx
index 461b7107dd..a358af8766 100644
--- a/autogpt_platform/frontend/src/app/(platform)/copilot/components/OnboardingWelcomeDialog/__tests__/useConnectToolsPanel.test.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/components/OnboardingWelcomeDialog/__tests__/useConnectToolsPanel.test.tsx
@@ -14,7 +14,7 @@ vi.mock("@/services/feature-flags/use-get-flag", async (importOriginal) => {
>();
return {
...actual,
- useGetFlag: (flag: string) => flag === actual.Flag.ONBOARDING_BRAIN_DUMP,
+ useGetFlag: () => false,
};
});
diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/OnboardingWelcomeDialog/__tests__/welcome-dialog.test.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/components/OnboardingWelcomeDialog/__tests__/welcome-dialog.test.tsx
index 525659a77b..8a68b913de 100644
--- a/autogpt_platform/frontend/src/app/(platform)/copilot/components/OnboardingWelcomeDialog/__tests__/welcome-dialog.test.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/components/OnboardingWelcomeDialog/__tests__/welcome-dialog.test.tsx
@@ -9,20 +9,6 @@ vi.mock("posthog-js", () => ({
default: { capture: (...a: unknown[]) => capture(...a) },
}));
-// All off by default, so every existing assertion keeps describing the
-// flag-off deck; the team tests below turn both flags on.
-const flags = vi.hoisted(() => ({ current: {} as Record<string, boolean> }));
-vi.mock("@/services/feature-flags/use-get-flag", async (importActual) => {
- const actual =
- await importActual<
- typeof import("@/services/feature-flags/use-get-flag")
- >();
- return {
- ...actual,
- useGetFlag: (flag: string) => flags.current[flag] ?? false,
- };
-});
-
const toastSpy = vi.fn();
vi.mock("@/components/molecules/Toast/use-toast", () => ({
toast: (...args: unknown[]) => toastSpy(...args),
@@ -81,7 +67,6 @@ async function advanceToCard(index: number) {
beforeEach(() => {
capture.mockClear();
toastSpy.mockClear();
- flags.current = {};
});
describe("OnboardingWelcomeDialog — deck", () => {
@@ -91,10 +76,10 @@ describe("OnboardingWelcomeDialog — deck", () => {
expect(
(await screen.findByRole("dialog", { name: "Welcome to AutoGPT" }))
.textContent,
- ).toContain("Meet Otto.");
+ ).toContain("Meet your Head of AI.");
expect(
screen.getByText(
- "It does the work. Ask once, or put it on a schedule. It delivers while you do something else.",
+ "Otto is yours alone — never shared. It listens, diagnoses, and builds the team that does the work.",
),
).toBeDefined();
expect(screen.getByRole("button", { name: "Next" })).toBeDefined();
@@ -104,19 +89,21 @@ describe("OnboardingWelcomeDialog — deck", () => {
it("walks forward and back through the deck", async () => {
render(<OnboardingWelcomeDialog isOpen onClose={vi.fn()} />);
- const user = await advanceToCard(1);
+ const user = await advanceToCard(2);
expect(
await screen.findByText("It works inside your tools."),
).toBeDefined();
expect(capture).toHaveBeenCalledWith("capability_card_viewed", {
- card_index: 1,
- deck: "autopilot",
+ card_index: 2,
+ deck: "team",
});
await user.click(screen.getByRole("button", { name: "Previous card" }));
- expect(await screen.findByText("Meet Otto.")).toBeDefined();
+ expect(
+ await screen.findByText("Hire an expert, or create your own."),
+ ).toBeDefined();
});
it("renders nothing and completes no step while closed", async () => {
@@ -125,7 +112,7 @@ describe("OnboardingWelcomeDialog — deck", () => {
render(<OnboardingWelcomeDialog isOpen={false} onClose={vi.fn()} />);
expect(screen.queryByRole("dialog")).toBeNull();
- expect(screen.queryByText("Meet Otto.")).toBeNull();
+ expect(screen.queryByText("Meet your Head of AI.")).toBeNull();
expect(steps).toEqual([]);
});
});
@@ -138,14 +125,14 @@ describe("OnboardingWelcomeDialog — completion", () => {
render(<OnboardingWelcomeDialog isOpen onClose={onClose} />);
const user = await advanceToCard(3);
- expect(await screen.findByText("It remembers everything.")).toBeDefined();
- await user.click(screen.getByRole("button", { name: "Meet Otto" }));
+ expect(await screen.findByText("Every morning, a briefing.")).toBeDefined();
+ await user.click(screen.getByRole("button", { name: "Meet your team" }));
expect(onClose).toHaveBeenCalledTimes(1);
await waitFor(() => expect(steps).toEqual(["CAPABILITY_CARDS"]));
expect(capture).toHaveBeenCalledWith("capability_cards_completed", {
card_index: 3,
- deck: "autopilot",
+ deck: "team",
});
});
@@ -154,7 +141,7 @@ describe("OnboardingWelcomeDialog — completion", () => {
const onClose = vi.fn();
render(<OnboardingWelcomeDialog isOpen onClose={onClose} />);
- const user = await advanceToCard(1);
+ const user = await advanceToCard(2);
await screen.findByText("It works inside your tools.");
await user.click(screen.getByRole("button", { name: "Skip" }));
@@ -162,8 +149,8 @@ describe("OnboardingWelcomeDialog — completion", () => {
expect(onClose).toHaveBeenCalledTimes(1);
await waitFor(() => expect(steps).toEqual(["CAPABILITY_CARDS"]));
expect(capture).toHaveBeenCalledWith("capability_cards_skipped", {
- card_index: 1,
- deck: "autopilot",
+ card_index: 2,
+ deck: "team",
});
});
@@ -172,7 +159,7 @@ describe("OnboardingWelcomeDialog — completion", () => {
const onClose = vi.fn();
render(<OnboardingWelcomeDialog isOpen onClose={onClose} />);
- await screen.findByText("Meet Otto.");
+ await screen.findByText("Meet your Head of AI.");
await userEvent.keyboard("{Escape}");
@@ -180,7 +167,7 @@ describe("OnboardingWelcomeDialog — completion", () => {
await waitFor(() => expect(steps).toEqual(["CAPABILITY_CARDS"]));
expect(capture).toHaveBeenCalledWith("capability_cards_skipped", {
card_index: 0,
- deck: "autopilot",
+ deck: "team",
});
});
@@ -188,7 +175,7 @@ describe("OnboardingWelcomeDialog — completion", () => {
recordCompletedSteps(500);
render(<OnboardingWelcomeDialog isOpen onClose={vi.fn()} />);
- await screen.findByText("Meet Otto.");
+ await screen.findByText("Meet your Head of AI.");
await userEvent.click(screen.getByRole("button", { name: "Skip" }));
@@ -209,7 +196,7 @@ describe("OnboardingWelcomeDialog — connect tools CTA", () => {
const onClose = vi.fn();
render(<OnboardingWelcomeDialog isOpen onClose={onClose} />);
- const user = await advanceToCard(1);
+ const user = await advanceToCard(2);
await screen.findByText("It works inside your tools.");
await user.click(
@@ -237,7 +224,7 @@ describe("OnboardingWelcomeDialog — connect tools CTA", () => {
const onClose = vi.fn();
render(<OnboardingWelcomeDialog isOpen onClose={onClose} />);
- const user = await advanceToCard(1);
+ const user = await advanceToCard(2);
await user.click(
screen.getByRole("button", { name: "Connect your tools" }),
);
@@ -266,7 +253,7 @@ describe("OnboardingWelcomeDialog — connect tools CTA", () => {
stubConnectPanelEndpoints();
render(<OnboardingWelcomeDialog isOpen onClose={vi.fn()} />);
- const user = await advanceToCard(1);
+ const user = await advanceToCard(2);
await screen.findByText("It works inside your tools.");
await user.click(
screen.getByRole("button", { name: "Connect your tools" }),
@@ -275,17 +262,12 @@ describe("OnboardingWelcomeDialog — connect tools CTA", () => {
await user.click(screen.getByRole("button", { name: "Next" }));
- expect(await screen.findByText("It learns how you operate.")).toBeDefined();
+ expect(await screen.findByText("Every morning, a briefing.")).toBeDefined();
});
});
describe("OnboardingWelcomeDialog — the team deck", () => {
- beforeEach(() => {
- flags.current = {
- "onboarding-expert-team": true,
- "hire-experts": true,
- };
- });
+ beforeEach(() => {});
it("frames Otto as the Head of AI that builds a team", async () => {
render(<OnboardingWelcomeDialog isOpen onClose={vi.fn()} />);
@@ -319,35 +301,11 @@ describe("OnboardingWelcomeDialog — the team deck", () => {
).toBeDefined();
expect(screen.queryByText("It remembers everything.")).toBeNull();
});
-
- it("keeps the old deck when only the team flag is on", async () => {
- flags.current = { "onboarding-expert-team": true };
-
- render(<OnboardingWelcomeDialog isOpen onClose={vi.fn()} />);
-
- expect(await screen.findByText("Meet Otto.")).toBeDefined();
- });
-});
-
-it("keeps the last card valid when team flags change in either direction", async () => {
- flags.current = { "onboarding-expert-team": true, "hire-experts": true };
- const { rerender } = render(
- <OnboardingWelcomeDialog isOpen onClose={vi.fn()} />,
- );
- await advanceToCard(3);
- expect(await screen.findByText("Every morning, a briefing.")).toBeDefined();
- flags.current = {};
- rerender(<OnboardingWelcomeDialog isOpen onClose={vi.fn()} />);
- expect(await screen.findByText("It remembers everything.")).toBeDefined();
- flags.current = { "onboarding-expert-team": true, "hire-experts": true };
- rerender(<OnboardingWelcomeDialog isOpen onClose={vi.fn()} />);
- expect(await screen.findByText("Every morning, a briefing.")).toBeDefined();
});
it.each(["completed", "skipped"] as const)(
"identifies the team deck in view and %s events",
async (outcome) => {
- flags.current = { "onboarding-expert-team": true, "hire-experts": true };
recordCompletedSteps();
render(<OnboardingWelcomeDialog isOpen onClose={vi.fn()} />);
const user = await advanceToCard(3);
diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/OnboardingWelcomeDialog/useConnectToolsPanel.ts b/autogpt_platform/frontend/src/app/(platform)/copilot/components/OnboardingWelcomeDialog/useConnectToolsPanel.ts
index 6f8c2b5a34..96353632dd 100644
--- a/autogpt_platform/frontend/src/app/(platform)/copilot/components/OnboardingWelcomeDialog/useConnectToolsPanel.ts
+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/components/OnboardingWelcomeDialog/useConnectToolsPanel.ts
@@ -15,7 +15,6 @@ import {
type ConnectableProvider,
} from "@/components/contextual/IntegrationsPanel/components/ConnectServiceDialog/helpers";
import { useDebouncedValue } from "@/hooks/useDebouncedValue";
-import { Flag, useGetFlag } from "@/services/feature-flags/use-get-flag";
import { useState } from "react";
import { fallbackProviders, firstMentionOfEachProvider } from "./helpers";
@@ -25,9 +24,6 @@ const POLL_INTERVAL_MS = 2_500;
const MAX_POLLS = 24;
export function useConnectToolsPanel() {
- // The endpoint 404s with the flag off, and a 404 never settles the poll
- // below on its own — so the request is not made at all.
- const isBrainDumpEnabled = useGetFlag(Flag.ONBOARDING_BRAIN_DUMP);
const [query, setQuery] = useState("");
const debouncedQuery = useDebouncedValue(query, 250);
const [selectedId, setSelectedId] = useState<string | null>(null);
@@ -53,7 +49,6 @@ export function useConnectToolsPanel() {
const recommendedQuery = useGetBrainDumpRecommendedProviders({
query: {
- enabled: Boolean(isBrainDumpEnabled),
refetchInterval: (q) => {
const response = q.state.data;
if (response && (response.status !== 200 || response.data.ready)) {
@@ -99,11 +94,10 @@ export function useConnectToolsPanel() {
.filter((provider) => provider !== null);
// Only fall back once the job has actually answered — `ready`, a status
- // it will not recover from, or the flag being off. Filling the section
+ // it will not recover from. Filling the section
// while it is still running would swap the generic picks out from under
// the user the moment the real ones land.
const isJobDone =
- !isBrainDumpEnabled ||
recommendedQuery.isError ||
(recommendedQuery.data !== undefined &&
(recommendedQuery.data.status !== 200 ||
diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/expertKickoff.ts b/autogpt_platform/frontend/src/app/(platform)/copilot/expertKickoff.ts
index d755f03696..dbc7e05b8d 100644
--- a/autogpt_platform/frontend/src/app/(platform)/copilot/expertKickoff.ts
+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/expertKickoff.ts
@@ -120,11 +120,10 @@ export function isKickoffMessage(message: UIMessage): boolean {
}
export function shouldClearKickoffParam(
- isExpertsEnabled: boolean,
hasExpertsSettled: boolean,
expertId: string | null,
): boolean {
- return !isExpertsEnabled || (hasExpertsSettled && expertId === null);
+ return hasExpertsSettled && expertId === null;
}
// The kickoff prompt is a control turn the client sends on the user's behalf.
diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/store.ts b/autogpt_platform/frontend/src/app/(platform)/copilot/store.ts
index 4c2a576e5c..2f09fa56f2 100644
--- a/autogpt_platform/frontend/src/app/(platform)/copilot/store.ts
+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/store.ts
@@ -222,9 +222,6 @@ interface CopilotUIState {
isSoundEnabled: boolean;
toggleSound: () => void;
- showNotificationDialog: boolean;
- setShowNotificationDialog: (show: boolean) => void;
-
// Artifact panel
artifactPanel: ArtifactPanelState;
// `persist: false` skips the localStorage write — used by the public
@@ -383,9 +380,6 @@ export const useCopilotUIStore = create<CopilotUIState>((set, get) => ({
return { isSoundEnabled: next };
}),
- showNotificationDialog: false,
- setShowNotificationDialog: (show) => set({ showNotificationDialog: show }),
-
// Artifact panel
artifactPanel: {
isOpen: getPersistedOpen(),
diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/useCopilotPage.ts b/autogpt_platform/frontend/src/app/(platform)/copilot/useCopilotPage.ts
index 0669c9f10a..20dbdbc32d 100644
--- a/autogpt_platform/frontend/src/app/(platform)/copilot/useCopilotPage.ts
+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/useCopilotPage.ts
@@ -1,13 +1,26 @@
+import { useCompleteBrainDumpGreeting } from "@/app/api/__generated__/endpoints/brain-dump/brain-dump";
import { toast } from "@/components/molecules/Toast/use-toast";
import { useStableCallback } from "@/hooks/useStableCallback";
import { useAuth } from "@/lib/auth/hooks/useAuth";
import { isValidUUID } from "@/lib/utils";
-import { Flag, useGetFlag } from "@/services/feature-flags/use-get-flag";
+import { trackBrainDump } from "@/services/onboarding/brain-dump-analytics";
+import {
+ peekGreetingDone,
+ setGreetingDone,
+ takeIntroAwaitingFollowup,
+} from "@/services/onboarding/brain-dump-handoff";
import type { UIMessage } from "ai";
import { parseAsString, useQueryState } from "nuqs";
import { useEffect, useMemo, useRef, useState } from "react";
+import { useCopilotStreamStore } from "./copilotStreamStore";
+import {
+ buildKickoffMessage,
+ getKickoffAttemptToken,
+ isKickoffMessage,
+ shouldClearKickoffParam,
+ type ExpertKickoffMetadata,
+} from "./expertKickoff";
import { concatWithAssistantMerge } from "./helpers/convertChatSessionToUiMessages";
-import type { WorkspaceAttachment } from "./helpers/workspaceAttachments";
import {
forgetHeldFollowUp,
rememberHeldFollowUp,
@@ -15,34 +28,20 @@ import {
} from "./helpers/heldFollowUps";
import { queueFollowUpMessage } from "./helpers/queueFollowUpMessage";
import { stripReplayPrefix } from "./helpers/stripReplayPrefix";
-import { useCopilotStreamStore } from "./copilotStreamStore";
-import { useCopilotPendingChips } from "./useCopilotPendingChips";
+import type { WorkspaceAttachment } from "./helpers/workspaceAttachments";
import { useCopilotUIStore } from "./store";
import { useChatSession } from "./useChatSession";
-import {
- buildKickoffMessage,
- getKickoffAttemptToken,
- isKickoffMessage,
- shouldClearKickoffParam,
- type ExpertKickoffMetadata,
-} from "./expertKickoff";
-import { useExpertKickoff } from "./useExpertKickoff";
import { useCopilotNotifications } from "./useCopilotNotifications";
+import { useCopilotPendingChips } from "./useCopilotPendingChips";
import { useCopilotRuntimeStream } from "./useCopilotRuntimeStream";
import { useCopilotStream } from "./useCopilotStream";
+import { useExpertKickoff } from "./useExpertKickoff";
import { resolveExpertIdentity, useExpertMap } from "./useExpertMap";
import { useLoadMoreMessages } from "./useLoadMoreMessages";
import { recoverFailedDeferredSend, useSendMessage } from "./useSendMessage";
-import { useSettleGate } from "./useSettleGate";
import { useSessionTitlePoll } from "./useSessionTitlePoll";
+import { useSettleGate } from "./useSettleGate";
import { useWorkflowImportAutoSubmit } from "./useWorkflowImportAutoSubmit";
-import { useCompleteBrainDumpGreeting } from "@/app/api/__generated__/endpoints/brain-dump/brain-dump";
-import { trackBrainDump } from "@/services/onboarding/brain-dump-analytics";
-import {
- peekGreetingDone,
- setGreetingDone,
- takeIntroAwaitingFollowup,
-} from "@/services/onboarding/brain-dump-handoff";
function trimVisibleMessagesForActiveRestore(messages: UIMessage[]) {
const lastUserIndex = messages.findLastIndex(
@@ -73,11 +72,10 @@ export function useCopilotPage({
isStreamRuntime = false,
}: { isStreamRuntime?: boolean } = {}) {
const { user, isUserLoading, isLoggedIn } = useAuth();
- const isExpertsEnabled = useGetFlag(Flag.HIRE_EXPERTS);
- const isBrainDumpEnabled = useGetFlag(Flag.ONBOARDING_BRAIN_DUMP);
+
const [expertIdParam] = useQueryState("expertId", parseAsString);
const [newThreadParam] = useQueryState("new", parseAsString);
- const expertId = isExpertsEnabled ? expertIdParam : null;
+ const expertId = expertIdParam;
const [kickoffParam, setKickoffParam] = useQueryState(
"kickoff",
parseAsString,
@@ -98,33 +96,17 @@ export function useCopilotPage({
? expertsById.get(validExpertIdParam)
: undefined;
const kickoffExpertId =
- isExpertsEnabled && hasExpertsSettled && kickoffExpert?.isArchived === false
+ hasExpertsSettled && kickoffExpert?.isArchived === false
? kickoffExpert.id
: null;
const isKickoffResolving =
- isExpertsEnabled &&
- kickoffParam === "1" &&
- validExpertIdParam !== null &&
- isLoadingExperts;
+ kickoffParam === "1" && validExpertIdParam !== null && isLoadingExperts;
useEffect(() => {
if (kickoffParam !== "1") return;
- if (
- !shouldClearKickoffParam(
- isExpertsEnabled,
- hasExpertsSettled,
- kickoffExpertId,
- )
- )
- return;
+ if (!shouldClearKickoffParam(hasExpertsSettled, kickoffExpertId)) return;
void setKickoffParam(null, { history: "replace" });
- }, [
- hasExpertsSettled,
- isExpertsEnabled,
- kickoffExpertId,
- kickoffParam,
- setKickoffParam,
- ]);
+ }, [hasExpertsSettled, kickoffExpertId, kickoffParam, setKickoffParam]);
const copilotLlmModel = useCopilotUIStore((s) => s.copilotLlmModel);
const isDryRun = useCopilotUIStore((s) => s.isDryRun);
@@ -177,7 +159,7 @@ export function useCopilotPage({
[activeExpertId, expertsById, hasExpertsErrored, hasExpertsSettled],
);
const isResolvingExpertIdentity = Boolean(
- isExpertsEnabled && activeExpertId && !hasExpertsSettled,
+ activeExpertId && !hasExpertsSettled,
);
const isExpertSendLocked =
isResolvingExpertIdentity || Boolean(expertIdentity?.isArchived);
@@ -385,10 +367,7 @@ export function useCopilotPage({
// Sending anything retires the greeting for good: flag it done on
// the server (kept in the DB, just never shown again) and cache the
// fact locally so no future visit even has to ask.
- // Gated on the flag: the endpoint 404s without it, and because the
- // local cache is only written on success, an ungated call retried on
- // every single message the user ever sent.
- if (isBrainDumpEnabled && !peekGreetingDone(user?.id)) {
+ if (!peekGreetingDone(user?.id)) {
completeGreeting(undefined, {
onSuccess: () => setGreetingDone(user?.id),
// Retiring the greeting is bookkeeping — the worst case is
@@ -477,7 +456,7 @@ export function useCopilotPage({
const { isKickoffStarting } = useExpertKickoff({
userId: user?.id ?? null,
expertId: kickoffExpertId,
- kickoff: isExpertsEnabled && kickoffParam === "1",
+ kickoff: kickoffParam === "1",
sessionId,
sessionExpertId,
hasPersistedExpertHistory:
diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/useExpertKickoff.ts b/autogpt_platform/frontend/src/app/(platform)/copilot/useExpertKickoff.ts
index ee22ae18d1..7dad5b4a60 100644
--- a/autogpt_platform/frontend/src/app/(platform)/copilot/useExpertKickoff.ts
+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/useExpertKickoff.ts
@@ -2,15 +2,14 @@ import {
useGetV2ListChatTransports,
useGetV2ListSessions,
} from "@/app/api/__generated__/endpoints/chat/chat";
-import { Flag, useGetFlag } from "@/services/feature-flags/use-get-flag";
import { useEffect, useRef, useState } from "react";
import {
clearKickoffPending,
getKickoffStatus,
markKickoffDone,
markKickoffPending,
- type KickoffAttemptToken,
withKickoffLock,
+ type KickoffAttemptToken,
} from "./expertKickoff";
import { latestExpertSessionParams } from "./expertSessionQuery";
@@ -44,7 +43,6 @@ export function useExpertKickoff({
onKickoff,
onSettled,
}: Args) {
- const isExpertsEnabled = useGetFlag(Flag.HIRE_EXPERTS);
const firedRef = useRef(false);
const settledRef = useRef(false);
const attemptTokenRef = useRef<KickoffAttemptToken | null>(null);
@@ -52,7 +50,7 @@ export function useExpertKickoff({
userId: string;
expertId: string;
} | null>(null);
- const isArmed = isExpertsEnabled && kickoff && !!userId && !!expertId;
+ const isArmed = kickoff && !!userId && !!expertId;
const wantsSession = isArmed && !sessionId && !!expertId;
const wantsCreatePath =
wantsSession &&
@@ -207,7 +205,6 @@ export function useExpertKickoff({
return {
isKickoffStarting:
- isExpertsEnabled &&
kickoff &&
!!userId &&
!!expertId &&
diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/useExpertMap.ts b/autogpt_platform/frontend/src/app/(platform)/copilot/useExpertMap.ts
index cb3bee71fa..2a6c295bd9 100644
--- a/autogpt_platform/frontend/src/app/(platform)/copilot/useExpertMap.ts
+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/useExpertMap.ts
@@ -1,5 +1,4 @@
import { useListExpertIdentities } from "@/app/api/__generated__/endpoints/experts/experts";
-import { Flag, useGetFlag } from "@/services/feature-flags/use-get-flag";
import { useMemo } from "react";
import type { AutopilotMode } from "./autopilotModeStore";
@@ -75,10 +74,8 @@ export function resolveExpertIdentity(
* separate `activeExperts` projection instead of iterating this map.
*/
export function useExpertMap() {
- const isExpertsEnabled = useGetFlag(Flag.HIRE_EXPERTS);
const expertsQuery = useListExpertIdentities({
query: {
- enabled: isExpertsEnabled,
select: (response) =>
response.status === 200 ? response.data : undefined,
},
@@ -114,11 +111,10 @@ export function useExpertMap() {
};
}, [expertsQuery.data]);
- const canAddressExperts = isExpertsEnabled && !expertsQuery.isError;
+ const canAddressExperts = !expertsQuery.isError;
return {
- isExpertsEnabled,
- expertsById: isExpertsEnabled ? expertCollections.expertsById : EMPTY_MAP,
+ expertsById: expertCollections.expertsById,
activeExperts: canAddressExperts
? expertCollections.activeExperts
: EMPTY_EXPERTS,
@@ -127,15 +123,11 @@ export function useExpertMap() {
activeExpertIds: canAddressExperts
? expertCollections.activeExpertIds
: EMPTY_IDS,
- // A disabled query reports `isPending` forever, so all flags stay gated
- // on the feature flag to remain honest when experts are off.
- isLoadingExperts: isExpertsEnabled && expertsQuery.isFetching,
- hasExpertsErrored:
- isExpertsEnabled && expertsQuery.isError && !expertsQuery.isFetching,
+ isLoadingExperts: expertsQuery.isFetching,
+ hasExpertsErrored: expertsQuery.isError && !expertsQuery.isFetching,
// Settled = success OR error. resolveExpertIdentity keys off this so an
// errored roster fetch fails closed (read-only) instead of open.
hasExpertsSettled:
- isExpertsEnabled &&
!expertsQuery.isFetching &&
(expertsQuery.isSuccess || expertsQuery.isError),
};
diff --git a/autogpt_platform/frontend/src/app/(platform)/dev/brain-dump-debug/__tests__/finalize.test.tsx b/autogpt_platform/frontend/src/app/(platform)/dev/brain-dump-debug/__tests__/finalize.test.tsx
index 04a505b11c..4da430e7bf 100644
--- a/autogpt_platform/frontend/src/app/(platform)/dev/brain-dump-debug/__tests__/finalize.test.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/dev/brain-dump-debug/__tests__/finalize.test.tsx
@@ -21,11 +21,10 @@ interface FakeMeta {
finalized: boolean;
}
-const { store, flagStatus } = vi.hoisted(() => ({
+const { store } = vi.hoisted(() => ({
store: {
meta: null as FakeMeta | null,
},
- flagStatus: { enabled: true, ready: true },
}));
vi.mock(
@@ -37,20 +36,6 @@ vi.mock(
}),
);
-vi.mock("@/services/feature-flags/use-get-flag", async (importOriginal) => {
- const actual =
- await importOriginal<
- typeof import("@/services/feature-flags/use-get-flag")
- >();
- return {
- ...actual,
- useFlagStatus: (flag: string) =>
- flag === "onboarding-brain-dump"
- ? flagStatus
- : actual.useFlagStatus(flag as never),
- };
-});
-
vi.mock("next/navigation", () => ({
useRouter: () => ({
push: vi.fn(),
@@ -149,7 +134,7 @@ describe("server status panel", () => {
const status = panel("Server status");
expect(
- await status.findByText(/the endpoint 404s when ONBOARDING_BRAIN_DUMP/),
+ await status.findByText(/check that you are signed in and the backend/),
).toBeDefined();
});
diff --git a/autogpt_platform/frontend/src/app/(platform)/dev/brain-dump-debug/__tests__/main.test.tsx b/autogpt_platform/frontend/src/app/(platform)/dev/brain-dump-debug/__tests__/main.test.tsx
index 001e4b9b50..ddaaec5f7a 100644
--- a/autogpt_platform/frontend/src/app/(platform)/dev/brain-dump-debug/__tests__/main.test.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/dev/brain-dump-debug/__tests__/main.test.tsx
@@ -22,13 +22,12 @@ interface FakePart {
// happy-dom has no IndexedDB, so the recording store is an in-memory
// double. Everything above it — the snapshot hook, the panels — is real.
-const { store, flagStatus } = vi.hoisted(() => ({
+const { store } = vi.hoisted(() => ({
store: {
available: true,
meta: null as FakeMeta | null,
parts: [] as FakePart[],
},
- flagStatus: { enabled: true as boolean, ready: true },
}));
vi.mock(
@@ -41,20 +40,6 @@ vi.mock(
}),
);
-vi.mock("@/services/feature-flags/use-get-flag", async (importOriginal) => {
- const actual =
- await importOriginal<
- typeof import("@/services/feature-flags/use-get-flag")
- >();
- return {
- ...actual,
- useFlagStatus: (flag: string) =>
- flag === "onboarding-brain-dump"
- ? flagStatus
- : actual.useFlagStatus(flag as never),
- };
-});
-
const notFoundMock = vi.hoisted(() => vi.fn());
vi.mock("next/navigation", () => ({
useRouter: () => ({
@@ -98,8 +83,6 @@ beforeEach(() => {
store.available = true;
store.meta = null;
store.parts = [];
- flagStatus.enabled = true;
- flagStatus.ready = true;
notFoundMock.mockClear();
window.sessionStorage.clear();
server.use(
@@ -115,7 +98,7 @@ afterEach(() => {
});
describe("brain dump debug page — gating", () => {
- it("404s in production even with the flag on", () => {
+ it("404s in production", () => {
vi.stubEnv("NEXT_PUBLIC_APP_ENV", "prod");
renderPage();
@@ -125,33 +108,13 @@ describe("brain dump debug page — gating", () => {
expect(statusCalls).toBe(0);
});
- it("404s when the onboarding-brain-dump flag is off", () => {
- flagStatus.enabled = false;
-
+ it("opens the debug tools outside production without a rollout flag", async () => {
renderPage();
-
- expect(notFoundMock).toHaveBeenCalled();
- expect(screen.queryByText("Brain dump debug")).toBeNull();
- expect(statusCalls).toBe(0);
- });
-
- it("waits with skeletons instead of 404ing while the flag is unresolved", async () => {
- // Short-circuiting to notFound() before LaunchDarkly answers would 404
- // users who actually have the flag on.
- flagStatus.ready = false;
- flagStatus.enabled = false;
-
- const { container } = render(<BrainDumpDebugPage />);
-
+ expect(await screen.findByText("Brain dump debug")).toBeDefined();
expect(notFoundMock).not.toHaveBeenCalled();
- expect(container.querySelectorAll(".animate-pulse")).toHaveLength(3);
- expect(screen.queryByText("Brain dump debug")).toBeNull();
- // The status query stays disabled until the page is known to be
- // available, so nothing is polled while the flag is in flight.
- expect(statusCalls).toBe(0);
});
- it("renders every panel once the flag resolves on outside production", async () => {
+ it("renders every panel outside production", async () => {
renderPage();
expect(await screen.findByText("Brain dump debug")).toBeDefined();
diff --git a/autogpt_platform/frontend/src/app/(platform)/dev/brain-dump-debug/components/ServerStatusPanel.tsx b/autogpt_platform/frontend/src/app/(platform)/dev/brain-dump-debug/components/ServerStatusPanel.tsx
index ec63c5b045..79c060fe5f 100644
--- a/autogpt_platform/frontend/src/app/(platform)/dev/brain-dump-debug/components/ServerStatusPanel.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/dev/brain-dump-debug/components/ServerStatusPanel.tsx
@@ -54,8 +54,8 @@ export function ServerStatusPanel({
>
{isError ? (
<DebugNote>
- Status request failed — the endpoint 404s when ONBOARDING_BRAIN_DUMP
- is off for this user, and 401s when signed out.
+ Status request failed — check that you are signed in and the backend
+ is available.
</DebugNote>
) : null}
{isLoading && !dump ? <DebugNote>Loading status…</DebugNote> : null}
diff --git a/autogpt_platform/frontend/src/app/(platform)/dev/brain-dump-debug/page.tsx b/autogpt_platform/frontend/src/app/(platform)/dev/brain-dump-debug/page.tsx
index d089470dc7..29c9209366 100644
--- a/autogpt_platform/frontend/src/app/(platform)/dev/brain-dump-debug/page.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/dev/brain-dump-debug/page.tsx
@@ -1,9 +1,7 @@
"use client";
import { Badge } from "@/components/atoms/Badge/Badge";
-import { Skeleton } from "@/components/atoms/Skeleton/Skeleton";
import { Text } from "@/components/atoms/Text/Text";
-import { Flag, useFlagStatus } from "@/services/feature-flags/use-get-flag";
import { notFound } from "next/navigation";
import { RecordingStatePanel } from "./components/RecordingStatePanel";
import { ServerStatusPanel } from "./components/ServerStatusPanel";
@@ -17,25 +15,13 @@ const MAIN_CLASS = "container flex min-h-screen flex-col gap-6 pb-20 pt-16";
export default function BrainDumpDebugPage() {
const isProduction = isProductionEnvironment();
- const { enabled, ready } = useFlagStatus(Flag.ONBOARDING_BRAIN_DUMP);
- const isAvailable = !isProduction && ready && Boolean(enabled);
+
+ const isAvailable = !isProduction;
const { snapshot, refreshSnapshot, timeline, finalize, introPath, stages } =
useBrainDumpDebugPage({ enabled: isAvailable });
if (isProduction) notFound();
- if (!ready) {
- return (
- <main className={MAIN_CLASS}>
- {[0, 1, 2].map((index) => (
- <Skeleton key={index} className="h-48 w-full rounded-2xlarge" />
- ))}
- </main>
- );
- }
-
- if (!enabled) notFound();
-
return (
<main className={MAIN_CLASS}>
<header className="flex flex-col gap-2">
@@ -49,7 +35,7 @@ export default function BrainDumpDebugPage() {
<Text variant="body" className="max-w-prose text-zinc-600">
Local recording state, the upload queue, the server pipeline and the
processing budget for the onboarding brain dump. Not reachable in
- production and gated on the onboarding-brain-dump flag.
+ production.
</Text>
</header>
diff --git a/autogpt_platform/frontend/src/app/(platform)/home/__tests__/attention-refresh.test.tsx b/autogpt_platform/frontend/src/app/(platform)/home/__tests__/attention-refresh.test.tsx
index 935851e6f0..e91bae18ff 100644
--- a/autogpt_platform/frontend/src/app/(platform)/home/__tests__/attention-refresh.test.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/home/__tests__/attention-refresh.test.tsx
@@ -21,7 +21,7 @@ vi.mock("@/services/feature-flags/use-get-flag", async (importActual) => {
return {
...actual,
useFlagStatus: () => ({ enabled: true, ready: true }),
- useGetFlag: (flag: string) => flag === actual.Flag.HIRE_EXPERTS,
+ useGetFlag: () => false,
};
});
@@ -68,7 +68,7 @@ function renderPage(page: "home" | "expert", client: QueryClient) {
{page === "home" ? (
<HomeRecap />
) : (
- <ExpertNeedsYouSection expert={{ id: ada.id } as Expert} enabled />
+ <ExpertNeedsYouSection expert={{ id: ada.id } as Expert} />
)}
</QueryClientProvider>,
);
diff --git a/autogpt_platform/frontend/src/app/(platform)/home/__tests__/main.test.tsx b/autogpt_platform/frontend/src/app/(platform)/home/__tests__/main.test.tsx
index 9de81443c1..aaeef996f3 100644
--- a/autogpt_platform/frontend/src/app/(platform)/home/__tests__/main.test.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/home/__tests__/main.test.tsx
@@ -1,7 +1,7 @@
import userEvent from "@testing-library/user-event";
import { http, HttpResponse } from "msw";
import { StrictMode } from "react";
-import { afterEach, beforeEach, expect, test, vi } from "vitest";
+import { beforeEach, expect, test, vi } from "vitest";
import type { HomeAgentStatus } from "@/app/api/__generated__/models/homeAgentStatus";
import type { HomeAttentionItem } from "@/app/api/__generated__/models/homeAttentionItem";
import type { HomeBriefingOutcome } from "@/app/api/__generated__/models/homeBriefingOutcome";
@@ -34,10 +34,6 @@ function funnelEventNames() {
return capture.mock.calls.map(([event]) => event as string);
}
-const { setFlagStatusMock } = vi.hoisted(() => ({
- setFlagStatusMock: vi.fn(() => ({ enabled: true, ready: true })),
-}));
-
vi.mock("@/services/feature-flags/use-get-flag", async (importActual) => {
const actual =
await importActual<
@@ -45,11 +41,7 @@ vi.mock("@/services/feature-flags/use-get-flag", async (importActual) => {
>();
return {
...actual,
- useFlagStatus: (flag: string) =>
- flag === "hire-experts"
- ? setFlagStatusMock()
- : actual.useFlagStatus(flag as never),
- useGetFlag: (flag: string) => flag === actual.Flag.HIRE_EXPERTS,
+ useGetFlag: () => false,
};
});
@@ -219,10 +211,6 @@ const dashboard: HomeDashboardResponse = {
},
};
-afterEach(() => {
- setFlagStatusMock.mockReturnValue({ enabled: true, ready: true });
-});
-
function mockDashboard(response: HomeDashboardResponse) {
server.use(
http.get(/\/api\/proxy\/api\/home(?:\?.*)?$/, () =>
@@ -531,21 +519,31 @@ test("shows a retryable page error when the aggregate cannot load", async () =>
await waitFor(() => expect(funnelEventNames()).toContain("home_viewed"));
});
-test("does not track home_viewed while feature state is loading", async () => {
- setFlagStatusMock.mockReturnValueOnce({ enabled: true, ready: false });
- server.use();
+test("does not track home_viewed until the dashboard responds", async () => {
+ let releaseDashboard!: () => void;
+ const responseReady = new Promise<void>((resolve) => {
+ releaseDashboard = resolve;
+ });
+ server.use(
+ http.get(/\/api\/proxy\/api\/home(?:\?.*)?$/, async () => {
+ await responseReady;
+ return HttpResponse.json(dashboard);
+ }),
+ );
render(<HomeRecap />);
expect(screen.getByLabelText("Loading Home…")).toBeDefined();
- await new Promise((resolve) => setTimeout(resolve, 0));
-
expect(funnelEventNames()).not.toContain("home_viewed");
+ releaseDashboard();
+ await waitFor(() => expect(funnelEventNames()).toContain("home_viewed"));
});
-test("hides the recap when the experts feature is disabled", () => {
- setFlagStatusMock.mockReturnValueOnce({ enabled: false, ready: true });
- const { container } = render(<HomeRecap />);
- expect(container.textContent).toBe("");
+test("shows the recap without a feature flag rollout", async () => {
+ mockDashboard(dashboard);
+ render(<HomeRecap />);
+ expect(
+ await screen.findByRole("heading", { name: "Needs you" }),
+ ).toBeDefined();
});
test("opens the briefing with the AI-written narrative when there is one", async () => {
diff --git a/autogpt_platform/frontend/src/app/(platform)/home/__tests__/needs-you.test.tsx b/autogpt_platform/frontend/src/app/(platform)/home/__tests__/needs-you.test.tsx
index 0f4aa17a09..bd58f146b6 100644
--- a/autogpt_platform/frontend/src/app/(platform)/home/__tests__/needs-you.test.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/home/__tests__/needs-you.test.tsx
@@ -18,11 +18,7 @@ vi.mock("@/services/feature-flags/use-get-flag", async (importActual) => {
>();
return {
...actual,
- useFlagStatus: (flag: string) =>
- flag === "hire-experts"
- ? { enabled: true, ready: true }
- : actual.useFlagStatus(flag as never),
- useGetFlag: (flag: string) => flag === actual.Flag.HIRE_EXPERTS,
+ useGetFlag: () => false,
};
});
diff --git a/autogpt_platform/frontend/src/app/(platform)/home/__tests__/recent-work.test.tsx b/autogpt_platform/frontend/src/app/(platform)/home/__tests__/recent-work.test.tsx
index 19a116dd29..96ec8781b1 100644
--- a/autogpt_platform/frontend/src/app/(platform)/home/__tests__/recent-work.test.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/home/__tests__/recent-work.test.tsx
@@ -13,11 +13,7 @@ vi.mock("@/services/feature-flags/use-get-flag", async (importActual) => {
>();
return {
...actual,
- useFlagStatus: (flag: string) =>
- flag === "hire-experts"
- ? { enabled: true, ready: true }
- : actual.useFlagStatus(flag as never),
- useGetFlag: (flag: string) => flag === actual.Flag.HIRE_EXPERTS,
+ useGetFlag: () => false,
};
});
diff --git a/autogpt_platform/frontend/src/app/(platform)/home/components/HomeRecap/HomeRecap.tsx b/autogpt_platform/frontend/src/app/(platform)/home/components/HomeRecap/HomeRecap.tsx
index aa5f9f62f9..adf71088ca 100644
--- a/autogpt_platform/frontend/src/app/(platform)/home/components/HomeRecap/HomeRecap.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/home/components/HomeRecap/HomeRecap.tsx
@@ -3,35 +3,29 @@
import { Skeleton } from "@/components/atoms/Skeleton/Skeleton";
import { ErrorCard } from "@/components/molecules/ErrorCard/ErrorCard";
import { useTrackFunnelViewOnce } from "@/services/experts/use-track-funnel-view-once";
-import { Flag, useFlagStatus } from "@/services/feature-flags/use-get-flag";
+import { useHomePage } from "../../useHomePage";
import { AgentTeam } from "../AgentTeam/AgentTeam";
import { HomeHeader } from "../HomeHeader/HomeHeader";
import { NeedsYou } from "../NeedsYou/NeedsYou";
import { NowNext } from "../NowNext/NowNext";
import { RecentWork } from "../RecentWork/RecentWork";
-import { useHomePage } from "../../useHomePage";
const SHELL_CLASS = "relative mt-10 px-4 pb-8 pt-6 text-left sm:px-6";
const CONTENT_CLASS = "relative mx-auto w-full max-w-[1120px]";
const GRID_CLASS = "grid grid-cols-1 items-start gap-4 xl:grid-cols-12";
export function HomeRecap() {
- const { enabled, ready } = useFlagStatus(Flag.HIRE_EXPERTS);
- const { dashboard, isLoading, isError, refetch } = useHomePage({
- enabled: Boolean(enabled) && ready,
- });
+ const { dashboard, isLoading, isError, refetch } = useHomePage();
useTrackFunnelViewOnce(
"home_viewed",
- ready && !isLoading && !isError && Boolean(dashboard) && Boolean(enabled),
+ !isLoading && !isError && Boolean(dashboard),
);
- if (!ready || isLoading) {
+ if (isLoading) {
return <HomeSkeleton />;
}
- if (!enabled) {
- return null;
- }
+
if (isError || !dashboard) {
return (
<section className={SHELL_CLASS}>
diff --git a/autogpt_platform/frontend/src/app/(platform)/home/useHomePage.ts b/autogpt_platform/frontend/src/app/(platform)/home/useHomePage.ts
index 7dfcd5c60d..3cc5d67f3d 100644
--- a/autogpt_platform/frontend/src/app/(platform)/home/useHomePage.ts
+++ b/autogpt_platform/frontend/src/app/(platform)/home/useHomePage.ts
@@ -1,15 +1,11 @@
import { useGetHomeDashboard } from "@/app/api/__generated__/endpoints/home/home";
import { okData } from "@/app/api/helpers";
-interface Args {
- enabled: boolean;
-}
-
-export function useHomePage({ enabled }: Args) {
+export function useHomePage({ enabled = true }: { enabled?: boolean } = {}) {
const query = useGetHomeDashboard({
query: {
- select: (response) => okData(response) ?? null,
enabled,
+ select: (response) => okData(response) ?? null,
staleTime: 0,
refetchInterval: 60_000,
refetchOnWindowFocus: true,
diff --git a/autogpt_platform/frontend/src/app/(platform)/library/__tests__/import-intro.test.tsx b/autogpt_platform/frontend/src/app/(platform)/library/__tests__/import-intro.test.tsx
new file mode 100644
index 0000000000..2fedad9944
--- /dev/null
+++ b/autogpt_platform/frontend/src/app/(platform)/library/__tests__/import-intro.test.tsx
@@ -0,0 +1,162 @@
+import { getGetV2ListLibraryFoldersMockHandler } from "@/app/api/__generated__/endpoints/folders/folders.msw";
+import { getGetV1ListAllExecutionsMockHandler } from "@/app/api/__generated__/endpoints/graphs/graphs.msw";
+import {
+ getGetV2ListFavoriteLibraryAgentsMockHandler,
+ getGetV2ListLibraryAgentsMockHandler,
+} from "@/app/api/__generated__/endpoints/library/library.msw";
+import { server } from "@/mocks/mock-server";
+import {
+ act,
+ fireEvent,
+ render,
+ screen,
+ waitFor,
+ within,
+} from "@/tests/integrations/test-utils";
+import userEvent from "@testing-library/user-event";
+import type { ReactNode } from "react";
+import { afterEach, beforeEach, expect, test, vi } from "vitest";
+import LibraryPage from "../page";
+
+const onboarding = vi.hoisted(() => ({
+ ready: false,
+ completeStep: vi.fn(),
+}));
+
+vi.mock("posthog-js", () => ({ default: { capture: vi.fn() } }));
+
+vi.mock("@/lib/auth/hooks/useAuth", () => ({
+ useAuth: () => ({
+ user: { id: "library-intro-user", created_at: "2026-10-01T00:00:00Z" },
+ isLoggedIn: true,
+ isUserLoading: false,
+ }),
+}));
+
+vi.mock("@/providers/onboarding/onboarding-provider", () => ({
+ useOnboarding: () => ({
+ state: onboarding.ready ? { completedSteps: [] } : null,
+ completeStep: onboarding.completeStep,
+ }),
+ default: ({ children }: { children: ReactNode }) => children,
+}));
+
+beforeEach(() => {
+ window.localStorage.clear();
+ onboarding.ready = false;
+ onboarding.completeStep.mockReset();
+ const pagination = {
+ total_items: 0,
+ total_pages: 1,
+ current_page: 1,
+ page_size: 20,
+ };
+ server.use(
+ getGetV2ListLibraryAgentsMockHandler({ agents: [], pagination }),
+ getGetV2ListFavoriteLibraryAgentsMockHandler({ agents: [], pagination }),
+ getGetV2ListLibraryFoldersMockHandler({ folders: [], pagination }),
+ getGetV1ListAllExecutionsMockHandler([]),
+ );
+});
+
+afterEach(() => {
+ vi.unstubAllGlobals();
+});
+
+function prepareDrawer(dialog: HTMLElement) {
+ // Happy DOM omits the browser's default computed transform.
+ if (dialog.hasAttribute("data-vaul-drawer")) dialog.style.transform = "none";
+}
+
+function finishDrawerExit() {
+ // Happy DOM does not emit the CSS animation events Radix awaits on close.
+ document
+ .querySelectorAll(
+ '[data-vaul-drawer][data-state="closed"], [data-vaul-overlay][data-state="closed"]',
+ )
+ .forEach((element) => {
+ const animationEnd = new Event("animationend", { bubbles: true });
+ Object.defineProperty(animationEnd, "animationName", {
+ value: window.getComputedStyle(element).animationName,
+ });
+ fireEvent(element, animationEnd);
+ });
+}
+
+test.each(
+ [1280, 390].flatMap((width) => [
+ { width, closeWithEscape: false },
+ { width, closeWithEscape: true },
+ ]),
+)(
+ "defers a late intro until Import closes at width $width (Escape=$closeWithEscape)",
+ async ({ width, closeWithEscape }) => {
+ vi.stubGlobal("innerWidth", width);
+ const { rerender } = render(<LibraryPage />);
+ await userEvent.click(screen.getAllByTestId("import-button")[0]);
+ const importDialog = await screen.findByRole("dialog", { name: "Import" });
+ prepareDrawer(importDialog);
+
+ onboarding.ready = true;
+ rerender(<LibraryPage />);
+ expect(screen.queryByTestId("tab-intro-overlay")).toBeNull();
+ expect(onboarding.completeStep).not.toHaveBeenCalled();
+ expect(
+ window.localStorage.getItem("autogpt:tab-intro-seen:agents"),
+ ).toBeNull();
+ expect(screen.getAllByTestId("import-button")).toHaveLength(1);
+
+ await userEvent.click(
+ within(importDialog).getByRole("tab", { name: "AutoGPT workflow" }),
+ );
+ const name = within(importDialog).getByRole("textbox", {
+ name: "Workflow name",
+ });
+ await userEvent.type(name, "Quarterly report");
+ act(() => {
+ window.innerWidth = width === 1280 ? 390 : 1280;
+ window.dispatchEvent(new Event("resize"));
+ });
+ await waitFor(() =>
+ expect(screen.getAllByRole("dialog", { name: "Import" })).toHaveLength(1),
+ );
+ const resizedDialog = screen.getByRole("dialog", { name: "Import" });
+ prepareDrawer(resizedDialog);
+ const draftName = within(resizedDialog).getByRole("textbox", {
+ name: "Workflow name",
+ }) as HTMLInputElement;
+ expect(draftName.value).toBe("Quarterly report");
+ expect(screen.queryByTestId("tab-intro-overlay")).toBeNull();
+
+ if (closeWithEscape) {
+ await userEvent.keyboard("{Escape}");
+ } else {
+ await userEvent.click(
+ within(resizedDialog).getByRole("button", { name: "Close" }),
+ );
+ }
+ if (resizedDialog.hasAttribute("data-vaul-drawer")) {
+ expect(resizedDialog.getAttribute("data-state")).toBe("closed");
+ finishDrawerExit();
+ }
+ await waitFor(() => expect(document.contains(resizedDialog)).toBe(false));
+ expect(
+ await screen.findByRole("dialog", { name: "Your mission control." }),
+ ).toBeDefined();
+ expect(onboarding.completeStep).not.toHaveBeenCalled();
+ expect(
+ window.localStorage.getItem("autogpt:tab-intro-seen:agents"),
+ ).toBeNull();
+
+ await userEvent.click(screen.getByRole("button", { name: "Got it" }));
+ await waitFor(() =>
+ expect(screen.queryByTestId("tab-intro-overlay")).toBeNull(),
+ );
+ expect(onboarding.completeStep).toHaveBeenCalledExactlyOnceWith(
+ "AGENTS_TAB_INTRO",
+ );
+ expect(window.localStorage.getItem("autogpt:tab-intro-seen:agents")).toBe(
+ "library-intro-user",
+ );
+ },
+);
diff --git a/autogpt_platform/frontend/src/app/(platform)/library/components/AgentsTabIntro/AgentsTabIntro.tsx b/autogpt_platform/frontend/src/app/(platform)/library/components/AgentsTabIntro/AgentsTabIntro.tsx
index 5f147849f3..f75530f9eb 100644
--- a/autogpt_platform/frontend/src/app/(platform)/library/components/AgentsTabIntro/AgentsTabIntro.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/library/components/AgentsTabIntro/AgentsTabIntro.tsx
@@ -4,10 +4,14 @@ import { TabIntroCard } from "@/app/(platform)/components/TabIntroCard/TabIntroC
import { useTabIntroCard } from "@/app/(platform)/components/TabIntroCard/useTabIntroCard";
import { GridViewIcon } from "@hugeicons/core-free-icons";
+interface Props {
+ canShow?: boolean;
+}
+
// First visit to the Agents tab. The fleet is already rendered behind the
// card, so "See my agents" only has to get out of the way.
-export function AgentsTabIntro() {
- const { isOpen, dismiss, takeAction } = useTabIntroCard("agents");
+export function AgentsTabIntro({ canShow = true }: Props) {
+ const { isOpen, dismiss, takeAction } = useTabIntroCard("agents", canShow);
return (
<TabIntroCard
diff --git a/autogpt_platform/frontend/src/app/(platform)/library/components/LibraryActionHeader/LibraryActionHeader.tsx b/autogpt_platform/frontend/src/app/(platform)/library/components/LibraryActionHeader/LibraryActionHeader.tsx
index c41b67cb36..8136175490 100644
--- a/autogpt_platform/frontend/src/app/(platform)/library/components/LibraryActionHeader/LibraryActionHeader.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/library/components/LibraryActionHeader/LibraryActionHeader.tsx
@@ -3,26 +3,26 @@ import { LibrarySearchBar } from "../LibrarySearchBar/LibrarySearchBar";
interface Props {
setSearchTerm: (value: string) => void;
+ isImportOpen: boolean;
+ onImportOpenChange: (open: boolean) => void;
}
-export function LibraryActionHeader({ setSearchTerm }: Props) {
+export function LibraryActionHeader({
+ setSearchTerm,
+ isImportOpen,
+ onImportOpenChange,
+}: Props) {
return (
- <>
- <div className="mb-7 hidden items-center justify-center gap-4 md:flex">
+ <div className="flex flex-col gap-4 p-4 pt-[52px] md:mb-7 md:flex-row md:items-center md:justify-center md:p-0">
+ <div className="order-2 flex items-center justify-center md:order-1">
<LibrarySearchBar setSearchTerm={setSearchTerm} />
- <LibraryImportDialog />
</div>
-
- {/* Mobile and tablet */}
- <div className="flex flex-col gap-4 p-4 pt-[52px] md:hidden">
- <div className="flex w-full justify-between gap-2">
- <LibraryImportDialog />
- </div>
-
- <div className="flex items-center justify-center">
- <LibrarySearchBar setSearchTerm={setSearchTerm} />
- </div>
+ <div className="order-1 flex items-center justify-between md:order-2">
+ <LibraryImportDialog
+ isOpen={isImportOpen}
+ onOpenChange={onImportOpenChange}
+ />
</div>
- </>
+ </div>
);
}
diff --git a/autogpt_platform/frontend/src/app/(platform)/library/components/LibraryImportDialog/LibraryImportDialog.tsx b/autogpt_platform/frontend/src/app/(platform)/library/components/LibraryImportDialog/LibraryImportDialog.tsx
index c9bb6ac712..c9690694c0 100644
--- a/autogpt_platform/frontend/src/app/(platform)/library/components/LibraryImportDialog/LibraryImportDialog.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/library/components/LibraryImportDialog/LibraryImportDialog.tsx
@@ -6,7 +6,6 @@ import {
TabsLineList,
TabsLineTrigger,
} from "@/components/molecules/TabsLine/TabsLine";
-import { useState } from "react";
import { useLibraryUploadAgentDialog } from "../LibraryUploadAgentDialog/useLibraryUploadAgentDialog";
import AgentUploadTab from "./components/AgentUploadTab/AgentUploadTab";
import ExternalWorkflowTab from "./components/ExternalWorkflowTab/ExternalWorkflowTab";
@@ -14,13 +13,16 @@ import { useExternalWorkflowTab } from "./components/ExternalWorkflowTab/useExte
import { Upload03Icon } from "@hugeicons/core-free-icons";
import { Icon } from "@/components/atoms/Icon/Icon";
-export default function LibraryImportDialog() {
- const [isOpen, setIsOpen] = useState(false);
+interface Props {
+ isOpen: boolean;
+ onOpenChange: (open: boolean) => void;
+}
+export default function LibraryImportDialog({ isOpen, onOpenChange }: Props) {
const importWorkflow = useExternalWorkflowTab();
function handleClose() {
- setIsOpen(false);
+ onOpenChange(false);
importWorkflow.setFileValue("");
importWorkflow.setUrlValue("");
}
@@ -33,7 +35,7 @@ export default function LibraryImportDialog() {
styling={{ maxWidth: "32rem" }}
controlled={{
isOpen,
- set: setIsOpen,
+ set: onOpenChange,
}}
onClose={handleClose}
>
diff --git a/autogpt_platform/frontend/src/app/(platform)/library/page.tsx b/autogpt_platform/frontend/src/app/(platform)/library/page.tsx
index db052e68bb..0b00932160 100644
--- a/autogpt_platform/frontend/src/app/(platform)/library/page.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/library/page.tsx
@@ -24,6 +24,7 @@ export default function LibraryPage() {
const [selectedFolderId, setSelectedFolderId] = useQueryState("folder");
const [activeTab, setActiveTab] = useState(LIBRARY_TABS[0].id);
const [statusFilter, setStatusFilter] = useState<AgentStatusFilter>("all");
+ const [isImportOpen, setIsImportOpen] = useState(false);
const { agents } = useLibraryAgents();
const fleetSummary = useLibraryFleetSummary(agents);
@@ -46,7 +47,11 @@ export default function LibraryPage() {
onAnimationComplete={handleFavoriteAnimationComplete}
>
<main className="pt-160 container min-h-screen space-y-4 pb-20 pt-16 sm:px-8 md:px-12">
- <LibraryActionHeader setSearchTerm={setSearchTerm} />
+ <LibraryActionHeader
+ setSearchTerm={setSearchTerm}
+ isImportOpen={isImportOpen}
+ onImportOpenChange={setIsImportOpen}
+ />
<LibraryAgentList
searchTerm={searchTerm}
librarySort={librarySort}
@@ -62,7 +67,7 @@ export default function LibraryPage() {
briefingAgents={agents}
/>
</main>
- <AgentsTabIntro />
+ <AgentsTabIntro canShow={!isImportOpen} />
</FavoriteAnimationProvider>
);
}
diff --git a/autogpt_platform/frontend/src/app/(platform)/marketplace/__tests__/expert-centric-layout.test.tsx b/autogpt_platform/frontend/src/app/(platform)/marketplace/__tests__/expert-centric-layout.test.tsx
index bfe1643ed6..3caa22925a 100644
--- a/autogpt_platform/frontend/src/app/(platform)/marketplace/__tests__/expert-centric-layout.test.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/marketplace/__tests__/expert-centric-layout.test.tsx
@@ -48,24 +48,6 @@ vi.mock("next/navigation", () => ({
vi.mock("@/lib/auth/hooks/useAuth", () => ({ useAuth: mockUseAuth }));
-vi.mock("@/services/feature-flags/use-get-flag", async (importOriginal) => {
- const actual =
- await importOriginal<
- typeof import("@/services/feature-flags/use-get-flag")
- >();
- return {
- ...actual,
- useGetFlag: (flag: string) => {
- if (flag === "skills-hub" || flag === "hire-experts") return true;
- return actual.useGetFlag(flag as never);
- },
- useFlagStatus: (flag: string) => {
- if (flag === "skills-hub") return { enabled: true, ready: true };
- return actual.useFlagStatus(flag as never);
- },
- };
-});
-
const outreach: MarketplaceSkill = {
slug: "outreach-playbook",
name: "outreach-playbook",
@@ -106,7 +88,7 @@ const agentsResponse = getGetV2ListStoreAgentsResponseMock({
},
});
-describe("Marketplace with hire-experts on", () => {
+describe("Marketplace", () => {
beforeEach(() => {
mockUseAuth.mockReturnValue({ user: { id: "user-1" }, isLoggedIn: true });
server.use(
@@ -348,7 +330,7 @@ describe("Marketplace with hire-experts on", () => {
render(<MainMarkeplacePage />);
expect(
- await screen.findByRole("button", { name: "Become a Creator" }),
+ await screen.findByRole("button", { name: "Publish your workflows" }),
).toBeDefined();
});
});
diff --git a/autogpt_platform/frontend/src/app/(platform)/marketplace/__tests__/experts-category-filter.test.tsx b/autogpt_platform/frontend/src/app/(platform)/marketplace/__tests__/experts-category-filter.test.tsx
index f9301c2e64..f144552200 100644
--- a/autogpt_platform/frontend/src/app/(platform)/marketplace/__tests__/experts-category-filter.test.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/marketplace/__tests__/experts-category-filter.test.tsx
@@ -17,7 +17,6 @@ import { MainMarkeplacePage } from "../components/MainMarketplacePage/MainMarket
configure({ asyncUtilTimeout: 10000 });
const mockUseAuth = vi.hoisted(() => vi.fn());
-const hireExpertsFlag = vi.hoisted(() => ({ enabled: true }));
vi.mock("next/navigation", () => ({
useRouter: () => ({
@@ -35,20 +34,6 @@ vi.mock("next/navigation", () => ({
vi.mock("@/lib/auth/hooks/useAuth", () => ({ useAuth: mockUseAuth }));
-vi.mock("@/services/feature-flags/use-get-flag", async (importOriginal) => {
- const actual =
- await importOriginal<
- typeof import("@/services/feature-flags/use-get-flag")
- >();
- return {
- ...actual,
- useGetFlag: (flag: string) =>
- flag === "hire-experts"
- ? hireExpertsFlag.enabled
- : actual.useGetFlag(flag as never),
- };
-});
-
const CATEGORIES = [
{ value: "marketing", label: "Marketing", description: "Campaigns and SEO" },
{ value: "sales", label: "Sales", description: "Leads and outreach" },
@@ -84,7 +69,7 @@ const requestedCategories: (string | null)[] = [];
describe("Marketplace category filter over experts", () => {
beforeEach(() => {
requestedCategories.length = 0;
- hireExpertsFlag.enabled = true;
+
mockUseAuth.mockReturnValue({ user: { id: "user-1" }, isLoggedIn: true });
server.use(
getListExpertsMockHandler([]),
diff --git a/autogpt_platform/frontend/src/app/(platform)/marketplace/__tests__/experts-section.test.tsx b/autogpt_platform/frontend/src/app/(platform)/marketplace/__tests__/experts-section.test.tsx
index f91dcf4543..3714510300 100644
--- a/autogpt_platform/frontend/src/app/(platform)/marketplace/__tests__/experts-section.test.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/marketplace/__tests__/experts-section.test.tsx
@@ -2,6 +2,11 @@ import {
getListExpertsMockHandler,
getListExpertTemplatesMockHandler,
} from "@/app/api/__generated__/endpoints/experts/experts.msw";
+import {
+ getGetV1CheckIfOnboardingIsCompletedMockHandler200,
+ getGetV1OnboardingStateMockHandler200,
+ getGetV1OnboardingStateResponseMock200,
+} from "@/app/api/__generated__/endpoints/onboarding/onboarding.msw";
import { Expert } from "@/app/api/__generated__/models/expert";
import { server } from "@/mocks/mock-server";
import {
@@ -30,7 +35,6 @@ beforeEach(() => {
});
const mockUseAuth = vi.hoisted(() => vi.fn());
-const hireExpertsFlag = vi.hoisted(() => ({ enabled: true }));
vi.mock("next/navigation", () => ({
useRouter: () => ({
@@ -50,20 +54,6 @@ vi.mock("@/lib/auth/hooks/useAuth", () => ({
useAuth: mockUseAuth,
}));
-vi.mock("@/services/feature-flags/use-get-flag", async (importOriginal) => {
- const actual =
- await importOriginal<
- typeof import("@/services/feature-flags/use-get-flag")
- >();
- return {
- ...actual,
- useGetFlag: (flag: string) =>
- flag === "hire-experts"
- ? hireExpertsFlag.enabled
- : actual.useGetFlag(flag as never),
- };
-});
-
const mariaTemplate: Expert = {
id: "template-maria",
name: "Maria",
@@ -94,11 +84,21 @@ const hiredMaria: Expert = {
describe("Marketplace ExpertsSection", () => {
beforeEach(() => {
- hireExpertsFlag.enabled = true;
mockUseAuth.mockReturnValue({
user: { id: "user-1" },
isLoggedIn: true,
});
+ server.use(
+ getGetV1CheckIfOnboardingIsCompletedMockHandler200({
+ is_completed: true,
+ }),
+ getGetV1OnboardingStateMockHandler200(
+ getGetV1OnboardingStateResponseMock200({
+ userId: "user-1",
+ completedSteps: ["ONBOARDING_COMPLETE", "MARKETPLACE_TAB_INTRO"],
+ }),
+ ),
+ );
});
test("links each expert card to its own page", async () => {
@@ -126,7 +126,7 @@ describe("Marketplace ExpertsSection", () => {
test("shows the expert cards to signed-out visitors without account links", async () => {
mockUseAuth.mockReturnValue({ user: null, isLoggedIn: false });
- hireExpertsFlag.enabled = false;
+
let rosterRequested = false;
server.use(
getListExpertTemplatesMockHandler([mariaTemplate]),
@@ -145,27 +145,35 @@ describe("Marketplace ExpertsSection", () => {
);
expect(screen.queryByText("Create an Expert")).toBeNull();
expect(screen.queryByRole("link", { name: "View your team" })).toBeNull();
- expect(screen.queryByRole("link", { name: "Hire" })).toBeNull();
+ expect(
+ screen.getByRole("link", { name: "Hire" }).getAttribute("href"),
+ ).toBe("/signup?next=%2Fmarketplace%2Fexperts%2Ftemplate-maria");
expect(rosterRequested).toBe(false);
});
- test("stays hidden and fetches nothing for signed-in users outside the beta", async () => {
- hireExpertsFlag.enabled = false;
+ test("shows experts to signed-in users without a rollout flag", async () => {
let templatesRequested = false;
+ let expertsRequested = false;
server.use(
getListExpertTemplatesMockHandler(() => {
templatesRequested = true;
return [mariaTemplate];
}),
- getListExpertsMockHandler([]),
+ getListExpertsMockHandler(() => {
+ expertsRequested = true;
+ return [];
+ }),
);
render(<MainMarkeplacePage />);
- expect(await screen.findByText("All AI Workflows")).toBeDefined();
- expect(screen.queryByText("Meet the AI Experts")).toBeNull();
- expect(screen.queryByText(/create your own expert/)).toBeNull();
- expect(templatesRequested).toBe(false);
+ expect(await screen.findByText("Meet the AI Experts")).toBeDefined();
+ expect(
+ screen.getByRole("link", { name: "Create an Expert" }),
+ ).toBeDefined();
+ expect(await screen.findByRole("link", { name: /Maria/ })).toBeDefined();
+ expect(templatesRequested).toBe(true);
+ await waitFor(() => expect(expertsRequested).toBe(true));
});
test("keeps the raise-your-own door open when no templates exist", async () => {
diff --git a/autogpt_platform/frontend/src/app/(platform)/marketplace/__tests__/install-on-expert.test.tsx b/autogpt_platform/frontend/src/app/(platform)/marketplace/__tests__/install-on-expert.test.tsx
index 1bc19cc6bd..adf31637a9 100644
--- a/autogpt_platform/frontend/src/app/(platform)/marketplace/__tests__/install-on-expert.test.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/marketplace/__tests__/install-on-expert.test.tsx
@@ -22,18 +22,6 @@ vi.mock("@/lib/auth/hooks/useAuth", () => ({
useAuth: mockUseAuth,
}));
-vi.mock("@/services/feature-flags/use-get-flag", async (importOriginal) => {
- const actual =
- await importOriginal<
- typeof import("@/services/feature-flags/use-get-flag")
- >();
- return {
- ...actual,
- useGetFlag: (flag: string) =>
- flag === "hire-experts" ? true : actual.useGetFlag(flag as never),
- };
-});
-
const hiredMaria: Expert = {
id: "expert-maria",
name: "Maria",
diff --git a/autogpt_platform/frontend/src/app/(platform)/marketplace/__tests__/skills-section.test.tsx b/autogpt_platform/frontend/src/app/(platform)/marketplace/__tests__/skills-section.test.tsx
index 55538fffa1..406e774d95 100644
--- a/autogpt_platform/frontend/src/app/(platform)/marketplace/__tests__/skills-section.test.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/marketplace/__tests__/skills-section.test.tsx
@@ -19,6 +19,7 @@ import {
} from "@/tests/integrations/test-utils";
import { beforeEach, describe, expect, test, vi } from "vitest";
+import { SkillsBrowsePage } from "../skills/components/SkillsBrowsePage/SkillsBrowsePage";
import { MainMarkeplacePage } from "../components/MainMarketplacePage/MainMarketplacePage";
// These pages wait on several queries before anything renders, and CI is
@@ -26,11 +27,6 @@ import { MainMarkeplacePage } from "../components/MainMarketplacePage/MainMarket
configure({ asyncUtilTimeout: 10000 });
const mockUseAuth = vi.hoisted(() => vi.fn());
-const flags = vi.hoisted(() => ({
- skillsHub: true,
- skillsHubReady: true,
- hireExperts: false,
-}));
vi.mock("next/navigation", () => ({
useRouter: () => ({
@@ -48,26 +44,6 @@ vi.mock("next/navigation", () => ({
vi.mock("@/lib/auth/hooks/useAuth", () => ({ useAuth: mockUseAuth }));
-vi.mock("@/services/feature-flags/use-get-flag", async (importOriginal) => {
- const actual =
- await importOriginal<
- typeof import("@/services/feature-flags/use-get-flag")
- >();
- return {
- ...actual,
- useGetFlag: (flag: string) => {
- if (flag === "skills-hub") return flags.skillsHub;
- if (flag === "hire-experts") return flags.hireExperts;
- return actual.useGetFlag(flag as never);
- },
- useFlagStatus: (flag: string) => {
- if (flag === "skills-hub")
- return { enabled: flags.skillsHub, ready: flags.skillsHubReady };
- return actual.useFlagStatus(flag as never);
- },
- };
-});
-
const brandVoice: MarketplaceSkill = {
slug: "brand-voice-guide",
name: "brand-voice-guide",
@@ -114,11 +90,8 @@ function listing(skills: MarketplaceSkill[], totalItems = skills.length) {
});
}
-describe("Marketplace SkillsSection", () => {
+describe("Marketplace skills", () => {
beforeEach(() => {
- flags.skillsHub = true;
- flags.skillsHubReady = true;
- flags.hireExperts = false;
mockUseAuth.mockReturnValue({ user: { id: "user-1" }, isLoggedIn: true });
server.use(
getGetV2ListStoreAgentsMockHandler(),
@@ -131,7 +104,7 @@ describe("Marketplace SkillsSection", () => {
test("shows a skill's title as its author cased it, acronyms intact", async () => {
server.use(listing([seoAudit]));
- render(<MainMarkeplacePage />);
+ render(<SkillsBrowsePage />);
expect(
await screen.findByRole("link", { name: /On-page SEO audit/ }),
@@ -139,7 +112,7 @@ describe("Marketplace SkillsSection", () => {
expect(screen.queryByText("On page seo audit")).toBeNull();
});
- test("shows skills as their own shelf, linked to the skill page", async () => {
+ test("shows skills as their own shelf with a browse link", async () => {
server.use(listing([brandVoice]));
render(<MainMarkeplacePage />);
@@ -153,10 +126,14 @@ describe("Marketplace SkillsSection", () => {
},
),
).toBeDefined();
- const card = await screen.findByRole("link", { name: /Brand voice guide/ });
- expect(card.getAttribute("href")).toBe(
- "/marketplace/skills/brand-voice-guide",
- );
+ expect(
+ await screen.findByRole("button", { name: /Brand voice guide/ }),
+ ).toBeDefined();
+ expect(
+ screen
+ .getByRole("link", { name: "Browse all skills" })
+ .getAttribute("href"),
+ ).toBe("/marketplace/skills");
});
test("sits above the workflow catalogue, not below it", async () => {
@@ -171,7 +148,7 @@ describe("Marketplace SkillsSection", () => {
timeout: 10000,
},
);
- const workflows = await screen.findByText("All AI Workflows");
+ const workflows = await screen.findByRole("heading", { name: "Workflows" });
// Node.DOCUMENT_POSITION_FOLLOWING === 4: the workflows heading comes after.
expect(skills.compareDocumentPosition(workflows) & 4).toBe(4);
});
@@ -179,7 +156,7 @@ describe("Marketplace SkillsSection", () => {
test("shows the compatibility line only for a skill that needs one", async () => {
server.use(listing([brandVoice, outreach]));
- render(<MainMarkeplacePage />);
+ render(<SkillsBrowsePage />);
await screen.findAllByTestId("skill-card", undefined, { timeout: 10000 });
const card = await screen.findByRole("link", { name: /Outreach playbook/ });
@@ -204,7 +181,7 @@ describe("Marketplace SkillsSection", () => {
};
server.use(listing([brandVoice, coldEmail]));
- render(<MainMarkeplacePage />);
+ render(<SkillsBrowsePage />);
await screen.findAllByTestId("skill-card", undefined, { timeout: 10000 });
const vendored = await screen.findByRole("link", { name: /Cold email/ });
@@ -226,7 +203,7 @@ describe("Marketplace SkillsSection", () => {
]),
);
- render(<MainMarkeplacePage />);
+ render(<SkillsBrowsePage />);
const card = await screen.findByRole("link", { name: /Outreach playbook/ });
await waitFor(() => expect(card.textContent).toContain("Added"));
@@ -237,40 +214,6 @@ describe("Marketplace SkillsSection", () => {
expect(brand.textContent).toContain("View");
});
- test("offers Build your own above the shelf's text action", async () => {
- server.use(listing([brandVoice, outreach], 2));
-
- render(<MainMarkeplacePage />);
-
- const build = await screen.findByRole(
- "link",
- { name: "Build your own" },
- { timeout: 10000 },
- );
- expect(build.getAttribute("href")).toBe("/library/skills");
- });
-
- test("hides Build your own from signed-out visitors", async () => {
- mockUseAuth.mockReturnValue({ user: null, isLoggedIn: false });
- server.use(listing([brandVoice, outreach], 2));
-
- render(<MainMarkeplacePage />);
-
- await screen.findAllByTestId("skill-card", undefined, { timeout: 10000 });
- expect(screen.queryByRole("link", { name: "Build your own" })).toBeNull();
- });
-
- test("offers no Browse all while the catalogue fits the shelf", async () => {
- server.use(listing([brandVoice, outreach], 2));
-
- render(<MainMarkeplacePage />);
-
- await screen.findAllByTestId("skill-card", undefined, { timeout: 10000 });
- expect(
- screen.queryByRole("link", { name: /Browse all skills/ }),
- ).toBeNull();
- });
-
test("offers Browse all once the catalogue outgrows the shelf", async () => {
server.use(listing([brandVoice, outreach], 9));
@@ -324,7 +267,7 @@ describe("Marketplace SkillsSection", () => {
}),
);
render(<MainMarkeplacePage />);
- await screen.findByRole("link", { name: /Brand voice guide/ });
+ await screen.findByRole("button", { name: /Brand voice guide/ });
await userEvent.click(await findCategoryChip("Sales"));
@@ -354,7 +297,7 @@ describe("Marketplace SkillsSection", () => {
}),
);
render(<MainMarkeplacePage />);
- await screen.findByRole("link", { name: /Brand voice guide/ });
+ await screen.findByRole("button", { name: /Brand voice guide/ });
await userEvent.click(await findCategoryChip("Sales"));
@@ -363,62 +306,15 @@ describe("Marketplace SkillsSection", () => {
expect(screen.getByRole("heading", { name: "Skills" })).toBeDefined();
});
- test("points a signed-in user at their own skills when none are published", async () => {
- server.use(listing([]));
-
- render(<MainMarkeplacePage />);
-
- expect(
- await screen.findByTestId("skills-shelf-empty", undefined, {
- timeout: 10000,
- }),
- ).toBeDefined();
- });
-
test("says nothing at all to a visitor when there are no skills", async () => {
mockUseAuth.mockReturnValue({ user: null, isLoggedIn: false });
server.use(listing([]));
render(<MainMarkeplacePage />);
- expect(await screen.findByText("All AI Workflows")).toBeDefined();
- await waitFor(() =>
- expect(screen.queryByRole("heading", { name: "Skills" })).toBeNull(),
- );
- });
-
- test("stays hidden and fetches nothing outside the beta", async () => {
- flags.skillsHub = false;
- let requested = false;
- server.use(
- getGetV2ListMarketplaceSkillsMockHandler200(() => {
- requested = true;
- return {
- skills: [brandVoice],
- pagination: {
- total_items: 1,
- total_pages: 1,
- current_page: 1,
- page_size: 4,
- },
- };
- }),
- );
-
- render(<MainMarkeplacePage />);
-
- expect(await screen.findByText("All AI Workflows")).toBeDefined();
- expect(screen.queryByRole("heading", { name: "Skills" })).toBeNull();
- await waitFor(() => expect(requested).toBe(false));
- });
-
- test("does not paint the shelf before the flag has answered", async () => {
- flags.skillsHubReady = false;
- server.use(listing([brandVoice]));
-
- render(<MainMarkeplacePage />);
-
- expect(await screen.findByText("All AI Workflows")).toBeDefined();
+ expect(
+ await screen.findByRole("heading", { name: "Workflows" }),
+ ).toBeDefined();
await waitFor(() =>
expect(screen.queryByRole("heading", { name: "Skills" })).toBeNull(),
);
diff --git a/autogpt_platform/frontend/src/app/(platform)/marketplace/components/BecomeACreator/BecomeACreator.tsx b/autogpt_platform/frontend/src/app/(platform)/marketplace/components/BecomeACreator/BecomeACreator.tsx
index 5f320d6099..7cb23bf29e 100644
--- a/autogpt_platform/frontend/src/app/(platform)/marketplace/components/BecomeACreator/BecomeACreator.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/marketplace/components/BecomeACreator/BecomeACreator.tsx
@@ -6,12 +6,23 @@ interface BecomeACreatorProps {
title?: string;
description?: string;
buttonText?: string;
+ onPublish?: () => void;
}
export function BecomeACreator({
description = "Join a community where your workflows can inspire, engage, and be installed by users around the world.",
buttonText = "Publish your workflow",
+ onPublish,
}: BecomeACreatorProps) {
+ const publishTrigger = (
+ <button
+ className="inline-flex h-12 cursor-pointer items-center justify-center rounded-full bg-zinc-900 px-8 text-[15px] font-medium text-white shadow-[0_1px_2px_rgba(16,24,40,0.1)] transition-all duration-200 hover:-translate-y-0.5 hover:bg-zinc-800 hover:shadow-[0_10px_24px_-10px_rgba(16,24,40,0.4)]"
+ onClick={onPublish}
+ >
+ {buttonText}
+ </button>
+ );
+
return (
<div className="relative mx-auto w-full max-w-[1360px] py-24">
<div className="mx-auto w-full max-w-2xl px-4 text-center">
@@ -24,13 +35,11 @@ export function BecomeACreator({
{description}
</p>
- <PublishAgentModal
- trigger={
- <button className="inline-flex h-12 cursor-pointer items-center justify-center rounded-full bg-zinc-900 px-8 text-[15px] font-medium text-white shadow-[0_1px_2px_rgba(16,24,40,0.1)] transition-all duration-200 hover:-translate-y-0.5 hover:bg-zinc-800 hover:shadow-[0_10px_24px_-10px_rgba(16,24,40,0.4)]">
- {buttonText}
- </button>
- }
- />
+ {onPublish ? (
+ publishTrigger
+ ) : (
+ <PublishAgentModal trigger={publishTrigger} />
+ )}
</div>
</div>
);
diff --git a/autogpt_platform/frontend/src/app/(platform)/marketplace/components/ExpertsSection/components/ExpertHireControl.tsx b/autogpt_platform/frontend/src/app/(platform)/marketplace/components/ExpertsSection/components/ExpertHireControl.tsx
index 383a03a6c6..175c7fcf31 100644
--- a/autogpt_platform/frontend/src/app/(platform)/marketplace/components/ExpertsSection/components/ExpertHireControl.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/marketplace/components/ExpertsSection/components/ExpertHireControl.tsx
@@ -9,7 +9,6 @@ import { VoicePicker } from "@/components/organisms/VoicePicker/VoicePicker";
import { useAuth } from "@/lib/auth/hooks/useAuth";
import { trackFunnel } from "@/services/experts/experts-analytics";
import { useHireFlow } from "@/services/experts/useHireFlow";
-import { Flag, useGetFlag } from "@/services/feature-flags/use-get-flag";
import { AddTeamIcon, CheckmarkCircle02Icon } from "@hugeicons/core-free-icons";
// A small secondary pill, like the team cards' corner buttons.
@@ -28,14 +27,6 @@ interface Props {
* hand-off to the expert's first thread — would unmount with it. Here the
* flow runs the expert page's own hook and outlives the swap. */
export function ExpertHireControl({ expert, isHired }: Props) {
- const isHireExpertsEnabled = useGetFlag(Flag.HIRE_EXPERTS);
-
- if (!isHireExpertsEnabled) return null;
-
- return <EnabledExpertHireControl expert={expert} isHired={isHired} />;
-}
-
-function EnabledExpertHireControl({ expert, isHired }: Props) {
const { isLoggedIn } = useAuth();
const {
hire,
diff --git a/autogpt_platform/frontend/src/app/(platform)/marketplace/components/FeaturedSection/FeaturedSection.tsx b/autogpt_platform/frontend/src/app/(platform)/marketplace/components/FeaturedSection/FeaturedSection.tsx
deleted file mode 100644
index 24e81b01dd..0000000000
--- a/autogpt_platform/frontend/src/app/(platform)/marketplace/components/FeaturedSection/FeaturedSection.tsx
+++ /dev/null
@@ -1,76 +0,0 @@
-"use client";
-
-import { StoreAgent } from "@/app/api/__generated__/models/storeAgent";
-import {
- Carousel,
- CarouselContent,
- CarouselItem,
- CarouselNext,
- CarouselPrevious,
-} from "@/components/__legacy__/ui/carousel";
-import Link from "next/link";
-import { FeaturedAgentCard } from "../FeaturedAgentCard/FeaturedAgentCard";
-import { SparklesIcon } from "@hugeicons/core-free-icons";
-import { Icon } from "@/components/atoms/Icon/Icon";
-import { FEATURED_SECTION_ID } from "../MarketplaceTabIntro/helpers";
-
-const FEATURED_COLORS = [
- "bg-violet-50 border-violet-100/70",
- "bg-blue-50 border-blue-100/70",
- "bg-green-50 border-green-100/70",
-];
-
-interface FeaturedSectionProps {
- featuredAgents: StoreAgent[];
-}
-
-export function FeaturedSection({ featuredAgents }: FeaturedSectionProps) {
- return (
- <section
- id={FEATURED_SECTION_ID}
- className="mb-8 w-full border-b border-zinc-200/70 pb-6"
- >
- <Carousel
- opts={{
- align: "start",
- containScroll: "trimSnaps",
- }}
- >
- <div className="mb-4 flex items-center justify-between">
- <div className="flex items-center gap-2 text-xs font-medium uppercase tracking-[0.14em] text-violet-600">
- <Icon icon={SparklesIcon} size={16} />
- Hand-picked
- </div>
- <div className="flex items-center gap-2">
- <CarouselPrevious className="static h-10 w-10" />
- <CarouselNext className="static h-10 w-10" />
- </div>
- </div>
- <div className="relative -mx-4">
- <CarouselContent className="px-4 pb-3 pt-1">
- {featuredAgents.map((agent, index) => (
- <CarouselItem
- key={index}
- className="h-[440px] md:basis-1/2 lg:basis-1/3"
- >
- <Link
- href={`/marketplace/agent/${encodeURIComponent(agent.creator)}/${encodeURIComponent(agent.slug)}`}
- className="block h-full"
- >
- <FeaturedAgentCard
- agent={agent}
- backgroundColor={
- FEATURED_COLORS[index % FEATURED_COLORS.length]
- }
- />
- </Link>
- </CarouselItem>
- ))}
- </CarouselContent>
- <div className="pointer-events-none absolute inset-y-0 left-0 w-8 bg-gradient-to-r from-[rgb(246,247,248)] to-transparent" />
- <div className="pointer-events-none absolute inset-y-0 right-0 w-8 bg-gradient-to-l from-[rgb(246,247,248)] to-transparent" />
- </div>
- </Carousel>
- </section>
- );
-}
diff --git a/autogpt_platform/frontend/src/app/(platform)/marketplace/components/HeroSection/HeroSection.tsx b/autogpt_platform/frontend/src/app/(platform)/marketplace/components/HeroSection/HeroSection.tsx
index 9de60cdf0a..641d83b0d5 100644
--- a/autogpt_platform/frontend/src/app/(platform)/marketplace/components/HeroSection/HeroSection.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/marketplace/components/HeroSection/HeroSection.tsx
@@ -1,42 +1,24 @@
"use client";
-import { Flag, useGetFlag } from "@/services/feature-flags/use-get-flag";
import { FilterChips } from "../FilterChips/FilterChips";
import { SearchBar } from "../SearchBar/SearchBar";
import { useHeroSection } from "./useHeroSection";
export const HeroSection = () => {
const { onFilterChange, searchTerms } = useHeroSection();
- const isHireExpertsEnabled = useGetFlag(Flag.HIRE_EXPERTS);
return (
<div className="mb-16 mt-10 flex flex-col items-center justify-center px-4">
<div className="w-full max-w-3xl">
<h1 className="mb-3 text-center text-3xl font-semibold leading-[1.05] tracking-[-0.02em] text-zinc-900 md:text-[3rem]">
- {isHireExpertsEnabled ? (
- <>
- Hire an AI expert
- <span className="block">
- for <span className="text-violet-600">your team</span>
- </span>
- </>
- ) : (
- <>
- Explore AI workflows built for{" "}
- <span className="text-violet-600">you</span>
- <span className="block">by the community</span>
- </>
- )}
+ Hire an AI expert
+ <span className="block">
+ for <span className="text-violet-600">your team</span>
+ </span>
</h1>
<p className="mb-8 text-center text-[15px] text-zinc-500 md:text-lg">
- {isHireExpertsEnabled ? (
- <>
- Ready-made specialists who bring their own skills and workflows
- <span className="block">— working in minutes.</span>
- </>
- ) : (
- "Bringing you AI workflows designed by thinkers from around the world"
- )}
+ Ready-made specialists who bring their own skills and workflows
+ <span className="block">— working in minutes.</span>
</p>
<div className="mb-4 flex w-full justify-center">
<SearchBar />
diff --git a/autogpt_platform/frontend/src/app/(platform)/marketplace/components/InstallOnExpertButton/useInstallOnExpertButton.ts b/autogpt_platform/frontend/src/app/(platform)/marketplace/components/InstallOnExpertButton/useInstallOnExpertButton.ts
index 6beed6f359..654f987820 100644
--- a/autogpt_platform/frontend/src/app/(platform)/marketplace/components/InstallOnExpertButton/useInstallOnExpertButton.ts
+++ b/autogpt_platform/frontend/src/app/(platform)/marketplace/components/InstallOnExpertButton/useInstallOnExpertButton.ts
@@ -1,15 +1,13 @@
import { useListExperts } from "@/app/api/__generated__/endpoints/experts/experts";
import { Expert } from "@/app/api/__generated__/models/expert";
import { useAuth } from "@/lib/auth/hooks/useAuth";
-import { Flag, useGetFlag } from "@/services/feature-flags/use-get-flag";
import { useState } from "react";
export function useInstallOnExpertButton() {
- const hireExpertsEnabled = useGetFlag(Flag.HIRE_EXPERTS);
const { isLoggedIn } = useAuth();
const [pickerOpen, setPickerOpen] = useState(false);
- const canFetchExperts = Boolean(hireExpertsEnabled) && isLoggedIn;
+ const canFetchExperts = isLoggedIn;
const expertsQuery = useListExperts({
query: {
diff --git a/autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainMarketplacePage/MainMarketplacePage.tsx b/autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainMarketplacePage/MainMarketplacePage.tsx
index d0e9edc434..6b4fcbb741 100644
--- a/autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainMarketplacePage/MainMarketplacePage.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainMarketplacePage/MainMarketplacePage.tsx
@@ -1,26 +1,29 @@
"use client";
+import { PublishAgentModal } from "@/components/contextual/PublishAgentModal/PublishAgentModal";
+import type { PublishState } from "@/components/contextual/PublishAgentModal/usePublishAgentModal";
import { ErrorCard } from "@/components/molecules/ErrorCard/ErrorCard";
import { useAuth } from "@/lib/auth/hooks/useAuth";
-import {
- Flag,
- useFlagStatus,
- useGetFlag,
-} from "@/services/feature-flags/use-get-flag";
-import { AgentsSection } from "../AgentsSection/AgentsSection";
-import { CategoryFilter } from "../CategoryFilter/CategoryFilter";
+import { useState } from "react";
import { BecomeACreator } from "../BecomeACreator/BecomeACreator";
-import { FeaturedSection } from "../FeaturedSection/FeaturedSection";
+import { CategoryFilter } from "../CategoryFilter/CategoryFilter";
import { ExpertsSection } from "../ExpertsSection/ExpertsSection";
-import { SkillsList } from "../SkillsList/SkillsList";
-import { SkillsSection } from "../SkillsSection/SkillsSection";
-import { WorkflowsShelf } from "../WorkflowsShelf/WorkflowsShelf";
import { HeroSection } from "../HeroSection/HeroSection";
import { MainMarketplacePageLoading } from "../MainMarketplacePageLoading";
import { MarketplaceTabIntro } from "../MarketplaceTabIntro/MarketplaceTabIntro";
import { AGENTS_SECTION_ID } from "../MarketplaceTabIntro/helpers";
+import { SkillsList } from "../SkillsList/SkillsList";
+import { WorkflowsShelf } from "../WorkflowsShelf/WorkflowsShelf";
import { useMainMarketplacePage } from "./useMainMarketplacePage";
-export const MainMarkeplacePage = () => {
+export function MainMarkeplacePage() {
+ const [publishState, setPublishState] = useState<PublishState>({
+ isOpen: false,
+ step: "select",
+ submissionData: null,
+ });
+ function openPublishing() {
+ setPublishState({ isOpen: true, step: "select", submissionData: null });
+ }
const {
featuredAgents,
topAgents,
@@ -29,15 +32,9 @@ export const MainMarkeplacePage = () => {
isLoading,
hasError,
} = useMainMarketplacePage();
- const { isLoggedIn, isUserLoading } = useAuth();
- const isHireExpertsEnabled = useGetFlag(Flag.HIRE_EXPERTS);
- // Branch on `ready` so the shelf does not pop in after LaunchDarkly
- // answers and push the whole workflow catalogue down.
- const skillsHub = useFlagStatus(Flag.SKILLS_HUB);
- // Hiring is still behind the flag, but the expert pages are public: a
- // visitor browsing the marketplace needs a way to reach them. Signed-in
- // users keep the flag gate so the beta stays invisible to them.
- const showExperts = !isUserLoading && (!isLoggedIn || isHireExpertsEnabled);
+ const { isUserLoading } = useAuth();
+
+ const showExperts = !isUserLoading;
const hasWorkflowShelf = Boolean(
topAgents &&
(topAgents.agents.length > 0 ||
@@ -75,55 +72,34 @@ export const MainMarkeplacePage = () => {
below its content changes what the reader has scrolled past. */}
<CategoryFilter selected={category} onSelect={setCategory} />
{showExperts ? <ExpertsSection category={category} /> : null}
- {isHireExpertsEnabled ? (
- <>
- {skillsHub.ready && skillsHub.enabled ? (
- <SkillsList key={category ?? "all"} category={category} />
- ) : null}
- {topAgents && (
- <WorkflowsShelf
- id={AGENTS_SECTION_ID}
- agents={topAgents.agents}
- featuredAgents={category ? [] : (featuredAgents?.agents ?? [])}
- total={topAgents.pagination.total_items}
- />
- )}
- </>
- ) : (
- <>
- {skillsHub.ready && skillsHub.enabled ? (
- <SkillsSection category={category} />
- ) : null}
- {topAgents && (
- <div className="mb-20" id={AGENTS_SECTION_ID}>
- <AgentsSection
- sectionTitle="All AI Workflows"
- subtitle="Ready-made automations from the community."
- agents={topAgents.agents}
- >
- {/* Featured is a whole-marketplace shelf; under a category filter
- it would show workflows the filter excludes. */}
- {!category &&
- featuredAgents &&
- featuredAgents.agents.length > 0 && (
- <FeaturedSection featuredAgents={featuredAgents.agents} />
- )}
- </AgentsSection>
- </div>
- )}
- </>
+
+ <SkillsList key={category ?? "all"} category={category} />
+ {topAgents && (
+ <WorkflowsShelf
+ id={AGENTS_SECTION_ID}
+ agents={topAgents.agents}
+ featuredAgents={category ? [] : (featuredAgents?.agents ?? [])}
+ total={topAgents.pagination.total_items}
+ onPublish={openPublishing}
+ />
)}
+
{/* The expert layout invites publishing from under the workflows
shelf instead, where it cannot outshout the shelf itself. */}
- {!isHireExpertsEnabled || !hasWorkflowShelf ? (
+ {!hasWorkflowShelf ? (
<BecomeACreator
- title="Become a Creator"
description="Join our ever-growing community of hackers and tinkerers"
- buttonText="Become a Creator"
+ buttonText="Publish your workflows"
+ onPublish={openPublishing}
/>
) : null}
</main>
- <MarketplaceTabIntro />
+ <PublishAgentModal
+ showTrigger={false}
+ targetState={publishState}
+ onStateChange={setPublishState}
+ />
+ <MarketplaceTabIntro canShow={!publishState.isOpen} />
</div>
);
-};
+}
diff --git a/autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainMarketplacePage/__tests__/main.test.tsx b/autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainMarketplacePage/__tests__/main.test.tsx
index 9b3ba6b77e..077a4b7ee3 100644
--- a/autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainMarketplacePage/__tests__/main.test.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainMarketplacePage/__tests__/main.test.tsx
@@ -1,21 +1,60 @@
import { getGetV2ListStoreAgentsResponseMock } from "@/app/api/__generated__/endpoints/store/store.msw";
-import { render, screen } from "@/tests/integrations/test-utils";
+import {
+ render,
+ screen,
+ waitFor,
+ within,
+} from "@/tests/integrations/test-utils";
+import userEvent from "@testing-library/user-event";
import { MainMarkeplacePage } from "../MainMarketplacePage";
import { beforeEach, describe, expect, test, vi } from "vitest";
const mockUseMainMarketplacePage = vi.hoisted(() => vi.fn());
+const mockUseFlagSource = vi.hoisted(() => vi.fn());
+const onboarding = vi.hoisted(() => ({
+ ready: false,
+ completeStep: vi.fn(),
+}));
+
+vi.mock("@/lib/auth/hooks/useAuth", () => ({
+ useAuth: () => ({
+ user: { id: "marketplace-intro-user" },
+ isLoggedIn: true,
+ isUserLoading: false,
+ }),
+}));
+
+vi.mock("@/providers/onboarding/onboarding-provider", () => ({
+ useOnboarding: () => ({
+ state: onboarding.ready ? { completedSteps: [] } : null,
+ completeStep: onboarding.completeStep,
+ }),
+ default: ({ children }: { children: React.ReactNode }) => children,
+}));
vi.mock("../useMainMarketplacePage", () => ({
useMainMarketplacePage: mockUseMainMarketplacePage,
}));
+vi.mock("@/services/feature-flags/flag-source", () => ({
+ useFlagSource: mockUseFlagSource,
+}));
+
describe("MainMarketplacePage", () => {
beforeEach(() => {
+ window.localStorage.clear();
+ onboarding.ready = false;
+ onboarding.completeStep.mockReset();
+ mockUseFlagSource.mockReturnValue({
+ value: undefined,
+ resolved: false,
+ });
mockUseMainMarketplacePage.mockReturnValue({
featuredAgents: getGetV2ListStoreAgentsResponseMock({
agents: [
{
...getGetV2ListStoreAgentsResponseMock().agents[0],
+ agent_graph_id: "featured-graph",
slug: "featured-agent",
agent_name: "Featured Agent",
creator: "AutoGPT",
@@ -26,6 +65,7 @@ describe("MainMarketplacePage", () => {
agents: [
{
...getGetV2ListStoreAgentsResponseMock().agents[0],
+ agent_graph_id: "top-graph",
slug: "top-agent",
agent_name: "Top Agent",
creator: "AutoGPT",
@@ -37,16 +77,80 @@ describe("MainMarketplacePage", () => {
});
});
- test("renders featured agents and all agents, and no creators shelf", () => {
+ test("renders the expert layout and workflow shelf before flags answer", () => {
render(<MainMarkeplacePage />);
- expect(screen.getByText(/hand-picked/i)).toBeDefined();
+ expect(
+ screen.getByRole("heading", { name: /hire an AI expert/i }),
+ ).toBeDefined();
+ expect(screen.getByRole("region", { name: "Workflows" })).toBeDefined();
expect(screen.getByText("Featured Agent")).toBeDefined();
- expect(screen.getByText("All AI Workflows")).toBeDefined();
- expect(screen.getAllByText("Top Agent").length).toBeGreaterThan(0);
- expect(screen.queryByText("Featured Creators")).toBeNull();
+ expect(screen.getByText("Top Agent")).toBeDefined();
expect(
- screen.getByRole("button", { name: "Become a Creator" }),
+ screen.getByRole("button", { name: "Publish your workflows" }),
).toBeDefined();
+ expect(screen.queryByText(/hand-picked/i)).toBeNull();
+ expect(screen.queryByText("All AI Workflows")).toBeNull();
+ expect(screen.queryByText("Featured Creators")).toBeNull();
});
+
+ test.each([
+ { experts: true, emptyShelf: false, trigger: "Publish your workflows" },
+ { experts: true, emptyShelf: true, trigger: "Publish your workflows" },
+ ])(
+ "defers the intro while publishing from $trigger (experts=$experts, emptyShelf=$emptyShelf)",
+ async ({ emptyShelf, trigger }) => {
+ mockUseFlagSource.mockImplementation(() => ({
+ value: true,
+ resolved: true,
+ }));
+ if (emptyShelf) {
+ const data = mockUseMainMarketplacePage();
+ mockUseMainMarketplacePage.mockReturnValue({
+ ...data,
+ featuredAgents: { ...data.featuredAgents, agents: [] },
+ topAgents: { ...data.topAgents, agents: [] },
+ });
+ }
+ const { rerender } = render(<MainMarkeplacePage />);
+ await userEvent.click(screen.getByRole("button", { name: trigger }));
+ const publishDialog = await screen.findByRole("dialog", {
+ name: "Publish Workflow",
+ });
+ expect(screen.getByTestId("publish-agent-modal")).toBeDefined();
+
+ onboarding.ready = true;
+ rerender(<MainMarkeplacePage />);
+ expect(screen.queryByTestId("tab-intro-overlay")).toBeNull();
+ expect(onboarding.completeStep).not.toHaveBeenCalled();
+
+ mockUseFlagSource.mockImplementation(() => ({
+ value: false,
+ resolved: true,
+ }));
+ rerender(<MainMarkeplacePage />);
+ expect(screen.getByRole("dialog", { name: "Publish Workflow" })).toBe(
+ publishDialog,
+ );
+ expect(screen.queryByTestId("tab-intro-overlay")).toBeNull();
+ expect(onboarding.completeStep).not.toHaveBeenCalled();
+
+ await userEvent.click(
+ within(publishDialog).getByRole("button", {
+ name: "Close",
+ }),
+ );
+ expect(
+ await screen.findByRole("dialog", { name: "Workflows ready to work." }),
+ ).toBeDefined();
+ expect(onboarding.completeStep).not.toHaveBeenCalled();
+ await userEvent.click(screen.getByRole("button", { name: "Got it" }));
+ await waitFor(() =>
+ expect(screen.queryByTestId("tab-intro-overlay")).toBeNull(),
+ );
+ expect(onboarding.completeStep).toHaveBeenCalledWith(
+ "MARKETPLACE_TAB_INTRO",
+ );
+ },
+ );
});
diff --git a/autogpt_platform/frontend/src/app/(platform)/marketplace/components/MarketplaceTabIntro/MarketplaceTabIntro.tsx b/autogpt_platform/frontend/src/app/(platform)/marketplace/components/MarketplaceTabIntro/MarketplaceTabIntro.tsx
index 1698d55ec3..f22674a80c 100644
--- a/autogpt_platform/frontend/src/app/(platform)/marketplace/components/MarketplaceTabIntro/MarketplaceTabIntro.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/marketplace/components/MarketplaceTabIntro/MarketplaceTabIntro.tsx
@@ -5,12 +5,19 @@ import { useTabIntroCard } from "@/app/(platform)/components/TabIntroCard/useTab
import { Store01Icon } from "@hugeicons/core-free-icons";
import { AGENTS_SECTION_ID, FEATURED_SECTION_ID } from "./helpers";
+interface Props {
+ canShow?: boolean;
+}
+
// First visit to the Marketplace tab. The CTA lands the user on the
// hand-picked carousel rather than the top of a long page, falling back to the
// full listing on the days nothing is featured — the card promises movement,
// so it has to produce some.
-export function MarketplaceTabIntro() {
- const { isOpen, dismiss, takeAction } = useTabIntroCard("marketplace");
+export function MarketplaceTabIntro({ canShow = true }: Props) {
+ const { isOpen, dismiss, takeAction } = useTabIntroCard(
+ "marketplace",
+ canShow,
+ );
function browseFeatured() {
takeAction("browse_featured");
diff --git a/autogpt_platform/frontend/src/app/(platform)/marketplace/components/SkillsSection/SkillsSection.tsx b/autogpt_platform/frontend/src/app/(platform)/marketplace/components/SkillsSection/SkillsSection.tsx
deleted file mode 100644
index da7c2a2c24..0000000000
--- a/autogpt_platform/frontend/src/app/(platform)/marketplace/components/SkillsSection/SkillsSection.tsx
+++ /dev/null
@@ -1,144 +0,0 @@
-"use client";
-
-import { Icon } from "@/components/atoms/Icon/Icon";
-import { Skeleton } from "@/components/atoms/Skeleton/Skeleton";
-import { Text } from "@/components/atoms/Text/Text";
-import { BookOpen01Icon } from "@hugeicons/core-free-icons";
-import Link from "next/link";
-import { SectionHeader } from "../SectionHeader";
-import { SkillCard } from "./components/SkillCard";
-import { SHELF_SIZE } from "./helpers";
-import { useSkillsSection } from "./useSkillsSection";
-
-const HEADING_ID = "skills-heading";
-
-interface Props {
- category?: string | null;
-}
-
-export function SkillsSection({ category }: Props) {
- const {
- isLoggedIn,
- skills: fetchedSkills,
- total,
- installedSlugs,
- isLoading,
- isError,
- refetch,
- } = useSkillsSection({ category });
- // One shared query feeds both shelves; the card layout takes the first four.
- const skills = fetchedSkills.slice(0, SHELF_SIZE);
-
- // Under a category filter an empty shelf means "no skills in this
- // category", so the whole section goes rather than offering an empty state.
- if (!isLoading && !isError && skills.length === 0 && category) return null;
- // Visitors get nothing when there is nothing to show, as Experts does.
- if (!isLoading && !isError && skills.length === 0 && !isLoggedIn) return null;
-
- return (
- <section
- id="skills"
- aria-labelledby={HEADING_ID}
- className="mb-20 scroll-mt-24"
- >
- <SectionHeader
- title="Skills"
- titleId={HEADING_ID}
- subtitle="Playbooks your experts follow — from brand voice to cold outreach. Teach them your way of working."
- action={sectionAction({ isLoggedIn, total })}
- secondaryAction={
- isLoggedIn
- ? { label: "Build your own", href: "/library/skills" }
- : undefined
- }
- />
- {isLoading ? (
- <div
- role="status"
- aria-busy="true"
- aria-label="Loading skills"
- className="grid grid-cols-1 gap-5 md:grid-cols-2"
- >
- {[0, 1].map((i) => (
- <Skeleton key={i} className="h-[18rem] w-full rounded-2xl" />
- ))}
- </div>
- ) : isError ? (
- <ShelfError onRetry={refetch} />
- ) : skills.length === 0 ? (
- <EmptyShelf />
- ) : (
- <div className="grid grid-cols-1 gap-5 md:grid-cols-2">
- {skills.map((skill) => (
- <SkillCard
- key={skill.slug}
- skill={skill}
- isInstalled={installedSlugs.has(skill.slug)}
- />
- ))}
- </div>
- )}
- </section>
- );
-}
-
-function sectionAction({
- isLoggedIn,
- total,
-}: {
- isLoggedIn: boolean;
- total: number;
-}) {
- if (total > SHELF_SIZE)
- return { label: "Browse all skills", href: "/marketplace/skills" };
- if (isLoggedIn) return { label: "Your skills", href: "/library/skills" };
- return undefined;
-}
-
-// The shelf is secondary on this page, so a failure is one line — the page
-// already reserves the full ErrorCard for its own failure.
-function ShelfError({ onRetry }: { onRetry: () => void }) {
- return (
- <div className="flex items-center gap-2 text-sm text-zinc-600">
- <span>Couldn&apos;t load skills right now.</span>
- <button
- type="button"
- onClick={onRetry}
- className="font-medium text-accent underline-offset-2 transition-colors hover:underline"
- >
- Retry
- </button>
- </div>
- );
-}
-
-function EmptyShelf() {
- return (
- <div
- className="flex flex-col items-center justify-center gap-3 rounded-large border border-dashed border-zinc-200 px-6 py-16 text-center"
- data-testid="skills-shelf-empty"
- >
- <div className="flex h-12 w-12 items-center justify-center rounded-full bg-violet-50">
- <Icon
- icon={BookOpen01Icon}
- size={24}
- className="text-violet-700"
- aria-hidden
- />
- </div>
- <Text variant="h4" className="text-zinc-900">
- Nothing published yet
- </Text>
- <Text variant="body" className="max-w-md !text-zinc-600">
- Skills from the community will show up here. In the meantime, teach your
- experts a skill of your own.
- </Text>
- <Link
- href="/library/skills"
- className="text-sm font-medium text-accent transition-colors hover:text-accent/80"
- >
- Go to your skills →
- </Link>
- </div>
- );
-}
diff --git a/autogpt_platform/frontend/src/app/(platform)/marketplace/components/WorkflowsShelf/WorkflowsShelf.tsx b/autogpt_platform/frontend/src/app/(platform)/marketplace/components/WorkflowsShelf/WorkflowsShelf.tsx
index 612ab37181..d5e4953e63 100644
--- a/autogpt_platform/frontend/src/app/(platform)/marketplace/components/WorkflowsShelf/WorkflowsShelf.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/marketplace/components/WorkflowsShelf/WorkflowsShelf.tsx
@@ -17,15 +17,27 @@ interface Props {
agents: StoreAgent[];
featuredAgents: StoreAgent[];
total: number;
+ onPublish?: () => void;
}
-export function WorkflowsShelf({ id, agents, featuredAgents, total }: Props) {
+export function WorkflowsShelf({
+ id,
+ agents,
+ featuredAgents,
+ total,
+ onPublish,
+}: Props) {
const [isExpanded, setIsExpanded] = useState(false);
const ordered = featuredFirst(agents, featuredAgents);
if (ordered.length === 0) return null;
const shown = isExpanded ? ordered : ordered.slice(0, SHELF_PREVIEW_SIZE);
+ const publishTrigger = (
+ <Button variant="secondary" size="small" onClick={onPublish}>
+ Publish your workflows
+ </Button>
+ );
return (
<section
@@ -56,13 +68,11 @@ export function WorkflowsShelf({ id, agents, featuredAgents, total }: Props) {
{/* The old full-width creator banner sat at the bottom of the page and
spoke louder than the shelf it advertised; one line under the
workflows is the whole invitation. */}
- <PublishAgentModal
- trigger={
- <Button variant="secondary" size="small">
- Publish your workflows
- </Button>
- }
- />
+ {onPublish ? (
+ publishTrigger
+ ) : (
+ <PublishAgentModal trigger={publishTrigger} />
+ )}
</div>
</section>
);
diff --git a/autogpt_platform/frontend/src/app/(platform)/marketplace/experts/[expertId]/components/ExpertComingSoonLabel.tsx b/autogpt_platform/frontend/src/app/(platform)/marketplace/experts/[expertId]/components/ExpertComingSoonLabel.tsx
deleted file mode 100644
index cde40884cb..0000000000
--- a/autogpt_platform/frontend/src/app/(platform)/marketplace/experts/[expertId]/components/ExpertComingSoonLabel.tsx
+++ /dev/null
@@ -1,9 +0,0 @@
-/** Shown where the hire action goes while the ``hire-experts`` flag is off
- * for this viewer: the profile stays public, the hiring does not. */
-export function ExpertComingSoonLabel() {
- return (
- <span className="inline-flex h-9 items-center rounded-full border border-zinc-200 bg-white px-3.5 text-sm font-medium text-zinc-500">
- Coming soon
- </span>
- );
-}
diff --git a/autogpt_platform/frontend/src/app/(platform)/marketplace/experts/[expertId]/components/ExpertHireCard.tsx b/autogpt_platform/frontend/src/app/(platform)/marketplace/experts/[expertId]/components/ExpertHireCard.tsx
index 86b7bd35fe..2d9448470c 100644
--- a/autogpt_platform/frontend/src/app/(platform)/marketplace/experts/[expertId]/components/ExpertHireCard.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/marketplace/experts/[expertId]/components/ExpertHireCard.tsx
@@ -8,20 +8,12 @@ interface Props {
expert: Expert;
firstName: string;
actions: ReactNode;
- /** Hiring is open to this viewer; when it is not, the card makes no
- * promise about joining. */
- isHiringOpen: boolean;
}
/** The page's call to action, kept in view: sticky beside the content on
* wide screens, straight under the hero on phones. It carries the price
* terms so the decision and its cost sit together. */
-export function ExpertHireCard({
- expert,
- firstName,
- actions,
- isHiringOpen,
-}: Props) {
+export function ExpertHireCard({ expert, firstName, actions }: Props) {
const weeklyBudget = expert.weekly_budget ?? null;
const workflowCount = expert.workflows.length;
@@ -31,9 +23,7 @@ export function ExpertHireCard({
<ul className="mt-5 flex flex-col gap-2.5">
<Perk icon={CheckmarkCircle02Icon}>No extra cost</Perk>
- {isHiringOpen ? (
- <Perk icon={CheckmarkCircle02Icon}>Joins your team instantly</Perk>
- ) : null}
+ <Perk icon={CheckmarkCircle02Icon}>Joins your team instantly</Perk>
{workflowCount > 0 ? (
<Perk icon={CheckmarkCircle02Icon}>
{`${workflowCount} ${workflowCount === 1 ? "workflow" : "workflows"} installed and ready to run`}
diff --git a/autogpt_platform/frontend/src/app/(platform)/marketplace/experts/[expertId]/components/ExpertPage.tsx b/autogpt_platform/frontend/src/app/(platform)/marketplace/experts/[expertId]/components/ExpertPage.tsx
index ba0b425614..53d15a82b8 100644
--- a/autogpt_platform/frontend/src/app/(platform)/marketplace/experts/[expertId]/components/ExpertPage.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/marketplace/experts/[expertId]/components/ExpertPage.tsx
@@ -10,23 +10,22 @@ import { Skeleton } from "@/components/atoms/Skeleton/Skeleton";
import { Dialog } from "@/components/molecules/Dialog/Dialog";
import { ErrorCard } from "@/components/molecules/ErrorCard/ErrorCard";
import { VoicePicker } from "@/components/organisms/VoicePicker/VoicePicker";
+import { useTrackExpertProfileOpened } from "@/services/experts/use-track-funnel-view-once";
+import { useHireFlow } from "@/services/experts/useHireFlow";
import { ArrowLeft02Icon } from "@hugeicons/core-free-icons";
import Link from "next/link";
import { notFound, useParams } from "next/navigation";
import { ReactNode } from "react";
+import { useExpertPage } from "../useExpertPage";
import { ExpertAbout } from "./ExpertAbout";
import { ExpertAccess } from "./ExpertAccess";
-import { ExpertComingSoonLabel } from "./ExpertComingSoonLabel";
import { ExpertDayOne } from "./ExpertDayOne";
import { ExpertHireActions } from "./ExpertHireActions";
-import { ExpertHeroBand, ExpertHeroIdentity } from "./ExpertPageHeader";
import { ExpertHireCard } from "./ExpertHireCard";
+import { ExpertHeroBand, ExpertHeroIdentity } from "./ExpertPageHeader";
import { ExpertProtectedRules } from "./ExpertProtectedRules";
import { ExpertSkills } from "./ExpertSkills";
import { ExpertWorkflowList } from "./ExpertWorkflowList";
-import { useExpertPage } from "../useExpertPage";
-import { useHireFlow } from "@/services/experts/useHireFlow";
-import { useTrackExpertProfileOpened } from "@/services/experts/use-track-funnel-view-once";
const MAIN_CLASS =
"mx-auto flex w-full max-w-[1120px] flex-col px-4 pb-24 pt-8 sm:px-6 md:px-8";
@@ -50,7 +49,6 @@ export function ExpertPage() {
expert,
hiredExpert,
isLoggedIn,
- isHiringOpen,
isActionReady,
systemProviders,
isLoading,
@@ -117,7 +115,7 @@ export function ExpertPage() {
let actions: ReactNode = <Skeleton className="h-9 w-full rounded-full" />;
if (isActionReady) {
- actions = isHiringOpen ? (
+ actions = (
<ExpertHireActions
expert={expert}
hiredExpert={hiredExpert}
@@ -125,8 +123,6 @@ export function ExpertPage() {
isHiring={isHiring}
onHire={hire}
/>
- ) : (
- <ExpertComingSoonLabel />
);
}
@@ -148,7 +144,6 @@ export function ExpertPage() {
expert={expert}
firstName={firstName}
actions={actions}
- isHiringOpen={isHiringOpen}
/>
</div>
</div>
diff --git a/autogpt_platform/frontend/src/app/(platform)/marketplace/experts/[expertId]/useExpertPage.ts b/autogpt_platform/frontend/src/app/(platform)/marketplace/experts/[expertId]/useExpertPage.ts
index 541e55eb70..4e5aef50be 100644
--- a/autogpt_platform/frontend/src/app/(platform)/marketplace/experts/[expertId]/useExpertPage.ts
+++ b/autogpt_platform/frontend/src/app/(platform)/marketplace/experts/[expertId]/useExpertPage.ts
@@ -3,25 +3,20 @@ import {
useListExpertTemplates,
} from "@/app/api/__generated__/endpoints/experts/experts";
import { useGetV1ListSystemProviders } from "@/app/api/__generated__/endpoints/integrations/integrations";
-import { okData } from "@/app/api/helpers";
import { Expert } from "@/app/api/__generated__/models/expert";
import { ExpertTemplate } from "@/app/api/__generated__/models/expertTemplate";
+import { okData } from "@/app/api/helpers";
import { useAuth } from "@/lib/auth/hooks/useAuth";
-import { Flag, useFlagStatus } from "@/services/feature-flags/use-get-flag";
interface Args {
expertId: string;
}
-/** The template behind a marketplace expert page, plus whether this viewer
- * can hire it. Templates are public, so the profile loads for everyone; the
- * hired roster and the hire itself need a session and the experts flag.
- * With the flag off the header shows its coming-soon label instead. */
+/** Public template and signed-in viewer hiring state. */
export function useExpertPage({ expertId }: Args) {
const { isLoggedIn, isUserLoading } = useAuth();
- const { enabled, ready } = useFlagStatus(Flag.HIRE_EXPERTS);
- const isHiringOpen = Boolean(enabled);
- const canHire = isLoggedIn && isHiringOpen;
+
+ const canHire = isLoggedIn;
const templatesQuery = useListExpertTemplates(undefined, {
query: { select: (x) => x.data as ExpertTemplate[] },
@@ -51,13 +46,7 @@ export function useExpertPage({ expertId }: Args) {
// rather than risk naming a provider the platform supplies.
systemProviders: systemProvidersQuery.data,
isLoggedIn,
- isHiringOpen,
- // Which header action to show is only decided once LaunchDarkly has
- // answered and the roster is in: rendering "Coming soon" or a "Hire"
- // button first would flash the wrong state at users who have hiring, or
- // have already hired this expert. A disabled roster query never blocks —
- // isLoading is false unless it is actually fetching.
- isActionReady: !isUserLoading && ready && !expertsQuery.isLoading,
+ isActionReady: !isUserLoading && !expertsQuery.isLoading,
isLoading: templatesQuery.isLoading,
isError: templatesQuery.isError,
refetch: templatesQuery.refetch,
diff --git a/autogpt_platform/frontend/src/app/(platform)/marketplace/experts/__tests__/expert-page.test.tsx b/autogpt_platform/frontend/src/app/(platform)/marketplace/experts/__tests__/expert-page.test.tsx
index 85e5a007c7..c97b2cb853 100644
--- a/autogpt_platform/frontend/src/app/(platform)/marketplace/experts/__tests__/expert-page.test.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/marketplace/experts/__tests__/expert-page.test.tsx
@@ -38,9 +38,6 @@ beforeEach(() => {
const mockUseAuth = vi.hoisted(() => vi.fn());
const mockRouterPush = vi.hoisted(() => vi.fn());
const mockParams = vi.hoisted(() => ({ expertId: "template-maria" }));
-const flagStatusMock = vi.hoisted(() =>
- vi.fn(() => ({ enabled: true, ready: true })),
-);
vi.mock("next/navigation", () => ({
useRouter: () => ({
@@ -63,20 +60,6 @@ vi.mock("@/lib/auth/hooks/useAuth", () => ({
useAuth: mockUseAuth,
}));
-vi.mock("@/services/feature-flags/use-get-flag", async (importOriginal) => {
- const actual =
- await importOriginal<
- typeof import("@/services/feature-flags/use-get-flag")
- >();
- return {
- ...actual,
- useFlagStatus: (flag: string) =>
- flag === "hire-experts"
- ? flagStatusMock()
- : actual.useFlagStatus(flag as never),
- };
-});
-
const mariaTemplate: Expert = {
id: "template-maria",
name: "Maria",
@@ -170,7 +153,7 @@ describe("Marketplace expert page", () => {
beforeEach(() => {
mockRouterPush.mockReset();
mockParams.expertId = "template-maria";
- flagStatusMock.mockReturnValue({ enabled: true, ready: true });
+
mockUseAuth.mockReturnValue({ user: { id: "user-1" }, isLoggedIn: true });
server.use(
getGetV1ListSystemProvidersMockHandler([
@@ -643,42 +626,4 @@ describe("Marketplace expert page", () => {
expect(screen.queryByText("Coming soon")).toBeNull();
expect(rosterRequested).toBe(false);
});
-
- test("shows the coming-soon label instead of hire actions when the flag is off", async () => {
- flagStatusMock.mockReturnValue({ enabled: false, ready: true });
- let rosterRequested = false;
- server.use(
- getListExpertTemplatesMockHandler([mariaTemplate]),
- getListExpertsMockHandler(() => {
- rosterRequested = true;
- return [];
- }),
- );
-
- renderPage();
-
- expect(
- await screen.findByRole("heading", { level: 1, name: "Maria" }),
- ).toBeDefined();
- expect(screen.getByText("Coming soon")).toBeDefined();
- expect(screen.queryByRole("button", { name: "Hire Maria" })).toBeNull();
- expect(screen.queryByRole("link", { name: "Get started" })).toBeNull();
- expect(rosterRequested).toBe(false);
- });
-
- test("waits for the flag before showing a header action", async () => {
- flagStatusMock.mockReturnValue({ enabled: false, ready: false });
- server.use(
- getListExpertTemplatesMockHandler([mariaTemplate]),
- getListExpertsMockHandler([]),
- );
-
- renderPage();
-
- expect(
- await screen.findByRole("heading", { level: 1, name: "Maria" }),
- ).toBeDefined();
- expect(screen.queryByText("Coming soon")).toBeNull();
- expect(screen.queryByRole("button", { name: "Hire Maria" })).toBeNull();
- });
});
diff --git a/autogpt_platform/frontend/src/app/(platform)/marketplace/search/__tests__/experts-in-search.test.tsx b/autogpt_platform/frontend/src/app/(platform)/marketplace/search/__tests__/experts-in-search.test.tsx
index 535ff7ca32..79a1117751 100644
--- a/autogpt_platform/frontend/src/app/(platform)/marketplace/search/__tests__/experts-in-search.test.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/marketplace/search/__tests__/experts-in-search.test.tsx
@@ -21,7 +21,6 @@ import { MainSearchResultPage } from "../components/MainSearchResultPage/MainSea
configure({ asyncUtilTimeout: 10000 });
const mockUseAuth = vi.hoisted(() => vi.fn());
-const hireExpertsFlag = vi.hoisted(() => ({ enabled: true }));
vi.mock("next/navigation", () => ({
useRouter: () => ({
@@ -39,21 +38,6 @@ vi.mock("next/navigation", () => ({
vi.mock("@/lib/auth/hooks/useAuth", () => ({ useAuth: mockUseAuth }));
-vi.mock("@/services/feature-flags/use-get-flag", async (importOriginal) => {
- const actual =
- await importOriginal<
- typeof import("@/services/feature-flags/use-get-flag")
- >();
- return {
- ...actual,
- useFlagStatus: () => ({ enabled: false, ready: true }),
- useGetFlag: (flag: string) =>
- flag === "hire-experts"
- ? hireExpertsFlag.enabled
- : actual.useGetFlag(flag as never),
- };
-});
-
const maria: Expert = {
id: "template-maria",
name: "Maria",
@@ -86,7 +70,7 @@ function rosterHandler(matches: Expert[]) {
describe("Experts in marketplace search", () => {
beforeEach(() => {
searchedTerms.length = 0;
- hireExpertsFlag.enabled = true;
+
mockUseAuth.mockReturnValue({ user: { id: "user-1" }, isLoggedIn: true });
server.use(
getGetV2ListStoreAgentsMockHandler(),
@@ -280,16 +264,26 @@ describe("Experts in marketplace search", () => {
expect(isExpertCardShown("template-max")).toBe(true);
});
- test("asks for no experts and offers no chip outside the beta", async () => {
- hireExpertsFlag.enabled = false;
- server.use(rosterHandler([maria]));
+ test("offers public expert search to signed-out visitors", async () => {
+ mockUseAuth.mockReturnValue({ user: null, isLoggedIn: false });
+ let privateRosterRequests = 0;
+ server.use(
+ rosterHandler([maria]),
+ getListExpertsMockHandler(() => {
+ privateRosterRequests += 1;
+ return [];
+ }),
+ );
render(<MainSearchResultPage searchTerm="Maria" sort="runs" />);
await screen.findByText(/Showing results for/);
- await waitFor(() => expect(searchedTerms).toHaveLength(0));
- expect(screen.queryByRole("heading", { name: "Experts" })).toBeNull();
- expect(screen.queryByRole("button", { name: /Experts/ })).toBeNull();
+ await waitFor(() => expect(searchedTerms).toEqual(["Maria"]));
+ expect(
+ await screen.findByRole("heading", { name: "Experts" }),
+ ).toBeDefined();
+ expect(screen.getByRole("button", { name: /Experts/ })).toBeDefined();
+ expect(privateRosterRequests).toBe(0);
});
});
diff --git a/autogpt_platform/frontend/src/app/(platform)/marketplace/search/__tests__/skills-in-search.test.tsx b/autogpt_platform/frontend/src/app/(platform)/marketplace/search/__tests__/skills-in-search.test.tsx
index 90d56b41dc..b8bfbf7392 100644
--- a/autogpt_platform/frontend/src/app/(platform)/marketplace/search/__tests__/skills-in-search.test.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/marketplace/search/__tests__/skills-in-search.test.tsx
@@ -20,7 +20,6 @@ import { MainSearchResultPage } from "../components/MainSearchResultPage/MainSea
configure({ asyncUtilTimeout: 10000 });
const mockUseAuth = vi.hoisted(() => vi.fn());
-const flag = vi.hoisted(() => ({ enabled: true, ready: true }));
vi.mock("next/navigation", () => ({
useRouter: () => ({
@@ -38,14 +37,6 @@ vi.mock("next/navigation", () => ({
vi.mock("@/lib/auth/hooks/useAuth", () => ({ useAuth: mockUseAuth }));
-vi.mock("@/services/feature-flags/use-get-flag", async (importOriginal) => {
- const actual =
- await importOriginal<
- typeof import("@/services/feature-flags/use-get-flag")
- >();
- return { ...actual, useFlagStatus: () => flag };
-});
-
const outreach: MarketplaceSkill = {
slug: "outreach-playbook",
name: "outreach-playbook",
@@ -60,8 +51,6 @@ const outreach: MarketplaceSkill = {
describe("Skills in marketplace search", () => {
beforeEach(() => {
- flag.enabled = true;
- flag.ready = true;
mockUseAuth.mockReturnValue({ user: { id: "user-1" }, isLoggedIn: true });
server.use(
getGetV2ListStoreAgentsMockHandler(),
@@ -98,8 +87,9 @@ describe("Skills in marketplace search", () => {
expect(screen.getByRole("button", { name: /Skills/ })).toBeDefined();
});
- test("asks for no skills and offers no chip outside the beta", async () => {
- flag.enabled = false;
+ test("offers public skill search to signed-out visitors", async () => {
+ mockUseAuth.mockReturnValue({ user: null, isLoggedIn: false });
+
let requested = false;
server.use(
getGetV2ListMarketplaceSkillsMockHandler200(() => {
@@ -121,7 +111,9 @@ describe("Skills in marketplace search", () => {
await screen.findByText(/Showing results for/, undefined, {
timeout: 10000,
});
- await waitFor(() => expect(requested).toBe(false));
- expect(screen.queryByRole("heading", { name: "Skills" })).toBeNull();
+ await waitFor(() => expect(requested).toBe(true));
+ expect(
+ await screen.findByRole("heading", { name: "Skills" }),
+ ).toBeDefined();
});
});
diff --git a/autogpt_platform/frontend/src/app/(platform)/marketplace/search/components/MainSearchResultPage/MainSearchResultPage.tsx b/autogpt_platform/frontend/src/app/(platform)/marketplace/search/components/MainSearchResultPage/MainSearchResultPage.tsx
index 8de09be93c..2d872ff83b 100644
--- a/autogpt_platform/frontend/src/app/(platform)/marketplace/search/components/MainSearchResultPage/MainSearchResultPage.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/marketplace/search/components/MainSearchResultPage/MainSearchResultPage.tsx
@@ -2,17 +2,17 @@ import { GetV2ListStoreAgentsParams } from "@/app/api/__generated__/models/getV2
import { SearchFilterChips } from "@/components/__legacy__/SearchFilterChips";
import { SortDropdown } from "@/components/__legacy__/SortDropdown";
import { Button } from "@/components/atoms/Button/Button";
+import { Icon } from "@/components/atoms/Icon/Icon";
import { ErrorCard } from "@/components/molecules/ErrorCard/ErrorCard";
+import { ArrowLeft02Icon } from "@hugeicons/core-free-icons";
import { AgentsSection } from "../../../components/AgentsSection/AgentsSection";
+import { ExpertCard } from "../../../components/ExpertsSection/components/ExpertCard";
import { FeaturedCreators } from "../../../components/FeaturedCreators/FeaturedCreators";
import { MainSearchResultPageLoading } from "../../../components/MainSearchResultPageLoading";
import { SearchBar } from "../../../components/SearchBar/SearchBar";
import { SectionHeader } from "../../../components/SectionHeader";
import { SkillCard } from "../../../components/SkillsSection/components/SkillCard";
-import { ExpertCard } from "../../../components/ExpertsSection/components/ExpertCard";
import { useMainSearchResultPage } from "./useMainSearchResultPage";
-import { ArrowLeft02Icon } from "@hugeicons/core-free-icons";
-import { Icon } from "@/components/atoms/Icon/Icon";
type MarketplaceSearchSort = GetV2ListStoreAgentsParams["sorted_by"];
@@ -41,7 +41,6 @@ export const MainSearchResultPage = ({
showSkills,
showExperts,
isExpertsVisible,
- isSkillsHubEnabled,
isAgentsLoading,
isCreatorsLoading,
isExpertsLoading,
@@ -106,7 +105,7 @@ export const MainSearchResultPage = ({
totalCount={totalCount}
agentsCount={agentsCount}
creatorsCount={creatorsCount}
- skillsCount={isSkillsHubEnabled ? skillsCount : undefined}
+ skillsCount={skillsCount}
expertsCount={isExpertsVisible ? expertsCount : undefined}
onFilterChange={handleFilterChange}
/>
diff --git a/autogpt_platform/frontend/src/app/(platform)/marketplace/search/components/MainSearchResultPage/useMainSearchResultPage.ts b/autogpt_platform/frontend/src/app/(platform)/marketplace/search/components/MainSearchResultPage/useMainSearchResultPage.ts
index 3f87a4d78b..3fbe4f2f7e 100644
--- a/autogpt_platform/frontend/src/app/(platform)/marketplace/search/components/MainSearchResultPage/useMainSearchResultPage.ts
+++ b/autogpt_platform/frontend/src/app/(platform)/marketplace/search/components/MainSearchResultPage/useMainSearchResultPage.ts
@@ -3,19 +3,14 @@ import {
useGetV2ListStoreAgents,
useGetV2ListStoreCreators,
} from "@/app/api/__generated__/endpoints/store/store";
-import { okData } from "@/app/api/helpers";
import { CreatorsResponse } from "@/app/api/__generated__/models/creatorsResponse";
import { GetV2ListStoreAgentsParams } from "@/app/api/__generated__/models/getV2ListStoreAgentsParams";
import { GetV2ListStoreCreatorsParams } from "@/app/api/__generated__/models/getV2ListStoreCreatorsParams";
import { StoreAgentsResponse } from "@/app/api/__generated__/models/storeAgentsResponse";
-import {
- Flag,
- useFlagStatus,
- useGetFlag,
-} from "@/services/feature-flags/use-get-flag";
+import { okData } from "@/app/api/helpers";
import { useAuth } from "@/lib/auth/hooks/useAuth";
+import { useMemo, useState } from "react";
import { useExpertsSection } from "../../../components/ExpertsSection/useExpertsSection";
-import { useState, useMemo } from "react";
type MarketplaceSearchSort = GetV2ListStoreAgentsParams["sorted_by"];
type CreatorSortBy = GetV2ListStoreCreatorsParams["sorted_by"];
@@ -33,13 +28,10 @@ export const useMainSearchResultPage = ({
const [showCreators, setShowCreators] = useState(true);
const [showSkills, setShowSkills] = useState(true);
const [showExperts, setShowExperts] = useState(true);
- const skillsHub = useFlagStatus(Flag.SKILLS_HUB);
- const { isLoggedIn, isUserLoading } = useAuth();
- const isHireExpertsEnabled = useGetFlag(Flag.HIRE_EXPERTS);
- // Same gate as the marketplace shelf: expert pages are public, hiring is
- // not, so a signed-in user outside the beta sees neither surface.
- const isExpertsVisible =
- !isUserLoading && (!isLoggedIn || isHireExpertsEnabled);
+
+ const { isUserLoading } = useAuth();
+
+ const isExpertsVisible = !isUserLoading;
const [clientSortBy, setClientSortBy] = useState<string>(
sort ?? "updated_at",
);
@@ -95,7 +87,6 @@ export const useMainSearchResultPage = ({
{ search_query: searchTerm },
{
query: {
- enabled: skillsHub.ready && skillsHub.enabled,
select: (response) => okData(response)?.skills ?? [],
},
},
@@ -178,7 +169,6 @@ export const useMainSearchResultPage = ({
showSkills,
showExperts,
isExpertsVisible,
- isSkillsHubEnabled: skillsHub.ready && skillsHub.enabled,
isAgentsLoading,
isCreatorsLoading,
isSkillsLoading,
diff --git a/autogpt_platform/frontend/src/app/(platform)/marketplace/skills/[slug]/__tests__/install-to-expert.test.tsx b/autogpt_platform/frontend/src/app/(platform)/marketplace/skills/[slug]/__tests__/install-to-expert.test.tsx
index 4b16243a8d..a1e467478d 100644
--- a/autogpt_platform/frontend/src/app/(platform)/marketplace/skills/[slug]/__tests__/install-to-expert.test.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/marketplace/skills/[slug]/__tests__/install-to-expert.test.tsx
@@ -34,14 +34,6 @@ vi.mock("next/navigation", () => ({
vi.mock("@/lib/auth/hooks/useAuth", () => ({ useAuth: mockUseAuth }));
-vi.mock("@/services/feature-flags/use-get-flag", async (importOriginal) => {
- const actual =
- await importOriginal<
- typeof import("@/services/feature-flags/use-get-flag")
- >();
- return { ...actual, useFlagStatus: () => ({ enabled: true, ready: true }) };
-});
-
const outreach: MarketplaceSkillDetails = {
slug: "outreach-playbook",
name: "outreach-playbook",
diff --git a/autogpt_platform/frontend/src/app/(platform)/marketplace/skills/[slug]/__tests__/main.test.tsx b/autogpt_platform/frontend/src/app/(platform)/marketplace/skills/[slug]/__tests__/main.test.tsx
index 0c80d74886..2671b47827 100644
--- a/autogpt_platform/frontend/src/app/(platform)/marketplace/skills/[slug]/__tests__/main.test.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/marketplace/skills/[slug]/__tests__/main.test.tsx
@@ -26,7 +26,6 @@ configure({ asyncUtilTimeout: 10000 });
const mockUseAuth = vi.hoisted(() => vi.fn());
const mockNotFound = vi.hoisted(() => vi.fn());
-const skillsHubFlag = vi.hoisted(() => ({ enabled: true, ready: true }));
vi.mock("next/navigation", () => ({
useRouter: () => ({
@@ -45,14 +44,6 @@ vi.mock("next/navigation", () => ({
vi.mock("@/lib/auth/hooks/useAuth", () => ({ useAuth: mockUseAuth }));
-vi.mock("@/services/feature-flags/use-get-flag", async (importOriginal) => {
- const actual =
- await importOriginal<
- typeof import("@/services/feature-flags/use-get-flag")
- >();
- return { ...actual, useFlagStatus: () => skillsHubFlag };
-});
-
const outreach: MarketplaceSkillDetails = {
slug: "outreach-playbook",
name: "outreach-playbook",
@@ -109,20 +100,15 @@ describe("Marketplace skill page", () => {
beforeEach(() => {
mockUseAuth.mockReturnValue({ user: { id: "user-1" }, isLoggedIn: true });
mockNotFound.mockClear();
- skillsHubFlag.enabled = true;
- skillsHubFlag.ready = true;
+
userSkills.length = 0;
server.use(userSkillsHandler());
});
- test("is not found when the skills-hub flag is off", async () => {
- skillsHubFlag.enabled = false;
+ test("loads skill instructions without a rollout flag", async () => {
renderPage([]);
-
- // A bookmarked URL reaches this page without passing the marketplace
- // shelf, so the shelf being hidden is not what keeps the feature dark.
- expect(mockNotFound).toHaveBeenCalled();
- expect(screen.queryByTestId("skill-install-button")).toBeNull();
+ expect(await screen.findByText(/Four sentences, no more/)).toBeDefined();
+ expect(mockNotFound).not.toHaveBeenCalled();
});
test("shows the instructions experts will follow", async () => {
diff --git a/autogpt_platform/frontend/src/app/(platform)/marketplace/skills/[slug]/__tests__/package-contents.test.tsx b/autogpt_platform/frontend/src/app/(platform)/marketplace/skills/[slug]/__tests__/package-contents.test.tsx
index c2fc3b837f..d0c37c1383 100644
--- a/autogpt_platform/frontend/src/app/(platform)/marketplace/skills/[slug]/__tests__/package-contents.test.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/marketplace/skills/[slug]/__tests__/package-contents.test.tsx
@@ -24,7 +24,6 @@ configure({ asyncUtilTimeout: 10000 });
const mockUseAuth = vi.hoisted(() => vi.fn());
const mockNotFound = vi.hoisted(() => vi.fn());
-const flag = vi.hoisted(() => ({ enabled: true, ready: true }));
vi.mock("next/navigation", () => ({
useRouter: () => ({
@@ -43,14 +42,6 @@ vi.mock("next/navigation", () => ({
vi.mock("@/lib/auth/hooks/useAuth", () => ({ useAuth: mockUseAuth }));
-vi.mock("@/services/feature-flags/use-get-flag", async (importOriginal) => {
- const actual =
- await importOriginal<
- typeof import("@/services/feature-flags/use-get-flag")
- >();
- return { ...actual, useFlagStatus: () => flag };
-});
-
const SLUG = "webapp-testing";
const SCRIPT_PATH = "scripts/with_server.py";
const SCRIPT_SOURCE = "#!/usr/bin/env python3\nprint('serving')\n";
@@ -92,8 +83,6 @@ const PACKAGE: SkillPackageFile[] = [
describe("Marketplace skill package contents", () => {
beforeEach(() => {
- flag.enabled = true;
- flag.ready = true;
mockNotFound.mockClear();
mockUseAuth.mockReturnValue({
user: { id: "user-1" },
diff --git a/autogpt_platform/frontend/src/app/(platform)/marketplace/skills/[slug]/components/SkillPage.tsx b/autogpt_platform/frontend/src/app/(platform)/marketplace/skills/[slug]/components/SkillPage.tsx
index f5670759c3..93ea79a5d0 100644
--- a/autogpt_platform/frontend/src/app/(platform)/marketplace/skills/[slug]/components/SkillPage.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/marketplace/skills/[slug]/components/SkillPage.tsx
@@ -9,6 +9,8 @@ import { Icon } from "@/components/atoms/Icon/Icon";
import { Skeleton } from "@/components/atoms/Skeleton/Skeleton";
import { ConnectServiceDialog } from "@/components/contextual/IntegrationsPanel/components/ConnectServiceDialog/ConnectServiceDialog";
import { formatProviderName } from "@/components/contextual/IntegrationsPanel/helpers";
+import { SkillFileViewer } from "@/components/contextual/SkillPackage/SkillFileViewer";
+import { SkillPackageFileList } from "@/components/contextual/SkillPackage/SkillPackageFileList";
import { ErrorCard } from "@/components/molecules/ErrorCard/ErrorCard";
import { IntegrationLogo } from "@/components/molecules/IntegrationLogo/IntegrationLogo";
import { cn } from "@/lib/utils";
@@ -20,8 +22,6 @@ import { getCategoryAccent } from "../../../components/ExpertsSection/helpers";
import { SkillCard } from "../../../components/SkillsSection/components/SkillCard";
import { formatCategoryLabel } from "../../../components/SkillsSection/helpers";
import { ExpertSection } from "../../../experts/[expertId]/components/ExpertSection";
-import { SkillFileViewer } from "@/components/contextual/SkillPackage/SkillFileViewer";
-import { SkillPackageFileList } from "@/components/contextual/SkillPackage/SkillPackageFileList";
import { ConnectStep } from "./ConnectStep";
import { SkillActions } from "./SkillActions";
import { SkillBody } from "./SkillBody";
@@ -43,8 +43,6 @@ export function SkillPage({ slug }: Props) {
isNotFound,
refetch,
isReady,
- flagEnabled,
- flagReady,
isAdded,
isAdding,
experts,
@@ -64,10 +62,9 @@ export function SkillPage({ slug }: Props) {
// A bookmarked URL reaches this page without passing the marketplace shelf,
// so the shelf being hidden is not what keeps the feature dark.
- if (flagReady && !flagEnabled) notFound();
if (isNotFound) notFound();
- if (!flagReady || isLoading) return <SkillPageSkeleton />;
+ if (isLoading) return <SkillPageSkeleton />;
if (isError || !skill) {
return (
diff --git a/autogpt_platform/frontend/src/app/(platform)/marketplace/skills/[slug]/components/useSkillPage.ts b/autogpt_platform/frontend/src/app/(platform)/marketplace/skills/[slug]/components/useSkillPage.ts
index c6c86c90d3..869b7c8eff 100644
--- a/autogpt_platform/frontend/src/app/(platform)/marketplace/skills/[slug]/components/useSkillPage.ts
+++ b/autogpt_platform/frontend/src/app/(platform)/marketplace/skills/[slug]/components/useSkillPage.ts
@@ -20,7 +20,6 @@ import { okData } from "@/app/api/helpers";
import { formatProviderName } from "@/components/contextual/IntegrationsPanel/helpers";
import { useToast } from "@/components/molecules/Toast/use-toast";
import { useAuth } from "@/lib/auth/hooks/useAuth";
-import { Flag, useFlagStatus } from "@/services/feature-flags/use-get-flag";
import { useQueryClient } from "@tanstack/react-query";
import { useState } from "react";
@@ -31,7 +30,7 @@ export function useSkillPage(slug: string) {
const queryClient = useQueryClient();
const { isLoggedIn, isUserLoading } = useAuth();
const { toast } = useToast();
- const flag = useFlagStatus(Flag.SKILLS_HUB);
+
const [isConnectOpen, setIsConnectOpen] = useState(false);
// Page state rather than the list's: a relative link in the body opens the
// same viewer the package list does.
@@ -122,15 +121,12 @@ export function useSkillPage(slug: string) {
isError: query.isError,
isNotFound: (query.error as { status?: number } | null)?.status === 404,
refetch: query.refetch,
- // Nothing renders before auth, the flag, the user's own skills and the
+ // Nothing renders before auth, the user's own skills and the
// roster have all answered, so the button never flashes into "Added" nor
// grows its dropdown half under the pointer.
isReady:
!isUserLoading &&
- flag.ready &&
(!isLoggedIn || (!installedSkills.isLoading && !expertsQuery.isLoading)),
- flagEnabled: flag.enabled,
- flagReady: flag.ready,
isAdded,
isAdding,
experts,
diff --git a/autogpt_platform/frontend/src/app/(platform)/marketplace/skills/__tests__/browse.test.tsx b/autogpt_platform/frontend/src/app/(platform)/marketplace/skills/__tests__/browse.test.tsx
index 585a160a34..c0b07bd921 100644
--- a/autogpt_platform/frontend/src/app/(platform)/marketplace/skills/__tests__/browse.test.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/marketplace/skills/__tests__/browse.test.tsx
@@ -5,12 +5,7 @@ import {
} from "@/app/api/__generated__/endpoints/store/store.msw";
import type { MarketplaceSkill } from "@/app/api/__generated__/models/marketplaceSkill";
import { server } from "@/mocks/mock-server";
-import {
- configure,
- render,
- screen,
- waitFor,
-} from "@/tests/integrations/test-utils";
+import { configure, render, screen } from "@/tests/integrations/test-utils";
import userEvent from "@testing-library/user-event";
import { HttpResponse, http } from "msw";
import { beforeEach, describe, expect, test, vi } from "vitest";
@@ -25,7 +20,6 @@ const mockUseAuth = vi.hoisted(() => vi.fn());
const mockPush = vi.hoisted(() => vi.fn());
const mockNotFound = vi.hoisted(() => vi.fn());
const searchParams = vi.hoisted(() => ({ value: "" }));
-const flag = vi.hoisted(() => ({ enabled: true, ready: true }));
vi.mock("next/navigation", () => ({
useRouter: () => ({
@@ -44,14 +38,6 @@ vi.mock("next/navigation", () => ({
vi.mock("@/lib/auth/hooks/useAuth", () => ({ useAuth: mockUseAuth }));
-vi.mock("@/services/feature-flags/use-get-flag", async (importOriginal) => {
- const actual =
- await importOriginal<
- typeof import("@/services/feature-flags/use-get-flag")
- >();
- return { ...actual, useFlagStatus: () => flag };
-});
-
const brandVoice: MarketplaceSkill = {
slug: "brand-voice-guide",
name: "brand-voice-guide",
@@ -84,8 +70,7 @@ function listing(skills: MarketplaceSkill[]) {
describe("Marketplace skills browse page", () => {
beforeEach(() => {
searchParams.value = "";
- flag.enabled = true;
- flag.ready = true;
+
mockPush.mockClear();
mockNotFound.mockClear();
mockUseAuth.mockReturnValue({ user: { id: "user-1" }, isLoggedIn: true });
@@ -155,12 +140,14 @@ describe("Marketplace skills browse page", () => {
).toBeDefined();
});
- test("is not found when the skills-hub flag is off", async () => {
- flag.enabled = false;
+ test("loads published skills without a rollout flag", async () => {
server.use(listing([brandVoice]));
render(<SkillsBrowsePage />);
- await waitFor(() => expect(mockNotFound).toHaveBeenCalled());
+ expect(
+ await screen.findByRole("link", { name: /Brand voice guide/ }),
+ ).toBeDefined();
+ expect(mockNotFound).not.toHaveBeenCalled();
});
});
diff --git a/autogpt_platform/frontend/src/app/(platform)/marketplace/skills/components/SkillsBrowsePage/SkillsBrowsePage.tsx b/autogpt_platform/frontend/src/app/(platform)/marketplace/skills/components/SkillsBrowsePage/SkillsBrowsePage.tsx
index f5caec5a47..757fa4e031 100644
--- a/autogpt_platform/frontend/src/app/(platform)/marketplace/skills/components/SkillsBrowsePage/SkillsBrowsePage.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/marketplace/skills/components/SkillsBrowsePage/SkillsBrowsePage.tsx
@@ -6,10 +6,8 @@ import { Text } from "@/components/atoms/Text/Text";
import { ErrorCard } from "@/components/molecules/ErrorCard/ErrorCard";
import { InfiniteList } from "@/components/molecules/InfiniteList/InfiniteList";
import { useStoreCategories } from "@/hooks/useStoreCategories";
-import { Flag, useFlagStatus } from "@/services/feature-flags/use-get-flag";
import { ArrowLeft02Icon, BookOpen01Icon } from "@hugeicons/core-free-icons";
import Link from "next/link";
-import { notFound } from "next/navigation";
import { SearchBar } from "../../../components/SearchBar/SearchBar";
import { SkillCard } from "../../../components/SkillsSection/components/SkillCard";
import { SkillTopicChips } from "../../../components/SkillTopicChips/SkillTopicChips";
@@ -18,7 +16,6 @@ import { useSkillsBrowsePage } from "./useSkillsBrowsePage";
const GRID_CLASS = "grid grid-cols-1 gap-5 md:grid-cols-2";
export function SkillsBrowsePage() {
- const { enabled, ready } = useFlagStatus(Flag.SKILLS_HUB);
const {
search,
category,
@@ -36,8 +33,6 @@ export function SkillsBrowsePage() {
} = useSkillsBrowsePage();
const { categories } = useStoreCategories();
- if (ready && !enabled) notFound();
-
return (
<main className="mx-auto w-full max-w-[1360px] px-6 pb-16 pt-8 md:px-10 lg:px-14">
<Link
@@ -75,7 +70,7 @@ export function SkillsBrowsePage() {
/>
</div>
- {!ready || isLoading ? (
+ {isLoading ? (
<div
role="status"
aria-busy="true"
diff --git a/autogpt_platform/frontend/src/app/(platform)/raise/__tests__/avatar-picker.test.tsx b/autogpt_platform/frontend/src/app/(platform)/raise/__tests__/avatar-picker.test.tsx
index ac384f4c95..fdef37a04b 100644
--- a/autogpt_platform/frontend/src/app/(platform)/raise/__tests__/avatar-picker.test.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/raise/__tests__/avatar-picker.test.tsx
@@ -1,5 +1,10 @@
import type { ExpertAvatarRequestCategory } from "@/app/api/__generated__/models/expertAvatarRequestCategory";
import { getListCopilotSkillsMockHandler } from "@/app/api/__generated__/endpoints/skills/skills.msw";
+import {
+ getGetV1CheckIfOnboardingIsCompletedMockHandler200,
+ getGetV1OnboardingStateMockHandler200,
+ getGetV1OnboardingStateResponseMock200,
+} from "@/app/api/__generated__/endpoints/onboarding/onboarding.msw";
import { MANAGED_IDENTITIES } from "@/components/molecules/ExpertAvatar/helpers";
import { Toaster } from "@/components/molecules/Toast/toaster";
import { server } from "@/mocks/mock-server";
@@ -20,30 +25,12 @@ import {
} from "../helpers";
import RaisePage from "../page";
-const { setFlagStatusMock } = vi.hoisted(() => ({
- setFlagStatusMock: vi.fn(() => ({ enabled: true, ready: true })),
-}));
-
-vi.mock("@/services/feature-flags/use-get-flag", async (importActual) => {
- const actual =
- await importActual<
- typeof import("@/services/feature-flags/use-get-flag")
- >();
- return {
- ...actual,
- useFlagStatus: (flag: string) =>
- flag === "hire-experts"
- ? setFlagStatusMock()
- : actual.useFlagStatus(flag as never),
- };
-});
-
vi.mock("@/lib/auth/hooks/useAuth", () => ({
useAuth: () => ({ isLoggedIn: true, user: { id: "user-1" } }),
}));
vi.mock("next/navigation", () => ({
- useRouter: () => ({ push: vi.fn() }),
+ useRouter: () => ({ push: vi.fn(), replace: vi.fn() }),
usePathname: () => "/raise",
useSearchParams: () => new URLSearchParams(),
useParams: () => ({}),
@@ -100,20 +87,36 @@ function seedAtAvatar(category: ExpertAvatarRequestCategory) {
});
}
-function renderRaise() {
+let onboardingRead = false;
+
+async function renderRaise() {
render(
<>
<RaisePage />
<Toaster />
</>,
);
+ await waitFor(() => expect(onboardingRead).toBe(true));
}
beforeEach(() => {
window.sessionStorage.clear();
mockReducedMotion();
- setFlagStatusMock.mockReturnValue({ enabled: true, ready: true });
- server.use(getListCopilotSkillsMockHandler([]));
+ onboardingRead = false;
+
+ server.use(
+ getListCopilotSkillsMockHandler([]),
+ getGetV1CheckIfOnboardingIsCompletedMockHandler200({
+ is_completed: true,
+ }),
+ getGetV1OnboardingStateMockHandler200(() => {
+ onboardingRead = true;
+ return getGetV1OnboardingStateResponseMock200({
+ userId: "user-1",
+ completedSteps: ["ONBOARDING_COMPLETE"],
+ });
+ }),
+ );
});
afterEach(() => {
@@ -124,7 +127,7 @@ test("the area beat answers the color first and asks for a job title", async ()
const requests: unknown[] = [];
server.use(...generationHandlers(requests));
saveDraft({ ...EMPTY_DRAFT, hasStarted: true });
- renderRaise();
+ await renderRaise();
const categories = await screen.findByRole(
"group",
@@ -169,7 +172,7 @@ test.each([
const requests: unknown[] = [];
server.use(...generationHandlers(requests));
seedAtAvatar(category);
- renderRaise();
+ await renderRaise();
const confirm = await screen.findByRole("button", {
name: "Use this avatar",
});
@@ -200,7 +203,7 @@ test("regeneration uses the area picked at the start", async () => {
const requests: unknown[] = [];
server.use(...generationHandlers(requests));
seedAtAvatar("finance");
- renderRaise();
+ await renderRaise();
await userEvent.click(
await screen.findByRole("button", { name: "Regenerate" }),
@@ -212,7 +215,7 @@ test("regeneration uses the area picked at the start", async () => {
test("the generated avatar is saved only after confirmation", async () => {
server.use(...generationHandlers());
seedAtAvatar("finance");
- renderRaise();
+ await renderRaise();
await userEvent.click(
await screen.findByRole("button", { name: "Regenerate" }),
);
@@ -237,7 +240,7 @@ test("regenerating asks for another avatar in the same category", async () => {
const requests: unknown[] = [];
server.use(...generationHandlers(requests));
seedAtAvatar("finance");
- renderRaise();
+ await renderRaise();
await userEvent.click(
await screen.findByRole("button", { name: "Regenerate" }),
@@ -253,7 +256,7 @@ test("regenerating asks for another avatar in the same category", async () => {
test("the picker offers upload and no face-part controls", async () => {
server.use(...generationHandlers());
seedAtAvatar("finance");
- renderRaise();
+ await renderRaise();
expect(
await screen.findByRole("button", { name: "Upload a picture" }),
diff --git a/autogpt_platform/frontend/src/app/(platform)/raise/__tests__/main.test.tsx b/autogpt_platform/frontend/src/app/(platform)/raise/__tests__/main.test.tsx
index d7527a542e..f18b7e1615 100644
--- a/autogpt_platform/frontend/src/app/(platform)/raise/__tests__/main.test.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/raise/__tests__/main.test.tsx
@@ -18,28 +18,6 @@ import {
VOICE_SKIPPED_LABEL,
} from "../helpers";
-const { setFlagStatusMock } = vi.hoisted(() => ({
- setFlagStatusMock: vi.fn(() => ({ enabled: true, ready: true })),
-}));
-
-vi.mock("@/services/feature-flags/use-get-flag", async (importActual) => {
- const actual =
- await importActual<
- typeof import("@/services/feature-flags/use-get-flag")
- >();
- return {
- ...actual,
- useFlagStatus: (flag: string) => {
- if (flag === "hire-experts") return setFlagStatusMock();
- // The Hub is on here so the flow runs in the configuration production
- // will be in: leaving it to the real hook disabled the listing query
- // and left "Hub on and empty" — the case that drops the beat — untested.
- if (flag === "skills-hub") return { enabled: true, ready: true };
- return actual.useFlagStatus(flag as never);
- },
- };
-});
-
vi.mock("@/lib/auth/hooks/useAuth", () => ({
useAuth: () => ({ isLoggedIn: true, user: { id: "user-1" } }),
}));
@@ -58,7 +36,7 @@ vi.mock("@/services/experts/invalidate-experts", () => ({
}));
vi.mock("next/navigation", () => ({
- useRouter: () => ({ push: pushMock }),
+ useRouter: () => ({ push: pushMock, replace: vi.fn() }),
usePathname: () => "/raise",
useSearchParams: () => new URLSearchParams(),
useParams: () => ({}),
@@ -171,7 +149,7 @@ function seedAtSkills(
beforeEach(() => {
window.sessionStorage.clear();
mockReducedMotion();
- setFlagStatusMock.mockReturnValue({ enabled: true, ready: true });
+
pushMock.mockClear();
notFoundMock.mockClear();
// One library skill is enough to keep the skills beat in the flow; with
@@ -220,14 +198,10 @@ test.each([null, "finance"])(
},
);
-test("calls notFound when the experts feature is disabled", () => {
- setFlagStatusMock.mockReturnValue({ enabled: false, ready: true });
-
- try {
- renderRaise();
- } catch {}
-
- expect(notFoundMock).toHaveBeenCalled();
+test("opens expert creation without a rollout flag", async () => {
+ renderRaise();
+ expect(await screen.findByText(/name/i)).toBeDefined();
+ expect(notFoundMock).not.toHaveBeenCalled();
});
test("skips remaining kit steps, posts null budget and empty attachments, and opens copilot", async () => {
@@ -541,8 +515,6 @@ test("picking a weekly budget advances to marketplace workflows", async () => {
test("drops the skills beat and raises from the marketplace step when there is nothing to add", async () => {
let captured: unknown = null;
- // The Hub is on for this file, so this is an empty catalogue plus an empty
- // library — not a disabled flag.
server.use(
getListCopilotSkillsMockHandler([]),
getCreateRaisedExpertMockHandler(async (info) => {
diff --git a/autogpt_platform/frontend/src/app/(platform)/raise/__tests__/raise-typewriter.test.tsx b/autogpt_platform/frontend/src/app/(platform)/raise/__tests__/raise-typewriter.test.tsx
index 6071514668..8b9be0505c 100644
--- a/autogpt_platform/frontend/src/app/(platform)/raise/__tests__/raise-typewriter.test.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/raise/__tests__/raise-typewriter.test.tsx
@@ -4,30 +4,12 @@ import { afterEach, beforeEach, expect, test, vi } from "vitest";
import { saveDraft } from "../helpers";
import RaisePage from "../page";
-const { setFlagStatusMock } = vi.hoisted(() => ({
- setFlagStatusMock: vi.fn(() => ({ enabled: true, ready: true })),
-}));
-
-vi.mock("@/services/feature-flags/use-get-flag", async (importActual) => {
- const actual =
- await importActual<
- typeof import("@/services/feature-flags/use-get-flag")
- >();
- return {
- ...actual,
- useFlagStatus: (flag: string) =>
- flag === "hire-experts"
- ? setFlagStatusMock()
- : actual.useFlagStatus(flag as never),
- };
-});
-
vi.mock("@/lib/auth/hooks/useAuth", () => ({
useAuth: () => ({ isLoggedIn: true, user: { id: "user-1" } }),
}));
vi.mock("next/navigation", () => ({
- useRouter: () => ({ push: vi.fn() }),
+ useRouter: () => ({ push: vi.fn(), replace: vi.fn() }),
usePathname: () => "/raise",
useSearchParams: () => new URLSearchParams(),
useParams: () => ({}),
@@ -54,7 +36,6 @@ function visibleBubbleText() {
beforeEach(() => {
window.sessionStorage.clear();
- setFlagStatusMock.mockReturnValue({ enabled: true, ready: true });
});
afterEach(() => {
diff --git a/autogpt_platform/frontend/src/app/(platform)/raise/__tests__/role-prefill.test.tsx b/autogpt_platform/frontend/src/app/(platform)/raise/__tests__/role-prefill.test.tsx
index 89cce2fab7..353ca1bc8e 100644
--- a/autogpt_platform/frontend/src/app/(platform)/raise/__tests__/role-prefill.test.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/raise/__tests__/role-prefill.test.tsx
@@ -8,26 +8,12 @@ const { searchParams } = vi.hoisted(() => ({
searchParams: { current: new URLSearchParams() },
}));
-vi.mock("@/services/feature-flags/use-get-flag", async (importActual) => {
- const actual =
- await importActual<
- typeof import("@/services/feature-flags/use-get-flag")
- >();
- return {
- ...actual,
- useFlagStatus: (flag: string) =>
- flag === "hire-experts"
- ? { enabled: true, ready: true }
- : actual.useFlagStatus(flag as never),
- };
-});
-
vi.mock("@/lib/auth/hooks/useAuth", () => ({
useAuth: () => ({ isLoggedIn: true, user: { id: "user-1" } }),
}));
vi.mock("next/navigation", () => ({
- useRouter: () => ({ push: vi.fn() }),
+ useRouter: () => ({ push: vi.fn(), replace: vi.fn() }),
usePathname: () => "/raise",
useSearchParams: () => searchParams.current,
useParams: () => ({}),
diff --git a/autogpt_platform/frontend/src/app/(platform)/raise/components/KitStep/useKitSearch.ts b/autogpt_platform/frontend/src/app/(platform)/raise/components/KitStep/useKitSearch.ts
index bd96420d76..b00b4e95a6 100644
--- a/autogpt_platform/frontend/src/app/(platform)/raise/components/KitStep/useKitSearch.ts
+++ b/autogpt_platform/frontend/src/app/(platform)/raise/components/KitStep/useKitSearch.ts
@@ -6,7 +6,6 @@ import {
} from "@/app/api/__generated__/endpoints/store/store";
import { okData } from "@/app/api/helpers";
import { useDebouncedValue } from "@/hooks/useDebouncedValue";
-import { Flag, useFlagStatus } from "@/services/feature-flags/use-get-flag";
import { useState } from "react";
import {
combineSearchHits,
@@ -21,8 +20,8 @@ export function useKitSearch(scope: KitSearchScope) {
const trimmed = debouncedQuery.trim();
const hasQuery = trimmed.length > 0;
const isWorkflowScope = scope === "marketplace";
- const hub = useFlagStatus(Flag.SKILLS_HUB);
- const searchHubSkills = !isWorkflowScope && hub.ready && hub.enabled;
+
+ const searchHubSkills = !isWorkflowScope;
const storeQuery = useGetV2ListStoreAgents(
{ search_query: trimmed, page_size: MAX_SEARCH_RESULTS },
diff --git a/autogpt_platform/frontend/src/app/(platform)/raise/components/SkillsStep/SkillsStep.test.tsx b/autogpt_platform/frontend/src/app/(platform)/raise/components/SkillsStep/SkillsStep.test.tsx
index f1100b3764..47e879021b 100644
--- a/autogpt_platform/frontend/src/app/(platform)/raise/components/SkillsStep/SkillsStep.test.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/raise/components/SkillsStep/SkillsStep.test.tsx
@@ -12,23 +12,6 @@ import userEvent from "@testing-library/user-event";
import { beforeEach, describe, expect, test, vi } from "vitest";
import { SkillsStep } from "./SkillsStep";
-const flags = vi.hoisted(() => ({ skillsHub: true }));
-
-vi.mock("@/services/feature-flags/use-get-flag", async (importOriginal) => {
- const actual =
- await importOriginal<
- typeof import("@/services/feature-flags/use-get-flag")
- >();
- return {
- ...actual,
- useFlagStatus: (flag: string) => {
- if (flag === "skills-hub")
- return { enabled: flags.skillsHub, ready: true };
- return actual.useFlagStatus(flag as never);
- },
- };
-});
-
const storeAgent = {
slug: "seo-writer",
agent_name: "SEO Blog Writer",
@@ -89,7 +72,6 @@ function renderSkills(
describe("SkillsStep", () => {
beforeEach(() => {
- flags.skillsHub = true;
server.use(marketplaceSkills([]));
});
@@ -183,8 +165,7 @@ describe("SkillsStep", () => {
expect(screen.queryByText("SEO Blog Writer")).toBeNull();
});
- test("offers no marketplace skills while the hub is off", async () => {
- flags.skillsHub = false;
+ test("offers marketplace skills without a rollout flag", async () => {
server.use(
getListCopilotSkillsMockHandler([
{ name: "seo-audit", description: "Audit landing pages" },
@@ -194,7 +175,7 @@ describe("SkillsStep", () => {
renderSkills();
expect(await screen.findByText("seo-audit")).toBeDefined();
- expect(screen.queryByText("Outreach playbook")).toBeNull();
+ expect(await screen.findByText("Outreach playbook")).toBeDefined();
});
test("skip raises without extra skills", async () => {
diff --git a/autogpt_platform/frontend/src/app/(platform)/raise/page.tsx b/autogpt_platform/frontend/src/app/(platform)/raise/page.tsx
index 3a2a8ce5ca..f6c8697d10 100644
--- a/autogpt_platform/frontend/src/app/(platform)/raise/page.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/raise/page.tsx
@@ -1,9 +1,7 @@
"use client";
import { Skeleton } from "@/components/atoms/Skeleton/Skeleton";
-import { Flag, useFlagStatus } from "@/services/feature-flags/use-get-flag";
import dynamic from "next/dynamic";
-import { notFound } from "next/navigation";
const RaiseFlow = dynamic(
() =>
@@ -14,15 +12,6 @@ const RaiseFlow = dynamic(
);
export default function RaisePage() {
- const { enabled, ready } = useFlagStatus(Flag.HIRE_EXPERTS);
-
- if (!ready) {
- return <RaiseSkeleton />;
- }
- if (!enabled) {
- notFound();
- }
-
return <RaiseFlow />;
}
diff --git a/autogpt_platform/frontend/src/app/(platform)/raise/useSkillsAvailability.ts b/autogpt_platform/frontend/src/app/(platform)/raise/useSkillsAvailability.ts
index 45dc047c1b..8458f4bf4a 100644
--- a/autogpt_platform/frontend/src/app/(platform)/raise/useSkillsAvailability.ts
+++ b/autogpt_platform/frontend/src/app/(platform)/raise/useSkillsAvailability.ts
@@ -1,21 +1,16 @@
import { useListCopilotSkills } from "@/app/api/__generated__/endpoints/skills/skills";
import { useGetV2ListMarketplaceSkills } from "@/app/api/__generated__/endpoints/store/store";
import { okData } from "@/app/api/helpers";
-import { Flag, useFlagStatus } from "@/services/feature-flags/use-get-flag";
import { MAX_SEARCH_RESULTS } from "./components/KitStep/helpers";
// The skills beat is only worth asking when there is something to add: a live
// Hub listing, or a skill the user has already written. Both queries share
// their keys with the picker's own search, so asking costs no extra request.
export function useSkillsAvailability() {
- const hub = useFlagStatus(Flag.SKILLS_HUB);
- const isHubOn = hub.ready && hub.enabled;
-
const marketplace = useGetV2ListMarketplaceSkills(
{ search_query: "", page_size: MAX_SEARCH_RESULTS },
{
query: {
- enabled: isHubOn,
select: (response) => okData(response)?.skills.length ?? 0,
},
},
@@ -25,10 +20,10 @@ export function useSkillsAvailability() {
});
const isSettled =
- hub.ready &&
!library.isLoading &&
!library.isError &&
- (!isHubOn || (!marketplace.isLoading && !marketplace.isError));
+ !marketplace.isLoading &&
+ !marketplace.isError;
return {
isReady: isSettled,
diff --git a/autogpt_platform/frontend/src/app/(platform)/settings/components/SettingsSidebar/helpers.ts b/autogpt_platform/frontend/src/app/(platform)/settings/components/SettingsSidebar/helpers.ts
index a262604757..4ba5251404 100644
--- a/autogpt_platform/frontend/src/app/(platform)/settings/components/SettingsSidebar/helpers.ts
+++ b/autogpt_platform/frontend/src/app/(platform)/settings/components/SettingsSidebar/helpers.ts
@@ -9,13 +9,11 @@ import {
UserIcon,
} from "@hugeicons/core-free-icons";
import type { IconSvgElement } from "@hugeicons/react";
-import { Flag } from "@/services/feature-flags/use-get-flag";
export interface SettingsNavItem {
label: string;
href: string;
Icon: IconSvgElement;
- flag?: Flag;
}
export const settingsNavItems: SettingsNavItem[] = [
@@ -29,7 +27,6 @@ export const settingsNavItems: SettingsNavItem[] = [
label: "Memory",
href: "/settings/memory",
Icon: BrainIcon,
- flag: Flag.GRAPHITI_MEMORY,
},
{ label: "Billing", href: "/settings/billing", Icon: CreditCardIcon },
{
diff --git a/autogpt_platform/frontend/src/app/(platform)/settings/components/SettingsSidebar/useSettingsSidebar.ts b/autogpt_platform/frontend/src/app/(platform)/settings/components/SettingsSidebar/useSettingsSidebar.ts
index e548d7c721..1198195d6d 100644
--- a/autogpt_platform/frontend/src/app/(platform)/settings/components/SettingsSidebar/useSettingsSidebar.ts
+++ b/autogpt_platform/frontend/src/app/(platform)/settings/components/SettingsSidebar/useSettingsSidebar.ts
@@ -1,21 +1,13 @@
-import { usePathname } from "next/navigation";
import { useIsBillingEnabled } from "@/hooks/useIsBillingEnabled";
-import { Flag, useGetFlag } from "@/services/feature-flags/use-get-flag";
+import { usePathname } from "next/navigation";
import { settingsNavItems } from "./helpers";
export function useSettingsSidebar() {
const pathname = usePathname();
- const isMemoryEnabled = useGetFlag(Flag.GRAPHITI_MEMORY);
- const isSkillLearningEnabled = useGetFlag(Flag.DREAM_SKILL_LEARNING_ENABLED);
+
const isBillingEnabled = useIsBillingEnabled();
const items = settingsNavItems
- .filter(
- (item) =>
- item.flag !== Flag.GRAPHITI_MEMORY ||
- isMemoryEnabled ||
- isSkillLearningEnabled,
- )
.filter((item) => item.href !== "/settings/billing" || isBillingEnabled)
.map((item) => ({
...item,
diff --git a/autogpt_platform/frontend/src/app/(platform)/settings/memory/__tests__/forget-topic-chat.test.tsx b/autogpt_platform/frontend/src/app/(platform)/settings/memory/__tests__/forget-topic-chat.test.tsx
index 9646b80691..8d31c15ca7 100644
--- a/autogpt_platform/frontend/src/app/(platform)/settings/memory/__tests__/forget-topic-chat.test.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/settings/memory/__tests__/forget-topic-chat.test.tsx
@@ -40,25 +40,13 @@ vi.mock("@/app/(platform)/copilot/helpers", async (importActual) => {
};
});
-vi.mock("@/services/feature-flags/use-get-flag", () => ({
- Flag: {
- GRAPHITI_MEMORY: "graphiti-memory",
- DREAM_SKILL_LEARNING_ENABLED: "dream-skill-learning-enabled",
- HIRE_EXPERTS: "hire-experts",
- CHAT_MODE_OPTION: "chat-mode-option",
- ENABLE_PLATFORM_PAYMENT: "enable-platform-payment",
- },
- useGetFlag: (flag: string) =>
- flag === "graphiti-memory" || flag === "hire-experts",
- useFlagStatus: (flag: string) => ({
- enabled: flag === "graphiti-memory",
- answered: true,
- }),
-}));
-
-vi.mock("@/services/feature-flags/with-feature-flag", () => ({
- withFeatureFlag: (Component: React.ComponentType) => Component,
-}));
+vi.mock("@/services/feature-flags/use-get-flag", async (importOriginal) => {
+ const actual =
+ await importOriginal<
+ typeof import("@/services/feature-flags/use-get-flag")
+ >();
+ return { ...actual, useGetFlag: () => false };
+});
import SettingsMemoryPage from "../page";
diff --git a/autogpt_platform/frontend/src/app/(platform)/settings/memory/__tests__/learning.test.tsx b/autogpt_platform/frontend/src/app/(platform)/settings/memory/__tests__/learning.test.tsx
index a4a36e9ba2..3216a25a08 100644
--- a/autogpt_platform/frontend/src/app/(platform)/settings/memory/__tests__/learning.test.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/settings/memory/__tests__/learning.test.tsx
@@ -21,9 +21,7 @@ import { within } from "@testing-library/react";
import { SkillVersionSummary } from "@/app/api/__generated__/models/skillVersionSummary";
import { server } from "@/mocks/mock-server";
-let graphitiEnabled = true;
let learningEnabled = true;
-let flagsAnswered = true;
vi.mock("@/services/environment", async (importActual) => {
const actual = await importActual<typeof import("@/services/environment")>();
@@ -53,13 +51,7 @@ vi.mock("@/services/feature-flags/use-get-flag", async (importOriginal) => {
return {
...actual,
useGetFlag: (flag: string) =>
- (flag === "graphiti-memory" && graphitiEnabled) ||
- flag === "hire-experts" ||
- (flag === "dream-skill-learning-enabled" && learningEnabled),
- useFlagStatus: (flag: string) => ({
- answered: flagsAnswered,
- enabled: flag === "graphiti-memory" ? graphitiEnabled : learningEnabled,
- }),
+ flag === "dream-skill-learning-enabled" && learningEnabled,
};
});
@@ -101,9 +93,7 @@ const proposal: SkillVersionSummary = {
};
beforeEach(() => {
- graphitiEnabled = true;
learningEnabled = true;
- flagsAnswered = true;
resetCopilotChatRegistry();
window.history.replaceState({}, "", "/settings/memory");
server.use(
@@ -155,8 +145,7 @@ beforeEach(() => {
);
});
-it("keeps personal learning controls available without requesting Graphiti data", async () => {
- graphitiEnabled = false;
+it("shows memory data alongside personal learning controls", async () => {
const facts = vi.fn(() => ({ expert_id: null, items: [] }));
const overview = vi.fn(() => ({
expert_id: null,
@@ -170,22 +159,20 @@ it("keeps personal learning controls available without requesting Graphiti data"
);
render(<SettingsMemoryPage />);
expect(await screen.findByText("Learning history")).toBeDefined();
- expect(screen.queryByText("Recent memories")).toBeNull();
- expect(facts).not.toHaveBeenCalled();
- expect(overview).not.toHaveBeenCalled();
+ expect(screen.getByText("Recent memories")).toBeDefined();
+ await waitFor(() => expect(facts).toHaveBeenCalled());
+ await waitFor(() => expect(overview).toHaveBeenCalled());
});
-it("waits for a flag answer before showing controls", () => {
- flagsAnswered = false;
+it("shows memory controls without a feature flag answer", () => {
render(<SettingsMemoryPage />);
- expect(screen.queryByRole("heading", { name: "Memory" })).toBeNull();
+ expect(screen.getByRole("heading", { name: "Memory" })).toBeDefined();
});
-it("hides the page when both features are disabled", () => {
- graphitiEnabled = false;
+it("keeps memory available when skill learning is disabled", () => {
learningEnabled = false;
render(<SettingsMemoryPage />);
- expect(screen.queryByRole("heading", { name: "Memory" })).toBeNull();
+ expect(screen.getByRole("heading", { name: "Memory" })).toBeDefined();
});
describe("Settings memory page — learning", () => {
@@ -337,7 +324,6 @@ describe("Settings memory page — learning", () => {
});
it("deep links from a chat chip open the requested personal version", async () => {
- graphitiEnabled = false;
window.history.replaceState(
{},
"",
diff --git a/autogpt_platform/frontend/src/app/(platform)/settings/memory/__tests__/main.test.tsx b/autogpt_platform/frontend/src/app/(platform)/settings/memory/__tests__/main.test.tsx
index 9036421d5e..13aacf0742 100644
--- a/autogpt_platform/frontend/src/app/(platform)/settings/memory/__tests__/main.test.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/settings/memory/__tests__/main.test.tsx
@@ -1,6 +1,6 @@
import { render, screen, waitFor } from "@/tests/integrations/test-utils";
import userEvent from "@testing-library/user-event";
-import { http } from "msw";
+import { http, HttpResponse } from "msw";
import { beforeEach, describe, expect, it, vi } from "vitest";
import { resetCopilotChatRegistry } from "@/app/(platform)/copilot/copilotChatRegistry";
@@ -53,16 +53,13 @@ vi.mock("@/app/(platform)/copilot/helpers", async (importActual) => {
vi.mock("@/services/feature-flags/use-get-flag", () => ({
Flag: {
- GRAPHITI_MEMORY: "graphiti-memory",
DREAM_SKILL_LEARNING_ENABLED: "dream-skill-learning-enabled",
- HIRE_EXPERTS: "hire-experts",
CHAT_MODE_OPTION: "chat-mode-option",
ENABLE_PLATFORM_PAYMENT: "enable-platform-payment",
},
- useGetFlag: (flag: string) =>
- flag === "graphiti-memory" || flag === "hire-experts",
- useFlagStatus: (flag: string) => ({
- enabled: flag === "graphiti-memory",
+ useGetFlag: () => false,
+ useFlagStatus: () => ({
+ enabled: false,
answered: true,
}),
}));
@@ -309,6 +306,13 @@ describe("Settings memory page", () => {
"falls back to AutoPilot when ?expert= is %s",
async (_case, expertParam) => {
mockHappyPath();
+ server.use(
+ http.get(
+ /\/api\/proxy\/api\/memory\/experts\/expert-gone\/(?:facts|overview)/,
+ () =>
+ HttpResponse.json({ detail: "Expert not found" }, { status: 404 }),
+ ),
+ );
window.history.replaceState(
{},
"",
diff --git a/autogpt_platform/frontend/src/app/(platform)/settings/memory/components/MemoryPageAccess.tsx b/autogpt_platform/frontend/src/app/(platform)/settings/memory/components/MemoryPageAccess.tsx
deleted file mode 100644
index 4d0cd46193..0000000000
--- a/autogpt_platform/frontend/src/app/(platform)/settings/memory/components/MemoryPageAccess.tsx
+++ /dev/null
@@ -1,33 +0,0 @@
-import { Flag, useFlagStatus } from "@/services/feature-flags/use-get-flag";
-import { useRouter } from "next/navigation";
-import { useEffect, type ReactNode } from "react";
-
-interface Props {
- children: ReactNode;
-}
-
-export function MemoryPageAccess({ children }: Props) {
- const memory = useFlagStatus(Flag.GRAPHITI_MEMORY);
- const learning = useFlagStatus(Flag.DREAM_SKILL_LEARNING_ENABLED);
- const router = useRouter();
- const allowed =
- (memory.answered && memory.enabled) ||
- (learning.answered && learning.enabled);
- const denied = memory.answered && learning.answered && !allowed;
-
- useEffect(() => {
- if (denied) router.push("/404");
- }, [denied, router]);
-
- if (allowed) return children;
- if (denied) return null;
- return (
- <div
- role="status"
- aria-label="Loading memory settings"
- className="flex min-h-screen items-center justify-center"
- >
- <div className="h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent" />
- </div>
- );
-}
diff --git a/autogpt_platform/frontend/src/app/(platform)/settings/memory/page.tsx b/autogpt_platform/frontend/src/app/(platform)/settings/memory/page.tsx
index 67975a40fc..60296191e0 100644
--- a/autogpt_platform/frontend/src/app/(platform)/settings/memory/page.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/settings/memory/page.tsx
@@ -2,25 +2,22 @@
import { Text } from "@/components/atoms/Text/Text";
import { ErrorCard } from "@/components/molecules/ErrorCard/ErrorCard";
-import { Flag, useGetFlag } from "@/services/feature-flags/use-get-flag";
import { useEffect } from "react";
+import { SkillLearningSheet } from "@/components/organisms/SkillLearningSheet/SkillLearningSheet";
import { EraseMemoryCard } from "./components/EraseMemoryCard";
import { LearningHistoryCard } from "./components/LearningHistoryCard";
-import { OpenDecisionsCard } from "./components/OpenDecisionsCard";
-import { SkillLearningSheet } from "@/components/organisms/SkillLearningSheet/SkillLearningSheet";
-import { learningSheetScope } from "./helpers";
import { MemoryChatPanel } from "./components/MemoryChatPanel/MemoryChatPanel";
import { useMemoryChatPanel } from "./components/MemoryChatPanel/useMemoryChatPanel";
+import { OpenDecisionsCard } from "./components/OpenDecisionsCard";
import { RecentMemoriesCard } from "./components/RecentMemoriesCard";
import { ScopeCard } from "./components/ScopeCard";
import { SummaryCard } from "./components/SummaryCard";
+import { learningSheetScope } from "./helpers";
import { useLearningHistory } from "./useLearningHistory";
import { useMemoryPage } from "./useMemoryPage";
-import { MemoryPageAccess } from "./components/MemoryPageAccess";
-function SettingsMemoryPage() {
- const memoryEnabled = Boolean(useGetFlag(Flag.GRAPHITI_MEMORY));
+export default function SettingsMemoryPage() {
useEffect(() => {
document.title = "Memory – AutoGPT Platform";
}, []);
@@ -40,7 +37,7 @@ function SettingsMemoryPage() {
forgettingUuid,
eraseScope,
isErasing,
- } = useMemoryPage(memoryEnabled);
+ } = useMemoryPage();
const chatPanel = useMemoryChatPanel({ scopeExpertID });
const learning = useLearningHistory(scopeExpertID);
@@ -52,9 +49,7 @@ function SettingsMemoryPage() {
Memory
</Text>
<Text variant="body" className="mt-4 max-w-[600px] text-zinc-700">
- {memoryEnabled
- ? "What AutoGPT remembers about you — and who remembers it."
- : "Skills learned from your work and when they changed."}
+ {"What AutoGPT remembers about you — and who remembers it."}
</Text>
</header>
@@ -64,31 +59,27 @@ function SettingsMemoryPage() {
onSelect={selectScope}
/>
- {memoryEnabled ? (
- <>
- <SummaryCard
- scopeExpertID={scopeExpertID}
- scopeName={scopeName}
- onViewSummary={() => void chatPanel.openWithSeed("summary")}
- />
+ <SummaryCard
+ scopeExpertID={scopeExpertID}
+ scopeName={scopeName}
+ onViewSummary={() => void chatPanel.openWithSeed("summary")}
+ />
- {isFactsError ? (
- <ErrorCard
- responseError={factsError || undefined}
- context="memory"
- onRetry={refetchFacts}
- />
- ) : (
- <RecentMemoriesCard
- facts={facts}
- isLoading={isLoadingFacts}
- forgettingUuid={forgettingUuid}
- onForget={forgetFact}
- onForgetTopic={() => void chatPanel.openWithSeed("forget")}
- />
- )}
- </>
- ) : null}
+ {isFactsError ? (
+ <ErrorCard
+ responseError={factsError || undefined}
+ context="memory"
+ onRetry={refetchFacts}
+ />
+ ) : (
+ <RecentMemoriesCard
+ facts={facts}
+ isLoading={isLoadingFacts}
+ forgettingUuid={forgettingUuid}
+ onForget={forgetFact}
+ onForgetTopic={() => void chatPanel.openWithSeed("forget")}
+ />
+ )}
{learning.enabled ? (
<>
@@ -121,40 +112,28 @@ function SettingsMemoryPage() {
</>
) : null}
- {memoryEnabled ? (
- <>
- <EraseMemoryCard
- scopeName={scopeName}
- memoryCount={memoryCount}
- isErasing={isErasing}
- onErase={eraseScope}
- />
+ <EraseMemoryCard
+ scopeName={scopeName}
+ memoryCount={memoryCount}
+ isErasing={isErasing}
+ onErase={eraseScope}
+ />
- <MemoryChatPanel
- scopeName={scopeName}
- isOpen={chatPanel.isOpen}
- isStarting={chatPanel.isStarting}
- startError={chatPanel.startError}
- sessionId={chatPanel.sessionId}
- messages={chatPanel.messages}
- status={chatPanel.status}
- error={chatPanel.error}
- queuedMessages={chatPanel.queuedMessages}
- onSend={chatPanel.onSend}
- onStop={chatPanel.stop}
- onRetry={chatPanel.retryStart}
- onClose={chatPanel.close}
- />
- </>
- ) : null}
+ <MemoryChatPanel
+ scopeName={scopeName}
+ isOpen={chatPanel.isOpen}
+ isStarting={chatPanel.isStarting}
+ startError={chatPanel.startError}
+ sessionId={chatPanel.sessionId}
+ messages={chatPanel.messages}
+ status={chatPanel.status}
+ error={chatPanel.error}
+ queuedMessages={chatPanel.queuedMessages}
+ onSend={chatPanel.onSend}
+ onStop={chatPanel.stop}
+ onRetry={chatPanel.retryStart}
+ onClose={chatPanel.close}
+ />
</div>
);
}
-
-export default function SettingsMemoryPageWithAccess() {
- return (
- <MemoryPageAccess>
- <SettingsMemoryPage />
- </MemoryPageAccess>
- );
-}
diff --git a/autogpt_platform/frontend/src/app/(platform)/settings/memory/useMemoryPage.ts b/autogpt_platform/frontend/src/app/(platform)/settings/memory/useMemoryPage.ts
index 60b81da96c..37282469c6 100644
--- a/autogpt_platform/frontend/src/app/(platform)/settings/memory/useMemoryPage.ts
+++ b/autogpt_platform/frontend/src/app/(platform)/settings/memory/useMemoryPage.ts
@@ -1,3 +1,4 @@
+import { useListExperts } from "@/app/api/__generated__/endpoints/experts/experts";
import {
getGetMyExpertMemoryOverviewQueryKey,
getGetMyMemoryOverviewQueryKey,
@@ -12,7 +13,6 @@ import {
useListMyExpertMemoryFacts,
useListMyMemoryFacts,
} from "@/app/api/__generated__/endpoints/memory/memory";
-import { useListExperts } from "@/app/api/__generated__/endpoints/experts/experts";
import { toast } from "@/components/molecules/Toast/use-toast";
import { useQueryClient } from "@tanstack/react-query";
import { useEffect, useState } from "react";
@@ -23,7 +23,7 @@ import {
RECENT_FACTS_LIMIT,
} from "./helpers";
-export function useMemoryPage(memoryEnabled = true) {
+export function useMemoryPage() {
// The Soul drawer's learned-notes panel links here with ?expert=<id>, so
// the link opens on that expert. Read once — the dropdown owns it after.
const [scopeExpertID, setScopeExpertID] = useState<string | null>(
@@ -31,8 +31,6 @@ export function useMemoryPage(memoryEnabled = true) {
);
const queryClient = useQueryClient();
- // Deliberately not gated on HIRE_EXPERTS: expert memory scopes must stay
- // manageable here even if the hiring UI is dark.
const expertsQuery = useListExperts();
const expertsSettled = expertsQuery.data?.status === 200;
const experts = getActiveExperts(
@@ -50,22 +48,22 @@ export function useMemoryPage(memoryEnabled = true) {
const accountFacts = useListMyMemoryFacts(
{ limit: RECENT_FACTS_LIMIT },
- { query: { enabled: memoryEnabled && scopeExpertID === null } },
+ { query: { enabled: scopeExpertID === null } },
);
const expertFacts = useListMyExpertMemoryFacts(
scopeExpertID ?? "",
{ limit: RECENT_FACTS_LIMIT },
- { query: { enabled: memoryEnabled && scopeExpertID !== null } },
+ { query: { enabled: scopeExpertID !== null } },
);
const factsQuery = scopeExpertID === null ? accountFacts : expertFacts;
const facts =
factsQuery.data?.status === 200 ? factsQuery.data.data.items : [];
const accountOverview = useGetMyMemoryOverview({
- query: { enabled: memoryEnabled && scopeExpertID === null },
+ query: { enabled: scopeExpertID === null },
});
const expertOverview = useGetMyExpertMemoryOverview(scopeExpertID ?? "", {
- query: { enabled: memoryEnabled && scopeExpertID !== null },
+ query: { enabled: scopeExpertID !== null },
});
const overviewQuery =
scopeExpertID === null ? accountOverview : expertOverview;
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.tsx
index 71daa764fe..34389e9567 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
@@ -51,7 +51,6 @@ vi.mock("@/services/feature-flags/use-get-flag", async (importOriginal) => {
>();
return {
...actual,
- useFlagStatus: () => ({ enabled: true, ready: true }),
useGetFlag: (flag: string) =>
flag === actual.Flag.COPILOT_AUTO_MODE ? flags.autoMode : false,
};
diff --git a/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/__tests__/integrations.test.tsx b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/__tests__/integrations.test.tsx
index e501549bb5..1493ecf7c9 100644
--- a/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/__tests__/integrations.test.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/__tests__/integrations.test.tsx
@@ -53,17 +53,6 @@ vi.mock("framer-motion", async (importActual) => {
return { ...actual, useReducedMotion: () => true };
});
-vi.mock("@/services/feature-flags/use-get-flag", async (importOriginal) => {
- const actual =
- await importOriginal<
- typeof import("@/services/feature-flags/use-get-flag")
- >();
- return {
- ...actual,
- useFlagStatus: () => ({ enabled: true, ready: true }),
- };
-});
-
vi.mock("next/navigation", () => ({
useRouter: () => ({
push: vi.fn(),
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.tsx
index 0324d9d133..83e1020ac1 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
@@ -42,6 +42,7 @@ import {
streamSseResponse,
} from "@/tests/integrations/copilot-sse";
import { getListCopilotSkillsMockHandler200 } from "@/app/api/__generated__/endpoints/skills/skills.msw";
+import { getListMyExpertMemoryFactsMockHandler200 } from "@/app/api/__generated__/endpoints/memory/memory.msw";
import {
getGetHomeDashboardMockHandler,
getGetHomeDashboardResponseMock200,
@@ -90,27 +91,6 @@ vi.mock("framer-motion", async (importActual) => {
return { ...actual, useReducedMotion: () => true };
});
-const { setFlagStatusMock, skillsHubFlag } = vi.hoisted(() => ({
- setFlagStatusMock: vi.fn(() => ({ enabled: true, ready: true })),
- skillsHubFlag: { enabled: true, ready: true },
-}));
-
-vi.mock("@/services/feature-flags/use-get-flag", async (importOriginal) => {
- const actual =
- await importOriginal<
- typeof import("@/services/feature-flags/use-get-flag")
- >();
- return {
- ...actual,
- useFlagStatus: (flag: string) =>
- flag === "hire-experts"
- ? setFlagStatusMock()
- : flag === "skills-hub"
- ? skillsHubFlag
- : actual.useFlagStatus(flag as never),
- };
-});
-
const { notFoundMock, pushMock } = vi.hoisted(() => ({
notFoundMock: vi.fn(),
pushMock: vi.fn(),
@@ -243,6 +223,10 @@ beforeEach(() => {
getGetHomeDashboardResponseMock200({ attention: [] }),
),
getGetExpertMockHandler(maria),
+ getListMyExpertMemoryFactsMockHandler200({
+ expert_id: maria.id,
+ items: [],
+ }),
getGetV1ListExecutionSchedulesForAUserMockHandler([mariaSchedule]),
getListExpertRunsMockHandler([]),
getGetExpertActivityMockHandler({
@@ -253,10 +237,9 @@ beforeEach(() => {
});
afterEach(() => {
- skillsHubFlag.enabled = true;
resetCopilotChatRegistry();
window.localStorage.removeItem("team-workflows-view");
- setFlagStatusMock.mockReturnValue({ enabled: true, ready: true });
+
pushMock.mockReset();
});
@@ -776,9 +759,9 @@ describe("ExpertDetailPage", () => {
expect(await within(attached).findByText("seo-audit")).toBeDefined();
});
- test("hides the marketplace tab when the skills hub is off", async () => {
+ test("shows the marketplace tab without a rollout flag", async () => {
const user = userEvent.setup();
- skillsHubFlag.enabled = false;
+
server.use(...hubSkillHandlers([]));
render(<ExpertDetailPage />);
@@ -788,11 +771,8 @@ describe("ExpertDetailPage", () => {
const dialog = await screen.findByRole("dialog", { name: "Add a skill" });
expect(
- within(dialog).queryByRole("tab", { name: "Marketplace" }),
- ).toBeNull();
- // The dialog must not promise a source it cannot show either.
- expect(dialog.textContent).toContain("Pick one from your library.");
- expect(dialog.textContent).not.toMatch(/marketplace/i);
+ within(dialog).getByRole("tab", { name: "Marketplace" }),
+ ).toBeDefined();
});
test("removes a skill from the expert", async () => {
diff --git a/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/__tests__/skill-learning.test.tsx b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/__tests__/skill-learning.test.tsx
index 7a3292daa7..3dc8aa845e 100644
--- a/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/__tests__/skill-learning.test.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/__tests__/skill-learning.test.tsx
@@ -45,9 +45,7 @@ vi.mock("@/services/feature-flags/use-get-flag", async (importOriginal) => {
>();
return {
...actual,
- useFlagStatus: () => ({ enabled: true, ready: true }),
- useGetFlag: (flag: string) =>
- flag === "hire-experts" || flag === "dream-skill-learning-enabled",
+ useGetFlag: (flag: string) => flag === "dream-skill-learning-enabled",
};
});
diff --git a/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/AddSkillDialog.tsx b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/AddSkillDialog.tsx
index 782c89900e..92b870108c 100644
--- a/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/AddSkillDialog.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/AddSkillDialog.tsx
@@ -33,7 +33,6 @@ interface Props {
onMarketQueryChange: (query: string) => void;
marketplaceSkills: MarketplaceSkill[];
isMarketplaceLoading: boolean;
- hasMarketplace: boolean;
isSaving: boolean;
onAdd: (name: string) => void;
onAddMarketplace: (skill: MarketplaceSkill) => void;
@@ -50,7 +49,6 @@ export function AddSkillDialog({
onMarketQueryChange,
marketplaceSkills,
isMarketplaceLoading,
- hasMarketplace,
isSaving,
onAdd,
onAddMarketplace,
@@ -83,27 +81,24 @@ export function AddSkillDialog({
<div className="flex flex-col gap-3">
<Text variant="body" tone="muted">
Skills are reusable instructions this expert follows for a specific
- job. Pick one from your library
- {hasMarketplace ? " or install one from the marketplace" : ""}.
+ job. Pick one from your library or install one from the marketplace.
</Text>
- {hasMarketplace ? (
- <TabsLine
- variant="compact"
- value={source}
- onValueChange={(next) => onSourceChange(next as Source)}
- >
- <TabsLineList>
- <TabsLineTrigger value="library" icon={BookOpen01Icon}>
- Library
- </TabsLineTrigger>
- <TabsLineTrigger value="marketplace" icon={Store01Icon}>
- Marketplace
- </TabsLineTrigger>
- </TabsLineList>
- </TabsLine>
- ) : null}
+ <TabsLine
+ variant="compact"
+ value={source}
+ onValueChange={(next) => onSourceChange(next as Source)}
+ >
+ <TabsLineList>
+ <TabsLineTrigger value="library" icon={BookOpen01Icon}>
+ Library
+ </TabsLineTrigger>
+ <TabsLineTrigger value="marketplace" icon={Store01Icon}>
+ Marketplace
+ </TabsLineTrigger>
+ </TabsLineList>
+ </TabsLine>
- {!hasMarketplace || source === "library" ? (
+ {source === "library" ? (
<>
<SearchInput
size="small"
diff --git a/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertComputerSection/ExpertComputerSection.tsx b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertComputerSection/ExpertComputerSection.tsx
index cdc6f94060..ef747ee0d6 100644
--- a/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertComputerSection/ExpertComputerSection.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertComputerSection/ExpertComputerSection.tsx
@@ -28,16 +28,11 @@ import { useExpertComputerSection } from "./useExpertComputerSection";
interface Props {
expertId: string;
expertName: string;
- enabled: boolean;
}
-export function ExpertComputerSection({
- expertId,
- expertName,
- enabled,
-}: Props) {
+export function ExpertComputerSection({ expertId, expertName }: Props) {
const { computer, isLoading, refetch, stream, openDesktop, isOpening } =
- useExpertComputerSection({ expertId, enabled });
+ useExpertComputerSection({ expertId });
if (isLoading) {
return (
diff --git a/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertComputerSection/__tests__/ExpertComputerSection.test.tsx b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertComputerSection/__tests__/ExpertComputerSection.test.tsx
index ff134ec162..26670a5784 100644
--- a/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertComputerSection/__tests__/ExpertComputerSection.test.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertComputerSection/__tests__/ExpertComputerSection.test.tsx
@@ -1,3 +1,5 @@
+// @vitest-environment-options {"settings":{"disableIframePageLoading":true}}
+
import {
getGetV2GetExpertComputerMockHandler,
getPostV2StartExpertDesktopMockHandler,
@@ -35,9 +37,7 @@ describe("ExpertComputerSection", () => {
it("shows the expert's boxes and volumes without waking anything", async () => {
server.use(getGetV2GetExpertComputerMockHandler(computer));
- render(
- <ExpertComputerSection expertId="expert-1" expertName="Maria" enabled />,
- );
+ render(<ExpertComputerSection expertId="expert-1" expertName="Maria" />);
expect(await screen.findByText("Maria's computer")).toBeDefined();
expect(screen.getByText("Suspended")).toBeDefined();
@@ -61,9 +61,7 @@ describe("ExpertComputerSection", () => {
}),
);
- render(
- <ExpertComputerSection expertId="expert-1" expertName="Maria" enabled />,
- );
+ render(<ExpertComputerSection expertId="expert-1" expertName="Maria" />);
await userEvent.click(
await screen.findByRole("button", { name: "Turn on screen" }),
@@ -89,7 +87,7 @@ describe("ExpertComputerSection", () => {
);
const { rerender } = render(
- <ExpertComputerSection expertId="expert-1" expertName="Maria" enabled />,
+ <ExpertComputerSection expertId="expert-1" expertName="Maria" />,
);
await userEvent.click(
await screen.findByRole("button", { name: "Turn on screen" }),
@@ -100,9 +98,7 @@ describe("ExpertComputerSection", () => {
).toBeDefined(),
);
- rerender(
- <ExpertComputerSection expertId="expert-2" expertName="Ada" enabled />,
- );
+ rerender(<ExpertComputerSection expertId="expert-2" expertName="Ada" />);
await waitFor(() =>
expect(
@@ -121,9 +117,7 @@ describe("ExpertComputerSection", () => {
}),
);
- render(
- <ExpertComputerSection expertId="expert-1" expertName="Maria" enabled />,
- );
+ render(<ExpertComputerSection expertId="expert-1" expertName="Maria" />);
expect(
await screen.findByText(
diff --git a/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertComputerSection/useExpertComputerSection.ts b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertComputerSection/useExpertComputerSection.ts
index 5602c0def9..26fcabd0d5 100644
--- a/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertComputerSection/useExpertComputerSection.ts
+++ b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertComputerSection/useExpertComputerSection.ts
@@ -11,10 +11,9 @@ import { useState } from "react";
interface Args {
expertId: string;
- enabled: boolean;
}
-export function useExpertComputerSection({ expertId, enabled }: Args) {
+export function useExpertComputerSection({ expertId }: Args) {
const queryClient = useQueryClient();
const { toast } = useToast();
// Kept with the expert it was opened for: the section can be re-rendered
@@ -28,7 +27,6 @@ export function useExpertComputerSection({ expertId, enabled }: Args) {
const computerQuery = useGetV2GetExpertComputer(expertId, {
query: {
select: (res) => okData(res) ?? null,
- enabled,
refetchInterval: 15_000,
},
});
diff --git a/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertNeedsYouSection/ExpertNeedsYouSection.tsx b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertNeedsYouSection/ExpertNeedsYouSection.tsx
index aced10b466..686f81dd0e 100644
--- a/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertNeedsYouSection/ExpertNeedsYouSection.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertNeedsYouSection/ExpertNeedsYouSection.tsx
@@ -1,24 +1,22 @@
"use client";
-import type { Expert } from "@/app/api/__generated__/models/expert";
import { HeldCall } from "@/app/(platform)/home/components/NeedsYou/components/HeldCall";
import { HeldReviewDialog } from "@/app/(platform)/home/components/NeedsYou/components/HeldReviewDialog";
import { isHeldCall } from "@/app/(platform)/home/components/NeedsYou/helpers";
+import type { Expert } from "@/app/api/__generated__/models/expert";
import { ExpertAttentionCard } from "./ExpertAttentionCard";
import { useExpertNeedsYou } from "./useExpertNeedsYou";
interface Props {
expert: Expert;
- enabled: boolean;
}
/** One card per item, styled like the stack sections in the chat sidebar.
* A held AutoPilot call is the same row and detail Home shows. */
-export function ExpertNeedsYouSection({ expert, enabled }: Props) {
+export function ExpertNeedsYouSection({ expert }: Props) {
const { rows, pendingCount, pendingIDs, decide, held, carousel } =
useExpertNeedsYou({
expertId: expert.id,
- enabled,
});
if (rows.length === 0) return null;
diff --git a/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertNeedsYouSection/__tests__/ExpertNeedsYouSection.test.tsx b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertNeedsYouSection/__tests__/ExpertNeedsYouSection.test.tsx
index f7c124ce4f..85cd34d4e3 100644
--- a/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertNeedsYouSection/__tests__/ExpertNeedsYouSection.test.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertNeedsYouSection/__tests__/ExpertNeedsYouSection.test.tsx
@@ -27,7 +27,7 @@ test("an Expert's page reviews its held calls with Home's row and dialog", async
),
);
- render(<ExpertNeedsYouSection expert={{ id: ada.id } as Expert} enabled />);
+ render(<ExpertNeedsYouSection expert={{ id: ada.id } as Expert} />);
expect(
await screen.findByRole("button", { name: `Review: ${email.title}` }),
diff --git a/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertNeedsYouSection/useExpertNeedsYou.ts b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertNeedsYouSection/useExpertNeedsYou.ts
index c339eec68b..3de394a692 100644
--- a/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertNeedsYouSection/useExpertNeedsYou.ts
+++ b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertNeedsYouSection/useExpertNeedsYou.ts
@@ -1,20 +1,18 @@
-import { useGetHomeDashboard } from "@/app/api/__generated__/endpoints/home/home";
-import { okData } from "@/app/api/helpers";
import { useAttentionDecisions } from "@/app/(platform)/home/components/NeedsYou/useAttentionDecisions";
import { useHeldReview } from "@/app/(platform)/home/components/NeedsYou/useHeldReview";
import { useReviewCarousel } from "@/app/(platform)/home/components/NeedsYou/useReviewCarousel";
+import { useGetHomeDashboard } from "@/app/api/__generated__/endpoints/home/home";
+import { okData } from "@/app/api/helpers";
interface Args {
expertId: string;
- enabled: boolean;
}
// Setup items are left to the Team page's Setup needed card, which names the fix.
-export function useExpertNeedsYou({ expertId, enabled }: Args) {
+export function useExpertNeedsYou({ expertId }: Args) {
const { pendingIDs, decide } = useAttentionDecisions();
const dashboardQuery = useGetHomeDashboard({
query: {
- enabled,
staleTime: 0,
select: (res) =>
(okData(res)?.attention ?? []).filter(
diff --git a/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertSkillsSection.tsx b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertSkillsSection.tsx
index b5d334f190..2a9aacec6f 100644
--- a/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertSkillsSection.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/ExpertSkillsSection.tsx
@@ -2,22 +2,22 @@
import { Expert } from "@/app/api/__generated__/models/expert";
import { Button } from "@/components/atoms/Button/Button";
+import { Icon } from "@/components/atoms/Icon/Icon";
import { Switch } from "@/components/atoms/Switch/Switch";
import { Text } from "@/components/atoms/Text/Text";
+import { SkillLearningSheet } from "@/components/organisms/SkillLearningSheet/SkillLearningSheet";
import {
BookOpen01Icon,
BulbIcon,
PlusSignIcon,
SparklesIcon,
} from "@hugeicons/core-free-icons";
-import { Icon } from "@/components/atoms/Icon/Icon";
import { SectionEmptyState } from "../../components/SectionEmptyState";
+import { ToolbarSearch } from "../../components/ToolbarSearch";
import { AddSkillDialog } from "./AddSkillDialog";
import { ExpertSkillListItem } from "./ExpertSkillListItem";
-import { SkillLearningSheet } from "@/components/organisms/SkillLearningSheet/SkillLearningSheet";
import { useExpertLearning } from "./useExpertLearning";
import { useExpertSkills } from "./useExpertSkills";
-import { ToolbarSearch } from "../../components/ToolbarSearch";
interface Props {
expert: Expert;
@@ -48,7 +48,6 @@ export function ExpertSkillsSection({
setMarketQuery,
marketplaceSkills,
isMarketplaceLoading,
- hasMarketplace,
addSkill,
addMarketplaceSkill,
removeSkill,
@@ -172,7 +171,6 @@ export function ExpertSkillsSection({
onMarketQueryChange={setMarketQuery}
marketplaceSkills={marketplaceSkills}
isMarketplaceLoading={isMarketplaceLoading}
- hasMarketplace={hasMarketplace}
isSaving={isSaving}
onAdd={addSkill}
onAddMarketplace={addMarketplaceSkill}
diff --git a/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/useExpertSkills.ts b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/useExpertSkills.ts
index a2e83e289d..a21f70ec07 100644
--- a/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/useExpertSkills.ts
+++ b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/useExpertSkills.ts
@@ -10,15 +10,14 @@ import {
useGetV2ListMarketplaceSkills,
usePostV2InstallMarketplaceSkill,
} from "@/app/api/__generated__/endpoints/store/store";
-import { MarketplaceSkill } from "@/app/api/__generated__/models/marketplaceSkill";
-import { useDebouncedValue } from "@/hooks/useDebouncedValue";
import { CopilotSkillInfo } from "@/app/api/__generated__/models/copilotSkillInfo";
import { Expert } from "@/app/api/__generated__/models/expert";
import { ExpertSkillsUpdate } from "@/app/api/__generated__/models/expertSkillsUpdate";
+import { MarketplaceSkill } from "@/app/api/__generated__/models/marketplaceSkill";
import { okData } from "@/app/api/helpers";
-import { ApiError } from "@/lib/autogpt-server-api/helpers";
import { useToast } from "@/components/molecules/Toast/use-toast";
-import { Flag, useFlagStatus } from "@/services/feature-flags/use-get-flag";
+import { useDebouncedValue } from "@/hooks/useDebouncedValue";
+import { ApiError } from "@/lib/autogpt-server-api/helpers";
import { invalidateExpertRosterQueries } from "@/services/experts/invalidate-experts";
import { useQueryClient } from "@tanstack/react-query";
import { useState } from "react";
@@ -37,12 +36,12 @@ export function useExpertSkills(expert: Expert) {
const [source, setSource] = useState<"library" | "marketplace">("library");
const [marketQuery, setMarketQuery] = useState("");
const debouncedMarketQuery = useDebouncedValue(marketQuery, 250);
- const hub = useFlagStatus(Flag.SKILLS_HUB);
+
const marketplaceSkills = useGetV2ListMarketplaceSkills(
{ search_query: debouncedMarketQuery.trim(), page_size: 20 },
{
query: {
- enabled: hub.enabled && isAddOpen && source === "marketplace",
+ enabled: isAddOpen && source === "marketplace",
select: (res) => okData(res)?.skills ?? [],
},
},
@@ -163,7 +162,6 @@ export function useExpertSkills(expert: Expert) {
setMarketQuery,
marketplaceSkills: marketplaceSkills.data ?? [],
isMarketplaceLoading: marketplaceSkills.isFetching,
- hasMarketplace: hub.enabled,
addSkill,
addMarketplaceSkill,
removeSkill,
diff --git a/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/page.tsx b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/page.tsx
index 2350109f5a..450f85794b 100644
--- a/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/page.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/page.tsx
@@ -13,24 +13,18 @@ import {
TabsLineTrigger,
} from "@/components/molecules/TabsLine/TabsLine";
import { cn } from "@/lib/utils";
-import { Flag, useFlagStatus } from "@/services/feature-flags/use-get-flag";
import {
+ AiBrain01Icon,
Calendar03Icon,
ComputerIcon,
+ DashboardSquare01Icon,
+ Folder01Icon,
PlugSocketIcon,
Settings01Icon,
SparklesIcon,
- AiBrain01Icon,
- DashboardSquare01Icon,
- Folder01Icon,
WorkflowSquare01Icon,
} from "@hugeicons/core-free-icons";
-import {
- notFound,
- useParams,
- useRouter,
- useSearchParams,
-} from "next/navigation";
+import { useParams, useRouter, useSearchParams } from "next/navigation";
import { BackToTeamLink } from "../components/BackToTeamLink";
import { ExpertChatDrawer } from "../components/ExpertChatDrawer/ExpertChatDrawer";
import { expertToChatTarget } from "../components/ExpertChatDrawer/helpers";
@@ -43,17 +37,17 @@ import {
PROFILE_TABS_LIST_CLASS,
PROFILE_TABS_TRIGGER_CLASS,
} from "../helpers";
-import { ExpertFilesSection } from "./components/ExpertFilesSection/ExpertFilesSection";
-import { ExpertOverview } from "./components/ExpertOverview/ExpertOverview";
-import { ExpertSoulSection } from "./components/ExpertSoulSection";
import { ExpertComputerSection } from "./components/ExpertComputerSection/ExpertComputerSection";
import { ExpertDetailHeader } from "./components/ExpertDetailHeader";
+import { ExpertFilesSection } from "./components/ExpertFilesSection/ExpertFilesSection";
import { ExpertIntegrationsSection } from "./components/ExpertIntegrationsSection/ExpertIntegrationsSection";
import { ExpertModeSection } from "./components/ExpertModeSection/ExpertModeSection";
import { ExpertNeedsYouSection } from "./components/ExpertNeedsYouSection/ExpertNeedsYouSection";
+import { ExpertOverview } from "./components/ExpertOverview/ExpertOverview";
import { ExpertSchedulesSection } from "./components/ExpertSchedulesSection";
import { ExpertSettingsSection } from "./components/ExpertSettingsSection";
import { ExpertSkillsSection } from "./components/ExpertSkillsSection";
+import { ExpertSoulSection } from "./components/ExpertSoulSection";
import { ExpertWorkflowsSection } from "./components/ExpertWorkflowsSection";
import { useExpertDetailPage } from "./useExpertDetailPage";
@@ -82,7 +76,7 @@ export default function ExpertDetailPage() {
: "basics";
const requestedSkill = searchParams.get("skill");
const requestedVersion = searchParams.get("version");
- const { enabled, ready } = useFlagStatus(Flag.HIRE_EXPERTS);
+
const {
expert,
isLoading,
@@ -112,10 +106,9 @@ export default function ExpertDetailPage() {
closeChat,
} = useExpertDetailPage({
expertId,
- enabled: Boolean(enabled) && ready,
});
- if (!ready || isLoading) {
+ if (isLoading) {
return (
<main className={MAIN_CLASS}>
<Skeleton className="h-20 w-full rounded-xl" />
@@ -125,10 +118,6 @@ export default function ExpertDetailPage() {
);
}
- if (!enabled) {
- notFound();
- }
-
if (isError || !expert) {
return (
<main className={MAIN_CLASS}>
@@ -170,10 +159,7 @@ export default function ExpertDetailPage() {
</div>
) : null}
- <ExpertNeedsYouSection
- expert={expert}
- enabled={Boolean(enabled) && ready}
- />
+ <ExpertNeedsYouSection expert={expert} />
<TabsLine data-profile-tabs variant="compact" defaultValue={initialTab}>
<TabsLineList
@@ -244,7 +230,6 @@ export default function ExpertDetailPage() {
<ExpertComputerSection
expertId={expert.id}
expertName={expert.name}
- enabled={Boolean(enabled) && ready}
/>
</TabsLineContent>
diff --git a/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/useExpertDetailPage.ts b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/useExpertDetailPage.ts
index ef62b1280c..c581311eec 100644
--- a/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/useExpertDetailPage.ts
+++ b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/useExpertDetailPage.ts
@@ -14,22 +14,21 @@ import { getExpertSchedules } from "../helpers";
interface Args {
expertId: string;
- enabled: boolean;
}
-export function useExpertDetailPage({ expertId, enabled }: Args) {
+export function useExpertDetailPage({ expertId }: Args) {
const queryClient = useQueryClient();
const { toast } = useToast();
const [isPickerOpen, setIsPickerOpen] = useState(false);
const expertQuery = useGetExpert(expertId, {
- query: { select: (res) => okData(res) ?? null, enabled },
+ query: { select: (res) => okData(res) ?? null },
});
const schedulesQuery = useGetV1ListExecutionSchedulesForAUser({
- query: { select: (res) => okData(res) ?? [], enabled },
+ query: { select: (res) => okData(res) ?? [] },
});
const activityQuery = useGetExpertActivity(expertId, {
- query: { select: (res) => okData(res) ?? null, enabled },
+ query: { select: (res) => okData(res) ?? null },
});
const expert = expertQuery.data ?? null;
@@ -116,7 +115,7 @@ export function useExpertDetailPage({ expertId, enabled }: Args) {
return {
expert,
- isLoading: enabled && (expertQuery.isLoading || schedulesQuery.isLoading),
+ isLoading: expertQuery.isLoading || schedulesQuery.isLoading,
isError:
expertQuery.isError ||
schedulesQuery.isError ||
@@ -124,7 +123,7 @@ export function useExpertDetailPage({ expertId, enabled }: Args) {
refetch,
schedules,
activity: activityQuery.data ?? null,
- isActivityLoading: enabled && activityQuery.isLoading,
+ isActivityLoading: activityQuery.isLoading,
isActivityError: activityQuery.isError,
isPickerOpen,
openPicker: () => setIsPickerOpen(true),
diff --git a/autogpt_platform/frontend/src/app/(platform)/team/__tests__/main.test.tsx b/autogpt_platform/frontend/src/app/(platform)/team/__tests__/main.test.tsx
index 7d9da059a3..25a2982f9c 100644
--- a/autogpt_platform/frontend/src/app/(platform)/team/__tests__/main.test.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/team/__tests__/main.test.tsx
@@ -16,6 +16,7 @@ import {
getGetV2ListLibraryAgentsResponseMock200,
} from "@/app/api/__generated__/endpoints/library/library.msw";
import { getGetV1ListProvidersMockHandler } from "@/app/api/__generated__/endpoints/integrations/integrations.msw";
+import { getListMyExpertMemoryFactsMockHandler200 } from "@/app/api/__generated__/endpoints/memory/memory.msw";
import { getGetV1ListExecutionSchedulesForAUserMockHandler } from "@/app/api/__generated__/endpoints/schedules/schedules.msw";
import type { ExpertSetupItem } from "@/app/api/__generated__/models/expertSetupItem";
import { Expert } from "@/app/api/__generated__/models/expert";
@@ -55,9 +56,6 @@ vi.mock("framer-motion", async (importActual) => {
});
const toastMock = vi.hoisted(() => vi.fn());
-const { setFlagStatusMock } = vi.hoisted(() => ({
- setFlagStatusMock: vi.fn(() => ({ enabled: true, ready: true })),
-}));
const autoModeFlag = vi.hoisted(() => ({ enabled: false }));
function libraryResponse(
@@ -108,13 +106,16 @@ beforeEach(() => {
getListExpertPodsMockHandler([]),
getListExpertCredentialsMockHandler([]),
getListExpertSetupItemsMockHandler([]),
+ getListMyExpertMemoryFactsMockHandler200({
+ expert_id: "expert-maria",
+ items: [],
+ }),
getGetV1ListProvidersMockHandler([]),
getGetV2ListLibraryAgentsMockHandler200(libraryResponse([])),
);
});
afterEach(() => {
- setFlagStatusMock.mockReturnValue({ enabled: true, ready: true });
autoModeFlag.enabled = false;
toastMock.mockReset();
});
@@ -134,10 +135,6 @@ vi.mock("@/services/feature-flags/use-get-flag", async (importOriginal) => {
>();
return {
...actual,
- useFlagStatus: (flag: string) =>
- flag === "hire-experts"
- ? setFlagStatusMock()
- : actual.useFlagStatus(flag as never),
useGetFlag: (flag: string) =>
flag === actual.Flag.COPILOT_AUTO_MODE
? autoModeFlag.enabled
@@ -1097,27 +1094,12 @@ describe("TeamPage", () => {
expect(podsRequest).not.toHaveBeenCalled();
});
- test("calls notFound() when the flag is resolved and disabled", () => {
- let listRequests = 0;
- server.use(
- getListExpertsMockHandler(() => {
- listRequests += 1;
- return [hiredMaria];
- }),
- );
- setFlagStatusMock.mockReturnValueOnce({ enabled: false, ready: true });
+ test("loads the expert roster without a rollout flag", async () => {
+ server.use(getListExpertsMockHandler([hiredMaria]));
notFoundMock.mockClear();
-
- try {
- render(<TeamPage />);
- } catch {
- // React surfaces the thrown notFound() error; the assertion below is
- // what we actually care about.
- }
-
- expect(notFoundMock).toHaveBeenCalled();
- expect(listRequests).toBe(0);
- expect(screen.queryByRole("button", { name: "Edit Soul" })).toBeNull();
+ render(<TeamPage />);
+ expect(await screen.findByText("Maria")).toBeDefined();
+ expect(notFoundMock).not.toHaveBeenCalled();
});
test("does not mark the card as needing setup when a stale id has a live job", async () => {
diff --git a/autogpt_platform/frontend/src/app/(platform)/team/__tests__/soul-learned-notes.test.tsx b/autogpt_platform/frontend/src/app/(platform)/team/__tests__/soul-learned-notes.test.tsx
index c6acc68fbd..11c474a5f7 100644
--- a/autogpt_platform/frontend/src/app/(platform)/team/__tests__/soul-learned-notes.test.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/team/__tests__/soul-learned-notes.test.tsx
@@ -20,28 +20,6 @@ import { http, HttpResponse } from "msw";
import { beforeEach, describe, expect, test, vi } from "vitest";
import TeamPage from "../page";
-const { memoryFlagMock } = vi.hoisted(() => ({
- memoryFlagMock: vi.fn(() => true),
-}));
-
-vi.mock("@/services/feature-flags/use-get-flag", async (importOriginal) => {
- const actual =
- await importOriginal<
- typeof import("@/services/feature-flags/use-get-flag")
- >();
- return {
- ...actual,
- useGetFlag: (flag: string) =>
- flag === "graphiti-memory"
- ? memoryFlagMock()
- : actual.useGetFlag(flag as never),
- useFlagStatus: (flag: string) =>
- flag === "hire-experts"
- ? { enabled: true, ready: true }
- : actual.useFlagStatus(flag as never),
- };
-});
-
vi.mock("next/navigation", () => ({
useRouter: () => ({
push: vi.fn(),
@@ -95,7 +73,6 @@ async function openSoulDrawer() {
}
beforeEach(() => {
- memoryFlagMock.mockReturnValue(true);
server.use(
getGetV1ListExecutionSchedulesForAUserMockHandler([]),
getListExpertPodsMockHandler([]),
@@ -224,8 +201,7 @@ describe("Soul drawer — what I've learned", () => {
expect(screen.queryByText(/Nothing recorded yet/)).toBeNull();
});
- test("asks the memory API for nothing while the memory flag is off", async () => {
- memoryFlagMock.mockReturnValue(false);
+ test("loads private memories only after opening the expert's Soul", async () => {
let listCalls = 0;
server.use(
getListMyExpertMemoryFactsMockHandler(async () => {
@@ -234,13 +210,15 @@ describe("Soul drawer — what I've learned", () => {
}),
);
- await openSoulDrawer();
+ const user = userEvent.setup();
+ render(<TeamPage />);
+ const editSoul = await screen.findByRole("button", { name: "Edit Soul" });
+ expect(listCalls).toBe(0);
+ await user.click(editSoul);
expect(
- await screen.findByText(
- "Nothing recorded yet. What this expert learns will appear here.",
- ),
+ await screen.findByText("Q4 campaign brief is due Friday"),
).toBeDefined();
- expect(listCalls).toBe(0);
+ expect(listCalls).toBe(1);
});
});
diff --git a/autogpt_platform/frontend/src/app/(platform)/team/__tests__/tabs.test.tsx b/autogpt_platform/frontend/src/app/(platform)/team/__tests__/tabs.test.tsx
index a2376b5085..41e45efb85 100644
--- a/autogpt_platform/frontend/src/app/(platform)/team/__tests__/tabs.test.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/team/__tests__/tabs.test.tsx
@@ -13,20 +13,6 @@ import userEvent from "@testing-library/user-event";
import { beforeEach, describe, expect, test, vi } from "vitest";
import TeamPage from "../page";
-vi.mock("@/services/feature-flags/use-get-flag", async (importOriginal) => {
- const actual =
- await importOriginal<
- typeof import("@/services/feature-flags/use-get-flag")
- >();
- return {
- ...actual,
- useFlagStatus: (flag: string) =>
- flag === "hire-experts"
- ? { enabled: true, ready: true }
- : actual.useFlagStatus(flag as never),
- };
-});
-
vi.mock("next/navigation", () => ({
useRouter: () => ({
push: vi.fn(),
diff --git a/autogpt_platform/frontend/src/app/(platform)/team/autopilot/__tests__/main.test.tsx b/autogpt_platform/frontend/src/app/(platform)/team/autopilot/__tests__/main.test.tsx
index f70abd6b57..bcbc165866 100644
--- a/autogpt_platform/frontend/src/app/(platform)/team/autopilot/__tests__/main.test.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/team/autopilot/__tests__/main.test.tsx
@@ -16,24 +16,6 @@ import { http, HttpResponse } from "msw";
import { afterEach, beforeEach, describe, expect, test, vi } from "vitest";
import AutopilotPage from "../page";
-const { setFlagStatusMock } = vi.hoisted(() => ({
- setFlagStatusMock: vi.fn(() => ({ enabled: true, ready: true })),
-}));
-
-vi.mock("@/services/feature-flags/use-get-flag", async (importOriginal) => {
- const actual =
- await importOriginal<
- typeof import("@/services/feature-flags/use-get-flag")
- >();
- return {
- ...actual,
- useFlagStatus: (flag: string) =>
- flag === "hire-experts"
- ? setFlagStatusMock()
- : actual.useFlagStatus(flag as never),
- };
-});
-
const { notFoundMock } = vi.hoisted(() => ({ notFoundMock: vi.fn() }));
vi.mock("next/navigation", () => ({
useRouter: () => ({
@@ -204,7 +186,6 @@ beforeEach(() => {
});
afterEach(() => {
- setFlagStatusMock.mockReturnValue({ enabled: true, ready: true });
notFoundMock.mockReset();
});
@@ -412,10 +393,9 @@ describe("AutopilotPage", () => {
expect(failures).toBe(2);
});
- test("404s when experts are switched off", () => {
- setFlagStatusMock.mockReturnValue({ enabled: false, ready: true });
-
- expect(() => render(<AutopilotPage />)).toThrow("NEXT_NOT_FOUND");
- expect(notFoundMock).toHaveBeenCalled();
+ test("loads Otto without a rollout flag", async () => {
+ render(<AutopilotPage />);
+ expect(await screen.findByRole("heading", { name: "Otto" })).toBeDefined();
+ expect(notFoundMock).not.toHaveBeenCalled();
});
});
diff --git a/autogpt_platform/frontend/src/app/(platform)/team/autopilot/__tests__/tabs.test.tsx b/autogpt_platform/frontend/src/app/(platform)/team/autopilot/__tests__/tabs.test.tsx
index 0537f53d81..f019bb7cb1 100644
--- a/autogpt_platform/frontend/src/app/(platform)/team/autopilot/__tests__/tabs.test.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/team/autopilot/__tests__/tabs.test.tsx
@@ -9,13 +9,6 @@ import { NuqsTestingAdapter, UrlUpdateEvent } from "nuqs/adapters/testing";
import { beforeEach, describe, expect, test, vi } from "vitest";
import AutopilotPage from "../page";
-vi.mock("@/services/feature-flags/use-get-flag", async (importOriginal) => ({
- ...(await importOriginal<
- typeof import("@/services/feature-flags/use-get-flag")
- >()),
- useFlagStatus: () => ({ enabled: true, ready: true }),
-}));
-
beforeEach(() => {
server.use(
getListExpertsMockHandler([]),
diff --git a/autogpt_platform/frontend/src/app/(platform)/team/autopilot/page.tsx b/autogpt_platform/frontend/src/app/(platform)/team/autopilot/page.tsx
index b9bcde0405..488083329d 100644
--- a/autogpt_platform/frontend/src/app/(platform)/team/autopilot/page.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/team/autopilot/page.tsx
@@ -2,21 +2,21 @@
import { Skeleton } from "@/components/atoms/Skeleton/Skeleton";
import { Text } from "@/components/atoms/Text/Text";
+import { AUTOPILOT_NAME } from "@/components/molecules/AutopilotAvatar/helpers";
import { ErrorCard } from "@/components/molecules/ErrorCard/ErrorCard";
+import { AUTOPILOT_HEX } from "@/components/molecules/ExpertAvatar/colors";
import {
TabsLine,
TabsLineContent,
TabsLineList,
TabsLineTrigger,
} from "@/components/molecules/TabsLine/TabsLine";
-import { Flag, useFlagStatus } from "@/services/feature-flags/use-get-flag";
import {
Calendar03Icon,
SparklesIcon,
UserIcon,
WorkflowSquare01Icon,
} from "@hugeicons/core-free-icons";
-import { notFound } from "next/navigation";
import { ExpertSchedulesSection } from "../[expertId]/components/ExpertSchedulesSection";
import { ExpertWorkflowsSection } from "../[expertId]/components/ExpertWorkflowsSection";
import { BackToTeamLink } from "../components/BackToTeamLink";
@@ -25,8 +25,6 @@ import {
PROFILE_TABS_LIST_CLASS,
PROFILE_TABS_TRIGGER_CLASS,
} from "../helpers";
-import { AUTOPILOT_NAME } from "@/components/molecules/AutopilotAvatar/helpers";
-import { AUTOPILOT_HEX } from "@/components/molecules/ExpertAvatar/colors";
import { AutopilotAboutSection } from "./components/AutopilotAboutSection";
import { AutopilotHeader } from "./components/AutopilotHeader";
import { AutopilotSkillsSection } from "./components/AutopilotSkillsSection";
@@ -44,12 +42,11 @@ const TABS = [
] as const;
export default function AutopilotPage() {
- const { enabled, ready } = useFlagStatus(Flag.HIRE_EXPERTS);
const { activeTab, onTabChange } = useAutopilotTab();
const { schedules, workflows, skills, isLoading, isError, refetch } =
- useAutopilotPage({ enabled: Boolean(enabled) && ready });
+ useAutopilotPage();
- if (!ready || isLoading) {
+ if (isLoading) {
return (
<main className={MAIN_CLASS}>
<Skeleton className="h-20 w-full rounded-xl" />
@@ -59,10 +56,6 @@ export default function AutopilotPage() {
);
}
- if (!enabled) {
- notFound();
- }
-
if (isError) {
return (
<main className={MAIN_CLASS}>
diff --git a/autogpt_platform/frontend/src/app/(platform)/team/autopilot/useAutopilotPage.ts b/autogpt_platform/frontend/src/app/(platform)/team/autopilot/useAutopilotPage.ts
index dcd9ac65c2..6aa404a6a4 100644
--- a/autogpt_platform/frontend/src/app/(platform)/team/autopilot/useAutopilotPage.ts
+++ b/autogpt_platform/frontend/src/app/(platform)/team/autopilot/useAutopilotPage.ts
@@ -8,31 +8,27 @@ import {
okData,
unpaginate,
} from "@/app/api/helpers";
+import { useEffect } from "react";
import {
getAutopilotSkills,
getAutopilotWorkflows,
getHiredExperts,
getTeamSchedules,
} from "../helpers";
-import { useEffect } from "react";
-
-interface Args {
- enabled: boolean;
-}
-export function useAutopilotPage({ enabled }: Args) {
+export function useAutopilotPage() {
const expertsQuery = useListExperts({
- query: { select: (res) => (okData(res) ?? []) as Expert[], enabled },
+ query: { select: (res) => (okData(res) ?? []) as Expert[] },
});
const schedulesQuery = useGetV1ListExecutionSchedulesForAUser({
- query: { select: (res) => okData(res) ?? [], enabled },
+ query: { select: (res) => okData(res) ?? [] },
});
const libraryQuery = useGetV2ListLibraryAgentsInfinite(
{ page: 1, page_size: 100, is_hidden: false },
- { query: { getNextPageParam: getPaginationNextPageNumber, enabled } },
+ { query: { getNextPageParam: getPaginationNextPageNumber } },
);
const skillsQuery = useListCopilotSkills(undefined, {
- query: { select: (res) => okData(res) ?? [], enabled },
+ query: { select: (res) => okData(res) ?? [] },
});
// Otto owns every library workflow no expert has claimed, so the
@@ -66,11 +62,10 @@ export function useAutopilotPage({ enabled }: Args) {
workflows,
skills,
isLoading:
- enabled &&
- (expertsQuery.isLoading ||
- schedulesQuery.isLoading ||
- libraryQuery.isLoading ||
- skillsQuery.isLoading),
+ expertsQuery.isLoading ||
+ schedulesQuery.isLoading ||
+ libraryQuery.isLoading ||
+ skillsQuery.isLoading,
isError: expertsQuery.isError || schedulesQuery.isError,
refetch,
};
diff --git a/autogpt_platform/frontend/src/app/(platform)/team/components/SetupNeeded/SetupNeeded.tsx b/autogpt_platform/frontend/src/app/(platform)/team/components/SetupNeeded/SetupNeeded.tsx
index 08e3f0abcf..8f1fa36980 100644
--- a/autogpt_platform/frontend/src/app/(platform)/team/components/SetupNeeded/SetupNeeded.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/team/components/SetupNeeded/SetupNeeded.tsx
@@ -7,13 +7,9 @@ import { ExpertConnectServiceDialog } from "../../[expertId]/components/ExpertIn
import { SetupNeededRow } from "./components/SetupNeededRow";
import { useSetupNeeded } from "./useSetupNeeded";
-interface Props {
- enabled: boolean;
-}
-
/** Everything still standing between the team's scheduled workflows and
* their schedules, one row per gap with the one action that closes it. */
-export function SetupNeeded({ enabled }: Props) {
+export function SetupNeeded() {
const {
items,
isConnectable,
@@ -23,7 +19,7 @@ export function SetupNeeded({ enabled }: Props) {
handleConnected,
allow,
isGranting,
- } = useSetupNeeded({ enabled });
+ } = useSetupNeeded();
if (items.length === 0) return null;
diff --git a/autogpt_platform/frontend/src/app/(platform)/team/components/SetupNeeded/useSetupNeeded.ts b/autogpt_platform/frontend/src/app/(platform)/team/components/SetupNeeded/useSetupNeeded.ts
index b5f0bad9b0..ea4227c478 100644
--- a/autogpt_platform/frontend/src/app/(platform)/team/components/SetupNeeded/useSetupNeeded.ts
+++ b/autogpt_platform/frontend/src/app/(platform)/team/components/SetupNeeded/useSetupNeeded.ts
@@ -13,21 +13,16 @@ import { invalidateExpertGrantQueries } from "@/services/experts/invalidate-expe
import { useQueryClient } from "@tanstack/react-query";
import { useState } from "react";
-interface Args {
- enabled: boolean;
-}
-
-export function useSetupNeeded({ enabled }: Args) {
+export function useSetupNeeded() {
const queryClient = useQueryClient();
const { toast } = useToast();
const [connecting, setConnecting] = useState<ExpertSetupItem | null>(null);
const itemsQuery = useListExpertSetupItems({
- query: { enabled, select: (res) => okData(res) ?? [] },
+ query: { select: (res) => okData(res) ?? [] },
});
const providersQuery = useGetV1ListProviders({
query: {
- enabled,
select: (res) => (res.status === 200 ? res.data : []),
},
});
diff --git a/autogpt_platform/frontend/src/app/(platform)/team/components/SoulDrawer/components/LearnedNotes/useLearnedNotes.ts b/autogpt_platform/frontend/src/app/(platform)/team/components/SoulDrawer/components/LearnedNotes/useLearnedNotes.ts
index 00acbfd56a..d0de52f7c0 100644
--- a/autogpt_platform/frontend/src/app/(platform)/team/components/SoulDrawer/components/LearnedNotes/useLearnedNotes.ts
+++ b/autogpt_platform/frontend/src/app/(platform)/team/components/SoulDrawer/components/LearnedNotes/useLearnedNotes.ts
@@ -4,7 +4,6 @@ import {
useListMyExpertMemoryFacts,
} from "@/app/api/__generated__/endpoints/memory/memory";
import { toast } from "@/components/molecules/Toast/use-toast";
-import { Flag, useGetFlag } from "@/services/feature-flags/use-get-flag";
import { useQueryClient } from "@tanstack/react-query";
/** Enough to show what the expert is picking up without crowding out the Soul
@@ -12,14 +11,11 @@ import { useQueryClient } from "@tanstack/react-query";
const SOUL_NOTES_LIMIT = 5;
export function useLearnedNotes(expertId: string) {
- const isMemoryEnabled = useGetFlag(Flag.GRAPHITI_MEMORY);
const queryClient = useQueryClient();
- const factsQuery = useListMyExpertMemoryFacts(
- expertId,
- { limit: SOUL_NOTES_LIMIT },
- { query: { enabled: Boolean(isMemoryEnabled) } },
- );
+ const factsQuery = useListMyExpertMemoryFacts(expertId, {
+ limit: SOUL_NOTES_LIMIT,
+ });
const facts =
factsQuery.data?.status === 200 ? factsQuery.data.data.items : [];
diff --git a/autogpt_platform/frontend/src/app/(platform)/team/page.tsx b/autogpt_platform/frontend/src/app/(platform)/team/page.tsx
index bf45366d8c..0c138dd752 100644
--- a/autogpt_platform/frontend/src/app/(platform)/team/page.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/team/page.tsx
@@ -4,26 +4,21 @@ import { Expert } from "@/app/api/__generated__/models/expert";
import { ErrorCard } from "@/components/molecules/ErrorCard/ErrorCard";
import { InstallWorkflowPicker } from "@/components/molecules/InstallWorkflowPicker/InstallWorkflowPicker";
import { cn } from "@/lib/utils";
-import { Flag, useFlagStatus } from "@/services/feature-flags/use-get-flag";
-import { notFound } from "next/navigation";
import { EmptyTeamState } from "./components/EmptyTeamState";
import { ExpertChatDrawer } from "./components/ExpertChatDrawer/ExpertChatDrawer";
import { ExpertTeamCard } from "./components/ExpertTeamCard/ExpertTeamCard";
-import { ExpertTeamCardSkeleton } from "./components/ExpertTeamCardSkeleton";
import { SetupNeeded } from "./components/SetupNeeded/SetupNeeded";
import { SoulDrawer } from "./components/SoulDrawer/SoulDrawer";
import { TeamPageHeader } from "./components/TeamPageHeader/TeamPageHeader";
import { TeamRoster } from "./components/TeamRoster/TeamRoster";
import { TeamRosterToolbar } from "./components/TeamRoster/TeamRosterToolbar";
import { useTeamRosterView } from "./components/TeamRoster/useTeamRosterView";
-import { TEAM_GRID_CLASS } from "./helpers";
import { useTeamPage } from "./useTeamPage";
const MAIN_CLASS =
"mx-auto min-h-screen w-full max-w-[1180px] space-y-5 px-4 pb-16 pt-6 duration-500 sm:px-8 md:px-12 animate-in fade-in slide-in-from-bottom-2 fill-mode-both motion-reduce:animate-none";
export default function TeamPage() {
- const { enabled, ready } = useFlagStatus(Flag.HIRE_EXPERTS);
const {
hiredExperts,
schedulesForExpert,
@@ -41,28 +36,12 @@ export default function TeamPage() {
chatDrawerKey,
openChat,
closeChat,
- } = useTeamPage({ enabled: Boolean(enabled) && ready });
+ } = useTeamPage();
const roster = useTeamRosterView({
experts: hiredExperts,
schedulesForExpert,
});
- if (!ready) {
- return (
- <main className={MAIN_CLASS}>
- <div className={TEAM_GRID_CLASS}>
- {[0, 1, 2].map((i) => (
- <ExpertTeamCardSkeleton key={i} />
- ))}
- </div>
- </main>
- );
- }
-
- if (!enabled) {
- notFound();
- }
-
function renderCard(expert: Expert) {
return (
<ExpertTeamCard
@@ -97,7 +76,7 @@ export default function TeamPage() {
/>
<div className="space-y-6">
- <SetupNeeded enabled={Boolean(enabled) && ready} />
+ <SetupNeeded />
<TeamRoster
isLoading={isLoading}
experts={hiredExperts}
diff --git a/autogpt_platform/frontend/src/app/(platform)/team/useTeamPage.ts b/autogpt_platform/frontend/src/app/(platform)/team/useTeamPage.ts
index dfc800aab8..246bbbd029 100644
--- a/autogpt_platform/frontend/src/app/(platform)/team/useTeamPage.ts
+++ b/autogpt_platform/frontend/src/app/(platform)/team/useTeamPage.ts
@@ -15,11 +15,7 @@ import {
SETUP_POLL_MS,
} from "./helpers";
-interface Args {
- enabled: boolean;
-}
-
-export function useTeamPage({ enabled }: Args) {
+export function useTeamPage() {
const [pickerExpertId, setPickerExpertId] = useState<string | null>(null);
const [soulExpertId, setSoulExpertId] = useState<string | null>(null);
const [soulDrawerKey, setSoulDrawerKey] = useState(0);
@@ -29,7 +25,6 @@ export function useTeamPage({ enabled }: Args) {
const expertsQuery = useListExperts({
query: {
select: (res) => (okData(res) ?? []) as Expert[],
- enabled,
// A fresh hire's skills land after the hire returns; follow them in.
refetchInterval: (query) =>
isSettingUp((okData(query.state.data) ?? []) as Expert[])
@@ -38,7 +33,7 @@ export function useTeamPage({ enabled }: Args) {
},
});
const schedulesQuery = useGetV1ListExecutionSchedulesForAUser({
- query: { select: (res) => okData(res) ?? [], enabled },
+ query: { select: (res) => okData(res) ?? [] },
});
const hiredExperts = getHiredExperts(expertsQuery.data ?? []);
const schedules = schedulesQuery.data ?? [];
@@ -86,7 +81,7 @@ export function useTeamPage({ enabled }: Args) {
schedulesForExpert,
// Only the roster decides the page's loading and error states: a slow or
// failing schedules fetch must not hide experts that loaded fine.
- isLoading: enabled && expertsQuery.isPending,
+ isLoading: expertsQuery.isPending,
isError: expertsQuery.isError,
refetch,
installWorkflow,
diff --git a/autogpt_platform/frontend/src/app/api/openapi.json b/autogpt_platform/frontend/src/app/api/openapi.json
index 872cb834cc..4311181e44 100644
--- a/autogpt_platform/frontend/src/app/api/openapi.json
+++ b/autogpt_platform/frontend/src/app/api/openapi.json
@@ -16412,7 +16412,7 @@
"$ref": "#/components/responses/HTTP401NotAuthenticatedError"
}
},
- "security": [{ "HTTPBearerJWT": [] }, { "HTTPBearer": [] }]
+ "security": [{ "HTTPBearerJWT": [] }]
}
},
"/api/store/admin/skills/submissions/{skill_listing_version_id}/files/{path}": {
@@ -16421,7 +16421,7 @@
"summary": "Admin Read Skill Submission File",
"description": "One submitted file's text, so a reviewer reads a script before approving.\n\nThe version is addressed directly rather than through its listing: a first\nsubmission has no approved version for a slug to resolve to, and this\nrouter's admin check is what grants the pending read.",
"operationId": "getV2Admin read skill submission file",
- "security": [{ "HTTPBearerJWT": [] }, { "HTTPBearer": [] }],
+ "security": [{ "HTTPBearerJWT": [] }],
"parameters": [
{
"name": "skill_listing_version_id",
@@ -16464,7 +16464,7 @@
"summary": "Review Skill Submission",
"description": "Approve or reject a skill submission.\n\nApproval promotes the version to the one the marketplace serves, so the\nbrowse cache is dropped; a rejection changes nothing shoppers can see.",
"operationId": "postV2Review skill submission",
- "security": [{ "HTTPBearerJWT": [] }, { "HTTPBearer": [] }],
+ "security": [{ "HTTPBearerJWT": [] }],
"parameters": [
{
"name": "skill_listing_version_id",
@@ -17418,7 +17418,6 @@
"summary": "List marketplace skills",
"description": "Approved skill listings, most recently updated first.",
"operationId": "getV2List marketplace skills",
- "security": [{ "HTTPBearer": [] }],
"parameters": [
{
"name": "category",
@@ -17507,7 +17506,7 @@
"$ref": "#/components/responses/HTTP401NotAuthenticatedError"
}
},
- "security": [{ "HTTPBearer": [] }, { "HTTPBearerJWT": [] }]
+ "security": [{ "HTTPBearerJWT": [] }]
},
"post": {
"tags": ["v2", "store", "private"],
@@ -17549,7 +17548,7 @@
"description": "Marketplace profile required, or slug taken"
}
},
- "security": [{ "HTTPBearer": [] }, { "HTTPBearerJWT": [] }]
+ "security": [{ "HTTPBearerJWT": [] }]
}
},
"/api/store/skills/submissions/{skill_listing_version_id}": {
@@ -17558,7 +17557,7 @@
"summary": "Edit skill submission",
"description": "Update a pending submission and re-snapshot the library skill.",
"operationId": "putV2Edit skill submission",
- "security": [{ "HTTPBearer": [] }, { "HTTPBearerJWT": [] }],
+ "security": [{ "HTTPBearerJWT": [] }],
"parameters": [
{
"name": "skill_listing_version_id",
@@ -17608,7 +17607,6 @@
"summary": "Get marketplace skill",
"description": "One listing with the full SKILL.md body the install will copy.",
"operationId": "getV2Get marketplace skill",
- "security": [{ "HTTPBearer": [] }],
"parameters": [
{
"name": "slug",
@@ -17712,7 +17710,7 @@
"summary": "Install marketplace skill",
"description": "Copy the listing's skill into an expert's skills, or the caller's own.",
"operationId": "postV2Install marketplace skill",
- "security": [{ "HTTPBearer": [] }, { "HTTPBearerJWT": [] }],
+ "security": [{ "HTTPBearerJWT": [] }],
"parameters": [
{
"name": "slug",
@@ -26095,19 +26093,12 @@
"enum": [
"marketplace-search-terms",
"enable-platform-payment",
- "artifacts-page",
"chat-mode-option",
"generic-trigger-agents",
"chat-workspace-files",
"chat-pinning",
"task-progress-bar",
- "hire-experts",
- "skills-hub",
"settings-notifications",
- "onboarding-brain-dump",
- "onboarding-expert-team",
- "graphiti-memory",
- "graphiti-communities-enabled",
"dream-pass-enabled",
"dream-pass-invalidate-entity",
"dream-skill-learning-enabled",
@@ -26122,19 +26113,12 @@
"x-enum-varnames": [
"MARKETPLACE_SEARCH_TERMS",
"ENABLE_PLATFORM_PAYMENT",
- "ARTIFACTS_PAGE",
"CHAT_MODE_OPTION",
"GENERIC_TRIGGER_AGENTS",
"CHAT_WORKSPACE_FILES",
"CHAT_PINNING",
"TASK_PROGRESS_BAR",
- "HIRE_EXPERTS",
- "SKILLS_HUB",
"SETTINGS_NOTIFICATIONS",
- "ONBOARDING_BRAIN_DUMP",
- "ONBOARDING_EXPERT_TEAM",
- "GRAPHITI_MEMORY",
- "GRAPHITI_COMMUNITIES_ENABLED",
"DREAM_PASS_ENABLED",
"DREAM_PASS_INVALIDATE_ENTITY",
"DREAM_SKILL_LEARNING_ENABLED",
diff --git a/autogpt_platform/frontend/src/components/contextual/SkillsPanel/components/SkillListItem/SkillListItem.tsx b/autogpt_platform/frontend/src/components/contextual/SkillsPanel/components/SkillListItem/SkillListItem.tsx
index 6e8de60213..4aa891bbee 100644
--- a/autogpt_platform/frontend/src/components/contextual/SkillsPanel/components/SkillListItem/SkillListItem.tsx
+++ b/autogpt_platform/frontend/src/components/contextual/SkillsPanel/components/SkillListItem/SkillListItem.tsx
@@ -3,20 +3,19 @@
import type { CopilotSkillInfo } from "@/app/api/__generated__/models/copilotSkillInfo";
import { Badge } from "@/components/atoms/Badge/Badge";
import { Button } from "@/components/atoms/Button/Button";
-import { Flag, useGetFlag } from "@/services/feature-flags/use-get-flag";
-import { PublishSkillButton } from "../PublishSkillButton/PublishSkillButton";
+import { Icon } from "@/components/atoms/Icon/Icon";
+import { LoadingSpinner } from "@/components/atoms/LoadingSpinner/LoadingSpinner";
import { Text } from "@/components/atoms/Text/Text";
import { Dialog } from "@/components/molecules/Dialog/Dialog";
-import { LoadingSpinner } from "@/components/atoms/LoadingSpinner/LoadingSpinner";
import { ErrorCard } from "@/components/molecules/ErrorCard/ErrorCard";
-import { useSkillListItem } from "./useSkillListItem";
import {
BookOpen01Icon,
Delete02Icon,
Download04Icon,
EyeIcon,
} from "@hugeicons/core-free-icons";
-import { Icon } from "@/components/atoms/Icon/Icon";
+import { PublishSkillButton } from "../PublishSkillButton/PublishSkillButton";
+import { useSkillListItem } from "./useSkillListItem";
interface Props {
skill: CopilotSkillInfo;
@@ -42,7 +41,6 @@ export function SkillListItem({ skill, isNew = false }: Props) {
detail,
detailErrorMessage,
} = useSkillListItem({ skill });
- const isSkillsHubEnabled = useGetFlag(Flag.SKILLS_HUB);
return (
<div
@@ -108,9 +106,7 @@ export function SkillListItem({ skill, isNew = false }: Props) {
>
<Icon icon={Download04Icon} className="h-4 w-4" />
</Button>
- {isSkillsHubEnabled ? (
- <PublishSkillButton skillName={skill.name} />
- ) : null}
+ <PublishSkillButton skillName={skill.name} />
<Button
variant="icon"
size="icon"
diff --git a/autogpt_platform/frontend/src/components/layout/AppSidebar/AppSidebar.tsx b/autogpt_platform/frontend/src/components/layout/AppSidebar/AppSidebar.tsx
index 5ebe2d9001..2a77262f95 100644
--- a/autogpt_platform/frontend/src/components/layout/AppSidebar/AppSidebar.tsx
+++ b/autogpt_platform/frontend/src/components/layout/AppSidebar/AppSidebar.tsx
@@ -1,5 +1,7 @@
"use client";
+import { Icon } from "@/components/atoms/Icon/Icon";
+import { LoadingSpinner } from "@/components/atoms/LoadingSpinner/LoadingSpinner";
import {
Sidebar,
SidebarContent,
@@ -11,10 +13,17 @@ import {
SidebarRail,
useSidebar,
} from "@/components/ui/sidebar";
-import { Flag, useGetFlag } from "@/services/feature-flags/use-get-flag";
-import { LoadingSpinner } from "@/components/atoms/LoadingSpinner/LoadingSpinner";
-import { isEditableElement } from "@/lib/platform";
import { useAuth } from "@/lib/auth/hooks/useAuth";
+import { isEditableElement } from "@/lib/platform";
+import {
+ AddTeamIcon,
+ FlowIcon,
+ Folder01Icon,
+ GridViewIcon,
+ Home10Icon,
+ Store01Icon,
+} from "@hugeicons/core-free-icons";
+import type { IconSvgElement } from "@hugeicons/react";
import { motion, useReducedMotion } from "framer-motion";
import Link, { useLinkStatus } from "next/link";
import { usePathname, useRouter } from "next/navigation";
@@ -26,16 +35,6 @@ import { CollapsibleNavGroup } from "./components/CollapsibleNavGroup/Collapsibl
import { ShortcutHint } from "./components/ShortcutHint/ShortcutHint";
import { SidebarUserActions } from "./components/SidebarUserActions/SidebarUserActions";
import { useNavItemClassName } from "./useNavItemClassName";
-import {
- FlowIcon,
- Folder01Icon,
- GridViewIcon,
- Home10Icon,
- Store01Icon,
- AddTeamIcon,
-} from "@hugeicons/core-free-icons";
-import type { IconSvgElement } from "@hugeicons/react";
-import { Icon } from "@/components/atoms/Icon/Icon";
type NavLink = {
name: string;
@@ -169,16 +168,13 @@ export function AppSidebar(props: Props) {
const { isMobile } = useSidebar();
const itemVariants = getSidebarItemVariants(!!reduceMotion);
const router = useRouter();
- const isHireExpertsEnabled = useGetFlag(Flag.HIRE_EXPERTS);
- const mainLinks = isHireExpertsEnabled
- ? MAIN_LINKS.filter((link) => link.href !== "/library")
- : MAIN_LINKS;
- const filesEnabled = useGetFlag(Flag.ARTIFACTS_PAGE);
- const workspaceLinks = (
- isHireExpertsEnabled
- ? [{ name: "Team", href: "/team", icon: AddTeamIcon }, ...WORKSPACE_LINKS]
- : WORKSPACE_LINKS
- ).filter((link) => link.href !== "/artifacts" || filesEnabled);
+
+ const mainLinks = MAIN_LINKS.filter((link) => link.href !== "/library");
+
+ const workspaceLinks = [
+ { name: "Team", href: "/team", icon: AddTeamIcon },
+ ...WORKSPACE_LINKS,
+ ];
useEffect(() => {
function handleNewTaskShortcut(event: KeyboardEvent) {
diff --git a/autogpt_platform/frontend/src/components/layout/AppSidebar/__tests__/AppSidebar.test.tsx b/autogpt_platform/frontend/src/components/layout/AppSidebar/__tests__/AppSidebar.test.tsx
index ef7cd245e9..cf1bf7d2cc 100644
--- a/autogpt_platform/frontend/src/components/layout/AppSidebar/__tests__/AppSidebar.test.tsx
+++ b/autogpt_platform/frontend/src/components/layout/AppSidebar/__tests__/AppSidebar.test.tsx
@@ -61,7 +61,11 @@ vi.mock("next/navigation", async (importOriginal) => {
const actual = await importOriginal<typeof import("next/navigation")>();
return {
...actual,
- useRouter: () => ({ push: routerPush, prefetch: vi.fn() }),
+ useRouter: () => ({
+ push: routerPush,
+ replace: vi.fn(),
+ prefetch: vi.fn(),
+ }),
usePathname: () => "/marketplace",
useSearchParams: () => new URLSearchParams(),
};
@@ -120,14 +124,14 @@ describe("AppSidebar", () => {
it("renders the primary navigation links", () => {
renderSidebar();
- expect(screen.getByText("Workflows")).toBeDefined();
+ expect(screen.queryByText("Workflows")).toBeNull();
expect(screen.getByText("Marketplace")).toBeDefined();
expect(screen.getByText("Build")).toBeDefined();
- expect(screen.queryByText("Files")).toBeNull();
+ expect(screen.getByRole("link", { name: /files/i })).toBeDefined();
expect(screen.getByText("Home")).toBeDefined();
});
- it("shows Team instead of Workflows when the hire-experts flag is on", () => {
+ it("shows Team instead of Workflows for every signed-in user", () => {
useGetFlagMock.mockReturnValue(true);
renderSidebar();
const teamLink = screen.getByRole("link", { name: /team/i });
@@ -135,7 +139,7 @@ describe("AppSidebar", () => {
expect(screen.queryByText("Workflows")).toBeNull();
});
- it("keeps a Home link when the hire-experts flag is on", () => {
+ it("keeps a Home link for every signed-in user", () => {
useGetFlagMock.mockReturnValue(true);
renderSidebar();
const homeLink = screen.getByRole("link", { name: /home/i });
@@ -156,27 +160,12 @@ describe("AppSidebar", () => {
expect(screen.getByText("Recent chats")).toBeDefined();
});
- it.each([
- [false, false],
- [false, true],
- [true, false],
- [true, true],
- ])(
- "shows Workspace only for available destinations (Experts %s, Files %s)",
- (experts, files) => {
- useGetFlagMock.mockImplementation((flag) =>
- flag === Flag.HIRE_EXPERTS
- ? experts
- : flag === Flag.ARTIFACTS_PAGE
- ? files
- : false,
- );
- renderSidebar();
- expect(!!screen.queryByText("Workspace")).toBe(experts || files);
- expect(!!screen.queryByRole("link", { name: /files/i })).toBe(files);
- expect(screen.getByText("Recent chats")).toBeDefined();
- },
- );
+ it("always shows Team and Files when the flag provider returns false", () => {
+ renderSidebar();
+ expect(screen.getByText("Workspace")).toBeDefined();
+ expect(screen.getByRole("link", { name: /team/i })).toBeDefined();
+ expect(screen.getByRole("link", { name: /files/i })).toBeDefined();
+ });
it("marks the active link based on the current pathname", () => {
// global next/navigation mock resolves usePathname() to "/marketplace"
diff --git a/autogpt_platform/frontend/src/components/layout/AppSidebar/components/RecentChats/RecentChats.tsx b/autogpt_platform/frontend/src/components/layout/AppSidebar/components/RecentChats/RecentChats.tsx
index f5d23a91c3..a55b69b1b1 100644
--- a/autogpt_platform/frontend/src/components/layout/AppSidebar/components/RecentChats/RecentChats.tsx
+++ b/autogpt_platform/frontend/src/components/layout/AppSidebar/components/RecentChats/RecentChats.tsx
@@ -2,27 +2,23 @@
import { DeleteChatDialog } from "@/app/(platform)/copilot/components/DeleteChatDialog/DeleteChatDialog";
import { ShareChatDialog } from "@/app/(platform)/copilot/sharing/ShareChatDialog";
-import { groupSessionsByExpert } from "@/app/(platform)/copilot/useSessionList";
import { useExpertMap } from "@/app/(platform)/copilot/useExpertMap";
+import { groupSessionsByExpert } from "@/app/(platform)/copilot/useSessionList";
+import { Icon } from "@/components/atoms/Icon/Icon";
import { LoadingSpinner } from "@/components/atoms/LoadingSpinner/LoadingSpinner";
import { SidebarMenu } from "@/components/ui/sidebar";
import { Flag, useGetFlag } from "@/services/feature-flags/use-get-flag";
-import { useLocalDay } from "@/hooks/useLocalDay";
-import { Icon } from "@/components/atoms/Icon/Icon";
import { PinIcon } from "@hugeicons/core-free-icons";
import { ExpertChatGroup } from "./components/ExpertChatGroup/ExpertChatGroup";
import { RecentChatItem } from "./components/RecentChatItem/RecentChatItem";
-import { getNewChatHref, groupSessionsByDate } from "./helpers";
+import { getNewChatHref } from "./helpers";
import { useRecentChats } from "./useRecentChats";
export function RecentChats() {
const chatPinningEnabled = useGetFlag(Flag.CHAT_PINNING);
- const isExpertsEnabled = useGetFlag(Flag.HIRE_EXPERTS);
+
const isLearningEnabled = useGetFlag(Flag.DREAM_SKILL_LEARNING_ENABLED);
const { expertsById, activeExpertIds } = useExpertMap();
- // Re-groups "Today" / "Yesterday" at midnight: list polls that return the
- // same sessions no longer re-render this component.
- useLocalDay();
const {
sessions,
isLoading,
@@ -109,39 +105,28 @@ export function RecentChats() {
<SidebarMenu>{pinnedSessions.map(renderItem)}</SidebarMenu>
</div>
)}
- {isExpertsEnabled
- ? groupSessionsByExpert(unpinnedSessions).map((group) => {
- const expert = group.expertId
- ? expertsById.get(group.expertId)
- : null;
- return (
- // Keyed by expert id so each group's collapse/reveal state
- // survives the session list's periodic refetch.
- <ExpertChatGroup
- key={group.expertId ?? "autopilot"}
- label={group.expertId ? (expert?.name ?? "Expert") : "Otto"}
- role={
- group.expertId
- ? expert?.jobTitle || expert?.role
- : "Head of AI"
- }
- avatarUrl={expert?.avatarUrl ?? null}
- color={expert?.color ?? null}
- newChatHref={getNewChatHref(group.expertId, activeExpertIds)}
- isAutopilot={!group.expertId}
- sessions={group.sessions}
- renderItem={renderItem}
- />
- );
- })
- : groupSessionsByDate(unpinnedSessions).map((group) => (
- <div key={group.label}>
- <div className="flex items-center gap-1.5 px-2 pb-1.5 text-xs font-medium text-zinc-500">
- <span className="truncate">{group.label}</span>
- </div>
- <SidebarMenu>{group.sessions.map(renderItem)}</SidebarMenu>
- </div>
- ))}
+ {groupSessionsByExpert(unpinnedSessions).map((group) => {
+ const expert = group.expertId
+ ? expertsById.get(group.expertId)
+ : null;
+ return (
+ // Keyed by expert id so each group's collapse/reveal state
+ // survives the session list's periodic refetch.
+ <ExpertChatGroup
+ key={group.expertId ?? "autopilot"}
+ label={group.expertId ? (expert?.name ?? "Expert") : "Otto"}
+ role={
+ group.expertId ? expert?.jobTitle || expert?.role : "Head of AI"
+ }
+ avatarUrl={expert?.avatarUrl ?? null}
+ color={expert?.color ?? null}
+ newChatHref={getNewChatHref(group.expertId, activeExpertIds)}
+ isAutopilot={!group.expertId}
+ sessions={group.sessions}
+ renderItem={renderItem}
+ />
+ );
+ })}
</div>
{hasMore && (
diff --git a/autogpt_platform/frontend/src/components/layout/AppSidebar/components/RecentChats/__tests__/RecentChats.test.tsx b/autogpt_platform/frontend/src/components/layout/AppSidebar/components/RecentChats/__tests__/RecentChats.test.tsx
index 0c3660552c..801d985c7f 100644
--- a/autogpt_platform/frontend/src/components/layout/AppSidebar/components/RecentChats/__tests__/RecentChats.test.tsx
+++ b/autogpt_platform/frontend/src/components/layout/AppSidebar/components/RecentChats/__tests__/RecentChats.test.tsx
@@ -1,4 +1,5 @@
import { getGetV2ListSessionsMockHandler200 } from "@/app/api/__generated__/endpoints/chat/chat.msw";
+import { getListExpertIdentitiesMockHandler } from "@/app/api/__generated__/endpoints/experts/experts.msw";
import { server } from "@/mocks/mock-server";
import {
fireEvent,
@@ -59,6 +60,7 @@ beforeEach(() => {
vi.useFakeTimers({ shouldAdvanceTime: true });
vi.setSystemTime(new Date("2026-06-30T12:00:00"));
useCopilotUIStore.setState({ sessionToDelete: null });
+ server.use(getListExpertIdentitiesMockHandler([]));
});
afterEach(() => {
@@ -76,7 +78,7 @@ describe("RecentChats — empty + loading", () => {
});
describe("RecentChats — grouped list", () => {
- it("renders sessions grouped under date labels", async () => {
+ it("keeps chats from different dates together under Otto", async () => {
const sessions = [
makeSession({ id: "a", title: "Today chat", updated_at: TODAY }),
makeSession({
@@ -91,9 +93,13 @@ describe("RecentChats — grouped list", () => {
renderRecentChats();
expect(await screen.findByText("Today chat")).toBeDefined();
- expect(screen.getByText("Yesterday chat")).toBeDefined();
- expect(screen.getByText("Today")).toBeDefined();
- expect(screen.getByText("Yesterday")).toBeDefined();
+ expect(screen.getByRole("button", { name: "Otto chats" })).toBeDefined();
+ fireEvent.click(
+ screen.getByRole("button", { name: "Load all Otto chats" }),
+ );
+ expect(await screen.findByText("Yesterday chat")).toBeDefined();
+ expect(screen.queryByText("Today")).toBeNull();
+ expect(screen.queryByText("Yesterday")).toBeNull();
});
});
@@ -108,7 +114,7 @@ describe("RecentChats — pinned split", () => {
makeSession({ id: "loose", title: "Loose chat", updated_at: TODAY }),
];
- it("lifts pinned sessions out of the date groups", async () => {
+ it("lifts pinned sessions out of the expert groups", async () => {
mockEnabledFlags.add("chat-pinning");
server.use(
getGetV2ListSessionsMockHandler200({
@@ -124,16 +130,15 @@ describe("RecentChats — pinned split", () => {
if (!pinnedGroup) throw new Error("pinned group not found");
expect(within(pinnedGroup).getByText("Pinned chat")).toBeDefined();
- // The only "Yesterday" session is pinned, so that date group disappears.
- expect(screen.queryByText("Yesterday")).toBeNull();
-
- const todayGroup = screen.getByText("Today").closest("div")?.parentElement;
- if (!todayGroup) throw new Error("today group not found");
- expect(within(todayGroup).getByText("Loose chat")).toBeDefined();
- expect(within(todayGroup).queryByText("Pinned chat")).toBeNull();
+ const ottoGroup = screen
+ .getByRole("button", { name: "Otto chats" })
+ .closest("div")?.parentElement;
+ if (!ottoGroup) throw new Error("Otto group not found");
+ expect(within(ottoGroup).getByText("Loose chat")).toBeDefined();
+ expect(within(ottoGroup).queryByText("Pinned chat")).toBeNull();
});
- it("keeps pinned sessions in their date group when the flag is off", async () => {
+ it("keeps pinned sessions in their expert group when the pinning flag is off", async () => {
server.use(
getGetV2ListSessionsMockHandler200({
sessions: pinnedAndDated,
@@ -144,11 +149,11 @@ describe("RecentChats — pinned split", () => {
await screen.findByText("Pinned chat");
expect(screen.queryByText("Pinned")).toBeNull();
- const yesterdayGroup = screen
- .getByText("Yesterday")
+ const ottoGroup = screen
+ .getByRole("button", { name: "Otto chats" })
.closest("div")?.parentElement;
- if (!yesterdayGroup) throw new Error("yesterday group not found");
- expect(within(yesterdayGroup).getByText("Pinned chat")).toBeDefined();
+ if (!ottoGroup) throw new Error("Otto group not found");
+ expect(within(ottoGroup).getByText("Pinned chat")).toBeDefined();
});
});
@@ -183,6 +188,9 @@ describe("RecentChats — load more", () => {
const loadMore = await screen.findByRole("button", { name: /load more/i });
fireEvent.click(loadMore);
+ fireEvent.click(
+ await screen.findByRole("button", { name: "Load all Otto chats" }),
+ );
expect(await screen.findByText("Page 1")).toBeDefined();
expect(seenOffsets).toContain("1");
});
diff --git a/autogpt_platform/frontend/src/components/layout/AppSidebar/components/RecentChats/__tests__/expert-groups.test.tsx b/autogpt_platform/frontend/src/components/layout/AppSidebar/components/RecentChats/__tests__/expert-groups.test.tsx
index ec2988a9df..b8f7802a25 100644
--- a/autogpt_platform/frontend/src/components/layout/AppSidebar/components/RecentChats/__tests__/expert-groups.test.tsx
+++ b/autogpt_platform/frontend/src/components/layout/AppSidebar/components/RecentChats/__tests__/expert-groups.test.tsx
@@ -16,17 +16,6 @@ import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import { RecentChats } from "../RecentChats";
-vi.mock("@/services/feature-flags/use-get-flag", async (importOriginal) => {
- const actual =
- await importOriginal<
- typeof import("@/services/feature-flags/use-get-flag")
- >();
- return {
- ...actual,
- useGetFlag: (flag: string) => flag === "hire-experts",
- };
-});
-
const mariaExpert: Expert = {
id: "expert-maria",
name: "Maria",
diff --git a/autogpt_platform/frontend/src/components/layout/AppSidebar/components/RecentChats/__tests__/helpers.test.ts b/autogpt_platform/frontend/src/components/layout/AppSidebar/components/RecentChats/__tests__/helpers.test.ts
index a8e59eded0..af6fd6c380 100644
--- a/autogpt_platform/frontend/src/components/layout/AppSidebar/components/RecentChats/__tests__/helpers.test.ts
+++ b/autogpt_platform/frontend/src/components/layout/AppSidebar/components/RecentChats/__tests__/helpers.test.ts
@@ -1,118 +1,6 @@
-import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
+import { describe, expect, it } from "vitest";
-import {
- getDateGroupLabel,
- getNewChatHref,
- groupSessionsByDate,
-} from "../helpers";
-
-// Pin "now" so the day-relative labels are deterministic.
-const NOW = new Date("2026-06-30T12:00:00Z");
-
-function isoDaysAgo(days: number): string {
- const d = new Date(NOW);
- d.setDate(d.getDate() - days);
- return d.toISOString();
-}
-
-beforeEach(() => {
- vi.useFakeTimers();
- vi.setSystemTime(NOW);
-});
-
-afterEach(() => {
- vi.useRealTimers();
-});
-
-describe("getDateGroupLabel", () => {
- it("labels today's date as 'Today'", () => {
- expect(getDateGroupLabel(isoDaysAgo(0))).toBe("Today");
- });
-
- it("labels a future-ish (negative diff) date as 'Today'", () => {
- const future = new Date(NOW);
- future.setHours(future.getHours() + 5);
- expect(getDateGroupLabel(future.toISOString())).toBe("Today");
- });
-
- it("labels yesterday as 'Yesterday'", () => {
- expect(getDateGroupLabel(isoDaysAgo(1))).toBe("Yesterday");
- });
-
- it("labels an older same-year date with month and day", () => {
- // 2026-06-20 -> "June 20"
- const label = getDateGroupLabel("2026-06-20T08:00:00", "en-US");
- expect(label).toBe("June 20");
- });
-
- it("includes the year for dates in a previous year", () => {
- const label = getDateGroupLabel("2024-12-01T08:00:00", "en-US");
- expect(label).toBe("December 1, 2024");
- });
-
- it("formats the date end-to-end in the user's locale", () => {
- // The label must come from a single locale-aware formatter, not from
- // hand-assembled English-style parts ("20th 六月"-style mixes).
- expect(getDateGroupLabel("2026-06-20T08:00:00", "en-GB")).toBe("20 June");
- expect(getDateGroupLabel("2026-06-20T08:00:00", "de-DE")).toBe("20. Juni");
- expect(getDateGroupLabel("2026-06-20T08:00:00", "zh-CN")).toBe("6月20日");
- expect(getDateGroupLabel("2024-12-01T08:00:00", "zh-CN")).toBe(
- "2024年12月1日",
- );
- });
-});
-
-describe("groupSessionsByDate", () => {
- it("returns an empty array for no sessions", () => {
- expect(groupSessionsByDate([])).toEqual([]);
- });
-
- it("buckets sessions from the same calendar day into one group", () => {
- // Local-time (no trailing Z) so the day boundary matches the runner's
- // timezone — startOfDay() uses local getFullYear/Month/Date.
- const sessions = [
- { id: "a", updated_at: "2026-06-30T01:00:00" },
- { id: "b", updated_at: "2026-06-30T23:00:00" },
- ];
- const groups = groupSessionsByDate(sessions);
- expect(groups).toHaveLength(1);
- expect(groups[0].label).toBe("Today");
- expect(groups[0].sessions.map((s) => s.id)).toEqual(["a", "b"]);
- });
-
- it("orders groups most-recent-day first regardless of input order", () => {
- const sessions = [
- { id: "old", updated_at: isoDaysAgo(5) },
- { id: "today", updated_at: isoDaysAgo(0) },
- { id: "yesterday", updated_at: isoDaysAgo(1) },
- ];
- const groups = groupSessionsByDate(sessions, "en-US");
- expect(groups.map((g) => g.label)).toEqual([
- "Today",
- "Yesterday",
- getDateGroupLabel(isoDaysAgo(5), "en-US"),
- ]);
- });
-
- it("preserves input order within a group and never duplicates day buckets", () => {
- const sessions = [
- { id: "1", updated_at: "2026-06-28T03:00:00" },
- { id: "2", updated_at: "2026-06-28T20:00:00" },
- { id: "3", updated_at: "2026-06-28T11:00:00" },
- ];
- const groups = groupSessionsByDate(sessions);
- expect(groups).toHaveLength(1);
- expect(groups[0].sessions.map((s) => s.id)).toEqual(["1", "2", "3"]);
- });
-
- it("labels groups in the given locale", () => {
- const groups = groupSessionsByDate(
- [{ id: "a", updated_at: "2026-06-20T08:00:00" }],
- "de-DE",
- );
- expect(groups[0].label).toBe("20. Juni");
- });
-});
+import { getNewChatHref } from "../helpers";
describe("getNewChatHref", () => {
const active = new Set(["expert-maria", "expert/slash"]);
diff --git a/autogpt_platform/frontend/src/components/layout/AppSidebar/components/RecentChats/__tests__/row-renders.test.tsx b/autogpt_platform/frontend/src/components/layout/AppSidebar/components/RecentChats/__tests__/row-renders.test.tsx
index 557b84a445..6f34925e46 100644
--- a/autogpt_platform/frontend/src/components/layout/AppSidebar/components/RecentChats/__tests__/row-renders.test.tsx
+++ b/autogpt_platform/frontend/src/components/layout/AppSidebar/components/RecentChats/__tests__/row-renders.test.tsx
@@ -62,12 +62,15 @@ function toSummary(seed: SessionSeed) {
};
}
-function renderRecentChats() {
- return render(
+async function renderRecentChats() {
+ render(
<SidebarProvider>
<RecentChats />
</SidebarProvider>,
);
+ fireEvent.click(
+ await screen.findByRole("button", { name: "Load all Otto chats" }),
+ );
}
async function settle() {
@@ -115,7 +118,7 @@ afterEach(() => {
describe("RecentChats — chat rows", () => {
it("re-renders no row when a refetch returns the same sessions", async () => {
- renderRecentChats();
+ await renderRecentChats();
await screen.findByText("Third chat");
await settle();
itemRenders.mockClear();
@@ -131,7 +134,7 @@ describe("RecentChats — chat rows", () => {
});
it("re-renders only the pinned row when one chat is pinned", async () => {
- renderRecentChats();
+ await renderRecentChats();
await screen.findByText("Third chat");
await settle();
itemRenders.mockClear();
@@ -146,7 +149,7 @@ describe("RecentChats — chat rows", () => {
});
it("re-renders only the edited row while typing a rename", async () => {
- renderRecentChats();
+ await renderRecentChats();
await screen.findByText("Third chat");
await settle();
diff --git a/autogpt_platform/frontend/src/components/layout/AppSidebar/components/RecentChats/__tests__/session-list-refresh.test.tsx b/autogpt_platform/frontend/src/components/layout/AppSidebar/components/RecentChats/__tests__/session-list-refresh.test.tsx
index cc7a197b9c..fae9dd0ef9 100644
--- a/autogpt_platform/frontend/src/components/layout/AppSidebar/components/RecentChats/__tests__/session-list-refresh.test.tsx
+++ b/autogpt_platform/frontend/src/components/layout/AppSidebar/components/RecentChats/__tests__/session-list-refresh.test.tsx
@@ -74,6 +74,9 @@ async function settle() {
async function loadOlderChats() {
fireEvent.click(await screen.findByRole("button", { name: /load more/i }));
+ fireEvent.click(
+ await screen.findByRole("button", { name: "Load all Otto chats" }),
+ );
await screen.findByText("Chat 74");
await settle();
}
diff --git a/autogpt_platform/frontend/src/components/layout/AppSidebar/components/RecentChats/helpers.ts b/autogpt_platform/frontend/src/components/layout/AppSidebar/components/RecentChats/helpers.ts
index e18643e66e..f33c6c8f2f 100644
--- a/autogpt_platform/frontend/src/components/layout/AppSidebar/components/RecentChats/helpers.ts
+++ b/autogpt_platform/frontend/src/components/layout/AppSidebar/components/RecentChats/helpers.ts
@@ -1,63 +1,3 @@
-function startOfDay(date: Date): number {
- return new Date(
- date.getFullYear(),
- date.getMonth(),
- date.getDate(),
- ).getTime();
-}
-
-function diffInDays(iso: string): number {
- const date = new Date(iso);
- const dayMs = 86_400_000;
- return Math.round((startOfDay(new Date()) - startOfDay(date)) / dayMs);
-}
-
-// e.g. "June 26" (current year) or "December 1, 2024" (older), in the user's
-// locale. A single Intl.DateTimeFormat options set keeps the format valid for
-// every locale instead of hand-assembling English-style date parts.
-function formatDayLabel(date: Date, locale?: string): string {
- const sameYear = date.getFullYear() === new Date().getFullYear();
- return new Intl.DateTimeFormat(locale, {
- day: "numeric",
- month: "long",
- ...(sameYear ? {} : { year: "numeric" }),
- }).format(date);
-}
-
-export function getDateGroupLabel(iso: string, locale?: string): string {
- const diffDays = diffInDays(iso);
- if (diffDays <= 0) return "Today";
- if (diffDays === 1) return "Yesterday";
- return formatDayLabel(new Date(iso), locale);
-}
-
-// Buckets sessions by calendar day and orders groups most-recent-first. Doesn't
-// rely on the input being pre-sorted, so an unsorted list can never produce
-// duplicate day groups; within a group, input order is preserved.
-export function groupSessionsByDate<T extends { updated_at: string }>(
- sessions: T[],
- locale?: string,
-): { label: string; sessions: T[] }[] {
- const buckets = new Map<number, { label: string; sessions: T[] }>();
-
- for (const session of sessions) {
- const dayKey = startOfDay(new Date(session.updated_at));
- const bucket = buckets.get(dayKey);
- if (bucket) {
- bucket.sessions.push(session);
- } else {
- buckets.set(dayKey, {
- label: getDateGroupLabel(session.updated_at, locale),
- sessions: [session],
- });
- }
- }
-
- return [...buckets.entries()]
- .sort((a, b) => b[0] - a[0])
- .map(([, group]) => group);
-}
-
// Fired experts can't be addressed, so their group gets no new-chat entry:
// the deep link would only fall back to Otto. `new=1` keeps the page on the
// fresh new-task state: without it `useChatSession` adopts the expert's
diff --git a/autogpt_platform/frontend/src/components/layout/AppSidebar/useNavItemClassName.ts b/autogpt_platform/frontend/src/components/layout/AppSidebar/useNavItemClassName.ts
index 62a49f513f..b0306d4464 100644
--- a/autogpt_platform/frontend/src/components/layout/AppSidebar/useNavItemClassName.ts
+++ b/autogpt_platform/frontend/src/components/layout/AppSidebar/useNavItemClassName.ts
@@ -1,13 +1,8 @@
import { cn } from "@/lib/utils";
-import { Flag, useGetFlag } from "@/services/feature-flags/use-get-flag";
-// The stronger active state ships with the brain-dump experience.
export function useNavItemClassName() {
- const isBrainDumpEnabled = useGetFlag(Flag.ONBOARDING_BRAIN_DUMP);
return cn(
"h-auto rounded-xl p-2 pl-3 font-normal data-[active=true]:font-normal group-data-[collapsible=icon]:!p-1.5 hover:!bg-zinc-100 [&>svg]:size-4 group-data-[collapsible=icon]:[&>svg]:size-4.5 max-md:gap-3 max-md:py-2.5 max-md:text-base max-md:[&>svg]:size-5",
- isBrainDumpEnabled
- ? "data-[active=true]:!bg-zinc-200 data-[active=true]:hover:!bg-zinc-200"
- : "data-[active=true]:!bg-zinc-100",
+ "data-[active=true]:!bg-zinc-200 data-[active=true]:hover:!bg-zinc-200",
);
}
diff --git a/autogpt_platform/frontend/src/hooks/__tests__/useLocalDay.test.tsx b/autogpt_platform/frontend/src/hooks/__tests__/useLocalDay.test.tsx
deleted file mode 100644
index 6bb2fd24f5..0000000000
--- a/autogpt_platform/frontend/src/hooks/__tests__/useLocalDay.test.tsx
+++ /dev/null
@@ -1,37 +0,0 @@
-import { act, renderHook } from "@testing-library/react";
-import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
-import { useLocalDay } from "../useLocalDay";
-
-beforeEach(() => {
- vi.useFakeTimers();
- vi.setSystemTime(new Date(2026, 9, 19, 23, 58, 30));
-});
-
-afterEach(() => {
- vi.useRealTimers();
-});
-
-describe("useLocalDay", () => {
- it("re-renders once when the local day changes, and not before", () => {
- let renders = 0;
- const { result } = renderHook(() => {
- renders += 1;
- return useLocalDay();
- });
- const today = result.current;
- const rendersBefore = renders;
-
- act(() => {
- vi.advanceTimersByTime(60_000);
- });
- expect(result.current).toBe(today);
- expect(renders).toBe(rendersBefore);
-
- act(() => {
- vi.advanceTimersByTime(60_000);
- });
- expect(result.current).not.toBe(today);
- expect(result.current).toBe(new Date(2026, 9, 20).toDateString());
- expect(renders).toBe(rendersBefore + 1);
- });
-});
diff --git a/autogpt_platform/frontend/src/hooks/useLocalDay.ts b/autogpt_platform/frontend/src/hooks/useLocalDay.ts
deleted file mode 100644
index 207bf41c17..0000000000
--- a/autogpt_platform/frontend/src/hooks/useLocalDay.ts
+++ /dev/null
@@ -1,45 +0,0 @@
-import { useSyncExternalStore } from "react";
-
-const CHECK_INTERVAL_MS = 60_000;
-
-const listeners = new Set<() => void>();
-let timer: ReturnType<typeof setInterval> | null = null;
-let current = localDay();
-
-function localDay() {
- return new Date().toDateString();
-}
-
-function check() {
- const next = localDay();
- if (next === current) return;
- current = next;
- listeners.forEach((listener) => listener());
-}
-
-function subscribe(listener: () => void) {
- listeners.add(listener);
- if (timer === null) {
- current = localDay();
- timer = setInterval(check, CHECK_INTERVAL_MS);
- }
- return () => {
- listeners.delete(listener);
- if (listeners.size > 0 || timer === null) return;
- clearInterval(timer);
- timer = null;
- };
-}
-
-function getSnapshot() {
- return timer === null ? localDay() : current;
-}
-
-/**
- * The local calendar day, e.g. "Tue Oct 20 2026". One shared timer checks it
- * once a minute, and callers re-render only when the day changes, so relative
- * date labels ("Today", "Yesterday") in memoised lists move on at midnight.
- */
-export function useLocalDay() {
- return useSyncExternalStore(subscribe, getSnapshot, getSnapshot);
-}
diff --git a/autogpt_platform/frontend/src/playwright/auth-happy-path.spec.ts b/autogpt_platform/frontend/src/playwright/auth-happy-path.spec.ts
index 72209a21a3..c076df25f5 100644
--- a/autogpt_platform/frontend/src/playwright/auth-happy-path.spec.ts
+++ b/autogpt_platform/frontend/src/playwright/auth-happy-path.spec.ts
@@ -2,7 +2,11 @@ import { expect, test } from "./coverage-fixture";
import { getSeededTestUser } from "./credentials/accounts";
import { BuildPage } from "./pages/build.page";
import { LoginPage } from "./pages/login.page";
-import { advanceToRoleStep, skipOnboardingIfPresent } from "./utils/onboarding";
+import {
+ advanceToRoleStep,
+ dismissTabIntros,
+ skipOnboardingIfPresent,
+} from "./utils/onboarding";
import { signupTestUser } from "./utils/signup";
test("auth happy path: user can sign up with a fresh account", async ({
@@ -83,6 +87,8 @@ test("auth happy path: multi-tab logout clears shared builder sessions", async (
const page1 = await context.newPage();
const page2 = await context.newPage();
+ await dismissTabIntros(page1);
+ await dismissTabIntros(page2);
const buildPage = new BuildPage(page1);
const recordWebSocketErrors =
diff --git a/autogpt_platform/frontend/src/playwright/coverage-fixture.ts b/autogpt_platform/frontend/src/playwright/coverage-fixture.ts
index 0aa0e3216c..deef6e1c43 100644
--- a/autogpt_platform/frontend/src/playwright/coverage-fixture.ts
+++ b/autogpt_platform/frontend/src/playwright/coverage-fixture.ts
@@ -1,9 +1,11 @@
import { test as base } from "@playwright/test";
import { addCoverageReport } from "monocart-reporter";
+import { dismissTabIntros } from "./utils/onboarding";
const test = base.extend<{ autoTestFixture: void }>({
autoTestFixture: [
async ({ page }, use) => {
+ await dismissTabIntros(page);
let hasCoverage = false;
try {
await page.coverage.startJSCoverage({ resetOnNavigation: false });
diff --git a/autogpt_platform/frontend/src/playwright/journeys/hosted-flags.json b/autogpt_platform/frontend/src/playwright/journeys/hosted-flags.json
index a63e362baf..5a2aa6f355 100644
--- a/autogpt_platform/frontend/src/playwright/journeys/hosted-flags.json
+++ b/autogpt_platform/frontend/src/playwright/journeys/hosted-flags.json
@@ -1,11 +1,4 @@
{
- "hire-experts": true,
- "onboarding-brain-dump": true,
- "onboarding-expert-team": true,
- "artifacts-page": true,
- "skills-hub": true,
- "graphiti-memory": true,
- "expert-spend-approval": true,
"enable-platform-payment": true,
"copilot-stream-runtime": true
}
diff --git a/autogpt_platform/frontend/src/playwright/landing-happy-path.spec.ts b/autogpt_platform/frontend/src/playwright/landing-happy-path.spec.ts
index b88949c349..746e101041 100644
--- a/autogpt_platform/frontend/src/playwright/landing-happy-path.spec.ts
+++ b/autogpt_platform/frontend/src/playwright/landing-happy-path.spec.ts
@@ -31,7 +31,6 @@ test("landing happy path: a user finishing onboarding lands on /home", async ({
const copilotRequests = recordCopilotNavigations(page);
await completeOnboardingWizard(page, {
role: "Engineering",
- painPoints: ["Research", "Reports & data"],
});
await expectHomeLanding(page, copilotRequests);
diff --git a/autogpt_platform/frontend/src/playwright/pages/library.page.ts b/autogpt_platform/frontend/src/playwright/pages/library.page.ts
index 23782d252b..d3825c6d7e 100644
--- a/autogpt_platform/frontend/src/playwright/pages/library.page.ts
+++ b/autogpt_platform/frontend/src/playwright/pages/library.page.ts
@@ -992,11 +992,10 @@ export async function assertRunOutputContainsText(
await openRunOutputTab(page);
const outputCard = page
- .locator("div")
+ .locator('[data-scrollable-tab-content][data-value="output"]')
.filter({
has: page.getByRole("button", { name: "Copy all text outputs" }),
- })
- .first();
+ });
await expect(outputCard, "run output card should be visible").toBeVisible({
timeout,
});
diff --git a/autogpt_platform/frontend/src/playwright/pages/marketplace.page.ts b/autogpt_platform/frontend/src/playwright/pages/marketplace.page.ts
index 2ff7ecc633..26e807dbc3 100644
--- a/autogpt_platform/frontend/src/playwright/pages/marketplace.page.ts
+++ b/autogpt_platform/frontend/src/playwright/pages/marketplace.page.ts
@@ -225,7 +225,11 @@ export class MarketplacePage extends BasePage {
agentSlug: string;
}> {
await this.page.goto("/marketplace");
- await this.page.getByRole("button", { name: "Become a Creator" }).click();
+ await this.page
+ .getByRole("button", {
+ name: "Publish your workflows",
+ })
+ .click();
const publishAgentModal = this.page.getByTestId("publish-agent-modal");
await expect(publishAgentModal).toBeVisible();
diff --git a/autogpt_platform/frontend/src/playwright/utils/onboarding.test.ts b/autogpt_platform/frontend/src/playwright/utils/onboarding.test.ts
new file mode 100644
index 0000000000..7580d3a407
--- /dev/null
+++ b/autogpt_platform/frontend/src/playwright/utils/onboarding.test.ts
@@ -0,0 +1,107 @@
+import type { Locator, Page } from "@playwright/test";
+import { describe, expect, it, vi } from "vitest";
+
+import { dismissTabIntros } from "./onboarding";
+
+type ButtonHandle = Awaited<ReturnType<Locator["elementHandles"]>>[number];
+
+function createButton() {
+ return {
+ press: vi.fn<ButtonHandle["press"]>().mockResolvedValue(undefined),
+ dispose: vi.fn<ButtonHandle["dispose"]>().mockResolvedValue(undefined),
+ };
+}
+
+async function registerIntroHandler() {
+ const elementHandles = vi.fn<Locator["elementHandles"]>();
+ const intro = {
+ getByRole: vi.fn().mockReturnValue({ elementHandles }),
+ } as unknown as Locator;
+ const addLocatorHandler = vi
+ .fn<Page["addLocatorHandler"]>()
+ .mockResolvedValue(undefined);
+ const page = {
+ getByTestId: vi.fn().mockReturnValue(intro),
+ addLocatorHandler,
+ } as unknown as Page;
+
+ await dismissTabIntros(page);
+ const handler = addLocatorHandler.mock.calls[0][1];
+ return { elementHandles, invoke: () => handler(intro) };
+}
+
+describe("dismissTabIntros", () => {
+ it.each([
+ "locator.elementHandles: Unable to adopt element handle from a different document",
+ "locator.elementHandles: Execution context was destroyed, most likely because of a navigation",
+ ])("recovers from a navigation during button lookup: %s", async (message) => {
+ const { elementHandles, invoke } = await registerIntroHandler();
+ let rejectLookup!: (error: Error) => void;
+ const lookup = new Promise<ButtonHandle[]>((_, reject) => {
+ rejectLookup = reject;
+ });
+ const newDocumentButton = createButton();
+ elementHandles
+ .mockReturnValueOnce(lookup)
+ .mockResolvedValueOnce([newDocumentButton as unknown as ButtonHandle]);
+
+ const interruptedHandler = invoke();
+ const result = expect(interruptedHandler).resolves.toBeUndefined();
+ rejectLookup(new Error(message));
+ await result;
+
+ await invoke();
+
+ expect(elementHandles).toHaveBeenCalledTimes(2);
+ expect(newDocumentButton.press).toHaveBeenCalledExactlyOnceWith("Enter");
+ expect(newDocumentButton.dispose).toHaveBeenCalledOnce();
+ });
+
+ it.each([
+ "Element is not attached to the DOM",
+ "Execution context was destroyed, most likely because of a navigation",
+ ])("releases a button detached during dismissal: %s", async (message) => {
+ const { elementHandles, invoke } = await registerIntroHandler();
+ const oldButton = createButton();
+ const newButton = createButton();
+ oldButton.press.mockRejectedValueOnce(new Error(message));
+ elementHandles
+ .mockResolvedValueOnce([oldButton as unknown as ButtonHandle])
+ .mockResolvedValueOnce([newButton as unknown as ButtonHandle]);
+
+ await expect(invoke()).resolves.toBeUndefined();
+ expect(oldButton.dispose).toHaveBeenCalledOnce();
+ await invoke();
+
+ expect(newButton.press).toHaveBeenCalledExactlyOnceWith("Enter");
+ expect(newButton.dispose).toHaveBeenCalledOnce();
+ });
+
+ it("allows an overlay to disappear before its button is found", async () => {
+ const { elementHandles, invoke } = await registerIntroHandler();
+ elementHandles.mockResolvedValueOnce([]);
+
+ await expect(invoke()).resolves.toBeUndefined();
+ });
+
+ it.each([
+ new Error("Target page, context or browser has been closed"),
+ "unexpected lookup failure",
+ ])("preserves unexpected lookup failures: %s", async (error) => {
+ const { elementHandles, invoke } = await registerIntroHandler();
+ elementHandles.mockRejectedValueOnce(error);
+
+ await expect(invoke()).rejects.toBe(error);
+ });
+
+ it("preserves unexpected press failures and releases the handle", async () => {
+ const { elementHandles, invoke } = await registerIntroHandler();
+ const button = createButton();
+ const error = new Error("Unexpected keyboard failure");
+ elementHandles.mockResolvedValueOnce([button as unknown as ButtonHandle]);
+ button.press.mockRejectedValueOnce(error);
+
+ await expect(invoke()).rejects.toBe(error);
+ expect(button.dispose).toHaveBeenCalledOnce();
+ });
+});
diff --git a/autogpt_platform/frontend/src/playwright/utils/onboarding.ts b/autogpt_platform/frontend/src/playwright/utils/onboarding.ts
index 9444bfc589..1493f1d855 100644
--- a/autogpt_platform/frontend/src/playwright/utils/onboarding.ts
+++ b/autogpt_platform/frontend/src/playwright/utils/onboarding.ts
@@ -1,4 +1,31 @@
-import { Page, expect } from "@playwright/test";
+import { type ElementHandle, Page, expect } from "@playwright/test";
+
+export async function dismissTabIntros(page: Page) {
+ await page.addLocatorHandler(
+ page.getByTestId("tab-intro-overlay"),
+ async (intro) => {
+ let button: ElementHandle<Node> | undefined;
+ try {
+ [button] = await intro
+ .getByRole("button", { name: "Got it", exact: true })
+ .elementHandles();
+ if (!button) return;
+ // A click can intercept its own handler after the outer wait expires.
+ await button.press("Enter");
+ } catch (error) {
+ if (
+ !(error instanceof Error) ||
+ !/Element is not attached to the DOM|Execution context was destroyed|Unable to adopt element handle from a different document/.test(
+ error.message,
+ )
+ )
+ throw error;
+ } finally {
+ await button?.dispose();
+ }
+ },
+ );
+}
function resolveAppUrl(page: Page, destination: string) {
const baseURL =
@@ -82,31 +109,40 @@ export async function completeOnboardingWizard(
page: Page,
options?: {
role?: string;
- painPoints?: string[];
plan?: "pro" | "max";
},
) {
const role = options?.role ?? "Engineering";
- const painPoints = options?.painPoints ?? ["Research", "Reports & data"];
const plan = options?.plan ?? "pro";
await advanceToRoleStep(page, plan);
await page.getByText(role, { exact: false }).click();
await page.getByRole("button", { name: "Next", exact: true }).click();
- await expect(page.getByText("What's eating your time?")).toBeVisible({
+ const skipBrainDump = page.getByRole("button", {
+ name: "Skip for now",
+ exact: true,
+ });
+ await expect(skipBrainDump).toBeVisible({
timeout: 5000,
});
- for (const point of painPoints) {
- await page.getByText(point, { exact: true }).click();
- }
- await page.getByRole("button", { name: "Continue", exact: true }).click();
+ await skipBrainDump.click();
+ await expect(skipBrainDump).toBeHidden({ timeout: 10000 });
+ const skipHiring = page.getByRole("button", {
+ name: "I'll add members later",
+ exact: true,
+ });
const connect = page.getByRole("heading", {
name: "Already paying for an AI subscription?",
});
const preparing = page.getByText("Preparing your workspace...", {
exact: false,
});
+ await expect(skipHiring).toBeVisible({
+ timeout: 10000,
+ });
+ await skipHiring.click();
+ await expect(skipHiring).toBeHidden();
await expect(connect.or(preparing).first()).toBeVisible({ timeout: 10000 });
if (await connect.isVisible()) {
await page.getByRole("button", { name: "Next", exact: true }).click();
@@ -117,5 +153,5 @@ export async function completeOnboardingWizard(
await expect(page.getByTestId("profile-popout-menu-trigger")).toBeVisible({
timeout: 15000,
});
- return { role, painPoints, plan };
+ return { role, plan };
}
diff --git a/autogpt_platform/frontend/src/services/feature-flags/__tests__/feature-flag-provider.test.tsx b/autogpt_platform/frontend/src/services/feature-flags/__tests__/feature-flag-provider.test.tsx
index 247d66083d..d108d2b221 100644
--- a/autogpt_platform/frontend/src/services/feature-flags/__tests__/feature-flag-provider.test.tsx
+++ b/autogpt_platform/frontend/src/services/feature-flags/__tests__/feature-flag-provider.test.tsx
@@ -54,7 +54,7 @@ vi.mock("@/app/(platform)/marketplace/components/HeroSection/helpers", () => ({
}));
function HireProbe() {
- const { enabled, ready } = useFlagStatus(Flag.HIRE_EXPERTS);
+ const { enabled, ready } = useFlagStatus(Flag.GENERIC_TRIGGER_AGENTS);
return (
<span>
hire: {String(enabled)} ready: {String(ready)}
@@ -175,7 +175,7 @@ describe("flag resolution timeout while LaunchDarkly is deferred", () => {
});
expect(screen.getByText("hire: false ready: false")).toBeDefined();
- ld.flags = { "hire-experts": true };
+ ld.flags = { "generic-trigger-agents": true };
rerender(
<FeatureFlagProvider>
<HireProbe />
diff --git a/autogpt_platform/frontend/src/services/feature-flags/__tests__/flag-backends.test.tsx b/autogpt_platform/frontend/src/services/feature-flags/__tests__/flag-backends.test.tsx
index 24e74b5a66..7436bddefa 100644
--- a/autogpt_platform/frontend/src/services/feature-flags/__tests__/flag-backends.test.tsx
+++ b/autogpt_platform/frontend/src/services/feature-flags/__tests__/flag-backends.test.tsx
@@ -69,7 +69,7 @@ vi.mock("@/services/environment", () => ({
environment: { areFeatureFlagsEnabled: () => env.launchDarklyEnabled },
}));
-const HIRE_EXPERTS = "hire-experts";
+const GENERIC_TRIGGER_AGENTS = "generic-trigger-agents";
describe("the default backend", () => {
it.each([undefined, "", "launch-darkly"])(
@@ -86,9 +86,11 @@ describe("the default backend", () => {
describe("launchdarkly backend", () => {
it("reads the LaunchDarkly value and never touches PostHog", async () => {
const { Flag, useGetFlag } = await loadWithBackend("launchdarkly");
- launchDarkly.flags = { [HIRE_EXPERTS]: true };
+ launchDarkly.flags = { [GENERIC_TRIGGER_AGENTS]: true };
- const { result } = renderHook(() => useGetFlag(Flag.HIRE_EXPERTS));
+ const { result } = renderHook(() =>
+ useGetFlag(Flag.GENERIC_TRIGGER_AGENTS),
+ );
expect(result.current).toBe(true);
expect(postHog.enabled).not.toHaveBeenCalled();
@@ -99,7 +101,9 @@ describe("launchdarkly backend", () => {
const { Flag, useFlagStatus } = await loadWithBackend("launchdarkly");
launchDarkly.flags = {};
- const { result } = renderHook(() => useFlagStatus(Flag.HIRE_EXPERTS));
+ const { result } = renderHook(() =>
+ useFlagStatus(Flag.GENERIC_TRIGGER_AGENTS),
+ );
expect(result.current).toEqual({
enabled: false,
@@ -114,7 +118,9 @@ describe("posthog backend", () => {
const { Flag, useFlagStatus } = await loadWithBackend("posthog");
postHog.enabled.mockReturnValue(true);
- const { result } = renderHook(() => useFlagStatus(Flag.HIRE_EXPERTS));
+ const { result } = renderHook(() =>
+ useFlagStatus(Flag.GENERIC_TRIGGER_AGENTS),
+ );
expect(result.current).toEqual({
enabled: true,
@@ -126,7 +132,7 @@ describe("posthog backend", () => {
it("distinguishes a conclusive off from no answer yet", async () => {
const { Flag, useFlagStatus } = await loadWithBackend("posthog");
postHog.enabled.mockReturnValue(false);
- const off = renderHook(() => useFlagStatus(Flag.HIRE_EXPERTS));
+ const off = renderHook(() => useFlagStatus(Flag.GENERIC_TRIGGER_AGENTS));
expect(off.result.current).toEqual({
enabled: false,
ready: true,
@@ -134,7 +140,9 @@ describe("posthog backend", () => {
});
postHog.loaded = false;
- const unanswered = renderHook(() => useFlagStatus(Flag.HIRE_EXPERTS));
+ const unanswered = renderHook(() =>
+ useFlagStatus(Flag.GENERIC_TRIGGER_AGENTS),
+ );
expect(unanswered.result.current).toEqual({
enabled: false,
ready: false,
@@ -147,7 +155,9 @@ describe("posthog backend", () => {
postHog.loaded = false;
postHog.enabled.mockReturnValue(true);
- const { result } = renderHook(() => useFlagStatus(Flag.HIRE_EXPERTS));
+ const { result } = renderHook(() =>
+ useFlagStatus(Flag.GENERIC_TRIGGER_AGENTS),
+ );
expect(result.current.answered).toBe(false);
});
@@ -156,7 +166,9 @@ describe("posthog backend", () => {
const { Flag, useFlagStatus } = await loadWithBackend("posthog");
postHog.errorsLoading = true;
- const { result } = renderHook(() => useFlagStatus(Flag.HIRE_EXPERTS));
+ const { result } = renderHook(() =>
+ useFlagStatus(Flag.GENERIC_TRIGGER_AGENTS),
+ );
expect(result.current.answered).toBe(false);
});
@@ -165,7 +177,9 @@ describe("posthog backend", () => {
const { Flag, useFlagStatus } = await loadWithBackend("posthog");
postHog.enabled.mockReturnValue(undefined);
- const { result } = renderHook(() => useFlagStatus(Flag.HIRE_EXPERTS));
+ const { result } = renderHook(() =>
+ useFlagStatus(Flag.GENERIC_TRIGGER_AGENTS),
+ );
expect(result.current).toEqual({
enabled: false,
@@ -196,10 +210,12 @@ describe("posthog backend", () => {
it("still honours a forced flag", async () => {
const { Flag, useGetFlag } = await loadWithBackend("posthog");
- process.env.NEXT_PUBLIC_FORCE_FLAG_HIRE_EXPERTS = "true";
+ process.env.NEXT_PUBLIC_FORCE_FLAG_GENERIC_TRIGGER_AGENTS = "true";
postHog.enabled.mockReturnValue(false);
- const { result } = renderHook(() => useGetFlag(Flag.HIRE_EXPERTS));
+ const { result } = renderHook(() =>
+ useGetFlag(Flag.GENERIC_TRIGGER_AGENTS),
+ );
expect(result.current).toBe(true);
});
@@ -212,15 +228,16 @@ describe("posthog backend", () => {
const forced = await loadWithBackend("posthog");
postHog.enabled.mockReturnValue(false);
expect(
- renderHook(() => forced.useFlagStatus(forced.Flag.HIRE_EXPERTS)).result
- .current,
+ renderHook(() => forced.useFlagStatus(forced.Flag.GENERIC_TRIGGER_AGENTS))
+ .result.current,
).toEqual({ enabled: true, ready: true, answered: true });
delete process.env.NEXT_PUBLIC_FORCE_ALL_FLAGS;
const unforced = await loadWithBackend("posthog");
expect(
- renderHook(() => unforced.useFlagStatus(unforced.Flag.HIRE_EXPERTS))
- .result.current,
+ renderHook(() =>
+ unforced.useFlagStatus(unforced.Flag.GENERIC_TRIGGER_AGENTS),
+ ).result.current,
).toEqual({ enabled: false, ready: true, answered: true });
});
});
@@ -228,10 +245,12 @@ describe("posthog backend", () => {
describe("dual backend", () => {
it("serves LaunchDarkly's answer when the two disagree", async () => {
const { Flag, useGetFlag } = await loadWithBackend("dual");
- launchDarkly.flags = { [HIRE_EXPERTS]: true };
+ launchDarkly.flags = { [GENERIC_TRIGGER_AGENTS]: true };
postHog.enabled.mockReturnValue(false);
- const { result } = renderHook(() => useGetFlag(Flag.HIRE_EXPERTS));
+ const { result } = renderHook(() =>
+ useGetFlag(Flag.GENERIC_TRIGGER_AGENTS),
+ );
expect(result.current).toBe(true);
});
@@ -239,30 +258,30 @@ describe("dual backend", () => {
it("reports the disagreement to PostHog and Sentry", async () => {
const { Flag, useGetFlag } = await loadWithBackend("dual");
vi.spyOn(console, "info").mockImplementation(() => {});
- launchDarkly.flags = { [HIRE_EXPERTS]: true };
+ launchDarkly.flags = { [GENERIC_TRIGGER_AGENTS]: true };
postHog.enabled.mockReturnValue(false);
- renderHook(() => useGetFlag(Flag.HIRE_EXPERTS));
+ renderHook(() => useGetFlag(Flag.GENERIC_TRIGGER_AGENTS));
expect(postHog.capture).toHaveBeenCalledWith("feature_flag_mismatched", {
- flag: HIRE_EXPERTS,
+ flag: GENERIC_TRIGGER_AGENTS,
launchdarkly: { value: true, resolved: true },
posthog: { value: false, resolved: true },
});
expect(sentry.captureMessage).toHaveBeenCalledExactlyOnceWith(
- `Feature flag mismatch: ${HIRE_EXPERTS} (LaunchDarkly=true, PostHog=false)`,
+ `Feature flag mismatch: ${GENERIC_TRIGGER_AGENTS} (LaunchDarkly=true, PostHog=false)`,
expect.objectContaining({
- fingerprint: ["feature-flag-mismatch", HIRE_EXPERTS],
+ fingerprint: ["feature-flag-mismatch", GENERIC_TRIGGER_AGENTS],
}),
);
});
it("stays quiet when the two agree", async () => {
const { Flag, useGetFlag } = await loadWithBackend("dual");
- launchDarkly.flags = { [HIRE_EXPERTS]: true };
+ launchDarkly.flags = { [GENERIC_TRIGGER_AGENTS]: true };
postHog.enabled.mockReturnValue(true);
- renderHook(() => useGetFlag(Flag.HIRE_EXPERTS));
+ renderHook(() => useGetFlag(Flag.GENERIC_TRIGGER_AGENTS));
expect(postHog.capture).not.toHaveBeenCalled();
});
@@ -322,13 +341,13 @@ describe("dual backend", () => {
it("reports a flag LaunchDarkly has and PostHog has never heard of", async () => {
const { Flag, useGetFlag } = await loadWithBackend("dual");
vi.spyOn(console, "info").mockImplementation(() => {});
- launchDarkly.flags = { [HIRE_EXPERTS]: true };
+ launchDarkly.flags = { [GENERIC_TRIGGER_AGENTS]: true };
postHog.enabled.mockReturnValue(undefined);
- renderHook(() => useGetFlag(Flag.HIRE_EXPERTS));
+ renderHook(() => useGetFlag(Flag.GENERIC_TRIGGER_AGENTS));
expect(postHog.capture).toHaveBeenCalledWith("feature_flag_mismatched", {
- flag: HIRE_EXPERTS,
+ flag: GENERIC_TRIGGER_AGENTS,
launchdarkly: { value: true, resolved: true },
posthog: { value: null, resolved: true },
});
@@ -342,13 +361,15 @@ describe("dual backend", () => {
launchDarkly.flags = {};
postHog.enabled.mockReturnValue(true);
- const { rerender } = renderHook(() => useGetFlag(Flag.HIRE_EXPERTS));
+ const { rerender } = renderHook(() =>
+ useGetFlag(Flag.GENERIC_TRIGGER_AGENTS),
+ );
rerender();
expect(postHog.capture).not.toHaveBeenCalled();
- launchDarkly.flags = { [HIRE_EXPERTS]: true };
+ launchDarkly.flags = { [GENERIC_TRIGGER_AGENTS]: true };
postHog.loaded = false;
- const pending = renderHook(() => useGetFlag(Flag.HIRE_EXPERTS));
+ const pending = renderHook(() => useGetFlag(Flag.GENERIC_TRIGGER_AGENTS));
pending.rerender();
expect(postHog.capture).not.toHaveBeenCalled();
@@ -358,10 +379,12 @@ describe("dual backend", () => {
const { Flag, useGetFlag } = await loadWithBackend("dual");
vi.spyOn(console, "info").mockImplementation(() => {});
postHog.enabled.mockReturnValue(true);
- const { rerender } = renderHook(() => useGetFlag(Flag.HIRE_EXPERTS));
+ const { rerender } = renderHook(() =>
+ useGetFlag(Flag.GENERIC_TRIGGER_AGENTS),
+ );
expect(postHog.capture).not.toHaveBeenCalled();
- launchDarkly.flags = { [HIRE_EXPERTS]: false };
+ launchDarkly.flags = { [GENERIC_TRIGGER_AGENTS]: false };
rerender();
expect(postHog.capture).toHaveBeenCalledTimes(1);
@@ -375,7 +398,9 @@ describe("dual backend", () => {
launchDarkly.flags = {};
postHog.enabled.mockReturnValue(true);
- const { result } = renderHook(() => useFlagStatus(Flag.HIRE_EXPERTS));
+ const { result } = renderHook(() =>
+ useFlagStatus(Flag.GENERIC_TRIGGER_AGENTS),
+ );
expect(result.current).toEqual({
enabled: true,
@@ -389,7 +414,7 @@ describe("dual backend", () => {
const { Flag, useGetFlag } = await loadWithBackend("dual");
postHog.enabled.mockReturnValue(true);
- renderHook(() => useGetFlag(Flag.HIRE_EXPERTS));
+ renderHook(() => useGetFlag(Flag.GENERIC_TRIGGER_AGENTS));
expect(postHog.capture).not.toHaveBeenCalled();
});
@@ -403,13 +428,13 @@ describe("Sentry's flag context", () => {
])("records the served boolean in %s mode", async (_, backend) => {
const { Flag, useFlagStatus } = await loadWithBackend(backend);
vi.spyOn(console, "warn").mockImplementation(() => {});
- launchDarkly.flags = { [HIRE_EXPERTS]: true };
+ launchDarkly.flags = { [GENERIC_TRIGGER_AGENTS]: true };
postHog.enabled.mockReturnValue(backend === "posthog");
- renderHook(() => useFlagStatus(Flag.HIRE_EXPERTS));
+ renderHook(() => useFlagStatus(Flag.GENERIC_TRIGGER_AGENTS));
expect(sentry.addFeatureFlag).toHaveBeenCalledExactlyOnceWith(
- HIRE_EXPERTS,
+ GENERIC_TRIGGER_AGENTS,
true,
);
});
@@ -417,10 +442,10 @@ describe("Sentry's flag context", () => {
it("records a flag read by a component that throws in the same render", async () => {
const { Flag, useGetFlag } = await loadWithBackend("launchdarkly");
vi.spyOn(console, "error").mockImplementation(() => {});
- launchDarkly.flags = { [HIRE_EXPERTS]: true };
+ launchDarkly.flags = { [GENERIC_TRIGGER_AGENTS]: true };
let recordedAtCatch: unknown[][] = [];
function Reader(): ReactNode {
- useGetFlag(Flag.HIRE_EXPERTS);
+ useGetFlag(Flag.GENERIC_TRIGGER_AGENTS);
throw new Error("render failed");
}
class Boundary extends Component<{ children: ReactNode }> {
@@ -442,19 +467,21 @@ describe("Sentry's flag context", () => {
</Boundary>,
);
- expect(recordedAtCatch).toContainEqual([HIRE_EXPERTS, true]);
+ expect(recordedAtCatch).toContainEqual([GENERIC_TRIGGER_AGENTS, true]);
});
it("records the default it serves while flags are disabled", async () => {
env.launchDarklyEnabled = false;
const { Flag, useGetFlag } = await loadWithBackend("launchdarkly");
- launchDarkly.flags = { [HIRE_EXPERTS]: true };
+ launchDarkly.flags = { [GENERIC_TRIGGER_AGENTS]: true };
- const { result } = renderHook(() => useGetFlag(Flag.HIRE_EXPERTS));
+ const { result } = renderHook(() =>
+ useGetFlag(Flag.GENERIC_TRIGGER_AGENTS),
+ );
expect(result.current).toBe(false);
expect(sentry.addFeatureFlag).toHaveBeenCalledExactlyOnceWith(
- HIRE_EXPERTS,
+ GENERIC_TRIGGER_AGENTS,
false,
);
});
@@ -462,10 +489,10 @@ describe("Sentry's flag context", () => {
it("records nothing for an env-forced flag", async () => {
const { Flag, useFlagStatus, useGetFlag } =
await loadWithBackend("launchdarkly");
- process.env.NEXT_PUBLIC_FORCE_FLAG_HIRE_EXPERTS = "true";
+ process.env.NEXT_PUBLIC_FORCE_FLAG_GENERIC_TRIGGER_AGENTS = "true";
- renderHook(() => useFlagStatus(Flag.HIRE_EXPERTS));
- renderHook(() => useGetFlag(Flag.HIRE_EXPERTS));
+ renderHook(() => useFlagStatus(Flag.GENERIC_TRIGGER_AGENTS));
+ renderHook(() => useGetFlag(Flag.GENERIC_TRIGGER_AGENTS));
expect(sentry.addFeatureFlag).not.toHaveBeenCalled();
});
@@ -484,11 +511,13 @@ describe("Sentry's flag context", () => {
sentry.addFeatureFlag.mockImplementation(() => {
throw new Error("sentry down");
});
- launchDarkly.flags = { [HIRE_EXPERTS]: true };
+ launchDarkly.flags = { [GENERIC_TRIGGER_AGENTS]: true };
const debug = vi.spyOn(console, "debug").mockImplementation(() => {});
- const { result } = renderHook(() => useGetFlag(Flag.HIRE_EXPERTS));
+ const { result } = renderHook(() =>
+ useGetFlag(Flag.GENERIC_TRIGGER_AGENTS),
+ );
expect(result.current).toBe(true);
expect(debug).toHaveBeenCalledOnce();
@@ -501,7 +530,9 @@ describe("posthog flags follow the provider's gate", () => {
const { Flag, useFlagStatus } = await loadWithBackend("posthog");
postHog.enabled.mockReturnValue(true);
- const { result } = renderHook(() => useFlagStatus(Flag.HIRE_EXPERTS));
+ const { result } = renderHook(() =>
+ useFlagStatus(Flag.GENERIC_TRIGGER_AGENTS),
+ );
expect(result.current).toEqual({
enabled: false,
diff --git a/autogpt_platform/frontend/src/services/feature-flags/__tests__/flag-defaults.test.ts b/autogpt_platform/frontend/src/services/feature-flags/__tests__/flag-defaults.test.ts
index 9ff061b604..a4125a88a5 100644
--- a/autogpt_platform/frontend/src/services/feature-flags/__tests__/flag-defaults.test.ts
+++ b/autogpt_platform/frontend/src/services/feature-flags/__tests__/flag-defaults.test.ts
@@ -22,21 +22,20 @@ vi.mock("@/services/environment", () => ({
environment: { areFeatureFlagsEnabled: () => true },
}));
-const DREAM_GRAPHITI_FLAGS = [
- Flag.GRAPHITI_MEMORY,
- Flag.GRAPHITI_COMMUNITIES_ENABLED,
+const DREAM_FLAGS = [
Flag.DREAM_PASS_ENABLED,
Flag.DREAM_PASS_INVALIDATE_ENTITY,
+ Flag.DREAM_SKILL_LEARNING_ENABLED,
] as const;
-describe("dream/graphiti flag defaults fail closed", () => {
+describe("experimental dream flag defaults fail closed", () => {
beforeEach(() => {
Object.keys(process.env)
.filter((k) => k.startsWith("NEXT_PUBLIC_FORCE_FLAG_"))
.forEach((k) => delete process.env[k]);
});
- it.each(DREAM_GRAPHITI_FLAGS)(
+ it.each(DREAM_FLAGS)(
"resolves %s to false when LaunchDarkly has not answered, mirroring the backend's default=False gating",
(flag) => {
const { result } = renderHook(() => useGetFlag(flag));
@@ -50,31 +49,3 @@ describe("dream/graphiti flag defaults fail closed", () => {
expect(result.current).toBe(true);
});
});
-
-// This one has been flipped to `true` in the defaults map twice now, and
-// both times it silently swapped the onboarding wizard for every
-// LaunchDarkly-less environment — local dev, CI, Playwright — which is how
-// auth-happy-path stopped finding the pillbox step.
-const ONBOARDING_FLAGS = [Flag.ONBOARDING_BRAIN_DUMP] as const;
-
-describe("onboarding flag defaults fail closed", () => {
- beforeEach(() => {
- Object.keys(process.env)
- .filter((k) => k.startsWith("NEXT_PUBLIC_FORCE_FLAG_"))
- .forEach((k) => delete process.env[k]);
- });
-
- it.each(ONBOARDING_FLAGS)(
- "resolves %s to false when LaunchDarkly has not answered, so the default flow renders untouched",
- (flag) => {
- const { result } = renderHook(() => useGetFlag(flag));
- expect(result.current).toBe(false);
- },
- );
-
- it("still lets local dev force-enable the brain dump via the env override", () => {
- process.env.NEXT_PUBLIC_FORCE_FLAG_ONBOARDING_BRAIN_DUMP = "true";
- const { result } = renderHook(() => useGetFlag(Flag.ONBOARDING_BRAIN_DUMP));
- expect(result.current).toBe(true);
- });
-});
diff --git a/autogpt_platform/frontend/src/services/feature-flags/__tests__/flag-source-mocking.test.tsx b/autogpt_platform/frontend/src/services/feature-flags/__tests__/flag-source-mocking.test.tsx
index 30e4fe64a9..f730fdc641 100644
--- a/autogpt_platform/frontend/src/services/feature-flags/__tests__/flag-source-mocking.test.tsx
+++ b/autogpt_platform/frontend/src/services/feature-flags/__tests__/flag-source-mocking.test.tsx
@@ -23,9 +23,13 @@ vi.mock("@/services/environment", () => ({
describe("mocking the flag source controls every flag hook", () => {
it("drives useGetFlag without mocking any vendor SDK", () => {
- source.results = { "hire-experts": { value: true, resolved: true } };
+ source.results = {
+ "generic-trigger-agents": { value: true, resolved: true },
+ };
- const { result } = renderHook(() => useGetFlag(Flag.HIRE_EXPERTS));
+ const { result } = renderHook(() =>
+ useGetFlag(Flag.GENERIC_TRIGGER_AGENTS),
+ );
expect(result.current).toBe(true);
});
@@ -33,7 +37,9 @@ describe("mocking the flag source controls every flag hook", () => {
it("drives useFlagStatus, including the not-answered-yet case", () => {
source.results = {};
- const { result } = renderHook(() => useFlagStatus(Flag.HIRE_EXPERTS));
+ const { result } = renderHook(() =>
+ useFlagStatus(Flag.GENERIC_TRIGGER_AGENTS),
+ );
expect(result.current).toEqual({
enabled: false,
diff --git a/autogpt_platform/frontend/src/services/feature-flags/__tests__/pw-flag-overrides.test.tsx b/autogpt_platform/frontend/src/services/feature-flags/__tests__/pw-flag-overrides.test.tsx
index c519617188..530f96dbfd 100644
--- a/autogpt_platform/frontend/src/services/feature-flags/__tests__/pw-flag-overrides.test.tsx
+++ b/autogpt_platform/frontend/src/services/feature-flags/__tests__/pw-flag-overrides.test.tsx
@@ -39,19 +39,20 @@ describe("Playwright runtime flag overrides", () => {
vi.stubEnv("NEXT_PUBLIC_PW_TEST", "true");
window.localStorage.setItem(
STORAGE_KEY,
- JSON.stringify({ "hire-experts": true }),
+ JSON.stringify({ "generic-trigger-agents": true }),
);
const { Flag, useGetFlag, useFlagStatus } = await loadFlags();
- expect(renderHook(() => useGetFlag(Flag.HIRE_EXPERTS)).result.current).toBe(
- true,
- );
expect(
- renderHook(() => useFlagStatus(Flag.HIRE_EXPERTS)).result.current,
+ renderHook(() => useGetFlag(Flag.GENERIC_TRIGGER_AGENTS)).result.current,
+ ).toBe(true);
+ expect(
+ renderHook(() => useFlagStatus(Flag.GENERIC_TRIGGER_AGENTS)).result
+ .current,
).toEqual({ enabled: true, ready: true, answered: true });
- expect(renderHook(() => useGetFlag(Flag.SKILLS_HUB)).result.current).toBe(
- false,
- );
+ expect(
+ renderHook(() => useGetFlag(Flag.CHAT_WORKSPACE_FILES)).result.current,
+ ).toBe(false);
});
it("keeps route gates waiting until hydration can read the overrides", async () => {
@@ -61,7 +62,7 @@ describe("Playwright runtime flag overrides", () => {
let status: ReturnType<typeof useFlagStatus> | undefined;
function Probe() {
- status = useFlagStatus(Flag.HIRE_EXPERTS);
+ status = useFlagStatus(Flag.GENERIC_TRIGGER_AGENTS);
return null;
}
@@ -73,44 +74,44 @@ describe("Playwright runtime flag overrides", () => {
vi.stubEnv("NEXT_PUBLIC_PW_TEST", "false");
window.localStorage.setItem(
STORAGE_KEY,
- JSON.stringify({ "hire-experts": true }),
+ JSON.stringify({ "generic-trigger-agents": true }),
);
const { Flag, useGetFlag } = await loadFlags();
- expect(renderHook(() => useGetFlag(Flag.HIRE_EXPERTS)).result.current).toBe(
- false,
- );
+ expect(
+ renderHook(() => useGetFlag(Flag.GENERIC_TRIGGER_AGENTS)).result.current,
+ ).toBe(false);
});
it("falls back to the default for a value of the wrong type or bad JSON", async () => {
vi.stubEnv("NEXT_PUBLIC_PW_TEST", "true");
window.localStorage.setItem(
STORAGE_KEY,
- JSON.stringify({ "hire-experts": "yes" }),
+ JSON.stringify({ "generic-trigger-agents": "yes" }),
);
const { Flag, useGetFlag } = await loadFlags();
- expect(renderHook(() => useGetFlag(Flag.HIRE_EXPERTS)).result.current).toBe(
- false,
- );
+ expect(
+ renderHook(() => useGetFlag(Flag.GENERIC_TRIGGER_AGENTS)).result.current,
+ ).toBe(false);
window.localStorage.setItem(STORAGE_KEY, "{not json");
- expect(renderHook(() => useGetFlag(Flag.HIRE_EXPERTS)).result.current).toBe(
- false,
- );
+ expect(
+ renderHook(() => useGetFlag(Flag.GENERIC_TRIGGER_AGENTS)).result.current,
+ ).toBe(false);
});
it("wins over a build-time env override", async () => {
vi.stubEnv("NEXT_PUBLIC_PW_TEST", "true");
- vi.stubEnv("NEXT_PUBLIC_FORCE_FLAG_HIRE_EXPERTS", "true");
+ vi.stubEnv("NEXT_PUBLIC_FORCE_FLAG_GENERIC_TRIGGER_AGENTS", "true");
window.localStorage.setItem(
STORAGE_KEY,
- JSON.stringify({ "hire-experts": false }),
+ JSON.stringify({ "generic-trigger-agents": false }),
);
const { Flag, useGetFlag } = await loadFlags();
- expect(renderHook(() => useGetFlag(Flag.HIRE_EXPERTS)).result.current).toBe(
- false,
- );
+ expect(
+ renderHook(() => useGetFlag(Flag.GENERIC_TRIGGER_AGENTS)).result.current,
+ ).toBe(false);
});
});
diff --git a/autogpt_platform/frontend/src/services/feature-flags/__tests__/server-flags.test.tsx b/autogpt_platform/frontend/src/services/feature-flags/__tests__/server-flags.test.tsx
index 80501529e7..d1186b24ea 100644
--- a/autogpt_platform/frontend/src/services/feature-flags/__tests__/server-flags.test.tsx
+++ b/autogpt_platform/frontend/src/services/feature-flags/__tests__/server-flags.test.tsx
@@ -37,7 +37,7 @@ vi.mock("@/app/(platform)/marketplace/components/HeroSection/helpers", () => ({
DEFAULT_SEARCH_TERMS: [],
}));
-const HIRE_EXPERTS = "hire-experts";
+const GENERIC_TRIGGER_AGENTS = "generic-trigger-agents";
const VISITOR = "0b6c1f3e-visitor-0001";
vi.mock("posthog-js", () => ({
@@ -59,10 +59,10 @@ afterAll(() => {
describe("server backend", () => {
it("serves the server's answer, and a flag it left out is not answered yet", async () => {
- serveFlags({ flags: { [HIRE_EXPERTS]: true }, configured: true });
+ serveFlags({ flags: { [GENERIC_TRIGGER_AGENTS]: true }, configured: true });
const { result } = renderHook(
() => ({
- hire: useFlagStatus(Flag.HIRE_EXPERTS),
+ hire: useFlagStatus(Flag.GENERIC_TRIGGER_AGENTS),
progressBar: useFlagStatus(Flag.TASK_PROGRESS_BAR),
}),
{ wrapper: withQueryClient() },
@@ -98,16 +98,19 @@ describe("server backend", () => {
});
it("asks again until the vendor answers it, then stops", async () => {
- const answers = [{}, {}, { [HIRE_EXPERTS]: true }];
+ const answers = [{}, {}, { [GENERIC_TRIGGER_AGENTS]: true }];
let requests = 0;
serveFlags(() => ({
flags: answers[Math.min(requests++, answers.length - 1)],
configured: true,
}));
- const { result } = renderHook(() => useFlagStatus(Flag.HIRE_EXPERTS), {
- wrapper: withQueryClient(),
- });
+ const { result } = renderHook(
+ () => useFlagStatus(Flag.GENERIC_TRIGGER_AGENTS),
+ {
+ wrapper: withQueryClient(),
+ },
+ );
await waitFor(() => expect(requests).toBe(1));
await act(() => vi.advanceTimersByTimeAsync(60_000));
@@ -121,12 +124,15 @@ describe("server backend", () => {
let requests = 0;
serveFlags(() => {
requests++;
- return { flags: { [HIRE_EXPERTS]: null }, configured: true };
+ return { flags: { [GENERIC_TRIGGER_AGENTS]: null }, configured: true };
});
- const { result } = renderHook(() => useFlagStatus(Flag.HIRE_EXPERTS), {
- wrapper: withQueryClient(),
- });
+ const { result } = renderHook(
+ () => useFlagStatus(Flag.GENERIC_TRIGGER_AGENTS),
+ {
+ wrapper: withQueryClient(),
+ },
+ );
await waitFor(() =>
expect(result.current).toMatchObject({
enabled: false,
@@ -145,15 +151,18 @@ describe("server backend", () => {
requests++ === 0
? HttpResponse.json({ detail: "bad gateway" }, { status: 502 })
: HttpResponse.json({
- flags: { [HIRE_EXPERTS]: true },
+ flags: { [GENERIC_TRIGGER_AGENTS]: true },
configured: true,
}),
),
);
- const { result } = renderHook(() => useFlagStatus(Flag.HIRE_EXPERTS), {
- wrapper: withQueryClient(),
- });
+ const { result } = renderHook(
+ () => useFlagStatus(Flag.GENERIC_TRIGGER_AGENTS),
+ {
+ wrapper: withQueryClient(),
+ },
+ );
await waitFor(() => expect(requests).toBe(1));
await act(() => vi.advanceTimersByTimeAsync(60_000));
@@ -169,7 +178,7 @@ describe("server backend", () => {
}),
);
- renderHook(() => useFlagStatus(Flag.HIRE_EXPERTS), {
+ renderHook(() => useFlagStatus(Flag.GENERIC_TRIGGER_AGENTS), {
wrapper: withQueryClient(),
});
await waitFor(() => expect(requests).toBe(1));
@@ -187,7 +196,7 @@ describe("server backend", () => {
return { flags: {}, configured: true };
});
- renderHook(() => useFlagStatus(Flag.HIRE_EXPERTS), {
+ renderHook(() => useFlagStatus(Flag.GENERIC_TRIGGER_AGENTS), {
wrapper: withQueryClient(),
});
await waitFor(() => expect(requests).toBe(1));
@@ -201,7 +210,7 @@ describe("server backend", () => {
it.each([
[
"a flag only another component reads",
- { flags: { [HIRE_EXPERTS]: true }, configured: true },
+ { flags: { [GENERIC_TRIGGER_AGENTS]: true }, configured: true },
],
[
"any flag, with no vendor to wait for",
@@ -214,7 +223,7 @@ describe("server backend", () => {
return response;
});
- renderHook(() => useFlagStatus(Flag.HIRE_EXPERTS), {
+ renderHook(() => useFlagStatus(Flag.GENERIC_TRIGGER_AGENTS), {
wrapper: withQueryClient(),
});
await waitFor(() => expect(requests).toBe(1));
@@ -229,13 +238,18 @@ describe("server backend", () => {
server.use(
getGetFeatureFlagsMockHandler(async () => {
if (requests++ === 0) {
- return { flags: { [HIRE_EXPERTS]: true }, configured: true };
+ return {
+ flags: { [GENERIC_TRIGGER_AGENTS]: true },
+ configured: true,
+ };
}
await new Promise((resolve) => setTimeout(resolve, 200));
- return { flags: { [HIRE_EXPERTS]: false }, configured: true };
+ return { flags: { [GENERIC_TRIGGER_AGENTS]: false }, configured: true };
}),
);
- const seen = renderRecording(() => useFlagStatus(Flag.HIRE_EXPERTS));
+ const seen = renderRecording(() =>
+ useFlagStatus(Flag.GENERIC_TRIGGER_AGENTS),
+ );
await waitFor(() =>
expect(seen.at(-1)).toMatchObject({ enabled: true, answered: true }),
);
@@ -253,14 +267,17 @@ describe("server backend", () => {
const answers = [true, false];
let requests = 0;
serveFlags(() => ({
- flags: { [HIRE_EXPERTS]: answers[requests++] },
+ flags: { [GENERIC_TRIGGER_AGENTS]: answers[requests++] },
configured: true,
}));
useAuthStore.setState({ isUserLoading: true });
- const { result } = renderHook(() => useFlagStatus(Flag.HIRE_EXPERTS), {
- wrapper: withQueryClient(),
- });
+ const { result } = renderHook(
+ () => useFlagStatus(Flag.GENERIC_TRIGGER_AGENTS),
+ {
+ wrapper: withQueryClient(),
+ },
+ );
await new Promise((resolve) => setTimeout(resolve, 50));
expect(requests).toBe(0);
@@ -292,7 +309,7 @@ describe("a signed-out visitor", () => {
installCookiebot({ statistics: true });
const sent = recordVisitorIDs();
- renderHook(() => useFlagStatus(Flag.HIRE_EXPERTS), {
+ renderHook(() => useFlagStatus(Flag.GENERIC_TRIGGER_AGENTS), {
wrapper: withQueryClient(),
});
@@ -306,7 +323,7 @@ describe("a signed-out visitor", () => {
installCookiebot(answer);
const sent = recordVisitorIDs();
- renderHook(() => useFlagStatus(Flag.HIRE_EXPERTS), {
+ renderHook(() => useFlagStatus(Flag.GENERIC_TRIGGER_AGENTS), {
wrapper: withQueryClient(),
});
@@ -318,7 +335,7 @@ describe("a signed-out visitor", () => {
signIn("u-1");
const sent = recordVisitorIDs();
- renderHook(() => useFlagStatus(Flag.HIRE_EXPERTS), {
+ renderHook(() => useFlagStatus(Flag.GENERIC_TRIGGER_AGENTS), {
wrapper: withQueryClient(),
});
@@ -330,13 +347,18 @@ describe("a signed-out visitor", () => {
server.use(
getGetFeatureFlagsMockHandler(async ({ request }) => {
if (!new URL(request.url).searchParams.get("visitor_id")) {
- return { flags: { [HIRE_EXPERTS]: false }, configured: true };
+ return {
+ flags: { [GENERIC_TRIGGER_AGENTS]: false },
+ configured: true,
+ };
}
await new Promise((resolve) => setTimeout(resolve, 200));
- return { flags: { [HIRE_EXPERTS]: true }, configured: true };
+ return { flags: { [GENERIC_TRIGGER_AGENTS]: true }, configured: true };
}),
);
- const seen = renderRecording(() => useFlagStatus(Flag.HIRE_EXPERTS));
+ const seen = renderRecording(() =>
+ useFlagStatus(Flag.GENERIC_TRIGGER_AGENTS),
+ );
await waitFor(() =>
expect(seen.at(-1)).toMatchObject({ enabled: false, answered: true }),
);
@@ -352,7 +374,7 @@ describe("a signed-out visitor", () => {
it("is read again under their id when they allow analytics", async () => {
installCookiebot();
const sent = recordVisitorIDs();
- renderHook(() => useFlagStatus(Flag.HIRE_EXPERTS), {
+ renderHook(() => useFlagStatus(Flag.GENERIC_TRIGGER_AGENTS), {
wrapper: withQueryClient(),
});
await waitFor(() => expect(sent).toEqual([null]));
diff --git a/autogpt_platform/frontend/src/services/feature-flags/__tests__/with-feature-flag.test.tsx b/autogpt_platform/frontend/src/services/feature-flags/__tests__/with-feature-flag.test.tsx
index 7ef8d59d9c..e1cfcfb369 100644
--- a/autogpt_platform/frontend/src/services/feature-flags/__tests__/with-feature-flag.test.tsx
+++ b/autogpt_platform/frontend/src/services/feature-flags/__tests__/with-feature-flag.test.tsx
@@ -29,17 +29,17 @@ vi.mock("@/services/environment", () => ({
}));
const FORCE_ALL = "NEXT_PUBLIC_FORCE_ALL_FLAGS";
-const PER_FLAG = "NEXT_PUBLIC_FORCE_FLAG_GRAPHITI_MEMORY";
+const PER_FLAG = "NEXT_PUBLIC_FORCE_FLAG_COPILOT_AUTO_MODE";
function Gated() {
return <div>gated content</div>;
}
-const Wrapped = withFeatureFlag(Gated, Flag.GRAPHITI_MEMORY);
+const Wrapped = withFeatureFlag(Gated, Flag.COPILOT_AUTO_MODE);
describe("withFeatureFlag reads through the flag seam", () => {
it("renders the page once the vendor answers true", () => {
- source.results = { "graphiti-memory": { value: true, resolved: true } };
+ source.results = { "copilot-auto-mode": { value: true, resolved: true } };
render(<Wrapped />);
@@ -48,7 +48,7 @@ describe("withFeatureFlag reads through the flag seam", () => {
});
it("sends the user to 404 once the vendor answers false", () => {
- source.results = { "graphiti-memory": { value: false, resolved: true } };
+ source.results = { "copilot-auto-mode": { value: false, resolved: true } };
render(<Wrapped />);
@@ -91,7 +91,7 @@ async function renderGated() {
vi.resetModules();
const { withFeatureFlag: freshHOC } = await import("../with-feature-flag");
const { Flag: FreshFlag } = await import("../use-get-flag");
- const Page = freshHOC(Gated, FreshFlag.GRAPHITI_MEMORY);
+ const Page = freshHOC(Gated, FreshFlag.COPILOT_AUTO_MODE);
return render(<Page />);
}
diff --git a/autogpt_platform/frontend/src/services/feature-flags/use-get-flag.ts b/autogpt_platform/frontend/src/services/feature-flags/use-get-flag.ts
index 2fb6608737..33906e90fe 100644
--- a/autogpt_platform/frontend/src/services/feature-flags/use-get-flag.ts
+++ b/autogpt_platform/frontend/src/services/feature-flags/use-get-flag.ts
@@ -20,25 +20,14 @@ const isPwMockEnabled = process.env.NEXT_PUBLIC_PW_TEST === "true";
const defaultFlags = {
[Flag.MARKETPLACE_SEARCH_TERMS]: DEFAULT_SEARCH_TERMS,
[Flag.ENABLE_PLATFORM_PAYMENT]: false,
- [Flag.ARTIFACTS_PAGE]: false,
[Flag.CHAT_MODE_OPTION]: false,
[Flag.GENERIC_TRIGGER_AGENTS]: false,
[Flag.CHAT_WORKSPACE_FILES]: false,
[Flag.CHAT_PINNING]: false,
[Flag.TASK_PROGRESS_BAR]: false,
- [Flag.HIRE_EXPERTS]: false,
- [Flag.SKILLS_HUB]: false,
// Off by default so a LaunchDarkly outage or a missing key hides the card
// rather than exposing the in-progress design to everyone.
[Flag.SETTINGS_NOTIFICATIONS]: false,
- // Off by default: with no LaunchDarkly key (local dev, CI, Playwright)
- // the wizard falls back to this map, and a ``true`` here renders the
- // brain dump for everyone — which is what the backend 404s are meant to
- // prevent. Use NEXT_PUBLIC_FORCE_FLAG_ONBOARDING_BRAIN_DUMP locally.
- [Flag.ONBOARDING_BRAIN_DUMP]: false,
- [Flag.ONBOARDING_EXPERT_TEAM]: false,
- [Flag.GRAPHITI_MEMORY]: false,
- [Flag.GRAPHITI_COMMUNITIES_ENABLED]: false,
[Flag.DREAM_PASS_ENABLED]: false,
[Flag.DREAM_PASS_INVALIDATE_ENTITY]: false,
[Flag.DREAM_SKILL_LEARNING_ENABLED]: false,
@@ -74,10 +63,6 @@ function readEnvOverride(flag: Flag): string | undefined {
return process.env.NEXT_PUBLIC_FORCE_FLAG_MARKETPLACE_SEARCH_TERMS;
case Flag.ENABLE_PLATFORM_PAYMENT:
return process.env.NEXT_PUBLIC_FORCE_FLAG_ENABLE_PLATFORM_PAYMENT;
- case Flag.SKILLS_HUB:
- return process.env.NEXT_PUBLIC_FORCE_FLAG_SKILLS_HUB;
- case Flag.ARTIFACTS_PAGE:
- return process.env.NEXT_PUBLIC_FORCE_FLAG_ARTIFACTS_PAGE;
case Flag.CHAT_MODE_OPTION:
return process.env.NEXT_PUBLIC_FORCE_FLAG_CHAT_MODE_OPTION;
case Flag.GENERIC_TRIGGER_AGENTS:
@@ -88,18 +73,8 @@ function readEnvOverride(flag: Flag): string | undefined {
return process.env.NEXT_PUBLIC_FORCE_FLAG_CHAT_PINNING;
case Flag.TASK_PROGRESS_BAR:
return process.env.NEXT_PUBLIC_FORCE_FLAG_TASK_PROGRESS_BAR;
- case Flag.HIRE_EXPERTS:
- return process.env.NEXT_PUBLIC_FORCE_FLAG_HIRE_EXPERTS;
case Flag.SETTINGS_NOTIFICATIONS:
return process.env.NEXT_PUBLIC_FORCE_FLAG_SETTINGS_NOTIFICATIONS;
- case Flag.ONBOARDING_BRAIN_DUMP:
- return process.env.NEXT_PUBLIC_FORCE_FLAG_ONBOARDING_BRAIN_DUMP;
- case Flag.ONBOARDING_EXPERT_TEAM:
- return process.env.NEXT_PUBLIC_FORCE_FLAG_ONBOARDING_EXPERT_TEAM;
- case Flag.GRAPHITI_MEMORY:
- return process.env.NEXT_PUBLIC_FORCE_FLAG_GRAPHITI_MEMORY;
- case Flag.GRAPHITI_COMMUNITIES_ENABLED:
- return process.env.NEXT_PUBLIC_FORCE_FLAG_GRAPHITI_COMMUNITIES_ENABLED;
case Flag.DREAM_PASS_ENABLED:
return process.env.NEXT_PUBLIC_FORCE_FLAG_DREAM_PASS_ENABLED;
case Flag.DREAM_PASS_INVALIDATE_ENTITY:
diff --git a/autogpt_platform/single-container/Dockerfile b/autogpt_platform/single-container/Dockerfile
index 780bf0090e..febe3da967 100644
--- a/autogpt_platform/single-container/Dockerfile
+++ b/autogpt_platform/single-container/Dockerfile
@@ -23,7 +23,6 @@ ENV NODE_ENV=production \
NEXT_PUBLIC_APP_ENV=local \
NEXT_PUBLIC_BEHAVE_AS=LOCAL \
NEXT_PUBLIC_LAUNCHDARKLY_ENABLED=false \
- NEXT_PUBLIC_FORCE_FLAG_GRAPHITI_MEMORY=true \
NEXT_PUBLIC_SOURCEMAPS=false \
NEXT_PUBLIC_TURNSTILE=disabled \
NEXT_PUBLIC_VAPID_PUBLIC_KEY="" \
@@ -238,9 +237,6 @@ RUN POETRY_VIRTUALENVS_CREATE=true POETRY_VIRTUALENVS_IN_PROJECT=true \
&& rm -f /app/autogpt_platform/backend/config.json \
&& ln -s /data/config/backend.json /app/autogpt_platform/backend/config.json
-# FORCE_FLAG_GRAPHITI_MEMORY keeps memory on; the frontend stage's
-# NEXT_PUBLIC_FORCE_FLAG_GRAPHITI_MEMORY must match it, or users can't open
-# /settings/memory to see or erase what was remembered.
ENV PATH="/opt/rabbitmq/sbin:/opt/erlang/bin:/opt/openssl/bin:/usr/lib/postgresql/15/bin:/app/autogpt_platform/backend/.venv/bin:${PATH}" \
ERLANG_INSTALL_PATH_PREFIX=/opt/erlang \
OPENSSL_INSTALL_PATH_PREFIX=/opt/openssl \
@@ -259,7 +255,6 @@ ENV PATH="/opt/rabbitmq/sbin:/opt/erlang/bin:/opt/openssl/bin:/usr/lib/postgresq
PRISMA_QUERY_ENGINE_BINARY=/opt/prisma-python/query-engine \
PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
- FORCE_FLAG_GRAPHITI_MEMORY=true \
AUTOGPT_PUBLIC_URL=http://localhost:3000
# These build arguments change on every build, so they are declared only after
diff --git a/docs/engineering/feature-flag-audit-prompt.md b/docs/engineering/feature-flag-audit-prompt.md
new file mode 100644
index 0000000000..457114748f
--- /dev/null
+++ b/docs/engineering/feature-flag-audit-prompt.md
@@ -0,0 +1,27 @@
+# Tuesday feature-flag retirement and default audit
+
+Use the prompt below for a weekly Tuesday task in AutoGPT. Set the run time in the task schedule using America/Chicago. This is an audit prompt; it does not create a schedule or authorize production changes.
+
+```text
+Audit AutoGPT's feature flags and code defaults. Find product features that have been fully rolled out for at least seven consecutive days and still carry obsolete rollout branches or fall back to older behavior when the flag service is absent or unavailable.
+
+Sources and scope:
+- Read the production PostHog project identified in Significant-Gravitas/AutoGPT's docs/engineering/feature-flags.md; confirm the project before querying. Use connected, authorized tools and paginate all flag and activity results. Report missing access instead of guessing.
+- Inspect a fresh upstream dev revision. Record its exact SHA and the audit timestamp. Use the previous Tuesday report and snapshot, if available, to describe changes; they are context, not current truth. Explicitly report when previous-run artifacts are unavailable.
+
+For each candidate:
+1. Read its full definition: active state, ordered targeting rules, exceptions, cohorts, variants/payloads, holdouts and dependencies. A 100% employee cohort is not 100% of everyone. An API-key owner's evaluated flags do not represent all employees or all users. Confirm the effective result for the whole intended production audience, including authenticated/anonymous differences where relevant.
+2. Use audit history to establish how long that effective state has been continuous. Track both targeting changes and payload changes. Include changes to referenced cohorts, dependent flags and holdouts where they affect the result. Matching weekly snapshots alone do not prove uninterrupted rollout; record gaps in history as unproven. Creation time alone is not an enablement date. Imported flags may only establish an earliest confirmed boundary; say so. If history cannot establish seven days, classify age as unproven. Highlight 14-day and 30-day stability separately. A rollback or meaningful configuration change restarts the relevant clock.
+3. Trace the key through frontend defaults, backend helpers, decorators/dependencies, API routes, tools, workers, schedulers and callsite-specific fallback arguments. Compare actual behavior when the provider is missing, fails, returns no definition, or explicitly returns false. Check SDK contracts: a successful response omitting an inactive flag may look identical to a failed read through a convenience helper. Distinguish a code fallback from an authoritative answer. Identify build-time overrides and deployment settings separately. Cite exact files and lines at the recorded SHA.
+4. Compare structured payloads semantically. An empty model/cost map can mean “use existing defaults.” A variant name is not a boolean. List real array/object mismatches separately and redact secrets or account-specific identifiers.
+5. Classify: suitable flag-retirement candidate; default-update candidate with a justified continuing rollout control; recent or restricted rollout; intentional deployment configuration; operational/enforcement control needing review; already aligned; or insufficient evidence. Keep billing, Stripe/trials, entitlements, authentication/security, provider requirements and background model costs separate. A longstanding rollout is not proof that removing its control is safe. Retirement means removing the flag consumer and obsolete branches, not changing the default to true. Preserve authorization and user preference checks.
+6. Check existing open and recently merged PRs/issues before recommending work. Link matching work and avoid duplicate recommendations. For each remaining candidate, propose the smallest coordinated change and meaningful tests: absent/failed provider, successful inactive-flag omission, explicit false, unchanged nonselected flags, frontend/backend parity, authority metadata and relevant worker/route behavior.
+
+Output:
+- A concise verdict and what changed since the previous audit.
+- A table with key/type, configured production value and audience, confirmed continuous rollout age, frontend/backend defaults, deployment overrides, mismatch, recommendation and evidence links.
+- Separate recent/employee-only flags and billing/operational exceptions. Clearly state unknowns; say “no new candidates” when appropriate.
+- Save feature-flag-audit-YYYY-MM-DD.md and feature-flag-audit-YYYY-MM-DD.json as task artifacts for the next Tuesday run, with a retrievable reference to the latest report and snapshot. Include the revision, project, timestamp, flag IDs/versions, sanitized effective values/payloads, normalized targeting fingerprints, code fallback values, history coverage, evidence boundary and recommendation status, without credentials or personal data.
+
+Do not change PostHog, production settings, subscriptions, deployments or code; do not open/merge PRs, create tickets, or notify other people unless separately authorized. Produce PR-ready recommendations for review. If a required tool is unavailable, finish the portions supported by evidence and identify the exact blocker.
+```
diff --git a/docs/engineering/feature-flags.md b/docs/engineering/feature-flags.md
index 9eacdafe0b..1bafd98f80 100644
--- a/docs/engineering/feature-flags.md
+++ b/docs/engineering/feature-flags.md
@@ -8,6 +8,39 @@ install and CI get. Call sites are unaffected by
the choice; they read through `evaluate_feature_flag()` on the backend and
`useGetFlag` / `useFlagStatus` on the frontend.
+## Retired product rollout flags
+
+The following features are permanent product paths. The backend and browser no
+longer evaluate these keys, and their former `FORCE_FLAG_*` /
+`NEXT_PUBLIC_FORCE_FLAG_*` overrides have no effect:
+
+- `artifacts-page`
+- `hire-experts`
+- `skills-hub`
+- `onboarding-brain-dump`
+- `onboarding-expert-team`
+- `graphiti-memory`
+- `graphiti-communities-enabled`
+- `expert-spend-approval`
+- `ai-agent-execution-summary`
+
+The sidebar and search flags, `autogpt-new-layout` and `chat-search`, were
+retired separately. Authentication, ownership, user preferences, billing
+configuration and provider requirements still apply. Spend approval is bypassed
+when `ENABLE_CREDIT=false`. Dream passes, skill learning, voice mode, payments and
+other independent rollout controls retain their existing gates.
+
+Memory still requires FalkorDB and configured embedding/model endpoints. The
+standard compose and single-container stacks include FalkorDB; custom installs
+must provide it. Memory operations can fail when these services are unavailable;
+removing the rollout flags does not make missing services a supported no-op.
+Community rebuilds and execution summaries can perform model work.
+
+Retired provider definitions can remain during a rolling deployment for older
+releases. Removing code consumers does not delete PostHog or LaunchDarkly
+configuration. Use the [Tuesday audit prompt](feature-flag-audit-prompt.md) to
+identify further retirement candidates.
+
## One PostHog project per environment
Dev and Prod each have their own PostHog project, and each project holds its