diff --git a/packages/core/src/session/instructions.ts b/packages/core/src/session/instructions.ts index 9f70ad3d3c..3e2eb27147 100644 --- a/packages/core/src/session/instructions.ts +++ b/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) {