refactor(OpenCode TLS): 共用 httpsAgent 建立邏輯

This commit is contained in:
2026-06-20 13:42:25 +00:00
parent c662a2e362
commit babe599977
3 changed files with 10 additions and 5 deletions
+2 -3
View File
@@ -1,6 +1,5 @@
import axios from 'axios';
import https from 'https';
import { getLLMConfig, shouldSkipOpenCodeTLSVerify } from './config.js';
import { getLLMConfig, getOpenCodeHttpsAgent } from './config.js';
import { line, error } from './log.js';
function isOpenAIGpt55(provider, model) {
@@ -50,7 +49,7 @@ function applyOpenCodeAuth(headers) {
function opencodeAxiosOptions(headers) {
return {
headers,
httpsAgent: shouldSkipOpenCodeTLSVerify() ? new https.Agent({ rejectUnauthorized: false }) : undefined,
httpsAgent: getOpenCodeHttpsAgent(),
};
}