Skip to content

[Bug]: Terminal fails with "Terminal cwd does not exist" after the project directory is renamed mid-thread #16923

Open

Description

@Bert0ns

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

Not sure

Steps to reproduce

  1. Open a project in the nightly build and start (or open) a thread.
  2. While the thread is open, rename the project's directory on disk (e.g. /path-to-project -> /path-to-project-renamed).
  3. In the same thread, press the "open terminal" button.

Expected behavior

The app should let the user relocate the project/thread to the renamed directory. Failing that, either a terminal opens, or the app clearly tells the user that the project directory no longer exists and how to fix it (for example relocating or re-linking the project). A terminal should not silently end up unavailable.

Actual behavior

No terminal shows up, and the only feedback is the message:

[terminal] Terminal cwd does not exist: /path-to-project

The message comes from the terminal cwd validation error in packages/contracts/src/terminal.ts. It refers to the old path and gives no hint that the project was renamed or moved, or what to do next.

The thread itself also stops working. Sending to it fails with:

This thread's workspace folder no longer exists or is not a directory: /path-to-project. Restore the folder at this path before retrying.

So the thread is unusable until the folder is restored at the old path. There is no way to point the thread or project at the renamed directory from within the app.

Impact

Minor bug or occasional failure

Version or commit

Nightly build (exact nightly version not captured)

Environment

Ubuntu 24.04 on WSL2 (Linux 6.18.33.2-microsoft-standard-WSL2), T3 Code nightly desktop build

Logs or stack traces

[terminal] Terminal cwd does not exist: /path-to-project
This thread's workspace folder no longer exists or is not a directory: /path-to-project. Restore the folder at this path before retrying.

Workaround

Renaming the directory back to its original name, as the thread error suggests (not verified).

Activity

  1. juliusmarminge commented on Oct 22, 2026

    @juliusmarminge
    Member

    Reproduced in the Linux web client on current main a12d6ed, using an isolated dev server and a throwaway Git repository.

    Added /tmp/triage-16923/project, started a Codex thread, renamed the directory to project-renamed, then opened the terminal. It displayed [terminal] Terminal cwd does not exist: /tmp/triage-16923/project. A follow-up message failed with the reported workspace-folder error. Renaming the directory back and opening a new terminal succeeded.

    The terminal error lacks the recovery instruction already present in the thread error. No matching duplicate found among open issues from the last 90 days. Nightly desktop/WSL2 was not tested.

    Reproduction: missing-folder terminal error and thread recovery instruction

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions