Skip to content

The agent that grows with you

test(e2e): tighten platform contract (file disabled_toolsets, batched mention leak, KNOWN #121325/#121326)

teknium1c1b98bc46cb6
diff --git a/tests/e2e/core/platforms/_contract.py b/tests/e2e/core/platforms/_contract.py
index f898bce320a..b75b232f122 100644
--- a/tests/e2e/core/platforms/_contract.py
+++ b/tests/e2e/core/platforms/_contract.py
@@ -104,6 +104,11 @@ def group_obeys_require_mention(rig: Rig, tag: str) -> None:
wait_reply(rig, inbound.chat_id, f"A-{loud}")
barrier(rig, f"gb-{tag}", group=True)
assert turns(rig, quiet) == 0, f"unmentioned group message started a model turn\n{rig.ctx()}"
+ # Rapid messages may be batched into one turn: the quiet text must not ride along in any prompt.
+ leaked = [t for t, reqs in rig.director.requests.items()
+ if any(f"[in:{quiet}]" in str(m.get("content")) for r in reqs for m in r.get("messages", [])
+ if m.get("role") == "user")]
+ assert not leaked, f"unmentioned group message reached the model inside turn(s) {leaked}\n{rig.ctx()}"
assert not copies(rig.drv.visible(inbound.chat_id), f"A-{quiet}"), "unmentioned message was answered"
assert len(complete(rig.drv.visible(inbound.chat_id), f"A-{loud}")) == 1, rig.ctx()
@@ -258,11 +263,11 @@ def platform_toolsets_are_honored(rig: Rig, tag: str) -> None:
def disabled_toolsets_are_honored(rig: Rig, tag: str) -> None:
- """``agent.disabled_toolsets: [web]``: web tools gone, the rest of the platform preset kept."""
+ """``agent.disabled_toolsets: [file]``: the file tools gone, the rest of the platform preset kept."""
names = _offered_tools(rig, tag)
assert "terminal" in names, f"control: the platform preset lost terminal: {sorted(names)}"
- web = sorted(n for n in names if n.startswith("web_"))
- assert not web, f"disabled toolset 'web' still offered: {web}"
+ leaked = sorted(names & {"read_file", "write_file", "patch", "search_files"})
+ assert not leaked, f"disabled toolset 'file' still offered: {leaked}"
def merge(a: Dict[str, Any], b: Dict[str, Any]) -> Dict[str, Any]:
diff --git a/tests/e2e/core/platforms/_suite.py b/tests/e2e/core/platforms/_suite.py
index 8ecd78ddd14..df2c956ff38 100644
--- a/tests/e2e/core/platforms/_suite.py
+++ b/tests/e2e/core/platforms/_suite.py
@@ -3,7 +3,7 @@
A test module declares ``KNOWN`` (scenario -> "#<issue> <symptom>") and gets:
* two module-scoped rigs: ``rig`` (the adapter's default delivery config, ``agent.disabled_toolsets:
- [web]``, supervisor-owned so ``/restart`` exits 75) and ``rig_stream`` (edit-streaming on,
+ [file]``, supervisor-owned so ``/restart`` exits 75) and ``rig_stream`` (edit-streaming on,
``platform_toolsets.<platform>: [file]``);
* one parametrized ``test_contract`` over every scenario, KNOWN ones as ``xfail(strict=True)`` so
a fix turns them red until the entry is removed.
@@ -105,7 +105,7 @@ def rig_fixtures(driver_cls: type) -> Tuple[Any, Any]:
@pytest.fixture(scope="module")
def rig(tmp_path_factory: pytest.TempPathFactory):
- r = _make(tmp_path_factory, "a", {"agent": {"disabled_toolsets": ["web"]}},
+ r = _make(tmp_path_factory, "a", {"agent": {"disabled_toolsets": ["file"]}},
{"HERMES_GATEWAY_EXTERNAL_SUPERVISOR": "1"})
yield r
_teardown(r)
diff --git a/tests/fakes/platforms/discord_standin.py b/tests/fakes/platforms/discord_standin.py
index 0e72effc67b..5482013023c 100644
--- a/tests/fakes/platforms/discord_standin.py
+++ b/tests/fakes/platforms/discord_standin.py
@@ -696,4 +696,3 @@ class DiscordStandin(StandinServer):
for comp in row.get("components") or []:
out.append({**comp, "message_id": vis.message_id})
return out
-