DEV Community

aicoding-guide
aicoding-guide

Posted on Originally published at aicoding-guide.com

What changed in Codex CLI v0.167, codex agents and the auto-compaction fix

Originally published at https://aicoding-guide.com.

Codex CLI v0.167.0 ships six new features, six bug fixes, two documentation changes and two chores. Two of them matter for everyday work: the agent command center gets unread markers, and automatic context compaction now counts tokens it used to miss.

One caveat first. This release contains a flag spelling that the official documentation contradicts outright, so it is worth knowing before a command fails on you.

Key point
What you will learn

  • What codex agents opens, and whether you may pass --no-daemon to it
  • What automatic context compaction now counts, and where to set its threshold
  • Which v0.167.0 settings are still missing from the configuration reference

Opening the agent command center with codex agents

The first release note reads: "Open the agent command center with codex agents --no-daemon. The command center and session picker now mark unread results". The screen that lists chats on a shared server now flags results you have not read.

codex agents itself is documented, with maturity Stable. The command overview describes it as "Open the agent command center on a shared local or remote server", and its own section as "Open the command center to browse chats and switch between agents on a shared server".

Flag What it does
--remote <URL> Connect to a remote server
--cd <DIR> Set the directory used for new remote tasks
--remote-auth-token-env A global flag, documented as requiring --remote

You can reach the same screen from inside the TUI with /agents, listed in the slash-command table as "Open the agent command center." with the when-to-use note "Browse chats and switch between agents on the connected server." A separate /subagents command switches the active subagent thread.

The docs say --no-daemon cannot be combined with codex agents
As of 2026-11-09 the codex agents section states "codex agents doesn't support --no-daemon". The global --no-daemon flag ("Run the interactive CLI without the shared background server.") carries the matching note "Can't be combined with --remote or codex agents". The v0.167.0 release notes spell the command with that flag anyway. Which one reflects the current implementation could not be confirmed in the official documentation. Start with a plain codex agents and only reach for the flag if that fails.

Automatic compaction now counts failed responses

The widest-reaching fix is: "Automatic context compaction now accounts for retained output from failed responses and responses with missing token usage data". Retained output from failed responses, and responses whose token usage never arrived, now feed into the compaction decision.

Until now those tokens went uncounted, so Codex judged compaction against a figure lower than real consumption. That is exactly the kind of drift that lets a long session run out of context without compaction ever firing.

The threshold lives in config.toml. These four keys are the ones documented today.

# Token threshold that triggers automatic history compaction
model_auto_compact_token_limit = 300000

# How the threshold is counted: "total" counts the full active context,
# "body_after_prefix" counts only growth after the carried compaction prefix
model_auto_compact_token_limit_scope = "total"

# Turn-end compaction, as a percentage of the usable context window
model_post_turn_compact_threshold_percent = 85

# Replace the prompt used for compaction
compact_prompt = "Summarize the work so far, keeping file paths and decisions."
Enter fullscreen mode Exit fullscreen mode
Key Value Description
model_auto_compact_token_limit number Token threshold for automatic compaction. Unset uses model defaults
model_auto_compact_token_limit_scope total / body_after_prefix Defaults to total, which counts the full active context
model_post_turn_compact_threshold_percent integer 0–100 Omit or set 0 to disable turn-end compaction. The usual auto-compaction limits still apply
compact_prompt string Inline override for the compaction prompt

To compact by hand, use /compact, documented as "Summarize the visible chat to free tokens." with the advice "Use after long runs so Codex retains key points without blowing the context window." For the rest of the file, see How to write Codex config.toml and its main settings keys.

Vertex AI and system proxy settings are not in the reference yet

Two release notes touch configuration, and neither has reached the configuration reference.

The first reads: "Find API key and cloud provider options under 'Sign in another way.' Enable gcp_setup_wizard to set up Google Cloud Vertex AI with Application Default Credentials or a credential file". A key named gcp_setup_wizard could not be found in the configuration reference as of 2026-11-09. These are the Vertex AI keys that are documented.

Key Description
model_providers.gcp.project_id Google Cloud project ID for the Vertex AI endpoint. Takes precedence over GOOGLE_CLOUD_PROJECT
model_providers.gcp.location Location for the Vertex AI endpoint. Takes precedence over GOOGLE_CLOUD_LOCATION, defaults to global
model_providers.gcp.credential_file Absolute path to an Application Default Credentials file. Overrides GOOGLE_APPLICATION_CREDENTIALS only for the provider's authentication command
model_providers.gcp.base_url Override the built-in Vertex AI endpoint. Otherwise Codex builds it from the project ID and location

The second reads: "Opt into macOS or Windows system proxy settings from /experimental". The /experimental command is documented ("Toggle experimental features." / "Enable options such as Network proxy or Prevent sleep while running."), and so is the matching key features.network_proxy ("Start the network proxy for sandboxed commands (experimental; off by default)."). But reading the operating system's proxy configuration, and the handling of variables such as HTTP_PROXY, could not be confirmed on those two pages. Environment-variable behaviour lives on a separate page, so check that before you turn the setting on.

The remaining fixes

The rest of the release is about keeping state that used to be dropped.

  • Saved chats stay visible after you switch model providers. If a chat cannot resume, you can still read its transcript and prepare an editable prompt to continue elsewhere
  • Ctrl+L clears the terminal display while earlier messages stay reachable through Ctrl+T. The docs confirm only the first half, "Ctrl+L only clears the terminal view and keeps the current chat." — no documentation for Ctrl+T could be found
  • Deleting text that exposes a leading ! keeps an ordinary draft in chat mode
  • Network approval prompts close when their requests end, and concurrent requests to the same endpoint prompt one at a time
  • Long realtime V3 conversations save completed speech into chat history as the transcript grows

On the documentation side, the app-server README now covers managed network constraints under [permissions.network] and prompt-user command rules that require fresh human approval. Note that the configuration reference has no section by that literal name: it documents named profiles as [permissions.<name>] with network.* keys beneath them. For how approvals and sandboxing interact, see Codex approval_policy and sandbox_mode combinations; for the previous release, see What changed in Codex CLI v0.166, codex queue --resume and codex doctor --network-only.

Summary

  • The headline changes in v0.167.0 are unread markers in the agent command center and drafts that survive a backend switch
  • codex agents is a Stable command, but the docs deny that it accepts --no-daemon, contradicting the release notes; which one is current could not be confirmed
  • Automatic context compaction now counts retained output from failed responses and responses with missing usage data
  • Tune the threshold with model_auto_compact_token_limit and model_auto_compact_token_limit_scope
  • gcp_setup_wizard and the system-proxy option do not appear in the configuration reference pages checked here

Top comments (0)