Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 21, 2026

Moves agent session archived/unread state from workspace to profile scope, enabling cross-workspace session management (e.g., archiving a Codex session reflects everywhere).

Changes

  • saveSessionStates(): Store to StorageScope.PROFILE instead of StorageScope.WORKSPACE
  • loadSessionStates(): Load from profile scope first; if empty, migrate from workspace scope and clean up old data

Migration

Existing workspace-scoped state is automatically migrated on first load:

// Try profile scope first (new location)
let statesCache = this.storageService.get(STATE_STORAGE_KEY, StorageScope.PROFILE);

// Migration: check workspace scope (old location) and migrate if found
if (!statesCache) {
    statesCache = this.storageService.get(STATE_STORAGE_KEY, StorageScope.WORKSPACE);
    if (statesCache) {
        this.storageService.store(STATE_STORAGE_KEY, statesCache, StorageScope.PROFILE, StorageTarget.MACHINE);
        this.storageService.remove(STATE_STORAGE_KEY, StorageScope.WORKSPACE);
    }
}
Original prompt

This section details on the original issue you should resolve

<issue_title>Agent sessions: consider to store archived/unread state in global scope</issue_title>
<issue_description>This would help getting rid of sessions across all workspaces, such as for Codex. This requires a migration of the existing data though. </issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits January 21, 2026 07:55
Co-authored-by: bpasero <900690+bpasero@users.noreply.github.com>
Co-authored-by: bpasero <900690+bpasero@users.noreply.github.com>
Copilot AI changed the title [WIP] Consider storing archived/unread state in global scope Agent sessions: store archived/unread state in profile scope Jan 21, 2026
Copilot AI requested a review from bpasero January 21, 2026 07:58
@bpasero bpasero closed this Jan 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

⛔ Agent sessions: migrate state storage to application and user

2 participants