fix: consensus now advertises a short list of models to avoid the CLI getting the names wrong

This commit is contained in:
Fahad
2025-10-03 22:41:28 +04:00
parent 9780c8ef02
commit 8759edc817
4 changed files with 254 additions and 2 deletions

View File

@@ -0,0 +1,24 @@
"""Schema-related tests for ConsensusTool."""
from types import MethodType
from tools.consensus import ConsensusTool
def test_consensus_models_field_includes_available_models(monkeypatch):
"""Consensus schema should surface available model guidance like single-model tools."""
tool = ConsensusTool()
monkeypatch.setattr(
tool,
"_get_ranked_model_summaries",
MethodType(lambda self, limit=5: (["gemini-2.5-pro (score 100, 1.0M ctx, thinking)"], 1, False), tool),
)
monkeypatch.setattr(tool, "_get_restriction_note", MethodType(lambda self: None, tool))
schema = tool.get_input_schema()
models_field_description = schema["properties"]["models"]["description"]
assert "listmodels" in models_field_description
assert "Top models" in models_field_description