Skip to content

app-server: refresh live threads from latest config snapshot#21187

Merged
jif-oai merged 6 commits into
mainfrom
jif/refresh-config
May 7, 2026
Merged

app-server: refresh live threads from latest config snapshot#21187
jif-oai merged 6 commits into
mainfrom
jif/refresh-config

Conversation

@jif-oai
Copy link
Copy Markdown
Collaborator

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

Why

App-server config writes were leaving existing threads partially stale. After a config mutation, the app-server told each live thread to run Op::ReloadUserConfig, but that path only re-read the user config.toml layer. Settings that came from the app-server's materialized config snapshot did not propagate to existing threads until restart.

This change prevent a FS access from core for CCA.

What changed

  • add CodexThread::refresh_runtime_config() and Session::refresh_runtime_config() so the app-server can push a freshly rebuilt config snapshot into a live thread
  • rebuild the latest config with each thread's cwd after config mutations, then refresh the thread from that snapshot instead of asking it to reload only config.toml
  • keep session-static settings unchanged during refresh, while updating runtime-refreshable state such as the config layer stack, tool_suggest, and derived hook/plugin/skill state
  • keep reload_user_config_layer() as the file-backed fallback for legacy local reload flows, but route the shared refresh logic through the new runtime refresh path

Testing

  • add a session test that verifies refresh_runtime_config() rebuilds hooks from refreshed config
  • add a session test that verifies runtime-refreshable fields update while session-static settings like model and notify stay unchanged

@jif-oai jif-oai requested a review from a team as a code owner May 5, 2026 13:04
@jif-oai
Copy link
Copy Markdown
Collaborator Author

jif-oai commented May 5, 2026

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown
Contributor

Codex Review: Didn't find any major issues. 👍

ℹ️ 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".

@jif-oai
Copy link
Copy Markdown
Collaborator Author

jif-oai commented May 5, 2026

@codex review

@jif-oai jif-oai changed the title feat: add a refresh_runtime_config on Codex thread app-server: refresh live threads from latest config snapshot May 5, 2026
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: ad56d24eda

ℹ️ 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/app-server/src/request_processors/config_processor.rs Outdated
Co-authored-by: Codex <noreply@openai.com>
@jif-oai
Copy link
Copy Markdown
Collaborator Author

jif-oai commented May 6, 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: 85fe8faa83

ℹ️ 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/app-server/src/request_processors/config_processor.rs Outdated
Comment thread codex-rs/app-server/src/request_processors/config_processor.rs Outdated
Comment thread codex-rs/core/src/session/mod.rs Outdated
Comment thread codex-rs/core/src/session/tests.rs
jif-oai and others added 3 commits May 6, 2026 20:26
@jif-oai jif-oai merged commit eb0462f into main May 7, 2026
26 checks passed
@jif-oai jif-oai deleted the jif/refresh-config branch May 7, 2026 17:22
@github-actions github-actions Bot locked and limited conversation to collaborators May 7, 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