Skip to content

Add workspace trust to lock file#3602

Merged
DonJayamanne merged 2 commits intomainfrom
alex/crimson-swordfish
Feb 10, 2026
Merged

Add workspace trust to lock file#3602
DonJayamanne merged 2 commits intomainfrom
alex/crimson-swordfish

Conversation

@alexweininger
Copy link
Member

No description provided.

@alexweininger alexweininger self-assigned this Feb 10, 2026
Copilot AI review requested due to automatic review settings February 10, 2026 03:29
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds workspace trust state to the Copilot CLI integration lock file so downstream consumers can understand whether the current VS Code workspace is trusted, and ensures the lock file is refreshed when trust is granted.

Changes:

  • Extend the lock file schema (LockFileInfo) to include isTrusted and write it on create/update.
  • Update the Copilot CLI contribution to refresh the lock file when workspace trust is granted.
  • Update unit tests to mock vscode.workspace.isTrusted and assert the field is written.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
src/extension/agents/copilotcli/vscode-node/test/lockFile.spec.ts Mocks workspace.isTrusted and asserts isTrusted is written into the lock file JSON.
src/extension/agents/copilotcli/vscode-node/lockFile.ts Adds isTrusted to the lock file JSON payload written by createLockFile() and LockFileHandle.update().
src/extension/agents/copilotcli/vscode-node/contribution.ts Refreshes the lock file when workspace trust is granted via onDidGrantWorkspaceTrust.

ideName: string;
timestamp: number;
workspaceFolders: string[];
isTrusted: boolean;
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LockFileInfo is used both for writing new lock files and for parsing existing/stale lock files in cleanupStaleLockFiles. Existing lock files created by older versions won’t have isTrusted, so typing it as required can be misleading and could lead to future code assuming it’s always present. Consider making isTrusted optional for the on-disk type (or introduce separate read/write types and default isTrusted when missing).

Suggested change
isTrusted: boolean;
isTrusted?: boolean;

Copilot uses AI. Check for mistakes.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@DonJayamanne DonJayamanne added this pull request to the merge queue Feb 10, 2026
@vs-code-engineering vs-code-engineering bot added this to the February 2026 milestone Feb 10, 2026
Merged via the queue into main with commit 550e6b1 Feb 10, 2026
19 checks passed
@DonJayamanne DonJayamanne deleted the alex/crimson-swordfish branch February 10, 2026 10:05
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.

3 participants