Skip to content

Commit cd30712

Browse files
authored
Merge branch 'main' into agents/configure-remote-agent-plugins
2 parents 3e8a8fb + 0e1f836 commit cd30712

43 files changed

Lines changed: 1457 additions & 212 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/screenshot-test.yml

Lines changed: 58 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -138,17 +138,23 @@ jobs:
138138

139139
- name: Diff screenshots against merge base
140140
id: diff
141-
if: github.event_name == 'pull_request' && steps.oidc.outputs.token
141+
if: steps.oidc.outputs.token
142142
run: |
143-
# We diff screenshots(checked-out commit) vs screenshots(merge-base of
144-
# that commit with the target branch). This isolates the visual effect
145-
# of just this PR's divergence from target. Using pull_request.base.sha
146-
# would be wrong: it's the target-branch tip at PR creation time and can
147-
# be stale, causing unrelated target-branch commits to show up as diffs.
148-
TARGET_REF="origin/${{ github.event.pull_request.base.ref }}"
149-
git fetch --no-tags --depth=1 origin "${{ github.event.pull_request.base.ref }}"
150-
BASE_SHA=$(git merge-base "${{ github.sha }}" "$TARGET_REF")
151-
echo "Using base SHA: $BASE_SHA (merge-base of ${{ github.sha }} and $TARGET_REF)"
143+
if [ "${{ github.event_name }}" = "pull_request" ]; then
144+
# For PRs, diff against the merge-base with the target branch.
145+
# This isolates the visual effect of just this PR's divergence
146+
# from target. Using pull_request.base.sha would be wrong: it's
147+
# the target-branch tip at PR creation time and can be stale,
148+
# causing unrelated target-branch commits to show up as diffs.
149+
TARGET_REF="origin/${{ github.event.pull_request.base.ref }}"
150+
git fetch --no-tags --depth=1 origin "${{ github.event.pull_request.base.ref }}"
151+
BASE_SHA=$(git merge-base "${{ github.sha }}" "$TARGET_REF")
152+
else
153+
# For push events, diff against the parent commit.
154+
BASE_SHA=$(git rev-parse "${{ github.sha }}^")
155+
fi
156+
echo "base_sha=$BASE_SHA" >> "$GITHUB_OUTPUT"
157+
echo "Using base SHA: $BASE_SHA (base for ${{ github.sha }})"
152158
BODY=$(node build/lib/screenshotDiffReport.ts \
153159
https://hediet-screenshots.azurewebsites.net \
154160
${{ github.repository_owner }} \
@@ -172,8 +178,25 @@ jobs:
172178
env:
173179
SCREENSHOT_SERVICE_TOKEN: ${{ steps.oidc.outputs.token }}
174180

181+
- name: Write job summary
182+
if: steps.diff.outputs.has_changes == 'true' || steps.blocks-ci.outputs.match == 'false'
183+
run: |
184+
BODY="${COMMENT_BODY}"
185+
if [ -n "$BLOCKS_CI_CONTENT" ]; then
186+
if [ -n "$BODY" ]; then BODY+=$'\n\n---\n\n'; fi
187+
BODY+="### blocks-ci screenshots changed"$'\n\n'
188+
BODY+="Replace the contents of \`test/componentFixtures/blocks-ci-screenshots.md\` with:"$'\n\n'
189+
BODY+="<details>"$'\n'"<summary>Updated blocks-ci-screenshots.md</summary>"$'\n\n'
190+
BODY+="\`\`\`md"$'\n'"${BLOCKS_CI_CONTENT}"$'\n'"\`\`\`"$'\n\n'
191+
BODY+="</details>"
192+
fi
193+
echo "$BODY" >> "$GITHUB_STEP_SUMMARY"
194+
env:
195+
COMMENT_BODY: ${{ steps.diff.outputs.body }}
196+
BLOCKS_CI_CONTENT: ${{ steps.blocks-ci.outputs.content }}
197+
175198
- name: Post PR comment
176-
if: github.event_name == 'pull_request' && (steps.diff.outputs.has_changes == 'true' || steps.blocks-ci.outputs.match == 'false')
199+
if: github.event_name == 'pull_request'
177200
uses: actions/github-script@v9
178201
with:
179202
script: |
@@ -190,7 +213,7 @@ jobs:
190213
body += '</details>';
191214
}
192215
193-
body = marker + '\n' + body;
216+
const hasContent = body || blocksCiContent;
194217
195218
const { data: comments } = await github.rest.issues.listComments({
196219
owner: context.repo.owner,
@@ -200,6 +223,27 @@ jobs:
200223
});
201224
const existing = comments.find(c => c.body?.startsWith(marker));
202225
226+
if (!hasContent) {
227+
// No changes to report — update existing comment if present, otherwise do nothing
228+
if (existing) {
229+
const baseSha = (process.env.BASE_SHA || '').slice(0, 8);
230+
const currentSha = (process.env.CURRENT_SHA || '').slice(0, 8);
231+
let noChangesBody = '~No screenshot changes.~';
232+
if (baseSha && currentSha) {
233+
noChangesBody = `**Base:** \`${baseSha}\` **Current:** \`${currentSha}\`\n\n` + noChangesBody;
234+
}
235+
await github.rest.issues.updateComment({
236+
owner: context.repo.owner,
237+
repo: context.repo.repo,
238+
comment_id: existing.id,
239+
body: marker + '\n' + noChangesBody,
240+
});
241+
}
242+
return;
243+
}
244+
245+
body = marker + '\n' + body;
246+
203247
if (existing) {
204248
await github.rest.issues.updateComment({
205249
owner: context.repo.owner,
@@ -218,6 +262,8 @@ jobs:
218262
env:
219263
COMMENT_BODY: ${{ steps.diff.outputs.body }}
220264
BLOCKS_CI_CONTENT: ${{ steps.blocks-ci.outputs.content }}
265+
BASE_SHA: ${{ steps.diff.outputs.base_sha }}
266+
CURRENT_SHA: ${{ github.sha }}
221267

222268
- name: Fail if blocks-ci hashes changed
223269
if: steps.blocks-ci.outputs.match == 'false'

extensions/copilot/package.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4018,6 +4018,15 @@
40184018
"tags": [
40194019
"experimental"
40204020
]
4021+
},
4022+
"github.copilot.chat.localIndex.enabled": {
4023+
"type": "boolean",
4024+
"default": false,
4025+
"markdownDescription": "%github.copilot.config.localIndex.enabled%",
4026+
"tags": [
4027+
"experimental",
4028+
"onExp"
4029+
]
40214030
}
40224031
}
40234032
},

