Bug: Codex worktree context leaks across all worktrees (shared chats)

Open 💬 3 comments Opened Apr 26, 2026 by jacobcoro

Summary

I’m seeing cross-thread context leakage in Codex across git worktrees. A single chat thread context appears shared across multiple worktrees instead of being isolated.

Steps to reproduce

  1. On Linux/WSL, create multiple git worktrees for the same repo.
  2. Open each worktree in VS Code and run/open Codex in each.
  3. Start or open a Codex chat/thread in one worktree, then switch to another worktree.
  4. In the second worktree, observe the visible Codex chat history/context.

Expected behavior

Each worktree should isolate Codex conversations, matching expected local-context behavior (or at minimum, clearly indicate thread/worktree ownership).

Actual behavior

Chats/threads from one worktree are visible in all worktrees; context bleeds across them.

Impact

This causes accidental context confusion and cross-task contamination during multi-worktree parallel work.

Environment

  • Date/time: 2026-04-26 (UTC+8)
  • Date for issue reproduction: 2026-04-26
  • OS: WSL2 Ubuntu on Windows
  • Client: VS Code Codex extension + local wtnew-managed git worktrees
  • Repo path: /home/jacob/outlandish/outlandish_web
  • Current worktrees: /home/jacob/outlandish/outlandish_web, plus multiple .worktrees/*
  • Repo setup has .vscode/settings.json, .worktree-ports, and symlinked shared node_modules/vendor in worktrees
  • Codex CLI version: 0.125.0-alpha.3
  • Codex path in shell: /home/jacob/.local/bin/codex

Additional details

This was reproducible while using stable Codex CLI shim + wtnew/wtopen flows.

  • /home/jacob/.zshenv contains a shim so codex resolves to /home/jacob/.local/bin/codex
  • Multiple worktrees are created and opened together through helper functions, then Codex UI shows cross-worktree thread visibility

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