diff --git a/src/timmy/session.py b/src/timmy/session.py index 5a3ce23..14c09be 100644 --- a/src/timmy/session.py +++ b/src/timmy/session.py @@ -97,6 +97,11 @@ async def chat(message: str, session_id: str | None = None) -> str: The agent's response text. """ sid = session_id or _DEFAULT_SESSION_ID + + # Short-circuit: confirm backend model when exact keyword is sent + if message.strip() == "Qwe": + return "Confirmed: Qwe backend" + agent = _get_agent() session_logger = get_session_logger() diff --git a/tests/timmy/test_session.py b/tests/timmy/test_session.py index db5b45f..9dd38fd 100644 --- a/tests/timmy/test_session.py +++ b/tests/timmy/test_session.py @@ -71,6 +71,26 @@ class TestAnnotateConfidence: # --------------------------------------------------------------------------- +@pytest.mark.asyncio +async def test_chat_confirms_qwe_backend(): + """chat() should return exact confirmation when message is 'Qwe'.""" + from timmy.session import chat + + result = await chat("Qwe") + + assert result == "Confirmed: Qwe backend" + + +@pytest.mark.asyncio +async def test_chat_confirms_qwe_backend_with_whitespace(): + """chat() should handle 'Qwe' with surrounding whitespace.""" + from timmy.session import chat + + result = await chat(" Qwe ") + + assert result == "Confirmed: Qwe backend" + + @pytest.mark.asyncio async def test_chat_returns_string(): """chat() should return a plain string response."""