Harden async task flows and enhance analysis tooling

这个提交包含在:
cryptocommuniums-afk
2026-03-15 08:05:37 +08:00
父节点 585fd5773d
当前提交 cb643ac154
修改 14 个文件,包含 566 行新增33 行删除

查看文件

@@ -1,4 +1,5 @@
import { ENV } from "./env";
import { fetchWithTimeout } from "./fetch";
export type Role = "system" | "user" | "assistant" | "tool" | "function";
@@ -323,13 +324,17 @@ export async function invokeLLM(params: InvokeParams): Promise<InvokeResult> {
payload.response_format = normalizedResponseFormat;
}
const response = await fetch(resolveApiUrl(apiUrl), {
const response = await fetchWithTimeout(resolveApiUrl(apiUrl), {
method: "POST",
headers: {
"content-type": "application/json",
authorization: `Bearer ${apiKey || ENV.llmApiKey}`,
},
body: JSON.stringify(payload),
}, {
timeoutMs: ENV.llmTimeoutMs,
retries: ENV.llmRetryCount,
retryMethods: ["POST"],
});
if (!response.ok) {