diff --git a/tests/test_ai_call_logger.py b/tests/test_ai_call_logger.py index c6b2bc0..193e8d7 100644 --- a/tests/test_ai_call_logger.py +++ b/tests/test_ai_call_logger.py @@ -144,6 +144,17 @@ def test_context_manager_set_error_without_raise(reset_state): assert 'timeout' in rec['error'] +def test_context_manager_marks_rag_hit(reset_state): + captured = reset_state + with log_ai_call('openclaw_qa', 'gcp_ollama', 'qwen3:14b') as ctx: + ctx.set_rag_hit(True) + + assert _wait_for_async(captured, 1) + rec = captured[0] + assert rec['status'] == 'ok' + assert rec['rag_hit'] is True + + # ───────────────────────────────────────────────────────────────────────────── # decorator 測試 # ─────────────────────────────────────────────────────────────────────────────