github / github/copilot-cli

GitHub Copilot CLI session state management failure - ENOENT error when trying to update plan.md file

Đang mở
#1,111 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
area:installation area:sessions
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

# 🐛 Bug Report / 📋 Issue Summary

**Brief Description:**
GitHub Copilot CLI session state management failure - ENOENT error when trying to update plan.md file

# 📝 Environment Information

- **Operating System:** Linux
- **Software Version:** GitHub Copilot CLI v0.0.394 (Commit: 3d79feb)
- **Browser/Runtime:** Terminal/CLI environment
- **Additional Environment Details:**
- Session ID: [session-id-redacted]

# 🔍 Steps to Reproduce

1. Start GitHub Copilot CLI development session
2. Complete development tasks successfully
3. Copilot CLI triggers context window compaction/summarization
4. Context window update completed
5. Copilot CLI attempts to update session state plan.md file
6. Error occurs when trying to edit the plan.md file

# 📋 Expected Behavior

Copilot CLI should successfully update its internal session state files (plan.md) after completing development phases, allowing the workflow to continue smoothly.

# ❌ Actual Behavior

Copilot CLI fails to update the plan.md file with an ENOENT (file not found) error, interrupting the development workflow despite successful completion of the actual development tasks.

# 📊 Error Logs

```
✗ Edit .github/copilot/session-state/52770d1f-ed4c-4567-82b1-48948bed0ba4/plan.md
Unhandled error: Error: ENOENT: no such file or directory, open
'/path/to/project/.github/copilot/session-state/[session-id]/plan.md'
```

**Session Context:**
```
✗ Create backend/container/internal/trace/context_test.go
Path not absolute

✓ Development tasks completed successfully

● Summarizing conversation to fit within context window.
Compaction completed
└ press ctrl+o to view summary

● Conversation summary finished and context window updated.

✗ Edit .github/copilot/session-state/[session-id]/plan.md
Unhandled error: Error: ENOENT: no such file or directory
```

# 🖼️ Screenshots/Additional Evidence

**Session State Directory Structure Issue:**
- Expected path: `~/.copilot/session-state/[session-id]/plan.md`
- Actual attempted path: `/path/to/project/.github/copilot/session-state/[session-id]/plan.md`

**Timeline:**
- ✅ Development tasks completed successfully
- 🔄 Context window compaction/summarization triggered
- ✅ Context window update completed
- ❌ Session state update failed immediately after

# 🔧 Possible Solution

1. **Context Window Operation Issue:** The error occurred immediately after a context window compaction/summarization operation, suggesting the context update process may have corrupted session state management
2. **File Path Resolution Issue:** Copilot CLI might be incorrectly constructing the path to session state files after context updates
3. **Session State Persistence Bug:** Context window updates might not properly preserve session state file references

**Suggested Fixes:**
- Ensure session state file references are properly preserved during context window operations
- Validate and restore session state paths after context compaction
- Add proper error handling for session state file operations post-context updates

# 📚 Additional Context

This error occurred during a development session where all actual development tasks completed successfully. The issue is specifically with Copilot CLI's internal session state management after a context window compaction operation, suggesting the context summarization process may interfere with session state file tracking.

The error suggests a mismatch between where Copilot CLI expects to find session state files and where it's actually looking for them.

---

### 📋 Checklist

- [x] I have searched existing issues to confirm this is not a duplicate
- [x] I have provided complete error logs
- [x] I have provided reproduction steps
- [x] I have described the expected behavior

### 🏷️ Labels

**Suggested Labels:** `bug`, `cli`, `session-management`, `file-system`, `copilot-cli`, `context-window`

### Affected version

0.0.394 Commit: 3d79feb

### Steps to reproduce the behavior

_No response_

### Expected behavior

_No response_

### 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.