forked from Rockachopa/Timmy-time-dashboard
fix: confirm Qwe backend model with exact phrase
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>
This commit is contained in:
@@ -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()
|
||||
|
||||
|
||||
@@ -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."""
|
||||
|
||||
Reference in New Issue
Block a user