From 12d7403a0e2181c17e242472c254b49723ebc62f Mon Sep 17 00:00:00 2001 From: Jeffery Date: Sat, 20 Jun 2026 13:42:25 +0000 Subject: [PATCH] =?UTF-8?q?chore(ai-review=20=E7=8B=80=E6=85=8B):=20?= =?UTF-8?q?=E7=A7=BB=E9=99=A4=E5=B7=B2=E8=A7=A3=E6=B1=BA=E7=9A=84=20OpenCo?= =?UTF-8?q?de=20TLS=20finding?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/ai-review/findings.json | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/.gitea/ai-review/findings.json b/.gitea/ai-review/findings.json index 5f58ec4..fe51488 100644 --- a/.gitea/ai-review/findings.json +++ b/.gitea/ai-review/findings.json @@ -1,9 +1 @@ -[ - { - "level": "warning", - "role": "Mage", - "location": "app/preflight.js:23", - "suggestion": "在 `app/llm.js` 與 `app/preflight.js` 中,`opencodeAxiosOptions` 函數的邏輯存在重複。雖然 `timeout` 參數在兩處有所不同,但處理 `httpsAgent` 的核心邏輯是相同的。建議將 `httpsAgent` 的建立邏輯抽象為一個共用函數或在 `config.js` 中定義,以避免未來修改時造成不一致,並提高程式碼的可維護性。\n\n例如,可以將 `httpsAgent` 的邏輯移至 `config.js`:\n```javascript\n// app/config.js\nexport function getOpenCodeHttpsAgent() {\n return shouldSkipOpenCodeTLSVerify() ? new https.Agent({ rejectUnauthorized: false }) : undefined;\n}\n\n// app/llm.js\nimport { getOpenCodeHttpsAgent } from './config.js';\nfunction opencodeAxiosOptions(headers) {\n return {\n headers,\n httpsAgent: getOpenCodeHttpsAgent(),\n };\n}\n\n// app/preflight.js\nimport { getOpenCodeHttpsAgent } from './config.js';\nconst opencodeAxiosOptions = (headers) => ({\n headers,\n timeout: 30000,\n httpsAgent: getOpenCodeHttpsAgent(),\n});\n```", - "is_new": true - } -] +[]