fix(coding-agent/session): switched session listing to async glob scanning

- Updated SessionManager.listAll to retrieve session files with Bun.Glob.scan instead of scanSync.
- Awaited the async glob scan results via Array.fromAsync before collecting session metadata.
This commit is contained in:
can1357
2026-04-24 13:50:34 +02:00
parent e4ee83000c
commit caef52f5e2
@@ -2771,7 +2771,7 @@ export class SessionManager {
static async listAll(storage: SessionStorage = new FileSessionStorage()): Promise<SessionInfo[]> {
const sessionsRoot = path.join(getDefaultAgentDir(), "sessions");
try {
const files = Array.from(new Bun.Glob("**/*.jsonl").scanSync(sessionsRoot)).map(name =>
const files = await Array.fromAsync(new Bun.Glob("*/*.jsonl").scan(sessionsRoot), name =>
path.join(sessionsRoot, name),
);
return await collectSessionsFromFiles(files, storage);