[App][Windows] Benign local refactor repeatedly ends with invalid_prompt, including in a fresh thread

Open 💬 2 comments Opened Aug 25, 2026 by fullmetalsonic
💡 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)?

26.818.8289.0

What subscription do you have?

ChatGPT Pro (5x)

What platform is your computer?

Microsoft Windows NT 10.0.26200.0 x64

What issue are you seeing?

Codex Desktop repeatedly terminates ordinary local software-development tasks with:

Invalid prompt: your prompt was flagged as potentially violating our usage policy. Please try again with a different prompt: https://platform.openai.com/docs/guides/reasoning#advice-on-prompting

Important chronology: the fresh-thread prompt was not the first occurrence. The first failure happened in an existing, long-running project thread after about 81 minutes of successful benign development work.

The initial user request, translated and shortened, was:

Continue addressing the recorded audit findings step by step. Start by splitting the large single-file App.tsx/App.css structure into feature modules, keep the handover records current, and continue the already approved improvements.

During that initial turn, Codex successfully:

  • inspected local project files and Git state;
  • created/updated local handover and audit documents;
  • extracted React/TypeScript components and domain modules;
  • applied multiple local patches;
  • ran pnpm lint and pnpm build successfully multiple times.

The initial turn started at 2026-08-25 19:40:01 KST and failed at 21:01:04 KST with the invalid_prompt error instead of producing the completion response. The successful file edits remained in the working tree.

Initial affected turn ID:

01a03881-6ace-7290-8384-3eb181cf3e05

After the first failure, short continuation requests such as “Continue”, “Keep going”, and “Check the committed content and continue as appropriate” also failed. Removing the persistent goal and shortening the task did not prevent the error. The original thread contains at least ten logged turns ending with the same invalid_prompt error.

A completely new top-level thread was then used as a controlled reproduction. Its benign prompt, translated and shortened, was:

Work in the local shift-leave-pwa project. Read the two local handover/checkpoint documents and check Git status. Then connect only the already extracted staffing-needs screen component and report the lint and build results.

This fresh-thread request was a later reproduction, not the original trigger.

There was no cybersecurity activity, credential access, authentication bypass, external scan, deployment, browser automation, or third-party target.

The failure can occur after successful local tool calls and edits, including during the final response stage. This suggests that the rejection is not necessarily caused by the visible user prompt alone; accumulated conversation/tool context or response-stage processing may also be involved. This is an inference from the observed sequence, not a confirmed root cause.

What steps can reproduce the bug?

There are two observed paths.

A. Original occurrence in an existing project thread

  1. Work normally in a long-running Codex Desktop thread on a local React/Vite project.
  2. Ask Codex to continue an approved modular refactor and keep project handover/audit records current.
  3. Allow Codex to inspect files, apply ordinary TypeScript/React patches, and run pnpm lint and pnpm build.
  4. In the observed case, these operations succeeded for about 81 minutes.
  5. During the final response stage, the turn ended with the invalid_prompt policy error while the local edits remained applied.
  6. Send short continuation requests. The same error may repeat even after removing the persistent goal and reducing the task scope.

B. Controlled reproduction in a fresh top-level thread

  1. Open a completely new top-level Codex Desktop thread on Windows.
  2. Select the same ordinary local React/Vite repository.
  3. Ask Codex to read two local handover/checkpoint files and inspect Git status.
  4. Ask it to connect one already-created React component.
  5. Ask it to run lint and build and report the result.
  6. Codex reads the files, inspects the Git state, and starts the edit.
  7. The turn terminates with the same invalid_prompt error.

The fresh-thread reproduction failed after about 78 seconds. Therefore, a long conversation or a persistent goal may aggravate the issue, but neither is required for it to occur.

Fresh thread ID:

01a038f8-2a2f-70a1-9479-263dc276afcb

Affected fresh-thread turn ID:

01a038f8-58c8-78d2-ae1d-ba0b55064e35

Fresh-thread occurrence:

2026-08-25 21:51:13 KST (UTC+09:00)

Original thread ID:

019fea94-7c19-7491-987e-5b068c7bb4f9

What is the expected behavior?

The benign local implementation should complete normally.

If a policy check terminates a turn, Codex should:

  1. expose a request or feedback ID;
  2. identify the relevant safety category;
  3. state whether any files were modified;
  4. avoid leaving partially applied changes;
  5. provide a recoverable retry path.

Additional information

Models and reasoning levels:

  • Original thread: gpt-5.6-sol, xhigh
  • Fresh top-level thread: gpt-5.6-sol, high

Public source repository:

https://github.com/fullmetalsonic/shift-leave-pwa

Public integration file:

https://github.com/fullmetalsonic/shift-leave-pwa/blob/main/src/App.tsx

The rejection occurred while extracting and connecting the local component:

src/features/staffing/StaffingNeedsScreen.tsx

The relevant local change immediately before one rejection was a harmless TypeScript prop-type narrowing:

NeedCountPick<NeedCount, "applied_count" | "confirmed_count">

Local Codex logs record the failure under codex_core::session::turn. The repository and files remain readable. git status, git diff, and git diff --check work normally, so this does not appear to be file corruption or a Git problem.

No request ID, feedback ID, or specific safety category is exposed.

Related issues:

  • #39539
  • #36305
  • #7250
  • #12011

Sanitized screenshots and log excerpts can be provided if needed.

View original on GitHub ↗

2 Comments

github-actions[bot] contributor · 2 days ago

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

  • #39742
  • #39539
  • #39745
  • #40327

Powered by Codex Action

fullmetalsonic · 2 days ago

Public source repository and affected files

Public repository:

https://github.com/fullmetalsonic/shift-leave-pwa

Public integration file:

https://github.com/fullmetalsonic/shift-leave-pwa/blob/main/src/App.tsx

The rejection occurred while extracting and connecting this local component:

src/features/staffing/StaffingNeedsScreen.tsx

The component was being connected to the existing needsScreen section in src/App.tsx. At the time of the failure, StaffingNeedsScreen.tsx existed only in the local checkpoint and had not yet been pushed to the public repository.

The relevant local change immediately before one rejection was a harmless TypeScript prop-type narrowing:

NeedCountPick<NeedCount, "applied_count" | "confirmed_count">

Local checkpoint commit:

b15f47eeed95e1a48c35fd425e363fbcafc64914

Current public remote baseline:

27713c9cdad78babff0dc5e11336274298f6b64e