-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Open
Labels
area:chatRelates to chat interfaceRelates to chat interfacekind:enhancementIndicates a new feature request, imrovement, or extensionIndicates a new feature request, imrovement, or extension
Description
Problem
Chat sessions are stored globally in ~/.continue/sessions/ with no filtering by workspace. This causes several UX issues:
- Fresh window loads wrong session: Opening a project shows the last active session from any project, not the last session for this project
- History shows all projects: No way to filter sessions to current workspace
- Multi-window confusion: Sessions from different workspaces appear interleaved
This affects VS Code, IntelliJ, and CLI.
Current Architecture
┌─────────────────────────────────────────────────────────────────────┐
│ ~/.continue/sessions/ │
│ ┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐ │
│ │ {uuid1}.json │ │ {uuid2}.json │ │ sessions.json │ │
│ │ workspaceDir: A │ │ workspaceDir: B │ │ [metadata...] │ │
│ └─────────────────┘ └─────────────────┘ └─────────────────┘ │
└─────────────────────────────────────────────────────────────────────┘
▲
│ All windows read/write same store
┌─────────────────────┼─────────────────────┐
│ │ │
┌───────┴───────┐ ┌───────┴───────┐ ┌───────┴───────┐
│ VS Code Win 1 │ │ VS Code Win 2 │ │ IntelliJ Win │
│ workspace: A │ │ workspace: B │ │ workspace: C │
└───────────────┘ └───────────────┘ └───────────────┘
│ │ │
└─────────────────────┴─────────────────────┘
│
All see ALL sessions
(no filtering by workspace)
Key Insight
workspaceDirectory is already saved in every session - it's just never used for filtering.
Proposed Solution
Filter sessions by workspaceDirectory by default, with optional "show all" toggle.
Scope Estimate
| Layer | Files | Functions/Types |
|---|---|---|
| Protocol | core/protocol/core.ts |
ListHistoryOptions - add workspaceDirectory?: string |
| Core history | core/util/history.ts |
HistoryManager.list() - add filter logic |
| Core handler | core/core.ts |
history/list handler - pass workspace |
| GUI thunks | gui/src/redux/thunks/session.ts |
refreshSessionMetadata - include workspace |
| GUI components | gui/src/components/History/index.tsx |
Add "show all" toggle |
| CLI session | extensions/cli/src/session.ts |
listSessions() - add filter param |
| Total | ~6 files | ~8 functions |
Implementation Outline
1. Protocol - Add optional filter:
export interface ListHistoryOptions {
offset?: number;
limit?: number;
workspaceDirectory?: string; // NEW
}2. Core - Filter when provided:
if (options.workspaceDirectory) {
sessions = sessions.filter(s =>
s.workspaceDirectory === options.workspaceDirectory
);
}3. GUI - Pass current workspace:
workspaceDirectory: window.workspacePaths?.[0]4. History page - Toggle: "Show sessions from all projects"
Risk Assessment
| Risk | Mitigation |
|---|---|
| Multi-root workspaces | Use first folder (matches current save behavior) |
| No folder open | Fall back to showing all sessions |
| Breaking change | Default filtered; toggle provides escape hatch |
| Migration | None needed - existing sessions have workspaceDirectory |
Related Issues
- Multi code-server share the Continue history #4691 - Original report of session sharing across windows
- IntelliJ: Windows → WSL remote not detected (only SSH detected) #9735 - IntelliJ WSL detection (comment with screenshots showing cross-window behavior)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area:chatRelates to chat interfaceRelates to chat interfacekind:enhancementIndicates a new feature request, imrovement, or extensionIndicates a new feature request, imrovement, or extension
Type
Projects
Status
Todo