فهرست منبع

fix(core): relativize instruction description to project root

Dax Raad 1 ماه پیش
والد
کامیت
50a1fe49bc
1فایلهای تغییر یافته به همراه4 افزوده شده و 3 حذف شده
  1. 4 3
      packages/core/src/session/instructions.ts

+ 4 - 3
packages/core/src/session/instructions.ts

@@ -33,8 +33,9 @@ const layer = Layer.effect(
     const store = yield* SessionStore.Service
     const location = yield* Location.Service
     // Resolved once for the Location layer; the synthetic text and dedup ledger keep
-    // absolute paths, but the human-facing description shows paths relative to this root.
-    const root = FSUtil.resolve(location.directory)
+    // absolute paths, but the human-facing description shows paths relative to the project
+    // root so opening a subdirectory still describes paths from the project root.
+    const root = FSUtil.resolve(location.project.directory)
     // Same-turn parallel reads settle concurrently, so an in-memory claim guards each
     // Session/path pair before any filesystem work. The durable history check below covers
     // paths injected in earlier turns after this Location layer was reopened.
@@ -100,7 +101,7 @@ function previouslyInjected(store: SessionStore.Interface, sessionID: SessionSch
   })
 }
 
-// Paths are normally discovered under the Location root, so the description shows them
+// Paths are normally discovered under the project root, so the description shows them
 // relative to it. A directly-loaded path outside the root falls back to its absolute form
 // rather than emitting `../..` chains.
 function describePath(root: string, path: string) {