refactor(LLM CLI): 明確化 CLI 參數與驗證輸出

This commit is contained in:
2026-06-29 10:49:22 +00:00
parent 68ce92b0e5
commit 0b59ca6023
3 changed files with 11 additions and 5 deletions
+6 -3
View File
@@ -100,8 +100,11 @@ export async function verifyCommentToken(token = GITEA_COMMENT_TOKEN) {
*
* 確認目前環境可偵測到支援的 CLI,且已解析出 model。實際模型可用性由 CLI
* 在正式呼叫時回報;preflight 不主動送 prompt,避免額外消耗額度。
* @returns {Promise<{ok: true, provider: string}|{ok: false, provider?: string, error: string}>}
* 通過時含 provider;未設定 provider 的失敗分支不含 provider 欄位。
* @returns {Promise<
* {ok: true, provider: string, command: string, model: string} |
* {ok: false, provider?: string, error: string}
* >}
* 通過時含 provider、command 與 model;未設定 provider 的失敗分支不含 provider 欄位。
* @remarks 設定來源為 config.js 的 getLLMConfig()。
*/
export async function verifyLLM() {
@@ -170,7 +173,7 @@ export async function runPreflight(workspace = process.env.GITHUB_WORKSPACE || '
error(`LLM 驗證失敗: ${llm.error}`);
return false;
}
ok(`LLM provider=${llm.provider} CLI 可用`);
ok(`LLM CLI 可用(command=${llm.command}, provider=${llm.provider}, model=${llm.model}`);
result(true, '前置驗證通過');
return true;