Rewind file tracking backs up gitignored secret files; add an exclude or an off switch
還沒有人認領這個 Issue。
評估
研究方向
The report identifies enableFileChangeTracking as the interactive CLI entry point and session-state/<session-id>/rewind-file-snapshots/backups/ plus index.json as the affected output. Start by tracing how the CLI enables tracking and how the tracker selects and writes files; the issue does not name source files or tests. Done means secret-file backups can be excluded or tracking disabled, and backups use mode 600.
由索引模型根據 Issue 內容生成。
描述
Version: Copilot CLI 1.0.91, Linux x64, interactive mode.
What happens
Since /rewind became git-free (1.0.78), the CLI saves the earlier content of every file that a turn changes under the session's working directory into session-state/<session-id>/rewind-file-snapshots/backups/. Gitignored files are included. When the agent edits a .env file in a turn (for example to rotate an API token), the old file, with every secret in it, stays in session state as a plain file at mode 644. It stays there after the session ends.
A session with one long autonomous turn has one snapshot, so every file that turn changes is held in that snapshot.
What I checked
copilot help config,copilot help environmentandcopilot --helpname no setting, flag or variable for rewind file tracking.respectGitignorecovers only the@file picker.- The interactive CLI starts each session with
enableFileChangeTrackingset totrueas a constant. Only SDK clients can pass the option. - The tracker skips a file only for its size, a non-regular file or an unverifiable identity. It does not skip files that
.gitignoreexcludes or files that hold secrets.
Steps to reproduce
- In a git repository, put
.env.localin.gitignoreand give it a line such asEXAMPLE_TOKEN=old-value. - Start
copilotin that repository and ask it to change the value tonew-valuewith a shell command. - List
session-state/<session-id>/rewind-file-snapshots/backups/. One file holdsEXAMPLE_TOKEN=old-value, andindex.jsonmaps it to.env.local.
Expected
A secret file that Copilot edits does not stay copied in session state. Any one of these would do:
- Skip files that
.gitignoreexcludes, or files that match.env*, when the tracker saves earlier content./rewindthen lists them as not restorable. - A setting, for example
rewind.excludePatterns, that takes path patterns the tracker skips. - A setting or flag that turns off file tracking, leaving conversation-only rewind.
Also: write the backups at mode 600, the same as the other session files.
- 主要語言
- Shell
- 星號
- 11.3k
- 分支
- 2k
- PR 合併指標
- 30 天內沒有已合併 PR
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 沒有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
github/copilot-cli 的其他 Issue
-
area:models area:sessions
難度 2/5 1-3 小時 新手友好度 76/100
github/copilot-cli#5189 · 1 個 reaction ·
-
area:configuration area:input-keyboard
難度 2/5 1-3 小時 新手友好度 62/100
github/copilot-cli#5159 ·
-
area:sessions
難度 2/5 1-3 小時 新手友好度 72/100
github/copilot-cli#5147 · 1 則留言 ·
-
area:input-keyboard
難度 2/5 1-3 小時 新手友好度 66/100
github/copilot-cli#5113 ·
-
area:sessions
難度 2/5 1-3 小時 新手友好度 72/100
github/copilot-cli#4996 ·
查看 github/copilot-cli 的全部 Issue
相似的 Issue
-
product-to-storybook is skipped silently by npx skills add because its frontmatter is invalid YAML未關閉
難度 1/5 1 小時以內 新手友好度 83/100
-
難度 2/5 1-3 小時 新手友好度 83/100
維護者通常 1 天內回覆
-
bug github_actions security
難度 2/5 1-3 小時 新手友好度 76/100
DewaldOosthuizen/tech-cheat-sheets-and-notes#388 ·
維護者通常 1 天內回覆
-
automated issue report
難度 1/5 1 小時以內 新手友好度 72/100
a2aproject/A2A#2376 ·
維護者通常 3 天內回覆
-
priority: low
難度 2/5 1-3 小時 新手友好度 76/100
melodic-software/claude-code-plugins#8831 · 1 則留言 ·
維護者通常 1 天內回覆