Skip to content

The agent that grows with you

test: trim salvaged test additions to two invariants each

teknium11f87fea54192
diff --git a/tests/gateway/test_matrix_recovery_key_scope.py b/tests/gateway/test_matrix_recovery_key_scope.py
index 3e7f08f0f97..ce1f4f200cb 100644
--- a/tests/gateway/test_matrix_recovery_key_scope.py
+++ b/tests/gateway/test_matrix_recovery_key_scope.py
@@ -86,11 +86,6 @@ class TestScopedRecoveryKey:
class TestScopedRecoveryKeyOutputPath:
- def test_multiplex_inactive_reads_environ(self, monkeypatch, tmp_path):
- default_path = tmp_path / "default-profile-key.txt"
- monkeypatch.setenv("MATRIX_RECOVERY_KEY_OUTPUT_FILE", str(default_path))
- assert _recovery_key_output_path() == default_path
-
def test_multiplex_active_scoped_uses_scope_not_environ(self, monkeypatch, tmp_path):
"""Secondary profile under multiplex must resolve its own output path.
@@ -110,13 +105,6 @@ class TestScopedRecoveryKeyOutputPath:
finally:
ss.reset_secret_scope(token)
- def test_multiplex_active_unscoped_falls_back_to_environ(self, monkeypatch, tmp_path):
- """Default-profile startup loop under multiplex: unscoped read is fine."""
- default_path = tmp_path / "default-profile-key.txt"
- monkeypatch.setenv("MATRIX_RECOVERY_KEY_OUTPUT_FILE", str(default_path))
- ss.set_multiplex_active(True)
- assert _recovery_key_output_path() == default_path
-
def test_multiplex_active_scoped_missing_key_is_none(self, monkeypatch, tmp_path):
"""A scope without the setting must NOT fall through to another
profile's env — the secondary profile's key silently goes unwritten
@@ -129,7 +117,3 @@ class TestScopedRecoveryKeyOutputPath:
assert _recovery_key_output_path() is None
finally:
ss.reset_secret_scope(token)
-
- def test_unset_returns_none(self, monkeypatch):
- monkeypatch.delenv("MATRIX_RECOVERY_KEY_OUTPUT_FILE", raising=False)
- assert _recovery_key_output_path() is None
diff --git a/tests/gateway/test_telegram_reactions.py b/tests/gateway/test_telegram_reactions.py
index 38d85122930..8c58dbd54a3 100644
--- a/tests/gateway/test_telegram_reactions.py
+++ b/tests/gateway/test_telegram_reactions.py
@@ -66,30 +66,6 @@ def test_explicit_env_wins_over_materialized_yaml_default(monkeypatch):
assert adapter._reactions_enabled() is True
-def test_bridged_yaml_false_without_explicit_env_still_disables(monkeypatch):
- """With no explicit env the YAML→env bridge writes 'false'; reactions stay off."""
- monkeypatch.setenv("TELEGRAM_REACTIONS", "false")
- adapter = _make_adapter()
- adapter.config.extra["reactions"] = False
- assert adapter._reactions_enabled() is False
-
-
-def test_yaml_true_enables_when_env_unset(monkeypatch):
- """An explicit ``reactions: true`` in config.yaml enables reactions without any env var."""
- monkeypatch.delenv("TELEGRAM_REACTIONS", raising=False)
- adapter = _make_adapter()
- adapter.config.extra["reactions"] = True
- assert adapter._reactions_enabled() is True
-
-
-def test_explicit_env_false_wins_over_yaml_true(monkeypatch):
- """An explicit TELEGRAM_REACTIONS=false also wins over a YAML ``reactions: true``."""
- monkeypatch.setenv("TELEGRAM_REACTIONS", "false")
- adapter = _make_adapter()
- adapter.config.extra["reactions"] = True
- assert adapter._reactions_enabled() is False
-
-
def test_scoped_miss_does_not_leak_default_profile_env(monkeypatch):
"""Under multiplex a scoped miss must not read another profile's process-env value (#72348)."""
from agent.secret_scope import reset_secret_scope, set_multiplex_active, set_secret_scope
@@ -106,25 +82,6 @@ def test_scoped_miss_does_not_leak_default_profile_env(monkeypatch):
set_multiplex_active(False)
-def test_scoped_env_hit_wins_over_own_yaml(monkeypatch):
- """A secondary profile's own scoped TELEGRAM_REACTIONS=true beats its YAML ``reactions: false``."""
- from agent.secret_scope import reset_secret_scope, set_multiplex_active, set_secret_scope
-
- monkeypatch.setenv("TELEGRAM_REACTIONS", "false") # default profile's value
- adapter = _make_adapter()
- adapter.config.extra["reactions"] = False
- set_multiplex_active(True)
- token = set_secret_scope({"TELEGRAM_BOT_TOKEN": "222:b2", "TELEGRAM_REACTIONS": "true"})
- try:
- assert adapter._reactions_enabled() is True
- finally:
- reset_secret_scope(token)
- set_multiplex_active(False)
-
-
-# ── _set_reaction ────────────────────────────────────────────────────
-
-
@pytest.mark.asyncio
async def test_set_reaction_calls_bot_api(monkeypatch):
"""_set_reaction should call bot.set_message_reaction with correct args."""
@@ -221,5 +178,3 @@ def test_config_bridges_telegram_reactions(monkeypatch, tmp_path):
import os
assert os.getenv("TELEGRAM_REACTIONS") == "true"
-
-