support reasoning agentid by accountId or session for cron (#847)
This commit is contained in:
committed by
GitHub
Unverified
parent
54ec784545
commit
758a8f8c94
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user