mirror of
https://github.com/getpaseo/paseo.git
synced 2026-07-29 12:01:31 +00:00
chore(lint): parallelize Claude persisted agents lookup
Replace sequential parseClaudeSessionDescriptor loop with Promise.all to fix no-await-in-loop warning.
This commit is contained in:
@@ -1193,19 +1193,14 @@ export class ClaudeAgentClient implements AgentClient {
|
||||
}
|
||||
const limit = options?.limit ?? 20;
|
||||
const candidates = await collectRecentClaudeSessions(projectsRoot, limit * 3);
|
||||
const descriptors: PersistedAgentDescriptor[] = [];
|
||||
|
||||
for (const candidate of candidates) {
|
||||
const descriptor = await parseClaudeSessionDescriptor(candidate.path, candidate.mtime);
|
||||
if (descriptor) {
|
||||
descriptors.push(descriptor);
|
||||
}
|
||||
if (descriptors.length >= limit) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return descriptors;
|
||||
const parsed = await Promise.all(
|
||||
candidates.map((candidate) =>
|
||||
parseClaudeSessionDescriptor(candidate.path, candidate.mtime),
|
||||
),
|
||||
);
|
||||
return parsed
|
||||
.filter((descriptor): descriptor is PersistedAgentDescriptor => descriptor !== null)
|
||||
.slice(0, limit);
|
||||
}
|
||||
|
||||
async isAvailable(): Promise<boolean> {
|
||||
|
||||
Reference in New Issue
Block a user