codex - 💡(How to fix) Fix Error running remote compact task: invalid_request_error [2 comments, 2 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…
GitHub stats
openai/codex#17811Fetched 2026-04-15 06:27:49
View on GitHub
Comments
2
Participants
2
Timeline
13
Reactions
6
Author
Timeline (top)
cross-referenced ×4labeled ×4commented ×2unlabeled ×2

Error Message

At compaction, the following error is being returned ■ 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"
  }
}
RAW_BUFFERClick to expand / collapse

What version of Codex CLI is running?

codex-cli 0.120.0

What subscription do you have?

Pro

Which model were you using?

gpt-5.4 high

What platform is your computer?

Darwin 25.3.0 arm64 arm

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

iTerm2

What issue are you seeing?

At compaction, the following error is being returned

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

The compaction failure is causing the session to be unusable. I tried to exist and resume but it didn't work, the session seems dead.

What steps can reproduce the bug?

Long lived session.

What is the expected behavior?

Compaction can succeed and session can resume.

Additional information

No response

extent analysis

TL;DR

The error "Unknown parameter: 'prompt_cache_retention'" suggests that the prompt_cache_retention parameter is not supported in the current version of Codex CLI, and removing or updating this parameter may resolve the compaction issue.

Guidance

  • Verify the documentation for Codex CLI version 0.120.0 to confirm if the prompt_cache_retention parameter is supported.
  • Check if there are any recent updates or releases of Codex CLI that may have added support for this parameter.
  • Consider removing the prompt_cache_retention parameter from the compaction task to see if it resolves the issue.
  • If the issue persists, try restarting the session or seeking further assistance from the Codex CLI support team.

Notes

The exact cause of the issue is unclear, but it appears to be related to an unsupported parameter in the compaction task. Further investigation may be needed to determine the root cause and find a permanent solution.

Recommendation

Apply workaround: Remove the prompt_cache_retention parameter from the compaction task, as it is likely causing the error and preventing the session from resuming.

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 Error running remote compact task: invalid_request_error [2 comments, 2 participants]