"Vibe-Trading: Your Personal Trading Agent"
Python ai-agentalgorithmic-tradingbacktestingfintechllmmcpmulti-agentpythonquantitative-financetrading
Add diagnostic logging for grounding-gate blocks and market-data sources
Will Liao58d03e175490
diff --git a/agent/src/agent/loop.py b/agent/src/agent/loop.pyindex 6c856e813..75fe01aa0 100644--- a/agent/src/agent/loop.py+++ b/agent/src/agent/loop.py@@ -1272,6 +1272,20 @@ class AgentLoop:batch_identity_status=batch_identity_status,)if not authorization.allowed:+ logger.warning(+ "grounding gate BLOCKED %s (iter=%s call_id=%s): error_code=%s "+ "requested=%s batch_status=%s locked_status=%s locked_symbols=%s "+ "reason=%s",+ tc.name,+ iteration,+ tc.id,+ authorization.error_code,+ sorted(authorization.symbols),+ batch_identity_status,+ self._grounding.identity_status,+ sorted(self._grounding.authorized_symbols),+ authorization.message,+ )execution_plan.append((tc,diff --git a/agent/src/market_data.py b/agent/src/market_data.pyindex 6f84d49f0..09eab7d34 100644--- a/agent/src/market_data.py+++ b/agent/src/market_data.py@@ -210,6 +210,14 @@ def fetch_market_data("fallback_used": bool(used_source and used_source != src),"currency_conversion": "none",}+ if data_map:+ logger.info(+ "market-data resolved symbols=%s via source=%r (detected=%r fallback=%s)",+ sorted(data_map),+ used_source or src,+ src,+ bool(used_source and used_source != src),+ )unresolved = [codediff --git a/agent/src/tools/market_data_tool.py b/agent/src/tools/market_data_tool.pyindex 72fd7abd5..b77c7e7c9 100644--- a/agent/src/tools/market_data_tool.py+++ b/agent/src/tools/market_data_tool.py@@ -2,11 +2,14 @@from __future__ import annotations+import loggingfrom typing import Anyfrom src.agent.tools import BaseToolfrom src.market_data import DEFAULT_MAX_ROWS, fetch_market_data_json+logger = logging.getLogger(__name__)+class MarketDataTool(BaseTool):"""Fetch normalized OHLCV data through repository loaders."""@@ -88,6 +91,15 @@ class MarketDataTool(BaseTool):repeatable = Truedef execute(self, **kwargs: Any) -> str:+ logger.info(+ "get_market_data call: codes=%s start=%s end=%s source=%s interval=%s max_rows=%s",+ kwargs["codes"],+ kwargs["start_date"],+ kwargs["end_date"],+ kwargs.get("source", "auto"),+ kwargs.get("interval", "1D"),+ kwargs.get("max_rows", DEFAULT_MAX_ROWS),+ )return fetch_market_data_json(codes=kwargs["codes"],start_date=kwargs["start_date"],