gpt-5.4 in Codex CLI appears to inject unrelated context/patterns into responses during coding tasks

Resolved 💬 3 comments Opened Mar 7, 2026 by kaid Closed Mar 29, 2026

What version of Codex CLI is running?

codex-cli 0.111.0

What subscription do you have?

ChatGPT Pro

Which model were you using?

gpt-5.4 hight

What platform is your computer?

Darwin 25.3.0 arm64 arm

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

Ghostty 1.2.3 build 6d2dd585a

What issue are you seeing?

When using gpt-5.4 in Codex CLI for coding tasks, I am seeing what looks like context contamination / unrelated pattern injection.

Instead of staying grounded in the current repository, prompt, and visible conversation context, the model sometimes introduces code structure, naming patterns, assumptions, or implementation details that do not appear to come from the current task. This makes the output feel "polluted" by unrelated prior patterns or latent examples, rather than tightly scoped to the active codebase and instructions.

This is not just ordinary hallucination in the abstract. The failure mode is specifically that the model appears to:

  • import conventions, APIs, or architectural assumptions that are not present in the current repo
  • continue with stylistic or structural patterns that were never established in the current thread
  • generate edits that feel anchored to an unrelated codebase or prior task template
  • become less locally faithful than expected during iterative coding/editing

Expected behavior

The model should remain tightly grounded in:

  1. the current repository contents,
  2. the visible conversation / instructions,
  3. the immediate editing context.

If it needs to assume something, those assumptions should stay minimal and local to the current task.

Actual behavior

gpt-5.4 sometimes introduces unrelated abstractions, invented project conventions, or off-target implementation patterns that do not match the current codebase. In practice this degrades trust and makes iterative coding harder, because the model can "drift" into a different latent template instead of continuing the actual local design.

Reproduction pattern

I do not yet have a perfectly minimal repro, but I have seen this during normal coding sessions in Codex CLI where:

  • the task involves code editing or extension of an existing codebase
  • the repo has its own conventions and architecture
  • the model is asked to continue/refactor/patch incrementally
  • after a few turns, the output starts reflecting unrelated assumptions rather than the local code context

Impact

This is especially harmful in CLI coding workflows because the model may still sound confident and produce plausible code, but the code is subtly misaligned with the actual repository. The result is extra review overhead and lower trust in model-grounded edits.

Additional context

Feedback was uploaded from Codex CLI and associated with thread ID:

019cc128-9f08-7403-aa94-472838cb8a83

If useful, I can provide a more concrete repro transcript with sensitive details redacted.

<img width="1107" height="45" alt="Image" src="https://github.com/user-attachments/assets/2a3f4162-3148-4f5b-a78e-cc373c7dcc4d" />

What steps can reproduce the bug?

Uploaded thread: 019cc128-9f08-7403-aa94-472838cb8a83

What is the expected behavior?

The model should stay tightly grounded in the current repository, the visible conversation context, and the user's explicit instructions.

During code generation, editing, and refactoring tasks, it should:

  • continue the local architecture and naming conventions already present in the codebase
  • avoid introducing APIs, abstractions, helper layers, or patterns that are not supported by the current repo context
  • make only minimal, local assumptions when information is missing
  • remain stable across iterative turns instead of drifting toward unrelated coding patterns or templates

In short, the expected behavior is strong local faithfulness: Codex should behave like it is extending the current project, not blending in latent patterns from unrelated tasks or repositories.

Additional information

_No response_

View original on GitHub ↗

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