Skip to content

Commit 30a2a40

Browse files
committed
Restore clarify followup test dropped in admin rebase.
1 parent 17c0d51 commit 30a2a40

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

‎application/tests/owasp_agent/owasp_agent_test.py‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -822,6 +822,28 @@ def test_genai_vs_ai_exchange(self) -> None:
822822
self.assertNotIn("do not appear to be commonly recognized", text)
823823
self.assertNotIn("facilitate the sharing, discovery", text)
824824

825+
def test_clarify_followup_uses_history(self) -> None:
826+
history = [
827+
{
828+
"role": "user",
829+
"content": "What does OWASP membership cost in Switzerland?",
830+
},
831+
{
832+
"role": "assistant",
833+
"content": "Answer: Standard individual dues apply in Switzerland.",
834+
},
835+
]
836+
resp = self.router.handle("and in Morocco?", history=history)
837+
self.assertIsNotNone(resp)
838+
assert resp is not None
839+
# Combined context should route as membership, not bare clarify miss.
840+
self.assertIn("owasp_agent", resp)
841+
kind = resp["owasp_agent"]["kind"]
842+
self.assertIn(kind, ("membership", "clarify"))
843+
if kind == "membership":
844+
self.assertIn("morocco", resp["response"].lower())
845+
846+
825847

826848
class TestIndexStoreDefaults(unittest.TestCase):
827849
def test_override_env_wins_over_app_db(self) -> None:

0 commit comments

Comments
 (0)