Skip to content

Agent thinks "background terminal" pwd is the same as the "normal terminal" pwd, leading to confusion and errors #256501

Open
@Cubox

Description

@Cubox
  • Copilot Chat Extension Version: v0.30.2025071701
  • VS Code Version: 1.103.0-insiders
  • OS Version: Windows 11
  • Feature (e.g. agent/edit/ask mode): Agent
  • Selected model (e.g. GPT 4.1, Claude 3.7 Sonnet): Sonnet 4

The agent doesn't properly handle having a "normal" terminal session and a "background" terminal session in different directories.

In my scenario, I am working on a repo that has a folder "packages/frontend" which contains my... frontend.
When tasking the agent with working on a frontend issue, it went into this folder on the terminal :

Image

However, when it tries to start it in a background terminal, it thinks this terminal is already there, when it's not:

Image Image

The agent is being told by the tools it seems that the path is correct:

Image

However, even if you try to tell it to cd into it first, the recently added feature of "stripping the cd from the command" is messing it up:

Image

I don't have time to grab the full debug logs and prompts (and censor them accordingly), but if needed to fix this, let me know.

@isidorn

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions