Skip to content

Commit d3d881d

Browse files
[cherry-pick] Revert "Add menu toggle for cloud sync in chat panel" (#311408)
Co-authored-by: vs-code-engineering[bot] <vs-code-engineering[bot]@users.noreply.github.com> Co-authored-by: Ben Villalobos <bevillal@microsoft.com>
1 parent 0835ce4 commit d3d881d

File tree

8 files changed

+7
-85
lines changed

8 files changed

+7
-85
lines changed

extensions/copilot/package.json

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3968,15 +3968,6 @@
39683968
{
39693969
"id": "advanced",
39703970
"properties": {
3971-
"github.copilot.chat.sessionSearch.cloudSync.enabled": {
3972-
"type": "boolean",
3973-
"default": false,
3974-
"markdownDescription": "%github.copilot.config.sessionSearch.cloudSync.enabled%",
3975-
"tags": [
3976-
"advanced",
3977-
"onExp"
3978-
]
3979-
},
39803971
"github.copilot.chat.reasoningEffortOverride": {
39813972
"type": [
39823973
"string",

extensions/copilot/package.nls.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@
173173
"copilot.chronicle.tips.description": "Get personalized tips based on your Copilot usage patterns",
174174
"github.copilot.config.sessionSearch.enabled": "Enable session search and /chronicle commands. This is a team-internal setting.",
175175
"github.copilot.config.sessionSearch.localIndex.enabled": "Enable local session tracking. When enabled, Copilot tracks session data locally for /chronicle commands.",
176-
"github.copilot.config.sessionSearch.cloudSync.enabled": "Enable cloud sync for session data. When enabled, chat session data is synced to the cloud for cross-device querying.",
176+
"github.copilot.config.sessionSearch.cloudSync.enabled": "Enable cloud sync for session data. When enabled, session data is synced to your Copilot account for cross-device access.",
177177
"github.copilot.config.sessionSearch.cloudSync.excludeRepositories": "Repository patterns to exclude from cloud sync. Use exact `owner/repo` names or glob patterns like `my-org/*`. Sessions from matching repos will only be stored locally.",
178178
"copilot.workspace.explain.description": "Explain how the code in your active editor works",
179179
"copilot.workspace.edit.description": "Edit files in your workspace",

extensions/copilot/src/extension/chronicle/common/sessionIndexingPreference.ts

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -46,19 +46,9 @@ export class SessionIndexingPreference {
4646
/**
4747
* Check if cloud sync is enabled for a given repo.
4848
* Returns true if cloudSync.enabled is true AND the repo is not excluded.
49-
* Check both new and old setting for backward compatibility.
5049
*/
5150
hasCloudConsent(repoNwo?: string): boolean {
52-
let cloudEnabled: boolean;
53-
if (this._configService.isConfigured(ConfigKey.Advanced.SessionSearchCloudSync)) {
54-
// New key explicitly set by user — authoritative
55-
cloudEnabled = this._configService.getConfig(ConfigKey.Advanced.SessionSearchCloudSync);
56-
} else {
57-
// Fall back to old internal key for existing users who haven't migrated yet
58-
cloudEnabled = this._configService.getConfig(ConfigKey.TeamInternal.SessionSearchCloudSyncEnabled);
59-
}
60-
61-
if (!cloudEnabled) {
51+
if (!this._configService.getConfig(ConfigKey.TeamInternal.SessionSearchCloudSyncEnabled)) {
6252
return false;
6353
}
6454

extensions/copilot/src/extension/chronicle/common/standupPrompt.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,13 +132,15 @@ Standup for <date>:
132132
- Key files: list 2-3 most important files changed
133133
- Tools used: mention key tools if visible (e.g., apply_patch, run_in_terminal, search)
134134
- PR: [#123](link) — merged/closed (if applicable)
135+
- Sessions: \`session-id-1\`, \`session-id-2\`
135136
136137
**🚧 In Progress**
137138
138139
**Feature name** (\`branch-name\` branch, \`repo-name\`)
139140
- Summary of current work (1-2 sentences based on turn content)
140141
- Key files: list 2-3 most important files being worked on
141142
- PR: [#789](link) — draft/open (if applicable)
143+
- Sessions: \`session-id\`
142144
143145
Formatting rules:
144146
- Use the turn data (user messages AND assistant responses) to understand WHAT was done, not just that something happened

extensions/copilot/src/extension/chronicle/common/test/sessionIndexingPreference.spec.ts

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,16 @@ import { SessionIndexingPreference } from '../sessionIndexingPreference';
99
function createMockConfigService(opts: {
1010
localIndexEnabled?: boolean;
1111
cloudSyncEnabled?: boolean;
12-
cloudSyncPublicEnabled?: boolean;
1312
excludeRepositories?: string[];
1413
} = {}) {
1514
const configs: Record<string, unknown> = {};
1615
// Map by fullyQualifiedId
1716
configs['github.copilot.chat.advanced.sessionSearch.localIndex.enabled'] = opts.localIndexEnabled ?? false;
1817
configs['github.copilot.chat.advanced.sessionSearch.cloudSync.enabled'] = opts.cloudSyncEnabled ?? false;
19-
configs['github.copilot.chat.sessionSearch.cloudSync.enabled'] = opts.cloudSyncPublicEnabled ?? false;
2018
configs['github.copilot.chat.advanced.sessionSearch.cloudSync.excludeRepositories'] = opts.excludeRepositories ?? [];
2119

22-
// Track which keys are explicitly configured (set by the user)
23-
const configuredKeys = new Set<string>();
24-
if (opts.cloudSyncPublicEnabled !== undefined) {
25-
configuredKeys.add('github.copilot.chat.sessionSearch.cloudSync.enabled');
26-
}
27-
2820
return {
2921
getConfig: (key: { fullyQualifiedId: string }) => configs[key.fullyQualifiedId],
30-
isConfigured: (key: { fullyQualifiedId: string }) => configuredKeys.has(key.fullyQualifiedId),
3122
} as unknown as import('../../../../platform/configuration/common/configurationService').IConfigurationService;
3223
}
3324

@@ -90,19 +81,4 @@ describe('SessionIndexingPreference', () => {
9081
expect(pref.hasCloudConsent('private-org/repo-b')).toBe(false);
9182
expect(pref.hasCloudConsent('public-org/repo-a')).toBe(true);
9283
});
93-
94-
it('hasCloudConsent uses new public key when explicitly configured', () => {
95-
const pref = new SessionIndexingPreference(createMockConfigService({
96-
cloudSyncPublicEnabled: true,
97-
}));
98-
expect(pref.hasCloudConsent()).toBe(true);
99-
});
100-
101-
it('hasCloudConsent new public key overrides old internal key', () => {
102-
const pref = new SessionIndexingPreference(createMockConfigService({
103-
cloudSyncEnabled: true,
104-
cloudSyncPublicEnabled: false,
105-
}));
106-
expect(pref.hasCloudConsent()).toBe(false);
107-
});
10884
});

extensions/copilot/src/extension/chronicle/vscode-node/remoteSessionExporter.ts

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -120,16 +120,12 @@ export class RemoteSessionExporter extends Disposable implements IExtensionContr
120120

121121
// Only set up span listener when both local index and cloud sync are enabled.
122122
// Uses autorun to react if settings change at runtime.
123-
// Both new and old settings taken into account for backward compatibility
124123
const localEnabled = this._configService.getExperimentBasedConfigObservable(ConfigKey.TeamInternal.SessionSearchLocalIndexEnabled, this._expService);
125-
const cloudEnabledInternal = this._configService.getConfigObservable(ConfigKey.TeamInternal.SessionSearchCloudSyncEnabled);
126-
const cloudEnabledPublic = this._configService.getConfigObservable(ConfigKey.Advanced.SessionSearchCloudSync);
124+
const cloudEnabled = this._configService.getConfigObservable(ConfigKey.TeamInternal.SessionSearchCloudSyncEnabled);
127125
const spanListenerStore = this._register(new DisposableStore());
128126
this._register(autorun(reader => {
129127
spanListenerStore.clear();
130-
const publicValue = cloudEnabledPublic.read(reader);
131-
const cloudEnabled = this._configService.isConfigured(ConfigKey.Advanced.SessionSearchCloudSync) ? publicValue : cloudEnabledInternal.read(reader);
132-
if (!localEnabled.read(reader) || !cloudEnabled) {
128+
if (!localEnabled.read(reader) || !cloudEnabled.read(reader)) {
133129
return;
134130
}
135131

@@ -268,10 +264,9 @@ export class RemoteSessionExporter extends Disposable implements IExtensionContr
268264
}
269265

270266
// Only export remotely if the user has cloud consent for this repo
271-
// Also require localIndex to be enabled (team-internal gate) as defense-in-depth
272267
const repoNwo = `${repo.owner}/${repo.repo}`;
273268

274-
if (!this._configService.getExperimentBasedConfig(ConfigKey.TeamInternal.SessionSearchLocalIndexEnabled, this._expService) || !this._indexingPreference.hasCloudConsent(repoNwo)) {
269+
if (!this._indexingPreference.hasCloudConsent(repoNwo)) {
275270
this._disabledSessions.add(sessionId);
276271
return;
277272
}

extensions/copilot/src/platform/configuration/common/configurationService.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -713,8 +713,6 @@ export namespace ConfigKey {
713713

714714
/** Internal: override reasoning/thinking effort sent to model APIs (e.g. Responses API, Messages API). Used by evals. */
715715
export const ReasoningEffortOverride = defineSetting<string | null>('chat.reasoningEffortOverride', ConfigType.Simple, null);
716-
717-
export const SessionSearchCloudSync = defineAndMigrateSetting<boolean>('chat.advanced.sessionSearch.cloudSync.enabled', 'chat.sessionSearch.cloudSync.enabled', false);
718716
}
719717

720718
/**

src/vs/workbench/contrib/chat/browser/actions/chatActions.ts

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1085,36 +1085,6 @@ export function registerChatActions() {
10851085
}
10861086
});
10871087

1088-
registerAction2(class ToggleSessionCloudSyncAction extends Action2 {
1089-
private static readonly _settingKey = 'github.copilot.chat.sessionSearch.cloudSync.enabled';
1090-
constructor() {
1091-
super({
1092-
id: 'workbench.action.chat.toggleSessionCloudSync',
1093-
title: localize2('chat.toggleSessionCloudSync', "Sync Chat Sessions to Cloud"),
1094-
category: CHAT_CATEGORY,
1095-
f1: false,
1096-
toggled: ContextKeyExpr.equals(`config.${ToggleSessionCloudSyncAction._settingKey}`, true),
1097-
menu: [{
1098-
id: CHAT_CONFIG_MENU_ID,
1099-
when: ContextKeyExpr.and(ChatContextKeys.enabled, ContextKeyExpr.equals('view', ChatViewId), ContextKeyExpr.equals('github.copilot.sessionSearch.enabled', true)),
1100-
order: 2,
1101-
group: '4_logs'
1102-
}, {
1103-
id: MenuId.ViewTitle,
1104-
when: ContextKeyExpr.and(ChatContextKeys.enabled, ContextKeyExpr.equals('view', ChatViewId), ContextKeyExpr.equals('github.copilot.sessionSearch.enabled', true)),
1105-
order: 2,
1106-
group: '4_logs'
1107-
}]
1108-
});
1109-
}
1110-
1111-
async run(accessor: ServicesAccessor): Promise<void> {
1112-
const configurationService = accessor.get(IConfigurationService);
1113-
const currentValue = configurationService.getValue<boolean>(ToggleSessionCloudSyncAction._settingKey);
1114-
await configurationService.updateValue(ToggleSessionCloudSyncAction._settingKey, !currentValue);
1115-
}
1116-
});
1117-
11181088
const nonEnterpriseCopilotUsers = ContextKeyExpr.and(ChatContextKeys.enabled, ContextKeyExpr.notEquals(`config.${defaultChat.completionsAdvancedSetting}.authProvider`, defaultChat.provider.enterprise.id));
11191089
registerAction2(class extends Action2 {
11201090
constructor() {

0 commit comments

Comments
 (0)