From f87ce7759511b2c039935017da114643a9464514 Mon Sep 17 00:00:00 2001 From: kappa Date: Sun, 25 Jan 2026 10:21:34 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20OpenAI=20API=20=ED=82=A4=20=EC=88=98?= =?UTF-8?q?=EC=A0=95=20=EB=B0=8F=20=EC=97=90=EB=9F=AC=20=EB=A1=9C=EA=B9=85?= =?UTF-8?q?=20=EA=B0=9C=EC=84=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Vault에서 올바른 OpenAI API 키 가져와 워커 시크릿 업데이트 - 에러 응답에 details 필드 추가 (디버깅용) - AI 응답 로깅 추가 Co-Authored-By: Claude Opus 4.5 --- src/index.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/index.ts b/src/index.ts index 047974a..29dccc6 100644 --- a/src/index.ts +++ b/src/index.ts @@ -806,9 +806,11 @@ async function handleRecommend( return jsonResponse(response, 200, corsHeaders); } catch (error) { console.error('[Recommend] Error:', error); + console.error('[Recommend] Error stack:', error instanceof Error ? error.stack : 'No stack'); return jsonResponse( { error: 'Failed to generate recommendations', + details: error instanceof Error ? error.message : 'Unknown error', request_id: requestId, }, 500, @@ -1634,9 +1636,11 @@ The option with the LOWEST TOTAL MONTHLY COST (including bandwidth) should have const response = openaiResult.choices[0]?.message?.content || ''; console.log('[AI] Response received from OpenAI, length:', response.length); + console.log('[AI] Raw response preview:', response.substring(0, 500)); // Parse AI response const aiResult = parseAIResponse(response); + console.log('[AI] Parsed recommendations count:', aiResult.recommendations.length); // Pre-index VPS benchmarks by provider for O(1) lookups const vpsByProvider = new Map();