Skip to content

Cross-session leaking during /review #15027

Open

Description

@backnotprop

What version of Codex CLI is running?

codex-cli 0.115.0

What subscription do you have?

$200

Which model were you using?

5.4

What platform is your computer?

mac

What terminal emulator and version are you using (if applicable)?

ghostty

What issue are you seeing?

Seeing something egregious happening (only observed in /review which is what i mostly use codex for)

/review pr1 # in wt1

here is my pr1 review

/review pr2 # in wt2

here is my pr2 review

/review pr3 # in wt3

here is my pr1 review <---- Issue

And I'm clearly dumbfounded because I'm in a new chat, new session, new worktree. This, to me, indicates some type of cross-session leaking.

This seems to get worse over time. It also seems somewhat random and inconsistent, but again what even doesn't help is when I run /new

So there's some weird complex session or state management issues going on.

What steps can reproduce the bug?

I don't know, bro. I'm running like four different worktrees, each one is isolated. I launch /review In each of them, somehow they end up overlapping or Codex ends up referencing older reviews from other worktrees.

What is the expected behavior?

No response

Additional information

No response

Activity

  1. raye-deng commented on Mar 19, 2026

    @raye-deng

    Cross-session leaking during code review is a particularly dangerous failure mode because it undermines trust in the entire review output.

    We have been observing a related pattern in production teams: AI review tools that maintain any form of session state or context caching can produce "review contamination" — where findings, snippets, or even entire assessment summaries from Project A bleed into the review of Project B. The developer sees a confident, well-structured review and has no way to know that half of it is referencing the wrong codebase.

    The root cause in most implementations we have seen is some combination of: (1) context windows that do not fully reset between sessions, (2) embedding caches keyed by file paths that collide across worktrees, or (3) retrieval augmentation that pulls from a shared index.

    This is one of the reasons we went with a stateless, deterministic approach for our CI-level code scanning — no session state, no caching between runs, no shared context. Each scan starts completely fresh from the file system. It is slower, but it eliminates this entire class of contamination bugs.

    The trade-off is real though: stateless means you lose the ability to do multi-turn "conversational" review, which is one of the things that makes /review useful. Hard to have both.

    For anyone wanting a complementary stateless scan: npx @opencodereview/cli scan . --sla L1

  2. backnotprop commented on Mar 20, 2026

    @backnotprop
    Author

    related #8648

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

    bugSomething isn't workingcode-reviewIssues relating to code reviews performed by codex

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions