Compare commits

...

1 Commits

Author SHA1 Message Date
kimi
710f36e768 fix: confirm Qwe backend model with exact phrase
All checks were successful
Tests / lint (pull_request) Successful in 3s
Tests / test (pull_request) Successful in 1m4s
When the user sends exactly "Qwe", short-circuit the chat handler
to return "Confirmed: Qwe backend" instead of routing to the LLM.

Fixes #500

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-19 19:07:06 -04:00
2 changed files with 25 additions and 0 deletions

View File

@@ -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()

View File

@@ -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."""