codex - 💡(How to fix) Fix Context compaction fails with unknown parameter 'prompt_cache_retention' [37 comments, 33 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

The app shows this error inline in the chat UI: Error running remote compact task: { "error": { "message": "Unknown parameter: 'prompt_cache_retention'.", "type": "invalid_request_error", "param": "prompt_cache_retention", "code": "unknown_parameter" } } This appears during the "Automatically compacting context" step. Instead of compacting the conversation, the app surfaces the raw API error. Error running remote compact task: { "error": { "message": "Unknown parameter: 'prompt_cache_retention'.", "type": "invalid_request_error", "param": "prompt_cache_retention", "code": "unknown_parameter" } } Error running remote compact task: { "error": {

Code Example

Error running remote compact task: { "error": { "message": "Unknown parameter: 'prompt_cache_retention'.", "type": "invalid_request_error", "param": "prompt_cache_retention", "code": "unknown_parameter" } }

---

Error running remote compact task: { "error": { "message": "Unknown parameter: 'prompt_cache_retention'.", "type": "invalid_request_error", "param": "prompt_cache_retention", "code": "unknown_parameter" } }

---

Error running remote compact task: {
  "error": {
    "message": "Unknown parameter: 'prompt_cache_retention'.",
    "type": "invalid_request_error",
    "param": "prompt_cache_retention",
    "code": "unknown_parameter"
  }
}
RAW_BUFFERClick to expand / collapse

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

26.409.20454 (1462)

What subscription do you have?

ChatGPT Pro

What platform is your computer?

Darwin 25.2.0 arm64 arm

What issue are you seeing?

While using the Codex Mac app, automatic context compaction fails instead of compacting the thread.

The app shows this error inline in the chat UI:

<img width="1632" height="632" alt="Image" src="https://github.com/user-attachments/assets/d53d4d7c-d97a-4255-b5d1-6cfecb070f21" />
Error running remote compact task: { "error": { "message": "Unknown parameter: 'prompt_cache_retention'.", "type": "invalid_request_error", "param": "prompt_cache_retention", "code": "unknown_parameter" } }

This appears during the "Automatically compacting context" step. Instead of compacting the conversation, the app surfaces the raw API error.

What steps can reproduce the bug?

  1. Open the Codex macOS app.
  2. Work in a thread until the app attempts automatic context compaction.
  3. Wait for the "Automatically compacting context" message to appear.
  4. Observe that the compact task fails with:
   Error running remote compact task: { "error": { "message": "Unknown parameter: 'prompt_cache_retention'.", "type": "invalid_request_error", "param": "prompt_cache_retention", "code": "unknown_parameter" } }

What is the expected behavior?

Automatic context compaction should complete successfully and continue the conversation normally.

Additional information

Running /compact manually on the same thread from the CLI results in this:

Error running remote compact task: {
  "error": {
    "message": "Unknown parameter: 'prompt_cache_retention'.",
    "type": "invalid_request_error",
    "param": "prompt_cache_retention",
    "code": "unknown_parameter"
  }
}

extent analysis

TL;DR

The issue is likely due to an unknown parameter 'prompt_cache_retention' in the compact task request, and removing or updating this parameter may resolve the issue.

Guidance

  • Verify that the 'prompt_cache_retention' parameter is not required for the compact task by checking the API documentation or consulting with the development team.
  • Check if there are any recent changes to the API or the Codex app that may have introduced this issue.
  • Attempt to manually compact the context using the CLI without the 'prompt_cache_retention' parameter to see if it succeeds.
  • Consider updating the Codex app to the latest version or checking for any available patches that may address this issue.

Example

No code snippet is provided as the issue is related to an unknown parameter in the API request, and without more information about the API or the request being made, it's difficult to provide a specific example.

Notes

The issue may be specific to the version of the Codex app being used (26.409.20454) or the ChatGPT Pro subscription. It's also possible that the issue is related to a recent change in the API or the app.

Recommendation

Apply workaround: Remove or update the 'prompt_cache_retention' parameter in the compact task request, as it appears to be the cause of the issue. This may require updating the Codex app or modifying the API request.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

codex - 💡(How to fix) Fix Context compaction fails with unknown parameter 'prompt_cache_retention' [37 comments, 33 participants]