feat: harden intelligence runtime and llm providers

This commit is contained in:
2026-05-16 21:18:34 +02:00
parent 7e85a54c32
commit 85f97bb2a6
22 changed files with 732 additions and 201 deletions

View File

@@ -35,13 +35,17 @@ async function fetchQuote(symbol) {
const url = `${BASE}/${encodeURIComponent(symbol)}?range=5d&interval=1d&includePrePost=false`;
const data = await safeFetch(url, {
timeout: 8000,
retries: 2,
source: `YFinance:${symbol}`,
headers: {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36',
'Accept': 'application/json,text/plain,*/*',
},
});
if (data?.error) throw new Error(data.error);
const result = data?.chart?.result?.[0];
if (!result) return null;
if (!result) throw new Error(data?.chart?.error?.description || 'Yahoo response missing chart result');
const meta = result.meta || {};
const quotes = result.indicators?.quote?.[0] || {};