更新配置和聊天路由,添加会话中止与分叉功能

This commit is contained in:
2026-04-30 13:07:39 +08:00
parent 6f15b5d7e3
commit 76d407a81c
16 changed files with 1228 additions and 121 deletions
+14
View File
@@ -1,6 +1,7 @@
import { randomUUID } from "node:crypto";
import { config } from "../config.js";
import { logger } from "../logger.js";
export type DynamicHttpInput = {
path: string;
@@ -53,11 +54,24 @@ export class DynamicHttpExecutor {
headers.set("x-project-id", context.projectId);
}
const startedAt = Date.now();
const response = await fetch(url, {
method,
headers,
signal: AbortSignal.timeout(config.TJWATER_API_TIMEOUT_MS),
});
const durationMs = Date.now() - startedAt;
logger.info(
{
method,
path,
statusCode: response.status,
durationMs,
traceId: context.traceId,
projectId: context.projectId,
},
"dynamic_http_call completed",
);
const contentType = response.headers.get("content-type") ?? "";
const rawText = await response.text();