App-server config write APIs cannot target project .codex/config.toml (user config only)

Resolved 💬 3 comments Opened Feb 13, 2026 by songkeys Closed May 10, 2026

What version of Codex is running?

Observed on openai/codex current main in v0.101.0.

What issue are you seeing?

config/read can resolve and return project layers (.codex/config.toml) when cwd is provided, but config/value/write and config/batchWrite reject writing to project config paths and only allow writes to $CODEX_HOME/config.toml.

This makes project-scoped config effectively read-only through the app-server protocol.

Steps to reproduce

  1. Create a repo with a trusted project and a project config file:
  • <repo>/.codex/config.toml
  1. Call config/read with cwd=<repo> and includeLayers=true.
  • Observe a Project layer in layers, and/or origins pointing to Project.
  1. Attempt to write a project-scoped key using:
  • config/value/write with filePath="<repo>/.codex/config.toml" (or equivalent absolute path),
  • or config/batchWrite with that same filePath.
  1. Observe error response:
  • config_write_error_code: "configLayerReadonly"
  • message: Only writes to the user config are allowed
  1. If filePath is omitted, the write succeeds but updates $CODEX_HOME/config.toml (user/global scope), not project scope.

Expected behavior

One of these (in order of preference):

  1. Support project-layer writes in config RPC:
  • explicit targeting, e.g. targetLayer: "project" + cwd, or
  • allow filePath to point at trusted .codex/config.toml with guardrails.
  1. If project writes are intentionally unsupported, make that explicit in protocol/docs and narrow filePath semantics to avoid implying arbitrary writable config target files.

Actual behavior

Write APIs are hard-restricted to user config path, even when the protocol can read project layers.

Why this matters

Protocol clients can read effective/project config but cannot persist project-scoped changes.
They must mutate global user config instead, which leaks project-specific settings across repositories.

Additional context (source references)

  • ConfigReadParams.cwd explicitly describes project-layer resolution.
  • ConfigValueWriteParams.file_path / ConfigBatchWriteParams.file_path accept a path and say it defaults to user config when omitted.
  • core/src/config/service.rs enforces:
  • allowed write target = $CODEX_HOME/config.toml
  • otherwise returns ConfigLayerReadonly with message Only writes to the user config are allowed.
  • App-server README currently describes write RPCs as writing user config.

Happy to help test a fix if there is a preferred API shape.

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