Skip to content

The agent that grows with you

test(bot-relay): trim the salvaged #107601 tests to the invariants

teknium13f29c10a80b6
diff --git a/tests/honcho_plugin/test_a2a_sessions.py b/tests/honcho_plugin/test_a2a_sessions.py
index c632bdab94c..f883df5cb06 100644
--- a/tests/honcho_plugin/test_a2a_sessions.py
+++ b/tests/honcho_plugin/test_a2a_sessions.py
@@ -195,11 +195,6 @@ class TestRelayedDmFromALoggedInClient:
from tools.bot_relay import relaying_principal_author
cls.RELAY = relaying_principal_author("principal:dashboard:0123456789abcdef0123456789abcdef")
- def test_author_shape_is_a_bot_with_a_principal_derived_id(self):
- assert self.RELAY["is_bot"] is True
- assert self.RELAY["id"] == "bot:principal:dashboard:0123456789abcdef0123456789abcdef/relay"
- assert self.RELAY["name"] == "relayed teammate"
-
def test_turn_lands_in_its_own_a2a_session_never_the_humans(self):
provider = _provider()
provider._manager.resolve_author_peer_id.return_value = "relay"
@@ -209,24 +204,3 @@ class TestRelayedDmFromALoggedInClient:
keys = [c[0][0] for c in provider._manager.get_or_create.call_args_list]
assert keys == [provider._a2a_session_key(self.RELAY)]
assert "Bot-Chat" not in keys
-
- def test_memory_writes_stay_refused_during_the_turn(self):
- provider = _provider()
- provider._turn_author = dict(self.RELAY)
- provider._manager.create_conclusion.return_value = True
- assert provider._bot_turn_write_refusal() is not None
- assert "error" in json.loads(provider._tool_conclude({"conclusion": "likes tea"}))
- provider.on_memory_write("add", "user", "likes tea")
- assert provider._memwrite_thread is None
- provider._manager.create_conclusion.assert_not_called()
-
- def test_an_unattributed_turn_would_have_been_the_humans(self):
- """The failure mode this guards against: with no author, the same turn goes to the human session."""
- provider = _provider()
- provider._manager.resolve_author_peer_id.return_value = None
-
- _sync(provider, turn_author=None)
-
- assert [c[0][0] for c in provider._manager.get_or_create.call_args_list] == ["Bot-Chat"]
- provider._turn_author = {}
- assert provider._bot_turn_write_refusal() is None
diff --git a/tests/tui_gateway/test_bot_relay_methods.py b/tests/tui_gateway/test_bot_relay_methods.py
index d3d5ac18c3e..d659ad088cd 100644
--- a/tests/tui_gateway/test_bot_relay_methods.py
+++ b/tests/tui_gateway/test_bot_relay_methods.py
@@ -416,28 +416,6 @@ def test_deliver_from_a_logged_in_client_is_attributed_to_its_principal_never_to
assert json.loads(calls[-1]["env"][TURN_AUTHOR_ENV])["id"] != authors[0]["id"], "a different principal is a different author"
-def test_live_delivery_from_a_logged_in_client_carries_the_principal_author(home, monkeypatch, bound_client):
- """The live Bot Chat path (``prompt.submit``) gets the principal-derived bot author as a ``DeliveryAuthor``."""
- from tools.bot_relay import DeliveryAuthor
-
- submitted = []
- monkeypatch.setitem(
- srv._methods, "prompt.submit",
- lambda rid, p: submitted.append(p) or srv._ok(rid, {"status": "streaming"}))
- monkeypatch.setattr(srv, "_profile_home", lambda name: home / "profiles" / name)
- monkeypatch.setitem(srv._sessions, "live-ops", {
- "profile_home": str(home / "profiles" / "ops"), "pending_title": "Bot Chat", "history": []})
- bound_client.auth_identity = {"user_id": "alice", "provider": "google"}
-
- _result(srv._methods["bot_relay.deliver"](1, {"profile": "ops", "message": "ping", **SENDER}))
-
- assert len(submitted) == 1 and submitted[0]["text"] == "ping"
- author = submitted[0]["_turn_author"]
- assert isinstance(author, DeliveryAuthor)
- assert author.author["is_bot"] is True and author.author["id"].startswith("bot:principal:dashboard:")
- assert author.author != SENDER_AUTHOR
-
-
def test_a_signed_in_ws_ticket_is_a_login_identity_so_the_desktop_is_one(monkeypatch, tmp_path):
"""The root cause, pinned: the Desktop's own credential produces a login identity.