support reasoning agentid by accountId or session for cron (#847)

This commit is contained in:
Tao Yiping
2026-04-14 14:52:47 +08:00
committed by GitHub
Unverified
parent 54ec784545
commit 758a8f8c94
9 changed files with 276 additions and 389 deletions

View File

@@ -1,4 +1,5 @@
import { readFile, readdir } from 'node:fs/promises';
import { extractSessionRecords } from '../../utils/session-util';
import type { IncomingMessage, ServerResponse } from 'http';
import { join } from 'node:path';
import {
@@ -679,16 +680,6 @@ function inferTargetKindFromValue(
return 'user';
}
function extractSessionRecords(store: JsonRecord): JsonRecord[] {
const directEntries = Object.entries(store)
.filter(([key, value]) => key !== 'sessions' && value && typeof value === 'object')
.map(([, value]) => value as JsonRecord);
const arrayEntries = Array.isArray(store.sessions)
? store.sessions.filter((entry): entry is JsonRecord => Boolean(entry && typeof entry === 'object'))
: [];
return [...directEntries, ...arrayEntries];
}
function buildChannelTargetCacheKey(params: {
channelType: string;
accountId?: string;