mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-27 04:47:03 -06:00
perf(sessions): build batch targets in place
This commit is contained in:
@@ -92,11 +92,16 @@ export async function executeSessionsPatchMany(params: {
|
||||
throw new ToolAuthorizationError(`Session changed after access was granted: ${sessionKey}`);
|
||||
}
|
||||
const expectedSessionId = requestedSessionId ?? resolved.expectedSessionId;
|
||||
return {
|
||||
const target: { key: string; agentId?: string; expectedSessionId?: string } = {
|
||||
key: resolved.key,
|
||||
...(!parseAgentSessionKey(resolved.key) ? { agentId: resolved.agentId } : {}),
|
||||
...(expectedSessionId ? { expectedSessionId } : {}),
|
||||
};
|
||||
if (!parseAgentSessionKey(resolved.key)) {
|
||||
target.agentId = resolved.agentId;
|
||||
}
|
||||
if (expectedSessionId) {
|
||||
target.expectedSessionId = expectedSessionId;
|
||||
}
|
||||
return target;
|
||||
}),
|
||||
);
|
||||
const result = await params.callGateway<SessionsPatchManyResult>({
|
||||
|
||||
Reference in New Issue
Block a user