github / github/copilot-cli

Regression: 'XDG_CONFIG_HOME' ignored -- no equivalent available

Đang mở
#1,954 2 bình luận 15 reaction 0 người được giao Xem trên GitHub
area:configuration
Ngôn ngữ chính
Shell
Star
11.2k
Fork
1.9k
Merge trung bình
14 giờ 16 phút
Pull request đã merge (30 ngày)
6

Mô tả

### Describe the bug

The `XDG_CONFIG_HOME` environment variable no longer appears to be respected for determining the configuration directory. This is a regression from 0.0.421.

Note that `COPILOT_HOME` and `--config-dir` are not acceptable substitutes because they also redirect machine local state, including:

* The SQLite database
* Auto-update package cache under pkg/
* Temporary .lock files

These artifacts are unsuitable for cloud sync (OneDrive) or version control (Git).

By contrast, XDG_CONFIG_HOME would only redirect the user's configuration (config.json, skills, agents, etc.). This is the motivation for separating XDG_CONFIG_HOME and XDG_STATE_HOME in the XDG spec.

### Affected version

GitHub Copilot CLI 1.0.4

### Steps to reproduce the behavior

1. Set XDG_CONFIG_HOME

```ps1
# PowerShell (Windows) — set for current session
$env:XDG_CONFIG_HOME = "D:\my_copilot_config"
```

2. Create a minimal agent under the XDG config path

```ps1
# PowerShell
New-Item -ItemType Directory -Force "$env:XDG_CONFIG_HOME\.copilot\agents"
@"
---
name: xdg-test
description: "Test agent to verify XDG_CONFIG_HOME support."
---
Reply with OK.
"@ | Set-Content "$env:XDG_CONFIG_HOME\.copilot\agents\xdg-test.agent.md"
```

3. Launch Copilot CLI and check `/agents`

```text
/agent

Custom Agents

Select Agent:
❯ 1. Default (current)

Manage Agents:
1. Create new agent...
2. Learn more about custom agents

↑↓ to navigate · Enter to select · Esc to cancel
```

### Expected behavior

xdg-test appears in the list of available agents:

```
Custom Agents

Select Agent:
❯ 1. Default (current)
2. xdg-test · user

Manage Agents:
3. Create new agent...
4. Learn more about custom agents

↑↓ to navigate · Enter to select · Esc to cancel
```

### Additional context

_No response_

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.