extensions/copilot/package.nls.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,10 +169,11 @@
169169
"copilot.agent.description": "Edit files in your workspace in agent mode",
170170
"copilot.agent.compact.description": "Free up context by compacting the conversation history. Optionally include extra instructions for compaction.",
171171
"copilot.chronicle.description": "Session history tools and insights",
172-
"copilot.chronicle.standup.description": "Generate a standup report from recent coding sessions",
173-
"copilot.chronicle.tips.description": "Get personalized tips based on your Copilot usage patterns",
172+
"copilot.chronicle.standup.description": "Generate a standup report from recent chat sessions",
173+
"copilot.chronicle.tips.description": "Get personalized tips based on your chat session 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.localIndex.enabled": "Enable local session tracking. When enabled, session data is tracked locally for /chronicle commands.",
176177
"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.",
177178
"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.",
178179
"copilot.workspace.explain.description": "Explain how the code in your active editor works",

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

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,6 @@ export type SessionIndexingLevel = 'local' | 'user' | 'repo_and_user';
1616

1717
/**
1818
* Manages user preferences for session indexing via VS Code settings.
19-
*
20-
* Two settings control behavior:
21-
* - `chat.sessionSearch.localIndex.enabled` (team-internal, ExP) — enables local
22-
* SQLite tracking and /chronicle commands
23-
* - `chat.sessionSearch.cloudSync.enabled` — enables
24-
* cloud upload to cloud
25-
* - `chat.sessionSearch.cloudSync.excludeRepositories` — repo patterns
26-
* to exclude from cloud sync
2719
*/
2820
export class SessionIndexingPreference {
2921

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ function createMockConfigService(opts: {
1313
} = {}) {
1414
const configs: Record<string, unknown> = {};
1515
// Map by fullyQualifiedId
16-
configs['github.copilot.chat.advanced.sessionSearch.localIndex.enabled'] = opts.localIndexEnabled ?? false;
16+
configs['github.copilot.chat.localIndex.enabled'] = opts.localIndexEnabled ?? false;
1717
configs['github.copilot.chat.advanced.sessionSearch.cloudSync.enabled'] = opts.cloudSyncEnabled ?? false;
1818
configs['github.copilot.chat.advanced.sessionSearch.cloudSync.excludeRepositories'] = opts.excludeRepositories ?? [];
1919

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ 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-
const localEnabled = this._configService.getExperimentBasedConfigObservable(ConfigKey.TeamInternal.SessionSearchLocalIndexEnabled, this._expService);
123+
const localEnabled = this._configService.getExperimentBasedConfigObservable(ConfigKey.LocalIndexEnabled, this._expService);
124124
const cloudEnabled = this._configService.getConfigObservable(ConfigKey.TeamInternal.SessionSearchCloudSyncEnabled);
125125
const spanListenerStore = this._register(new DisposableStore());
126126
this._register(autorun(reader => {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ export class SessionStoreTracker extends Disposable implements IExtensionContrib
8080

8181
// Only set up span listener and flush timer when the feature is enabled.
8282
// Uses autorun to react if the setting changes at runtime.
83-
const featureEnabled = this._configService.getExperimentBasedConfigObservable(ConfigKey.TeamInternal.SessionSearchLocalIndexEnabled, this._expService);
83+
const featureEnabled = this._configService.getExperimentBasedConfigObservable(ConfigKey.LocalIndexEnabled, this._expService);
8484
const spanListenerStore = this._register(new DisposableStore());
8585
this._register(autorun(reader => {
8686
spanListenerStore.clear();

extensions/copilot/src/extension/contextKeys/vscode-node/contextKeys.contribution.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ export class ContextKeysContribution extends Disposable {
8585
commands.executeCommand('setContext', debugReportFeedbackContextKey, debugReportFeedback.read(reader));
8686
}));
8787

88-
const sessionSearchEnabled = this._configService.getExperimentBasedConfigObservable(ConfigKey.TeamInternal.SessionSearchLocalIndexEnabled, this._expService);
88+
const sessionSearchEnabled = this._configService.getExperimentBasedConfigObservable(ConfigKey.LocalIndexEnabled, this._expService);
8989
this._register(autorun(reader => {
9090
commands.executeCommand('setContext', sessionSearchEnabledContextKey, sessionSearchEnabled.read(reader));
9191
}));

extensions/copilot/src/extension/intents/node/chronicleIntent.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export class ChronicleIntent implements IIntent {
4949
readonly id = ChronicleIntent.ID;
5050
readonly description = l10n.t('Session history tools and insights (standup, tips, improve)');
5151
get locations(): ChatLocation[] {
52-
return this._configService.getExperimentBasedConfig(ConfigKey.TeamInternal.SessionSearchLocalIndexEnabled, this._expService) ? [ChatLocation.Panel] : [];
52+
return this._configService.getExperimentBasedConfig(ConfigKey.LocalIndexEnabled, this._expService) ? [ChatLocation.Panel] : [];
5353
}
5454

5555
readonly commandInfo: IIntentSlashCommandInfo = {
@@ -86,7 +86,7 @@ export class ChronicleIntent implements IIntent {
8686
location: ChatLocation,
8787
chatTelemetry: ChatTelemetryBuilder,
8888
): Promise<vscode.ChatResult> {
89-
if (!this._configService.getExperimentBasedConfig(ConfigKey.TeamInternal.SessionSearchLocalIndexEnabled, this._expService)) {
89+
if (!this._configService.getExperimentBasedConfig(ConfigKey.LocalIndexEnabled, this._expService)) {
9090
stream.markdown(l10n.t('Session search is not available yet.'));
9191
return {};
9292
}

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -875,8 +875,6 @@ export namespace ConfigKey {
875875
export const ResponsesApiWebSocketEnabled = defineTeamInternalSetting<boolean>('chat.advanced.responsesApi.webSocket.enabled', ConfigType.ExperimentBased, false);
876876
export const DebugSimulateWebSocketResponse = defineTeamInternalSetting<string>('chat.advanced.debug.simulateWebSocketResponse', ConfigType.Simple, '');
877877

878-
/** Enable local session search index — tracks sessions locally and enables chronicle commands.*/
879-
export const SessionSearchLocalIndexEnabled = defineTeamInternalSetting<boolean>('chat.advanced.sessionSearch.localIndex.enabled', ConfigType.ExperimentBased, false, vBoolean());
880878
/** Enable cloud sync of session data to cloud. */
881879
export const SessionSearchCloudSyncEnabled = defineTeamInternalSetting<boolean>('chat.advanced.sessionSearch.cloudSync.enabled', ConfigType.Simple, false, vBoolean());
882880
/** Repository patterns to exclude from cloud sync (exact owner/repo or glob patterns like my-org/*). */
@@ -1030,6 +1028,9 @@ export namespace ConfigKey {
10301028
export const CopilotMemoryEnabled = defineSetting<boolean>('chat.copilotMemory.enabled', ConfigType.ExperimentBased, false);
10311029
export const MemoryToolEnabled = defineSetting<boolean>('chat.tools.memory.enabled', ConfigType.ExperimentBased, true);
10321030
export const ViewImageToolEnabled = defineSetting<boolean>('chat.tools.viewImage.enabled', ConfigType.ExperimentBased, true);
1031+
1032+
/** Enable local session search index — tracks sessions locally and enables chronicle commands.*/
1033+
export const LocalIndexEnabled = defineSetting<boolean>('chat.localIndex.enabled', ConfigType.ExperimentBased, false);
10331034
}
10341035

10351036
export function getAllConfigKeys(): string[] {

0 commit comments

Comments
 (0)