feat: add agent run queue controls

This commit is contained in:
John
2026-07-02 07:52:07 +08:00
parent 8e5094fcd9
commit 3ea973968e
9 changed files with 387 additions and 66 deletions
+13
View File
@@ -572,6 +572,8 @@ async function bootstrapUserAuth() {
pool,
userAuth,
tkmindProxy,
maxConcurrentRuns: Number(process.env.MEMIND_AGENT_RUN_QUEUE_CONCURRENCY ?? 1),
runTimeoutMs: Number(process.env.MEMIND_AGENT_RUN_TIMEOUT_MS ?? 15 * 60 * 1000),
});
wechatMpService = createWechatMpService({
config: WECHAT_MP_CONFIG,
@@ -1781,6 +1783,17 @@ api.get('/runtime/status', async (_req, res) => {
}
try {
const status = await tkmindProxy.getRuntimeStatus();
const toolQueue = agentRunGateway?.getQueueStatus
? await agentRunGateway.getQueueStatus().catch((err) => ({
error: err instanceof Error ? err.message : String(err),
}))
: null;
if (toolQueue) {
status.toolRuntime = {
...(status.toolRuntime ?? {}),
queue: toolQueue,
};
}
return res.json({
ok: true,
timestamp: new Date().toISOString(),