Skip to content

Conversation

@etraut-openai
Copy link
Collaborator

@etraut-openai etraut-openai commented Jan 20, 2026

This PR adds support for chained (layered) config.toml file merging for clients that use the app server interface. This feature already exists for the TUI, but it does not work for GUI clients.

It does the following:

  • Changes code paths for new thread, resume thread, and fork thread to use the effective config based on the cwd.
  • Updates the config/read API to accept an optional cwd parameter. If specified, the API returns the effective config based on that cwd path. Also optionally includes all layers including project config files. If cwd is not specified, the API falls back on its older behavior where it considers only the global (non-project) config files when computing the effective config.

The changes in codex_message_processor.rs look deceptively large. They mostly just involve moving existing blocks of code to a later point in some functions so it can use the cwd to calculate the config.

This PR builds upon #9509 and should be reviewed and merged after that PR.

Tested:

  • Verified change with (dependent, as-yet-uncommitted) changes to IDE Extension and confirmed correct behavior

The full fix requires additional changes in the IDE Extension code base, but they depend on this PR.

This PR fixes a small issue with chained (nested) config.toml file merging. The old logic didn't properly handle profiles.

The change adds a unit test for this case. It also exposes a function from the config crate that is needed by the app server code paths to implement support for chained configs.
This PR adds support for chained (layered) config.toml file merging for clients that use the app server interface.

It does the following:
* Changes code paths for new thread, resume thread, and fork thread to use the effective config based on the cwd.
* Updates the `config/read` API to accept an optional `cwd` parameter. If specified, the API returns the effective config based on that cwd path. Also optionally includes all layers including project config files. If cwd is not specified, the API falls back on its older behavior where it considers only the global (non-project) config files when computing the effective config.

The changes in codex_message_processor.rs look deceptively large. They mostly just involve moving existing blocks of code to a later point in some functions so it can use the cwd to calculate the config.

This PR builds upon #9509 and should be reviewed and merged after that PR.
# Conflicts:
#	codex-rs/core/src/config/mod.rs
#	codex-rs/tui/src/lib.rs
#	codex-rs/tui2/src/lib.rs
Copy link
Collaborator

@owenlin0 owenlin0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

API changes look good to me, just would like an expanded docstring (from my comments above)

@etraut-openai etraut-openai merged commit 2ca9a56 into main Jan 21, 2026
30 of 32 checks passed
@etraut-openai etraut-openai deleted the etraut/layered_configs_app_server branch January 21, 2026 22:21
@github-actions github-actions bot locked and limited conversation to collaborators Jan 21, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants