Codex App fails to detect sub-repositories in a workspace folder and orphans conversation context

Resolved 💬 3 comments Opened Mar 10, 2026 by T-1234567890 Closed Apr 6, 2026
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

What version of the Codex App are you using (From “About Codex” dialog)?

Version 26.305.950 (863)

What subscription do you have?

Plus

What platform is your computer?

_No response_

What issue are you seeing?

Codex App does not correctly handle a workspace folder that contains multiple Git repositories.

In my setup, I have a workspace directory that contains two independent repositories:

workspace/
repository_a/.git
repository_b/.git

The workspace folder itself is NOT a Git repository.

When I move two repositories:

  1. The Codex app does not detect the repositories inside subfolders.
  2. The previous conversation context is lost after removing the folder from the Codex app (the folder isn't deleted).
  3. There is no warning that removing the repository will delete the conversation context.

This caused a loss of several hours of debugging context.

What steps can reproduce the bug?

  1. Open a Git repository in Codex App.
  2. Work with Codex for a while so the conversation builds context.
  3. Remove the repository from Codex.
  4. Add a workspace folder that contains multiple Git repositories (including the first Git repository that has the context).

Original structure:

projects/
repository_a/.git
repository_b/.git

The folder repository_a/ and repository_b/ is moved to another folder in this case.

Structure that loses context and not detecting the Git repositories in sub folders:
projects/
workspace/
repository_a/.git
repository_b/.git

  1. Codex does not detect the sub-repositories and suggests creating a Git repository in the workspace root.
  2. The previous conversation context is lost.

What is the expected behavior?

Expected behavior:

  1. Codex should detect Git repositories inside subfolders.
  2. Codex should not suggest creating a Git repository if sub-repositories already exist.
  3. Codex app should warn the user that removing a repository will delete the conversation and context.
  4. Ideally, Codex should support multi-repository workspaces so related projects can share context.

Additional information

_No response_

View original on GitHub ↗

3 Comments

github-actions[bot] contributor · 5 months ago

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #14182

Powered by Codex Action

miraclebakelaser contributor · 5 months ago

To aid on the recovery side: these conversations are never really lost, and can be recovered with some finagling to the session jsonl files. See my comment here on how to recover a thread: https://github.com/openai/codex/issues/12166#issuecomment-3931914079. You may have to adjust your remedy depending on the specifics of your situation.

T-1234567890 · 5 months ago
To aid on the recovery side: these conversations are never really lost, and can be recovered with some finagling to the session jsonl files. See my comment here on how to recover a thread: #12166 (comment). You may have to adjust your remedy depending on the specifics of your situation.

Thanks for the suggestion on recovering the session jsonl files.

That helps with recovering, but the issue here is slightly different.

The main problem is that Codex currently fails to detect valid Git repositories located inside a folder (sub-repositories).

In my case, the structure is:

workspace/
repository_a/.git
repository_b/.git

The workspace itself is not a Git repository, but the subfolders are.

Codex does not detect these repositories automatically and instead recommends creating a new repository at the workspace root.

Additionally, removing a repository from Codex removes the conversation context in the UI without warning, which makes it very easy to accidentally orphan active threads.

The jsonl helps recovery, but the expected behavior would be proper sub-repo detection (similar to JetBrains IDE) and preserving context.