Skip to content

The agent that grows with you

fix(free-tier): HERMES_PREVIEW_FULL_CONNECTORS=1 turns the preview cohort on

alt-glitch58ba6a7b0415
diff --git a/hermes_cli/anon_auth.py b/hermes_cli/anon_auth.py
index 8c9bc18bf71..2fa33e4b524 100644
--- a/hermes_cli/anon_auth.py
+++ b/hermes_cli/anon_auth.py
@@ -51,8 +51,9 @@ ANON_SECRET_ENV = "HERMES_ANON_API_SECRET"
# config.yaml or .env, never shown in setup. Deleted at GA together with this comment.
GUEST_ONBOARDING_ENV = "HERMES_GUEST_ONBOARDING"
# Preview cohort for the free tier's connector set, sent once on account creation so the account
-# service can record it on the account. Exactly "true" or "false" is sent as that boolean; anything
-# else (unset included) omits the field and the service applies its default. Self-reported and
+# service can record it on the account. "1" / "true" send true and "0" / "false" send false ("1" is
+# GUEST_ONBOARDING_ENV's spelling, so one bundle command reads the same for both); anything else (unset
+# included) omits the field and the service applies its default. Self-reported and
# baked into desktop bundles in plain text: the service must treat it as a preference, never proof.
PREVIEW_FULL_CONNECTORS_ENV = "HERMES_PREVIEW_FULL_CONNECTORS"
GUEST_MINT_TIMEOUT_SECONDS = 5.0
@@ -333,9 +334,9 @@ def _raise_for_anon_status(
def mint_request_body() -> Dict[str, Any]:
"""The ``/api/anonymous/create`` body: ``{"preview_full_connectors": bool}`` when the env var is
- exactly ``true`` / ``false``, else ``{}``."""
+ ``1`` / ``true`` or ``0`` / ``false``, else ``{}``."""
raw = (os.environ.get(PREVIEW_FULL_CONNECTORS_ENV) or "").strip()
- return {"preview_full_connectors": raw == "true"} if raw in ("true", "false") else {}
+ return {"preview_full_connectors": raw in ("1", "true")} if raw in ("1", "true", "0", "false") else {}
def mint_guest(client: httpx.Client, portal_base_url: str) -> Dict[str, Any]:
diff --git a/tests/hermes_cli/test_anon_auth_core.py b/tests/hermes_cli/test_anon_auth_core.py
index 5b76e84d9d5..e66ded2bfab 100644
--- a/tests/hermes_cli/test_anon_auth_core.py
+++ b/tests/hermes_cli/test_anon_auth_core.py
@@ -139,13 +139,16 @@ class TestExplicitProvision:
@pytest.mark.parametrize("raw, body", [
("true", {"preview_full_connectors": True}),
+ ("1", {"preview_full_connectors": True}),
("false", {"preview_full_connectors": False}),
+ ("0", {"preview_full_connectors": False}),
(None, {}),
- ("1", {}),
+ ("yes", {}),
])
def test_preview_full_connectors_rides_the_create_call(self, portal, monkeypatch, raw, body):
"""The cohort reaches the account service on the one call that creates the account, as a
- real boolean; anything but exactly true/false leaves the body empty (the service default)."""
+ real boolean. "1" turns it on, as it does HERMES_GUEST_ONBOARDING, so one bundle command reads
+ the same for both; an unrecognised value leaves the body empty (the service default)."""
if raw is None:
monkeypatch.delenv(anon_auth.PREVIEW_FULL_CONNECTORS_ENV, raising=False)
else: