mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-12-03 09:53:45 +00:00
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.
This commit is contained in:
parent
166c37bbbe
commit
bae5b14adf
1 changed files with 5 additions and 0 deletions
|
|
@ -451,6 +451,11 @@ def check_protocol_compliance(obj: Any, protocol: Any) -> None:
|
||||||
obj_params.discard("self")
|
obj_params.discard("self")
|
||||||
if not (proto_params <= obj_params):
|
if not (proto_params <= obj_params):
|
||||||
logger.error(f"Method {name} incompatible proto: {proto_params} vs. obj: {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"))
|
missing_methods.append((name, "signature_mismatch"))
|
||||||
else:
|
else:
|
||||||
# Check if the method has a concrete implementation (not just a protocol stub)
|
# Check if the method has a concrete implementation (not just a protocol stub)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue