Skip to content

Conversation

@etraut-openai
Copy link
Collaborator

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

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

In particular, if a lower-layer config overrides a profile defined in a higher-layer config, the override did not take effect. This prevents users from having project-specific profile overrides and contradicts the (soon-to-be) documented behavior of config merging.

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 layered configs.

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.
etraut-openai added a commit that referenced this pull request Jan 20, 2026
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.
Copy link
Collaborator

@bolinfest bolinfest left a comment

Choose a reason for hiding this comment

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

@etraut-openai could you please expand the PR body to explain what the fix was? I see the new unit test, which is great, but I also see a bunch of changes to TUI code that I did not expect. It seems like there is some relationship between restoring cwd and profile correctness, which is not obvious, so I think that should be explained in the PR body.

@etraut-openai etraut-openai merged commit 79c5bf9 into main Jan 20, 2026
29 of 32 checks passed
@etraut-openai etraut-openai deleted the etraut/chained_configs_profiles branch January 20, 2026 20:18
@github-actions github-actions bot locked and limited conversation to collaborators Jan 20, 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