mirror of
https://github.com/Xe138/AI-Trader.git
synced 2026-04-15 14:27:25 -04:00
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:
@@ -49,6 +49,9 @@ class ContextInjector:
|
|||||||
"""
|
"""
|
||||||
# Inject context parameters for trade tools
|
# Inject context parameters for trade tools
|
||||||
if request.name in ["buy", "sell"]:
|
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
|
# Add signature and today_date to args if not present
|
||||||
if "signature" not in request.args:
|
if "signature" not in request.args:
|
||||||
request.args["signature"] = self.signature
|
request.args["signature"] = self.signature
|
||||||
|
|||||||
Reference in New Issue
Block a user