The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
test(free-tier): drop change-detector challenge tests; keep the invariants
kshitijk4poor8c0568ee73d0
diff --git a/apps/desktop/src/store/free-tier-challenge.test.ts b/apps/desktop/src/store/free-tier-challenge.test.tsindex fa4e1f71e49..f8ea9a8192f 100644--- a/apps/desktop/src/store/free-tier-challenge.test.ts+++ b/apps/desktop/src/store/free-tier-challenge.test.ts@@ -64,14 +64,6 @@ describe('runFreeTierChallenge', () => {await expect(runFreeTierChallenge({ ...challenge, url: `${challenge.url}5` }, report)).resolves.toBe('done')})- it('passes an optional challenge through as not-required', async () => {- const run = vi.fn().mockResolvedValue('failed')-- installBridge(run)- await runFreeTierChallenge({ ...challenge, url: `${challenge.url}2`, required: false })- expect(run).toHaveBeenCalledWith(expect.objectContaining({ required: false }))- })-it('ignores anything that is not a browser challenge', () => {installBridge(vi.fn())expect(runFreeTierChallenge(undefined)).toBeNull()diff --git a/tests/hermes_cli/test_anon_challenge.py b/tests/hermes_cli/test_anon_challenge.pyindex c50bfb3c528..face57177f3 100644--- a/tests/hermes_cli/test_anon_challenge.py+++ b/tests/hermes_cli/test_anon_challenge.py@@ -47,21 +47,6 @@ class TestWhatTheClientSends:assert sent["body"]["client"]["name"] == "hermes-agent"assert sent["user_agent"].startswith("hermes-agent/") and "(cli;" in sent["user_agent"]- def test_the_desktop_backend_reports_the_desktop_surface(self, nas, monkeypatch):- _desktop_backend(monkeypatch)- _resolve()- assert nas.token_requests[-1]["body"]["client"]["surface"] == "desktop"- assert "(desktop;" in nas.token_requests[-1]["user_agent"]-- def test_the_messaging_gateway_reports_the_gateway_surface(self, nas, monkeypatch):- """The gateway process has no console and no desktop; it must not read as ``cli`` (whose- rules may expect a human at a terminal) or print challenge links into its logs."""- import gateway.status as status- monkeypatch.setattr(status, "owns_gateway_runtime_lock", lambda: True)- _resolve()- assert nas.token_requests[-1]["body"]["client"]["surface"] == "gateway"--class TestRequiredChallenge:def test_a_host_failure_wakes_the_waiter_but_still_requires_an_authoritative_mint(self, nas, monkeypatch):nas.challenge_required = True@@ -160,15 +145,6 @@ class TestRequiredChallenge:monkeypatch.setattr(anon_challenge, "present", present)assert _resolve()["api_key"]- def test_status_shows_the_pending_challenge_while_it_is_worked(self, nas, monkeypatch):- nas.challenge_required = True- nas.challenge_statuses = ["pending"]- seen = []- monkeypatch.setattr(anon_challenge, "present", lambda _c: seen.append(anon_challenge.pending_challenge()))- _resolve()- assert seen == [{"type": "browser", "url": nas.challenge_url, "required": True,- "expires_in": 600, "message": "A quick check first.", "attempt": 0}]-def test_a_challenge_that_never_clears_is_a_retryable_error_not_a_hang(self, nas, presented, monkeypatch):nas.challenge_required = Truenas.challenge_never_clears = True@@ -353,12 +329,6 @@ class TestWhatIsNeverOpened:payload = {"challenges": [{"type": "browser", "url": f"{PORTAL}/challenge?code=\x1b]0;x"}]}assert anon_challenge.parse_browser_challenge(payload, PORTAL) is None- def test_server_copy_is_only_used_when_it_looks_like_copy(self):- assert anon_challenge.server_message(" Two\n lines ") == "Two lines"- assert anon_challenge.server_message("x" * 301) == ""- assert anon_challenge.server_message({"not": "text"}) == ""--class TestOptionalChallenge:def test_a_terminal_never_opens_anything_for_an_optional_challenge(self, nas, presented, monkeypatch):announced = []diff --git a/tui_gateway/contracts/events.py b/tui_gateway/contracts/events.pyindex f6307647e3a..cd1f402fd56 100644--- a/tui_gateway/contracts/events.py+++ b/tui_gateway/contracts/events.py@@ -742,8 +742,8 @@ event("bot_relay.outbox.pending", ChangeSignalPayload, doc="A bot-relay outbox e__all__ = ["BillingBlock", "BillingStepUpVerificationPayload", "BrowserControllerCancelPayload","BrowserControllerCommandPayload", "BrowserProgressPayload", "ChangeSignalPayload", "ErrorPayload",- "ErrorSurface", "GatewayReadyPayload", "LayoutApplyPayload", "MessageCompletePayload",- "FreeTierChallengePayload", "MessageInterimPayload", "MessageReaction", "MessageReactionPayload", "MoaAggregatingPayload",+ "ErrorSurface", "FreeTierChallengePayload", "GatewayReadyPayload", "LayoutApplyPayload",+ "MessageCompletePayload", "MessageInterimPayload", "MessageReaction", "MessageReactionPayload", "MoaAggregatingPayload","MoaPhasePayload", "MoaProgressPayload", "MoaReferencePayload", "NoticePayload","NotificationClearPayload", "NotificationShowPayload", "OpenPayload", "PaneRevealPayload","PetChangedPayload", "PetGenerateProgressPayload", "PetHatchProgressPayload", "PreviewClosePayload",