Skip to content

Create lockfiles in ide directory#3583

Merged
DonJayamanne merged 15 commits intomainfrom
alex/cyan-dolphin
Feb 10, 2026
Merged

Create lockfiles in ide directory#3583
DonJayamanne merged 15 commits intomainfrom
alex/cyan-dolphin

Conversation

@alexweininger
Copy link
Copy Markdown
Member

We decided these are best placed into .copilot/ide/ instead of at .copilot/. The change has already been shipped in the CLI

Copy link
Copy Markdown
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

Moves Copilot CLI integration lockfiles to live under .copilot/ide/ (instead of directly under .copilot/), aligning the extension with the already-shipped CLI behavior.

Changes:

  • Update Copilot CLI state directory helper to return <XDG_STATE_HOME or homedir>/.copilot/ide.
  • Update lockfile tests to assert the new .copilot/ide location and create the correct directory for cleanup tests.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/extension/agents/copilotcli/vscode-node/cliHelpers.ts Changes the computed state dir from .copilot to .copilot/ide.
src/extension/agents/copilotcli/vscode-node/test/lockFile.spec.ts Updates assertions/setup so lockfile tests reflect the new .copilot/ide directory.
Comment on lines 112 to 116
const handle = await createLockFile(mockServerUri, mockHeaders, logger);
createdLockFile = handle.path;

expect(handle.path).toMatch(/\.copilot.*\.lock$/);
expect(handle.path).toMatch(/\.copilot[/\\]ide.*\.lock$/);
expect(fs.existsSync(handle.path)).toBe(true);
Copy link

Copilot AI Feb 9, 2026

Choose a reason for hiding this comment

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

These createLockFile tests call createLockFile(...) without setting XDG_STATE_HOME, so they write into the real user home directory (now ~/.copilot/ide). The test only deletes the lock file, leaving the .copilot/ide directory behind and making the suite non-hermetic. Set process.env.XDG_STATE_HOME to a temp dir for this describe block (and restore it in afterEach/afterAll) so all filesystem writes are contained and fully cleaned up.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Collaborator

@DonJayamanne DonJayamanne left a comment

Choose a reason for hiding this comment

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

Can we make the I/O async

Copy link
Copy Markdown
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

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

@alexweininger
Copy link
Copy Markdown
Member Author

I'll follow up these changes with a PR that stops using the deprecated server.tool

Copy link
Copy Markdown
Collaborator

@DonJayamanne DonJayamanne left a comment

Choose a reason for hiding this comment

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

@copilot address the review comments

@alexweininger
Copy link
Copy Markdown
Member Author

@copilot address the review comments

DonJayamanne
DonJayamanne previously approved these changes Feb 9, 2026
@vs-code-engineering vs-code-engineering bot added this to the February 2026 milestone Feb 9, 2026
roblourens
roblourens previously approved these changes Feb 10, 2026
@DonJayamanne DonJayamanne added this pull request to the merge queue Feb 10, 2026
Merged via the queue into main with commit b248059 Feb 10, 2026
19 checks passed
@DonJayamanne DonJayamanne deleted the alex/cyan-dolphin branch February 10, 2026 01:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

5 participants