compact_prompt is loaded but ignored for OpenAI remote compaction

Open 💬 0 comments Opened Jul 20, 2026 by skorkac

What version of Codex CLI is running?

Codex version: 0.144.6

What subscription do you have?

Enterprise

Which model were you using?

gpt-5.6-sol

What platform is your computer?

Linux 4.18.0-553.124.1.el8_10.x86_64 x86_64 x86_64

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

_No response_

Codex doctor report

What issue are you seeing?

In codex-rs/core/src/tasks/compact.rs, config.compact_prompt is read only
in the local-compaction branch. The built-in OpenAI provider reports remote
compaction support and is routed through compact_remote or compact_remote_v2, neither of which consumes config.compact_prompt.

Therefore both manual and automatic compaction silently ignore the documented setting for the default OpenAI provider. experimental_compact_prompt_file has
the same problem because it resolves into the same config field.

compact_prompt is explicitly documented as: https://learn.chatgpt.com/docs/config-file/config-reference#configtoml

config/read confirms the setting loads successfully.

=====================
Codex version: 0.144.6
Platform: Linux
Provider: built-in OpenAI
Model: gpt-5.6-sol

codex_home=/nobackup/skorka/context_compaction/.codex
compact_prompt_loaded=true
config_probe=WORKSPACE_CONFIG_LOADED_20260720
context_compaction_started=true
context_compaction_completed=true
post_compaction_response=NONE

What steps can reproduce the bug?

  1. Using Codex CLI 0.144.6 with the built-in OpenAI provider, create or open a trusted Git repository.
  1. Add the following project-local .codex/config.toml:

developer_instructions = """
When the user sends CONFIG_PROBE_REQUEST, reply exactly:
WORKSPACE_CONFIG_LOADED
"""

compact_prompt = """
Begin the compacted summary with exactly this identifier:
CUSTOM_COMPACT_MARKER_7F3A

Then provide the normal handoff summary.
"""

  1. Start a new Codex session from the repository and accept the project trust prompt.
  1. Send CONFIG_PROBE_REQUEST. Confirm that Codex replies WORKSPACE_CONFIG_LOADED. This demonstrates that the project-local config was loaded.
  1. Continue with one or more ordinary turns. Do not mention CUSTOM_COMPACT_MARKER_7F3A anywhere in the conversation.
  1. Run /compact manually and wait for context compaction to complete.
  1. Send the following message:

During the immediately preceding compaction, you were instructed to begin
the summary with a unique all-caps identifier. Reply with only that
identifier. If no identifier is present in your compacted context, reply NONE.

  1. Observe that Codex replies NONE, or otherwise cannot identify the marker.

Expected behavior:

Codex should reply CUSTOM_COMPACT_MARKER_7F3A, proving that the documented compact_prompt was used.

Actual behavior:

The project configuration loads and compaction completes, but the marker is absent. The built-in OpenAI provider routes compaction through the remote compaction implementation, which does not consume config.compact_prompt.

What is the expected behavior?

Codex should reply CUSTOM_COMPACT_MARKER_7F3A, proving that the documented compact_prompt was used.

Additional information

_No response_

View original on GitHub ↗