Directory Synchronization [Bug]
Before submitting your bug report
- [ ] I've tried using the "Ask AI" feature on the Continue docs site to see if the docs have an answer
- [ ] I'm not able to find a related conversation on GitHub discussions that reports the same bug
- [ ] I'm not able to find an open issue that reports the same bug
- [ ] I've seen the troubleshooting guide on the Continue Docs
Relevant environment info
- OS: Windows 10
- Continue version: maybe 2.53 (probably just about the latest vesion)
- IDE version: VS Code
- Model: ?
- config: Using Qwen3 30B this problem does not occur. Using Gemma 3 27B this problem does occur.
When I click on the Run button, it copies the correct command string into the PS Terminal. Which I can then hit <Enter> and the command runs successfully. Which makes me think it is something other than a malformed command string.
I wondered whether Gemma 3 maybe had not switched to the proper directory. Or maybe when it asked to switch to the proper directory, I did not click on <Accept> button. And instead I ran the command in the powershell Terminal. And Continue then did not realize that the command was already run and that it was then not synchronized.
But then, Qwen3 does not seem to have this same behavior.
This ... sounds like the most probable explanation for the behavior you're seeing. It perfectly explains why the command failed when executed via the AI agent but worked when you ran it manually in the PowerShell terminal.
Here is a breakdown of why this scenario fits all the evidence:
The Desynchronization Scenario
You likely experienced a synchronization failure between the AI Agent's environment and your manual PowerShell terminal environment.
Gemma Suggests a cd (Change Directory) Command:
The model likely recognized it needed to navigate from its default starting point (e.g., your home directory C:\Users\Name) to R:\test_repo.
It generated the command cd R:\test_repo or similar.
You Ran cd Manually, but Skipped "Accept" for the Agent:
You saw the command cd R:\test_repo suggested by the AI.
Instead of clicking the "Accept" button (which would have run the command in the Agent's hidden context), you copied the command or typed it into your visible VS Code PowerShell Terminal.
Your visible PS terminal successfully changed directory to R:\test_repo.
The Next Command Fails for the Agent:
The AI then generated the next command: git checkout old_branch.
When you clicked "Accept" this time, the Agent's hidden context executed the command without ever having run that crucial initial cd command.
The agent was still sitting in the wrong directory [in the background], failed to find a .git repository [and not knowing why it was failing], and produced the error: "error: pathspec 'old_branch' did not match any file(s) known to git."
The Command Works Manually:
When you immediately ran git checkout old_branch in your manual PS terminal, it worked because that specific window was already correctly positioned at R:\test_repo.
OR link to agent in Continue hub:
Description
No response
To reproduce
No response
Log output
Related issues found:
Terminal Command Execution Issues:
- #5996 - Running terminal commands in Agent mode results in an error (WSL)
- #8091 - Bug: Cannot run commands in terminal "The URL must be of scheme file"
- #7952 - Command Issues on Windows
- #4622 - Model cannot use "tools" after running a command in terminal
Working Directory / CWD Issues:
- #8867 - fix: HOTFIX only set cwd to workspace dir for file URIs (closed PR that addressed cwd handling)
- #7536 - feat: warning when running CLI in home dir
These issues share similar symptoms around terminal command execution, working directory handling, and environment synchronization between the agent and terminal context.
This issue hasn't been updated in 90 days and will be closed after an additional 10 days without activity. If it's still important, please leave a comment and share any new information that would help us address the issue.
This issue was closed because it wasn't updated for 10 days after being marked stale. If it's still important, please reopen + comment and we'll gladly take another look!