You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Component:quantcore-stock-price MCP wrapper → quantcore-api → RecommendationsService Environment: Prod (quantcore-prod-20260606) — reproduced 2026-06-18 with symbol=AVGO Severity: High — the flagship "one-shot recommendation" tool is currently unusable; it returns Upstream request timed out on every call.
Symptom
get_trade_recommendation(AVGO) fails with Upstream request timed out on every attempt (4/4 retries). Connectivity and auth are healthy — get_stock_price(AVGO) and mcp_health_check on the same prod stack return immediately, so the token (QUANTCORE_MCP_TOKEN) is valid and the wrappers are reachable.
Root cause
The failure is not a single hung dependency. Every sub-analysis the tool aggregates was tested individually against AVGO on prod and all succeeded:
The aggregator runs all of these sequentially within a single request, and several are independently slow due to multiple yfinance round-trips:
get_unusual_calls and get_delta_adjusted_oi each scan 3 option expirations.
get_stop_loss_analysis alone runs 7 nested sub-analyses (price/BB, VWAP, MACD, RSI, delta-adjusted OI / gamma wall, historical drawdown, short interest).
Summed serially, total wall-clock exceeds the upstream/Cloud Run request timeout (~60s) and the gateway kills the request before it returns.
Proposed fixes (most durable first)
Parallelize the fan-out in RecommendationsService (e.g. asyncio.gather or a thread pool) so sub-analyses run concurrently. Wall-clock drops to ~the slowest single call instead of the sum.
Cache/share the OHLCV download. Many sub-tools each re-fetch the same price history from yfinance. Fetch once, pass the DataFrame down — removes most redundant latency.
get_news_sentiment(AVGO) returns INSUFFICIENT_DATA (0 stored articles), so the recommendation's sentiment leg would be empty even once the timeout is fixed. News likely needs collect_news(AVGO) run first / a backfill job. Worth a separate ticket.
Acceptance criteria
get_trade_recommendation returns a full recommendation for a liquid symbol (e.g. AVGO) within the gateway timeout.
Component:
quantcore-stock-priceMCP wrapper →quantcore-api→RecommendationsServiceEnvironment: Prod (
quantcore-prod-20260606) — reproduced 2026-06-18 withsymbol=AVGOSeverity: High — the flagship "one-shot recommendation" tool is currently unusable; it returns
Upstream request timed outon every call.Symptom
get_trade_recommendation(AVGO)fails withUpstream request timed outon every attempt (4/4 retries). Connectivity and auth are healthy —get_stock_price(AVGO)andmcp_health_checkon the same prod stack return immediately, so the token (QUANTCORE_MCP_TOKEN) is valid and the wrappers are reachable.Root cause
The failure is not a single hung dependency. Every sub-analysis the tool aggregates was tested individually against AVGO on prod and all succeeded:
get_stock_price,get_rsi,get_macd,get_stochastic,get_volume_analysis,get_candlestick_patterns,get_unusual_calls,get_delta_adjusted_oi,get_dark_pool,get_short_interest,get_bid_ask_spread,get_news_sentiment,get_stop_loss_analysis.The aggregator runs all of these sequentially within a single request, and several are independently slow due to multiple yfinance round-trips:
get_unusual_callsandget_delta_adjusted_oieach scan 3 option expirations.get_stop_loss_analysisalone runs 7 nested sub-analyses (price/BB, VWAP, MACD, RSI, delta-adjusted OI / gamma wall, historical drawdown, short interest).Summed serially, total wall-clock exceeds the upstream/Cloud Run request timeout (~60s) and the gateway kills the request before it returns.
Proposed fixes (most durable first)
RecommendationsService(e.g.asyncio.gatheror a thread pool) so sub-analyses run concurrently. Wall-clock drops to ~the slowest single call instead of the sum.--timeout=300) as a stopgap only; Build Alert System #1+added alert system #2 are the real fix.Side-finding (separate, lower priority)
get_news_sentiment(AVGO)returnsINSUFFICIENT_DATA(0 stored articles), so the recommendation's sentiment leg would be empty even once the timeout is fixed. News likely needscollect_news(AVGO)run first / a backfill job. Worth a separate ticket.Acceptance criteria
get_trade_recommendationreturns a full recommendation for a liquid symbol (e.g. AVGO) within the gateway timeout.🤖 Generated with Claude Code