diff --git a/backend/app/llm/service.py b/backend/app/llm/service.py index adb86b15..b0156c81 100644 --- a/backend/app/llm/service.py +++ b/backend/app/llm/service.py @@ -26,8 +26,7 @@ logger = logging.getLogger(__name__) -MODEL = "openrouter/openai/gpt-oss-120b" -EXTRA_BODY = {"provider": {"order": ["cerebras"]}} +MODEL = "claude-sonnet-4-6" SYSTEM_PROMPT = """You are FinAlly, an AI trading assistant for a simulated trading workstation. @@ -240,8 +239,6 @@ async def chat_with_llm(user_message: str, price_cache: PriceCache) -> dict: model=MODEL, messages=messages, response_format=LlmResponse, - reasoning_effort="low", - extra_body=EXTRA_BODY, ) content = response.choices[0].message.content llm_response = LlmResponse.model_validate_json(content) diff --git a/backend/app/routes/watchlist.py b/backend/app/routes/watchlist.py index 19133357..c0cdd60f 100644 --- a/backend/app/routes/watchlist.py +++ b/backend/app/routes/watchlist.py @@ -16,12 +16,17 @@ class AddTickerRequest(BaseModel): async def list_watchlist(request: Request): """Current watchlist tickers with latest prices from PriceCache.""" cache = request.app.state.price_cache + source = request.app.state.market_source watchlist = await get_watchlist() items = [] for entry in watchlist: ticker = entry["ticker"] update = cache.get(ticker) + # Auto-recover tickers not currently tracked (e.g., added in a previous session) + if update is None: + await source.add_ticker(ticker) + update = cache.get(ticker) items.append({ "ticker": ticker, "price": update.price if update else None, diff --git a/frontend/components/PriceChart.tsx b/frontend/components/PriceChart.tsx index 739b255e..bf9d345f 100644 --- a/frontend/components/PriceChart.tsx +++ b/frontend/components/PriceChart.tsx @@ -18,6 +18,7 @@ export default function PriceChart({ ticker, getHistory }: PriceChartProps) { if (!containerRef.current) return; const chart = createChart(containerRef.current, { + autoSize: true, layout: { background: { color: "#161b22" }, textColor: "#8b949e", @@ -52,16 +53,7 @@ export default function PriceChart({ ticker, getHistory }: PriceChartProps) { chartRef.current = chart; seriesRef.current = series; - const ro = new ResizeObserver((entries) => { - for (const entry of entries) { - const { width, height } = entry.contentRect; - chart.applyOptions({ width, height }); - } - }); - ro.observe(containerRef.current); - return () => { - ro.disconnect(); chart.remove(); chartRef.current = null; seriesRef.current = null; @@ -101,22 +93,21 @@ export default function PriceChart({ ticker, getHistory }: PriceChartProps) { }); }); - if (!ticker) { - return ( -