From bae5b14adfd5a44b3f78c3d8fcc00dee7262c17e Mon Sep 17 00:00:00 2001 From: Omar Abdelwahab Date: Wed, 12 Nov 2025 16:01:13 -0800 Subject: [PATCH] debug: Add detailed logging for signature mismatch errors Adding comprehensive debug logging to understand what's causing the persistent signature mismatch errors in CI. The logging will show: - Provider class name and module - Both protocol and object signatures - The actual method object - The method's source module This will help us identify if the issue is: 1. A cached module being loaded 2. A parent class overriding the method 3. Some other source of the wrong signature Once we see the debug output, we can pinpoint the exact root cause. --- src/llama_stack/core/resolver.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/llama_stack/core/resolver.py b/src/llama_stack/core/resolver.py index 8bf371fed..625c7a771 100644 --- a/src/llama_stack/core/resolver.py +++ b/src/llama_stack/core/resolver.py @@ -451,6 +451,11 @@ def check_protocol_compliance(obj: Any, protocol: Any) -> None: obj_params.discard("self") if not (proto_params <= obj_params): logger.error(f"Method {name} incompatible proto: {proto_params} vs. obj: {obj_params}") + logger.error(f"Provider: {obj.__class__.__name__} from module {obj.__class__.__module__}") + logger.error(f"Protocol signature: {proto_sig}") + logger.error(f"Object signature: {obj_sig}") + logger.error(f"Object method: {obj_method}") + logger.error(f"Object method's module: {inspect.getmodule(obj_method)}") missing_methods.append((name, "signature_mismatch")) else: # Check if the method has a concrete implementation (not just a protocol stub)