|
| 1 | +"""Tests for Arcee Trinity Large Thinking per-model overrides. |
| 2 | +
|
| 3 | +Arcee Trinity Large Thinking is a reasoning model that wants: |
| 4 | +- Fixed temperature=0.5 (vs the global default) |
| 5 | +- Compression threshold=0.75 (delay compression to preserve reasoning context) |
| 6 | +
|
| 7 | +The helpers must match the bare model name, including when it arrives via |
| 8 | +OpenRouter as ``arcee-ai/trinity-large-thinking``, but must NOT hit sibling |
| 9 | +Arcee models like trinity-large-preview or trinity-mini. |
| 10 | +""" |
| 11 | + |
| 12 | +from __future__ import annotations |
| 13 | + |
| 14 | +import pytest |
| 15 | + |
| 16 | +from agent.auxiliary_client import ( |
| 17 | + _compression_threshold_for_model, |
| 18 | + _fixed_temperature_for_model, |
| 19 | + _is_arcee_trinity_thinking, |
| 20 | +) |
| 21 | + |
| 22 | + |
| 23 | +@pytest.mark.parametrize( |
| 24 | + "model", |
| 25 | + [ |
| 26 | + "trinity-large-thinking", |
| 27 | + "arcee-ai/trinity-large-thinking", |
| 28 | + "Arcee-AI/Trinity-Large-Thinking", # case-insensitive |
| 29 | + " trinity-large-thinking ", # whitespace tolerant |
| 30 | + ], |
| 31 | +) |
| 32 | +def test_is_arcee_trinity_thinking_matches(model: str) -> None: |
| 33 | + assert _is_arcee_trinity_thinking(model) is True |
| 34 | + |
| 35 | + |
| 36 | +@pytest.mark.parametrize( |
| 37 | + "model", |
| 38 | + [ |
| 39 | + None, |
| 40 | + "", |
| 41 | + "trinity-large-preview", |
| 42 | + "arcee-ai/trinity-large-preview:free", |
| 43 | + "trinity-mini", |
| 44 | + "arcee-ai/trinity-mini", |
| 45 | + "trinity-large", # prefix-only must not match |
| 46 | + "claude-sonnet-4.6", |
| 47 | + "gpt-5.4", |
| 48 | + ], |
| 49 | +) |
| 50 | +def test_is_arcee_trinity_thinking_rejects_non_matches(model) -> None: |
| 51 | + assert _is_arcee_trinity_thinking(model) is False |
| 52 | + |
| 53 | + |
| 54 | +def test_fixed_temperature_for_trinity_thinking() -> None: |
| 55 | + assert _fixed_temperature_for_model("trinity-large-thinking") == 0.5 |
| 56 | + assert _fixed_temperature_for_model("arcee-ai/trinity-large-thinking") == 0.5 |
| 57 | + |
| 58 | + |
| 59 | +def test_fixed_temperature_sibling_arcee_models_unaffected() -> None: |
| 60 | + # Preview and mini do not pin temperature — caller chooses its default. |
| 61 | + assert _fixed_temperature_for_model("trinity-large-preview") is None |
| 62 | + assert _fixed_temperature_for_model("trinity-mini") is None |
| 63 | + |
| 64 | + |
| 65 | +def test_compression_threshold_for_trinity_thinking() -> None: |
| 66 | + assert _compression_threshold_for_model("trinity-large-thinking") == 0.75 |
| 67 | + assert _compression_threshold_for_model("arcee-ai/trinity-large-thinking") == 0.75 |
| 68 | + |
| 69 | + |
| 70 | +def test_compression_threshold_default_none_for_other_models() -> None: |
| 71 | + # None means "leave the user's config value unchanged". |
| 72 | + assert _compression_threshold_for_model(None) is None |
| 73 | + assert _compression_threshold_for_model("") is None |
| 74 | + assert _compression_threshold_for_model("trinity-large-preview") is None |
| 75 | + assert _compression_threshold_for_model("claude-sonnet-4.6") is None |
| 76 | + assert _compression_threshold_for_model("kimi-k2") is None |
0 commit comments