Skip to content

Fix multi-directory workspace resolution and chat-to-project assignment #3

@wpak-ai

Description

@wpak-ai

Summary

Chats from multi-directory Cursor workspaces were incorrectly grouped in the UI:

  1. Some workspaces appeared as fallback names like Project <hash> instead of a real project name.
  2. Many chats that should belong to named projects (especially boostbacklog) were shown under Other chats.

Environment

  • Repo: CppDigest/cursor-chat-browser-python
  • OS: Windows (Git Bash / Cursor)
  • Workspace source: Cursor workspaceStorage + global state.vscdb
  • Exclusion rules enabled (--exclude-rules)

Reproduction

  1. Start app:
    • python app.py --exclude-rules "$HOME/.cursor-chat-browser/exclusion-rules.txt"
  2. Open Projects page.
  3. Observe:
    • fallback project labels like Project <hash>
    • large number of chats in Other chats that should map to real projects (e.g. boostbacklog).

Expected Behavior

  • Multi-directory workspaces resolve to meaningful names (e.g. cppdigest-github-app, boostbacklog).
  • Chats are assigned to the correct project whenever there is enough workspace/path/layout evidence.
  • Other chats should only contain truly unmapped chats.

Actual Behavior (before fix)

  • Workspace naming logic only handled limited workspace.json shapes (folder / folders[].path).
  • Some Cursor entries store only a workspace pointer (e.g. to .code-workspace), including stale/missing pointers.
  • Assignment logic trusted composerId -> workspaceId even when that workspace descriptor was invalid, causing many chats to fall into global.

Root Cause

  • Incomplete parsing of workspace descriptor formats.
  • No robust handling for indirection (workspace URI/path).
  • No fallback reassignment strategy when a workspace ID is invalid or stale.
  • Empty/stale workspace shells were still displayed.

Fix Implemented

  • Added robust workspace descriptor resolution:
    • supports workspace indirection (file://... / path)
    • supports more folder shapes (folder, folders[].path, folders[].uri.path, etc.)
    • resolves relative paths in .code-workspace.
  • Updated workspace display-name derivation to use normalized folder extraction.
  • Marked invalid workspace IDs as low-confidence during chat assignment.
  • Added alias-voting fallback:
    • infer replacement valid workspace for invalid IDs based on evidence-backed chats.
  • Suppressed empty workspace shell entries (conversationCount == 0) in project listing.

Validation / Result

  • Fallback Project <hash> entries removed in affected cases.
  • Other chats count reduced dramatically (bulk reassigned to correct project, especially boostbacklog).
  • Added regression tests for:
    • workspace folder parsing/display-name extraction
    • invalid workspace fallback assignment
    • invalid-workspace alias inference

Acceptance Criteria

  • No Project <hash> rows for resolvable multi-directory workspaces.
  • Chats previously misbucketed in Other chats are reassigned to correct projects where evidence exists.
  • Other chats only contains truly unassigned conversations.
  • New tests pass in CI.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions