osborn 0.9.25 → 0.9.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/config.js +33 -18
- package/package.json +1 -1
package/dist/config.js
CHANGED
|
@@ -649,30 +649,45 @@ export async function listAllClaudeSessions(limit = 100) {
|
|
|
649
649
|
]);
|
|
650
650
|
if (preview.messageCount < 2)
|
|
651
651
|
continue;
|
|
652
|
-
//
|
|
652
|
+
// TWO FIELDS — two distinct purposes. The dashboard uses each for
|
|
653
|
+
// exactly one thing:
|
|
653
654
|
//
|
|
654
|
-
//
|
|
655
|
-
// the
|
|
656
|
-
//
|
|
657
|
-
//
|
|
658
|
-
//
|
|
659
|
-
//
|
|
660
|
-
//
|
|
655
|
+
// `projectPath` ← content cwd from JSONL.
|
|
656
|
+
// What the session ORIGINALLY recorded as its working directory.
|
|
657
|
+
// For native fly sessions that's the same as the slug-derived
|
|
658
|
+
// path. For imported sessions (migrated from sprite, copied from
|
|
659
|
+
// Codespaces, synced from a Mac) it's the source machine's cwd —
|
|
660
|
+
// a path that may not exist on this host. The dashboard groups
|
|
661
|
+
// by this so a user who imported sessions from 4 different
|
|
662
|
+
// places sees 4 project cards, named after where each came from.
|
|
661
663
|
//
|
|
662
|
-
//
|
|
663
|
-
//
|
|
664
|
-
//
|
|
665
|
-
//
|
|
666
|
-
//
|
|
667
|
-
//
|
|
668
|
-
//
|
|
669
|
-
//
|
|
664
|
+
// `cwd` ← slug-derived. File LOCATION on disk.
|
|
665
|
+
// Forwarded to the agent as `workingDirectory` so Claude Code's
|
|
666
|
+
// `--resume` finds the JSONL — Claude Code looks up sessions
|
|
667
|
+
// by slug folder, not by content cwd. Always points at the
|
|
668
|
+
// real on-disk location regardless of what the JSONL records.
|
|
669
|
+
//
|
|
670
|
+
// Why NOT use content cwd for routing too: imported sessions still
|
|
671
|
+
// live in the LOCAL slug after migration. A session whose content
|
|
672
|
+
// cwd is `/workspaces/codespaces-blank` was put in slug `-workspace/`
|
|
673
|
+
// when we synced it onto fly, so `--resume` needs cwd=/workspace to
|
|
674
|
+
// find it. Forwarding the content cwd would send Claude Code to a
|
|
675
|
+
// slug that doesn't exist on this host.
|
|
676
|
+
//
|
|
677
|
+
// Why NOT use slug-derived path for grouping too: that collapses all
|
|
678
|
+
// imported sessions into one "Workspace" card on the dashboard,
|
|
679
|
+
// losing the "this came from Codespaces, that came from sprite"
|
|
680
|
+
// organization the user thinks of when finding old conversations.
|
|
681
|
+
//
|
|
682
|
+
// Each field falls back to the other if its preferred source is
|
|
683
|
+
// empty — slugToPath returns '' for ambiguous slug encodings, and
|
|
684
|
+
// some old JSONL files don't carry a cwd field at all.
|
|
670
685
|
const slugPath = slugToPath(c.slug);
|
|
671
686
|
sessions.push({
|
|
672
687
|
sessionId: c.sessionId,
|
|
673
688
|
projectSlug: c.slug,
|
|
674
|
-
projectPath:
|
|
675
|
-
cwd: slugPath || cwd,
|
|
689
|
+
projectPath: cwd || slugPath, // display / group key (original cwd)
|
|
690
|
+
cwd: slugPath || cwd, // resume routing (file location)
|
|
676
691
|
timestamp: c.mtime,
|
|
677
692
|
lastMessage: preview.lastMessage,
|
|
678
693
|
messageCount: preview.messageCount,
|