osborn 0.9.23 → 0.9.24
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 +22 -2
- package/package.json +1 -1
package/dist/config.js
CHANGED
|
@@ -649,11 +649,31 @@ export async function listAllClaudeSessions(limit = 100) {
|
|
|
649
649
|
]);
|
|
650
650
|
if (preview.messageCount < 2)
|
|
651
651
|
continue;
|
|
652
|
+
// SLUG-FIRST: prefer the slug-derived path over the content cwd.
|
|
653
|
+
//
|
|
654
|
+
// Claude Code's `--resume <id>` looks up sessions by file LOCATION
|
|
655
|
+
// (slug folder under ~/.claude/projects/), not by the cwd field inside
|
|
656
|
+
// the JSONL. The JSONL content cwd is immutable historical metadata —
|
|
657
|
+
// it's where the session was ORIGINALLY recorded (e.g. sprite path
|
|
658
|
+
// /home/sprite/workspace or /workspaces/codespaces-blank). On migration
|
|
659
|
+
// (sprite → fly), files were finalized into a new slug but their
|
|
660
|
+
// content still records the original cwd.
|
|
661
|
+
//
|
|
662
|
+
// The dashboard forwards this field as `workingDirectory` to the
|
|
663
|
+
// agent, which uses it as Claude Code's spawn cwd. If it doesn't
|
|
664
|
+
// match the slug, the spawn lands in the wrong folder and resume
|
|
665
|
+
// errors with "No conversation found". The slug is the source of
|
|
666
|
+
// truth for where the file lives on disk; use it.
|
|
667
|
+
//
|
|
668
|
+
// Content cwd is kept as a last-resort fallback only when slug
|
|
669
|
+
// reversal fails (slugToPath validates with existsSync and returns
|
|
670
|
+
// '' on ambiguous encodings like dir names containing literal '-').
|
|
671
|
+
const slugPath = slugToPath(c.slug);
|
|
652
672
|
sessions.push({
|
|
653
673
|
sessionId: c.sessionId,
|
|
654
674
|
projectSlug: c.slug,
|
|
655
|
-
projectPath:
|
|
656
|
-
cwd:
|
|
675
|
+
projectPath: slugPath || cwd,
|
|
676
|
+
cwd: slugPath || cwd,
|
|
657
677
|
timestamp: c.mtime,
|
|
658
678
|
lastMessage: preview.lastMessage,
|
|
659
679
|
messageCount: preview.messageCount,
|