feat(admin): Agent 并发 - 后台可调同时对话上限并展示 Agent 服务状态

新增运行策略 agentMaxSessions(默认 30,范围 1-64),保存后同时下发到内嵌进程闸门与独立 yingce-agent 的 /v1/limit,降低上限不会中断已开始的对话。系统性能页展示 Agent 服务健康、进行中/排队数量,并可直接修改上限。
This commit is contained in:
ddcat666
2026-09-30 03:37:54 +08:00
parent b59317415d
commit 0ac61434df
17 changed files with 408 additions and 29 deletions

View File

@@ -350,6 +350,8 @@ export type RuntimeTaskPolicy = {
agentStepMaxOutputTokens: number;
/** 画布 Agent 单步模型调用的秒级墙钟;0 表示沿用文本任务超时。 */
agentStepTimeoutSeconds: number;
/** 同时进行中的画布 Agent 轮次上限。审批等待不占用名额。 */
agentMaxSessions: number;
};
export type RuntimeRequestPolicy = {

View File

@@ -105,9 +105,23 @@ export type SystemPerformance = {
cacheGroups: SystemPerformanceCacheGroup[];
statusMessage?: string;
};
agents: SystemPerformanceAgent[];
build: { version: string; commit: string; buildTime: string; goVersion: string };
};
export type SystemPerformanceAgent = {
id: string;
name: string;
mode: "remote" | "embedded";
endpoint: string;
healthy: boolean;
active: number;
limit: number;
queued: number;
configuredLimit: number;
statusMessage?: string;
};
export type RuntimeCacheClearResult = {
scope: "runtime";
deletedKeys: number;
@@ -120,6 +134,10 @@ export function getSystemPerformance(signal?: AbortSignal) {
return http.get<SystemPerformance>("/admin/system-performance", { signal });
}
export function updateAgentSessionLimit(maxSessions: number) {
return http.put<SystemPerformanceAgent>("/admin/system-performance/agent-limit", { maxSessions });
}
export function clearRuntimeCache() {
return http.post<RuntimeCacheClearResult>("/admin/system-performance/cache/clear", { scope: "runtime" });
}