Skip to content

Commit 3a3037e

Browse files
committed
Merge remote-tracking branch 'origin/main' into connor4312/eager-activeclient
2 parents a0abf26 + ad7c759 commit 3a3037e

113 files changed

Lines changed: 4329 additions & 554 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/no-engineering-system-changes.yml

Lines changed: 31 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,19 @@ jobs:
3030
# touches the "distro" or "version" field, OR
3131
# 2. package.json + package-lock.json are the only changed files and
3232
# the package.json diff exclusively touches the "version" field
33-
# (lock file updates are expected from npm install after version bump).
33+
# (lock file updates are expected from npm install after version bump), OR
34+
# 3. Same as (2) but also including extensions/copilot/package.json
35+
# and extensions/copilot/package-lock.json, where the copilot
36+
# package.json diff only touches "version" and "vscode" fields.
3437
35-
ONLY_PKG=$(jq -e '. == ["package.json"]' "$HOME/files.json" > /dev/null 2>&1 && echo true || echo false)
36-
PKG_AND_LOCK=$(jq -e '. | sort == ["package-lock.json", "package.json"]' "$HOME/files.json" > /dev/null 2>&1 && echo true || echo false)
38+
SORTED_FILES=$(jq -e '. | sort' "$HOME/files.json")
3739
38-
if [[ "$ONLY_PKG" != "true" && "$PKG_AND_LOCK" != "true" ]]; then
39-
echo "Bot modified files beyond package.json (+ package-lock.json) — not allowed"
40+
ONLY_PKG=$(echo "$SORTED_FILES" | jq -e '. == ["package.json"]' > /dev/null 2>&1 && echo true || echo false)
41+
PKG_AND_LOCK=$(echo "$SORTED_FILES" | jq -e '. == ["package-lock.json", "package.json"]' > /dev/null 2>&1 && echo true || echo false)
42+
PKG_LOCK_AND_COPILOT=$(echo "$SORTED_FILES" | jq -e '. == ["extensions/copilot/package-lock.json", "extensions/copilot/package.json", "package-lock.json", "package.json"]' > /dev/null 2>&1 && echo true || echo false)
43+
44+
if [[ "$ONLY_PKG" != "true" && "$PKG_AND_LOCK" != "true" && "$PKG_LOCK_AND_COPILOT" != "true" ]]; then
45+
echo "Bot modified files beyond package.json (+ package-lock.json + extensions/copilot) — not allowed"
4046
echo "allowed=false" >> $GITHUB_OUTPUT
4147
exit 0
4248
fi
@@ -47,7 +53,7 @@ jobs:
4753
exit 0
4854
}
4955
50-
# Extract only the package.json diff section (ignore package-lock.json changes)
56+
# Extract only the root package.json diff section (ignore lock file changes)
5157
PKG_DIFF=$(echo "$DIFF" | awk '/^diff --git a\/package\.json b\/package\.json/{p=1} p && /^diff --git / && !/^diff --git a\/package\.json/{exit} p{print}')
5258
5359
CHANGED_LINES=$(echo "$PKG_DIFF" | grep -E '^[+-]' | grep -vE '^(\+\+\+|---)' | wc -l)
@@ -57,9 +63,25 @@ jobs:
5763
if [[ "$ONLY_PKG" == "true" && "$CHANGED_LINES" -eq 2 && ("$DISTRO_LINES" -eq 2 || "$VERSION_LINES" -eq 2) ]]; then
5864
echo "Distro-only or version-only update by bot — allowing"
5965
echo "allowed=true" >> $GITHUB_OUTPUT
60-
elif [[ "$PKG_AND_LOCK" == "true" && "$CHANGED_LINES" -eq 2 && "$VERSION_LINES" -eq 2 ]]; then
61-
echo "Version bump with lock file update by bot — allowing"
62-
echo "allowed=true" >> $GITHUB_OUTPUT
66+
elif [[ ("$PKG_AND_LOCK" == "true" || "$PKG_LOCK_AND_COPILOT" == "true") && "$CHANGED_LINES" -eq 2 && "$VERSION_LINES" -eq 2 ]]; then
67+
# Validate extensions/copilot/package.json when present
68+
if [[ "$PKG_LOCK_AND_COPILOT" == "true" ]]; then
69+
COPILOT_PKG_DIFF=$(echo "$DIFF" | awk '/^diff --git a\/extensions\/copilot\/package\.json b\/extensions\/copilot\/package\.json/{p=1} p && /^diff --git / && !/^diff --git a\/extensions\/copilot\/package\.json/{exit} p{print}')
70+
COPILOT_CHANGED=$(echo "$COPILOT_PKG_DIFF" | grep -E '^[+-]' | grep -vE '^(\+\+\+|---)' | wc -l)
71+
COPILOT_VERSION=$(echo "$COPILOT_PKG_DIFF" | grep -cE '^[+-][[:space:]]*"version"[[:space:]]*:' || true)
72+
COPILOT_VSCODE=$(echo "$COPILOT_PKG_DIFF" | grep -cE '^[+-][[:space:]]*"vscode"[[:space:]]*:' || true)
73+
74+
if [[ "$COPILOT_CHANGED" -eq 4 && "$COPILOT_VERSION" -eq 2 && "$COPILOT_VSCODE" -eq 2 ]]; then
75+
echo "Version bump with lock file and copilot extension update by bot — allowing"
76+
echo "allowed=true" >> $GITHUB_OUTPUT
77+
else
78+
echo "Copilot package.json changed more than version + vscode fields — not allowed"
79+
echo "allowed=false" >> $GITHUB_OUTPUT
80+
fi
81+
else
82+
echo "Version bump with lock file update by bot — allowing"
83+
echo "allowed=true" >> $GITHUB_OUTPUT
84+
fi
6385
else
6486
echo "Bot changed more than a single allowed field (distro or version) — not allowed"
6587
echo "allowed=false" >> $GITHUB_OUTPUT

