From 0261000f2a4ddd545afbfb7d9f4b9ad576d0426a Mon Sep 17 00:00:00 2001 From: Swapna Lekkala Date: Thu, 16 Oct 2025 14:51:17 -0700 Subject: [PATCH] fix: Add logs for recordings debug --- llama_stack/testing/api_recorder.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/llama_stack/testing/api_recorder.py b/llama_stack/testing/api_recorder.py index d3830d035..4f5ed8ff0 100644 --- a/llama_stack/testing/api_recorder.py +++ b/llama_stack/testing/api_recorder.py @@ -448,7 +448,15 @@ class ResponseStorage: if fallback_path.exists(): return _recording_from_file(fallback_path) - logger.info(f"find_recording: Recording not found in either location for hash: {request_hash}") + # NEW: Recursive search within base_dir if exact paths fail + logger.info(f"find_recording: Exact paths failed, searching recursively in {self.base_dir}") + + # Search for the file recursively within base_dir + for found_path in Path(self.base_dir).rglob(response_file): + logger.info(f"find_recording: Found recording at: {found_path}") + return _recording_from_file(found_path) + + logger.info(f"find_recording: Recording not found anywhere for hash: {request_hash}") return None def _model_list_responses(self, request_hash: str) -> list[dict[str, Any]]: