Conversation
There was a problem hiding this comment.
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 includeisTrustedand 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.isTrustedand 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; |
There was a problem hiding this comment.
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).
| isTrusted: boolean; | |
| isTrusted?: boolean; |
src/extension/agents/copilotcli/vscode-node/test/lockFile.spec.ts
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
No description provided.