.vscode/notebooks/endgame.github-issues

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
{
88
"kind": 2,
99
"language": "github-issues",
10-
"value": "$MILESTONE=milestone:\"1.114.0\"\n\n$TPI_CREATION=2026-03-23 // Used to find fixes that need to be verified"
10+
"value": "$MILESTONE=milestone:\"1.117.0\"\n\n$TPI_CREATION=2026-03-23 // Used to find fixes that need to be verified"
1111
},
1212
{
1313
"kind": 1,

.vscode/notebooks/my-endgame.github-issues

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
{
88
"kind": 2,
99
"language": "github-issues",
10-
"value": "$MILESTONE=milestone:\"1.115.0\"\n\n$MINE=assignee:@me"
10+
"value": "$MILESTONE=milestone:\"1.117.0\"\n\n$MINE=assignee:@me"
1111
},
1212
{
1313
"kind": 2,

extensions/copilot/package.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3968,6 +3968,15 @@
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+
},
39713980
"github.copilot.chat.reasoningEffortOverride": {
39723981
"type": [
39733982
"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, session data is synced to your Copilot account for cross-device access.",
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.",
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/byok/common/byokProvider.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ export function byokKnownModelToAPIInfo(providerName: string, id: string, capabi
147147
family: id,
148148
tooltip: `${capabilities.name} is contributed via the ${providerName} provider.`,
149149
multiplierNumeric: 0,
150+
isUserSelectable: true,
150151
capabilities: {
151152
toolCalling: capabilities.toolCalling,
152153
imageInput: capabilities.vision

extensions/copilot/src/extension/byok/vscode-node/byokContribution.ts

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { ICAPIClientService } from '../../../platform/endpoint/common/capiClient
88
import { IVSCodeExtensionContext } from '../../../platform/extContext/common/extensionContext';
99
import { ILogService } from '../../../platform/log/common/logService';
1010
import { IFetcherService } from '../../../platform/networking/common/fetcherService';
11-
import { Disposable } from '../../../util/vs/base/common/lifecycle';
11+
import { Disposable, DisposableStore } from '../../../util/vs/base/common/lifecycle';
1212
import { IInstantiationService } from '../../../util/vs/platform/instantiation/common/instantiation';
1313
import { BYOKKnownModels, isBYOKEnabled } from '../../byok/common/byokProvider';
1414
import { IExtensionContribution } from '../../common/contributions';
@@ -26,6 +26,7 @@ export class BYOKContrib extends Disposable implements IExtensionContribution {
2626
public readonly id: string = 'byok-contribution';
2727
private readonly _byokStorageService: IBYOKStorageService;
2828
private readonly _providers: Map<string, LanguageModelChatProvider<LanguageModelChatInformation>> = new Map();
29+
private readonly _byokRegistrations = this._register(new DisposableStore());
2930
private _byokProvidersRegistered = false;
3031

3132
constructor(
@@ -46,7 +47,17 @@ export class BYOKContrib extends Disposable implements IExtensionContribution {
4647
}
4748

4849
private async _authChange(authService: IAuthenticationService, instantiationService: IInstantiationService) {
49-
if (authService.copilotToken && isBYOKEnabled(authService.copilotToken, this._capiClientService) && !this._byokProvidersRegistered) {
50+
const byokEnabled = authService.copilotToken && isBYOKEnabled(authService.copilotToken, this._capiClientService);
51+
52+
if (!byokEnabled && this._byokProvidersRegistered) {
53+
this._logService.info('BYOK: Disabling BYOK providers due to account change.');
54+
this._byokRegistrations.clear();
55+
this._providers.clear();
56+
this._byokProvidersRegistered = false;
57+
return;
58+
}
59+
60+
if (byokEnabled && !this._byokProvidersRegistered) {
5061
this._byokProvidersRegistered = true;
5162
// Update known models list from CDN so all providers have the same list
5263
const knownModels = await this.fetchKnownModelList(this._fetcherService);
@@ -63,7 +74,7 @@ export class BYOKContrib extends Disposable implements IExtensionContribution {
6374
this._providers.set(CustomOAIBYOKModelProvider.providerName.toLowerCase(), instantiationService.createInstance(CustomOAIBYOKModelProvider, this._byokStorageService));
6475

6576
for (const [providerName, provider] of this._providers) {
66-
this._store.add(lm.registerLanguageModelChatProvider(providerName, provider));
77+
this._byokRegistrations.add(lm.registerLanguageModelChatProvider(providerName, provider));
6778
}
6879
}
6980
}

extensions/copilot/src/extension/chatSessions/copilotcli/common/copilotCLITools.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1684,6 +1684,15 @@ export class FakeToolsService implements IToolsService {
16841684
};
16851685
}
16861686

1687+
if (name === 'vscode_reviewPlan') {
1688+
if (this._confirmationResult === 'no') {
1689+
return { content: [new LanguageModelTextPart(JSON.stringify({ rejected: true }))] };
1690+
}
1691+
const input = options.input as { actions?: Array<{ label: string }> } | undefined;
1692+
const firstAction = input?.actions?.[0]?.label;
1693+
return { content: [new LanguageModelTextPart(JSON.stringify({ action: firstAction, rejected: false }))] };
1694+
}
1695+
16871696
return { content: [] };
16881697
}
16891698

extensions/copilot/src/extension/chatSessions/copilotcli/node/copilotcliSession.ts

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import type { Attachment, SendOptions, Session, SessionOptions } from '@github/c
77
import * as l10n from '@vscode/l10n';
88
import type * as vscode from 'vscode';
99
import type { ChatParticipantToolToken } from 'vscode';
10-
import { IRunCommandExecutionService } from '../../../../platform/commands/common/runCommandExecutionService';
1110
import { ConfigKey, IConfigurationService } from '../../../../platform/configuration/common/configurationService';
1211
import { ILogService } from '../../../../platform/log/common/logService';
1312
import { GenAiMetrics } from '../../../../platform/otel/common/genAiMetrics';
@@ -31,7 +30,6 @@ import { IChatSessionMetadataStore } from '../../common/chatSessionMetadataStore
3130
import { ExternalEditTracker } from '../../common/externalEditTracker';
3231
import { getWorkingDirectory, isIsolationEnabled, IWorkspaceInfo } from '../../common/workspaceInfo';
3332
import { enrichToolInvocationWithSubagentMetadata, isCopilotCliEditToolCall, isCopilotCLIToolThatCouldRequirePermissions, isTodoRelatedSqlQuery, processToolExecutionComplete, processToolExecutionStart, ToolCall, updateTodoListFromSqlItems } from '../common/copilotCLITools';
34-
import { SessionIdForCLI } from '../common/utils';
3533
import { getCopilotCLISessionDir } from './cliHelpers';
3634
import type { CopilotCliBridgeSpanProcessor } from './copilotCliBridgeSpanProcessor';
3735
import { ICopilotCLIImageSupport } from './copilotCLIImageSupport';
@@ -98,12 +96,6 @@ export interface ICopilotCLISession extends IDisposable {
9896
addUserMessage(content: string): void;
9997
addUserAssistantMessage(content: string): void;
10098
getSelectedModelId(): Promise<string | undefined>;
101-
/**
102-
* Temporarily sets the session resource.
103-
* Only for non-controller code paths.
104-
* @deprecated
105-
*/
106-
setSessionResource(resource: vscode.Uri): IDisposable;
10799
}
108100

109101
export class CopilotCLISession extends DisposableStore implements ICopilotCLISession {
@@ -160,8 +152,6 @@ export class CopilotCLISession extends DisposableStore implements ICopilotCLISes
160152
setSdkTraceContextUpdater(updater: ((traceparent?: string, tracestate?: string) => void) | undefined): void {
161153
this._updateSdkTraceContext = updater;
162154
}
163-
private _sessionResource: Uri;
164-
165155
constructor(
166156
private readonly _workspaceInfo: IWorkspaceInfo,
167157
private readonly _agentName: string | undefined,
@@ -177,21 +167,13 @@ export class CopilotCLISession extends DisposableStore implements ICopilotCLISes
177167
@IUserQuestionHandler private readonly _userQuestionHandler: IUserQuestionHandler,
178168
@IConfigurationService private readonly configurationService: IConfigurationService,
179169
@IOTelService private readonly _otelService: IOTelService,
180-
@IRunCommandExecutionService private readonly _commandExecutionService: IRunCommandExecutionService,
181170
@IGitService private readonly _gitService: IGitService,
182171
) {
183172
super();
184173
this.sessionId = _sdkSession.sessionId;
185174
this.add(toDisposable(() => this._todoSqlQuery.dispose()));
186-
this._sessionResource = SessionIdForCLI.getResource(this.sessionId);
187175
}
188176

189-
setSessionResource(resource: vscode.Uri): IDisposable {
190-
this._sessionResource = resource;
191-
return this.add(toDisposable(() => {
192-
this._sessionResource = SessionIdForCLI.getResource(this.sessionId);
193-
}));
194-
}
195177
attachStream(stream: vscode.ChatResponseStream): IDisposable {
196178
this._stream = stream;
197179
return toDisposable(() => {
@@ -544,20 +526,11 @@ export class CopilotCLISession extends DisposableStore implements ICopilotCLISes
544526
this._toolInvocationToken,
545527
this.workspaceService,
546528
this.logService,
547-
this._userQuestionHandler,
529+
this._toolsService,
548530
token,
549531
);
550532
flushPendingInvocationMessages();
551533

552-
// Update the permission picker dropdown based on the selected action
553-
if (response.approved && response.selectedAction !== 'exit_only') {
554-
const autopilotSelected = response.selectedAction === 'autopilot' || response.selectedAction === 'autopilot_fleet';
555-
const commandId = 'workbench.action.chat.copilotcli.approval';
556-
this._commandExecutionService.executeCommand(commandId, this._sessionResource, autopilotSelected).catch(error => {
557-
this.logService.error(error, '[CopilotCLISession] Failed to update permission picker');
558-
});
559-
}
560-
561534
this._sdkSession.respondToExitPlanMode(event.data.requestId, response);
562535
} catch (error) {
563536
this.logService.error(error, '[CopilotCLISession] Error handling exit plan mode');

0 commit comments

Comments
 (0)