Repository navigation
Support COPILOT_HOME for Copilot CLI state - #314917
Dmitriy Vasyura (dmitrivMS) merged 12 commits into
Conversation
|
@microsoft-github-policy-service agree |
|
Agreed Montiwa11 |
There was a problem hiding this comment.
Pull request overview
Adds support for the COPILOT_HOME environment variable when resolving Copilot CLI state directories in the Copilot extension, while preserving the existing XDG and home-directory fallback behavior. This aligns the extension with the documented Copilot CLI configuration mechanism and helps Windows users avoid creating ~/.copilot by default.
Changes:
- Add
COPILOT_HOMEas the highest-precedence location for Copilot CLI state. - Refactor CLI state and session-state directory resolution to be based on
getCopilotHome().
8e74877 to
ebfc4ef
Compare
|
Don Jayamanne (@DonJayamanne) Alex Ross (@alexr00) Thanks for the review and approvals. I see Component Screenshots check is failing while the related Copilot/compile checks are passing. Since this change does not affect UI rendering, should I wait for a rerun or is there anything you would like me to do? |
Pull request was converted to draft
Co-authored-by: Copilot <[email protected]>
Use COPILOT_HOME as the configured Copilot root and otherwise fall back to ~/.copilot, matching the current CLI. XDG_STATE_HOME is now a migration source handled by the CLI rather than an active state location. Co-authored-by: Copilot <[email protected]>
8bb793b
|
Updated this PR against current The important adjustment is that If VS Code continued resolving session state or IDE lockfiles through |
|
Praneeth Kodumagulla (@praneethhere) I've made some updates, could you please help to test/verify that these changes still address original issue? |
Don Jayamanne (DonJayamanne)
left a comment
There was a problem hiding this comment.
We no longer check XDG_STATE_HOME
Let me double check
Don Jayamanne (DonJayamanne)
left a comment
There was a problem hiding this comment.
Its correct, github/copilot-cli#1750 (comment)
Yes, this is intentional - the point that AI made is that Copilot CLI does not support it any longer, only migrates on first start. |
Co-authored-by: Copilot <[email protected]>
Resolve the Copilot agent session conflict by preserving the latest agent host changes while using COPILOT_HOME for CLI session state. Co-authored-by: Copilot <[email protected]>
📬 CODENOTIFYThe following users are being notified based on files changed in this PR: TylerLeonhardtMatched files:
Benjamin Christopher Simmonds (@benibenj)Matched files:
Sandeep Somavarapu (@sandy081)Matched files:
Ladislau Szomoru (@lszomoru)Matched files:
|
|
yikes, copilot messed up the merge conflict badly |
Resolve the Copilot agent session conflict by preserving the latest agent host changes while using COPILOT_HOME for CLI session state. Co-authored-by: Copilot <[email protected]>
eaac8a9 to
d861d71
Compare
Co-authored-by: Copilot <[email protected]>
…ot-home-env' into dev/dmitriv/support-copilot-home-env
Pull request was converted to draft
282c305
Summary
Adds support for
COPILOT_HOMEwhen resolving Copilot CLI state directories across the Copilot extension, Agent Host, and workbench diagnostics.The lookup order now matches the current Copilot CLI:
COPILOT_HOME~/.copilotThe extension and Agent Host reuse a consistent Copilot home resolver for:
<COPILOT_HOME>/ideevents.jsonlunder<COPILOT_HOME>/session-stateplan.md<COPILOT_HOME>/logsThis keeps session discovery, permissions, diagnostics, and log collection aligned with the directory the Copilot CLI actually uses.
Why
XDG_STATE_HOMEis not usedOlder Copilot CLI versions stored state under
$XDG_STATE_HOME/.copilot. Current Copilot CLI versions no longer treat XDG as an active configuration location. WhenCOPILOT_HOMEis not set, the CLI migrates previous XDG-based data to~/.copilotat startup and then uses~/.copilot.Keeping
XDG_STATE_HOMEin VS Code's runtime lookup could therefore make VS Code inspect a different session-state, IDE lockfile, or diagnostics directory than the CLI itself. This change removes that mismatch while retaining migration responsibility in the CLI.Remote Agent Host diagnostics continue to use the remote host's reported home directory because AHP does not currently expose the remote process's
COPILOT_HOME.The affected tests set and restore
COPILOT_HOMEexplicitly so they remain hermetic when a developer or CI environment already defines it.Fixes #314806
Validation
npm run precommitnpm run typecheck-clientandnpm run valid-layers-checkcurrently reach an unrelated existing error insrc/vs/platform/agentHost/node/copilot/copilotSystemNotification.tson the latestmain.