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.
Files changed (2) hide show
  1. package/dist/config.js +33 -18
  2. 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
- // SLUG-FIRST for both `cwd` (routing) and `projectPath` (display).
652
+ // TWO FIELDS two distinct purposes. The dashboard uses each for
653
+ // exactly one thing:
653
654
  //
654
- // The workspace root (the agent's cwd, e.g. `/workspace` on fly) is
655
- // the base layer. Projects are subdirectories beneath it — a session
656
- // started in `/workspace/instagram` gets slug `-workspace-instagram`,
657
- // and slugToPath turns that back into `/workspace/instagram`. The
658
- // dashboard groups by this path "instagram" naturally becomes a
659
- // project card. Sessions started at the workspace root collapse into
660
- // one "General" / "Workspace" card.
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
- // Why NOT prefer the content cwd: the JSONL records whatever cwd
663
- // existed when the session was recorded for migrated sessions that
664
- // can be a path that no longer exists on this host (e.g.
665
- // `/workspaces/codespaces-blank` from someone's Codespace). Using
666
- // file LOCATION as the source of truth keeps grouping aligned with
667
- // where the data actually lives and where Claude Code's --resume
668
- // will look. Content cwd is kept as a last-resort fallback for the
669
- // rare case where slugToPath reversal fails.
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: slugPath || cwd,
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,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "osborn",
3
- "version": "0.9.25",
3
+ "version": "0.9.26",
4
4
  "description": "Voice AI coding assistant - local agent that connects to Osborn frontend",
5
5
  "type": "module",
6
6
  "bin": {