Skip to content

Commit 038be3a

Browse files
committed
fix(qwen): dedupe slug variant root paths on case-insensitive filesystems
On macOS (case-insensitive HFS+), two slug variants differing only in case resolve to the same projects directory, causing session files to be read twice and inflating responseCount. Use realpathSync.native to dedupe resolved root paths before walking.
1 parent 93af416 commit 038be3a

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

  • scripts/session-analysis/platforms

scripts/session-analysis/platforms/qwen.mjs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/usr/bin/env node
22

3+
import { realpathSync } from "node:fs";
34
import path from "node:path";
45
import { fileURLToPath } from "node:url";
56

@@ -315,8 +316,13 @@ export class QwenSessionAnalyzer extends SessionAnalyzer {
315316
async discoverSessions(scope, roots) {
316317
const sessions = new Map();
317318
const transcriptRoot = roots.find((root) => root.kind === "qwen-project-jsonl");
319+
const seenRoots = new Set();
318320
for (const rootPath of transcriptRoot?.paths ?? []) {
319321
if (!await pathExists(rootPath)) continue;
322+
let realRoot;
323+
try { realRoot = realpathSync.native(rootPath); } catch { realRoot = path.resolve(rootPath); }
324+
if (seenRoots.has(realRoot)) continue;
325+
seenRoots.add(realRoot);
320326
const files = await walkFiles(rootPath, { maxDepth: 2, limit: 20_000, match: (file) => file.endsWith(".jsonl") });
321327
for (const filePath of files) {
322328
const probe = await probeTranscript(filePath, scope.workspace);

0 commit comments

Comments
 (0)