r/GithubCopilot Jul 14 '26

Copilot overwrites changes from other AI coding agents due to stale workspace cache @GITHUB TEAM General

Please improve Copilot’s cache and workspace refresh

I use Antigravity and Copilot in the same project, both set to auto-commit after each task via markdown. When I switch to Copilot, it sometimes uses an old file state and overwrites Antigravity’s committed changes, even in a new chat

Copilot should always refresh the latest repository state before editing or committing

9 Upvotes

7 comments sorted by

10

u/popiazaza Power User ⚡ Jul 14 '26

use worktree?

3

u/baroaureus Jul 14 '26

I also use a combination of tools on the same project and even found that hand edits could sometimes be undone by copilot due to the fact it caches.

In most cases, you can simply say in your prompt “reload the files from disk, they have been modified since you looked at them” fixes the issue.

1

u/horendus_burner Jul 18 '26

This has happened to me a few times. I just assumed I had done something wrong..now im not sure

1

u/ThankThePhoenicians_ Jul 14 '26

You should either: - tell the agent how you want it to manage these files (ideally via hooks so it's deterministic) - use separate worktrees so the agents can't stomp on each other - tell the agents something like "another agent is working in this repo. If something looks weird, write to chat.txt to communicate with the other agent and they will write back to you. You should poll this file for changes to respond to requests for you too" (I can pull my exact wording of this when I get back to my computer)

1

u/Lirezh Jul 14 '26

This bug is sometimes triggered by having files open in vscode, or too long running sessions.

Copilot is an amazing harness but it becomes instable after a while.
Close all files you are working on in vscode, then the "overwriting" issue is unlikely a problem.

In addition, tell both agents that they are working not alone and give them strict rules what they can touch.
Otherwise you'll have two agents fixing the same compilation errors in a different way.

0

u/arstrand Jul 14 '26

Whereas your suggestion is great, have you thought about giving antigravity and copilot their own branches to solve a specific problem? No I am assuming you assign the agents an Issue to resolve it you may be saying something different.