Skip to content

bug(vscode): dashboard episodes use a stale project root #1270

Description

@cedric013

Problem

VS Code agents can produce episodic records while the native dashboard still shows every episode counter at zero.

The dashboard process inherits LEAN_CTX_PROJECT_ROOT from the extension host and /api/episodes hashes only that selected root. When the inherited value belongs to another workspace, the dashboard reads an empty store even though non-empty episode stores exist. Separately, MCP startup under WSL can accept /mnt/<drive>/Users/<user> as a markerless project root, so new episodes are persisted under a broad user-profile hash rather than the active repository.

Reproduction

  1. Start VS Code with an inherited LEAN_CTX_PROJECT_ROOT for workspace A.
  2. Open workspace B and run agents that record episodes.
  3. Open the native lean-ctx dashboard from workspace B.
  4. Observe /api/episodes scoped to workspace A and zero counters while episode stores for the agent session are non-empty.

Expected

  • The VS Code dashboard is explicitly scoped to the active workspace folder.
  • VS Code MCP configuration supplies ${workspaceFolder} as LEAN_CTX_PROJECT_ROOT.
  • WSL-mounted Windows user profiles are rejected as broad project roots, while repositories below them remain valid.
  • Multi-root detection never enumerates an unsafe broad root.

Scope

  • pass the active workspace as --project when the extension launches the dashboard
  • write LEAN_CTX_PROJECT_ROOT=${workspaceFolder} in VS Code MCP entries
  • classify /mnt/<drive>/Users/<user> as broad/unsafe
  • apply the shared broad-root guard before project and multi-root detection
  • add focused regression coverage

Related

This issue covers the complementary VS Code launch/configuration and WSL broad-root paths.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdashboardDashboard relatedpriority: mediumNormalstatus: integratedFix merged to main but NOT yet in a tagged release

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions