From 0af92098f281ce3ca164d6e188bf91edc4822624 Mon Sep 17 00:00:00 2001 From: kshitijk4poor <82637225+kshitijk4poor@users.noreply.github.com> Date: Sat, 5 Sep 2026 15:15:52 +0530 Subject: [PATCH] test(agent): split the Kimi lookalike-host case into its own test --- tests/run_agent/test_fallback_api_mode_preservation.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/run_agent/test_fallback_api_mode_preservation.py b/tests/run_agent/test_fallback_api_mode_preservation.py index 3177840614..05ad206bcd 100644 --- a/tests/run_agent/test_fallback_api_mode_preservation.py +++ b/tests/run_agent/test_fallback_api_mode_preservation.py @@ -161,7 +161,7 @@ class TestOriginalUrlDetection: def test_kimi_coding_hint_uses_the_messages_wire(self): """api.kimi.com/coding serves Anthropic Messages only; the fallback must not POST - /chat/completions there (404, #77256). A lookalike host stays on chat_completions.""" + /chat/completions there (404, #77256).""" fbs = [{"provider": "kimi-coding", "model": "kimi-for-coding", "base_url": "https://api.kimi.com/coding/v1", "api_key": "k"}] agent = _make_agent(fallback_model=fbs) @@ -169,6 +169,7 @@ class TestOriginalUrlDetection: assert agent.api_mode == "anthropic_messages" assert mock_rpc.call_args.kwargs["api_mode"] == "anthropic_messages" + def test_kimi_lookalike_host_stays_chat_completions(self): lookalike = "https://api.kimi.com.attacker.test/coding/v1" agent = _make_agent(fallback_model=[{"provider": "custom", "model": "m", "base_url": lookalike, "api_key": "k"}]) _activate(agent, lookalike, "m")