-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Labels
Description
When running multiple Copilot CLI sessions concurrently, changes to ~/.copilot/config.json made by one session are
overwritten by other sessions, resulting in loss of configuration changes.
Steps to reproduce:
- Start Copilot CLI session 1 in terminal window A
- Start Copilot CLI session 2 in terminal window B
- In session 1, make a configuration change (e.g., add a trusted folder with /add-dir)
- In session 2, make a different configuration change (e.g., add an allowed URL)
- Check ~/.copilot/config.json - only the last change persists, the first change is lost
Expected behavior:
Configuration changes from all sessions should be merged or preserved. Ideally:
- Use file locking to prevent concurrent writes
- Watch the config file for external changes and reload when modified
- Merge changes from multiple sessions intelligently
Actual behavior:
Each CLI session reads config.json on startup, holds it in memory, and writes the entire file back on changes,
overwriting any modifications made by other sessions.
Environment:
- Copilot CLI version:
0.0.402 - OS: Windows (but likely affects all platforms)
Suggested solutions:
- Implement file locking (flock/LockFile) during config writes
- Add file watching to detect external changes and prompt user to reload
- Use atomic read-modify-write operations with retry logic on conflicts
- Store session-specific settings separately from global config
Reactions are currently unavailable