debug: add self attribute logging to ContextInjector.__call__

Log ContextInjector instance ID and attribute values at entry to __call__()
to diagnose why attributes appear as None during tool invocation despite
being set correctly during set_context().

This will reveal whether:
- Multiple ContextInjector instances exist
- Attributes are being overwritten/cleared
- Wrong instance is being invoked
This commit is contained in:
2025-11-02 23:17:52 -05:00
parent 1c19eea29a
commit 618943b278

View File

@@ -49,6 +49,9 @@ class ContextInjector:
"""
# Inject context parameters for trade tools
if request.name in ["buy", "sell"]:
# Debug: Log self attributes BEFORE injection
print(f"[ContextInjector.__call__] ENTRY: id={id(self)}, self.signature={self.signature}, self.today_date={self.today_date}, self.job_id={self.job_id}, self.session_id={self.session_id}")
# Add signature and today_date to args if not present
if "signature" not in request.args:
request.args["signature"] = self.signature