Skip to content

feat: add config-change extension contributor#22488

Merged
jif-oai merged 2 commits into
mainfrom
jif/config-contrib
May 13, 2026
Merged

feat: add config-change extension contributor#22488
jif-oai merged 2 commits into
mainfrom
jif/config-contrib

Conversation

@jif-oai
Copy link
Copy Markdown
Collaborator

@jif-oai jif-oai commented May 13, 2026

Why

Extensions can observe thread and turn lifecycle events today, but there was no single host-owned hook for changes to the effective thread configuration. That makes features that need to react to model, permission, or tool-suggest updates either depend on individual mutation paths or risk going stale after runtime config refreshes.

This adds a typed config-change contributor so extension-owned state can stay synchronized with the effective thread config while the host remains responsible for deciding when config changed.

What Changed

  • Added ConfigContributor<C> to codex_extension_api, with before/after immutable snapshots of the effective config plus session/thread extension stores.
  • Added registry builder/accessor support through config_contributor and config_contributors.
  • Emits config-change callbacks after committed updates from session settings, per-turn setting updates, and refresh_runtime_config.
  • Builds effective config snapshots only when config contributors are registered, and suppresses no-op callbacks when the before/after snapshots are equal.
  • Added a core session regression test that verifies contributors observe both model changes and user-layer runtime config changes, including access to session and thread extension stores.

Validation

Added config_change_contributor_observes_effective_config_changes in codex-rs/core/src/session/tests.rs to cover the new contributor path.

@jif-oai jif-oai requested a review from a team as a code owner May 13, 2026 12:33
@jif-oai jif-oai changed the title feat: config update contributor feat: add config-change extension contributor May 13, 2026
@jif-oai
Copy link
Copy Markdown
Collaborator Author

jif-oai commented May 13, 2026

@codex review

Copy link
Copy Markdown
Contributor

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8915124e18

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread codex-rs/core/src/session/mod.rs
@jif-oai jif-oai merged commit 34bb855 into main May 13, 2026
26 of 27 checks passed
@jif-oai jif-oai deleted the jif/config-contrib branch May 13, 2026 15:13
@github-actions github-actions Bot locked and limited conversation to collaborators May 13, 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.

2 participants