Skip to content

Add remote thread config endpoint#18908

Merged
rasmusrygaard merged 3 commits intomainfrom
dev/rasmus/session_cfg_flag
Apr 23, 2026
Merged

Add remote thread config endpoint#18908
rasmusrygaard merged 3 commits intomainfrom
dev/rasmus/session_cfg_flag

Conversation

@rasmusrygaard
Copy link
Copy Markdown
Contributor

@rasmusrygaard rasmusrygaard commented Apr 21, 2026

Why

App-server needs a way to fetch thread-scoped config from the remote thread config service when the user config opts into that behavior. This mirrors the existing experimental remote thread store endpoint while keeping local/noop behavior as the default.

Startup paths also need to avoid silently dropping the remote config endpoint after the first config load. The stdio app-server path discovers the endpoint from the initial config and installs the real thread config loader for later config builds, while in-process clients used by TUI/exec now select the same remote loader directly from their provided config.

What changed

  • Added experimental_thread_config_endpoint to ConfigToml, Config, and core/config.schema.json.
  • Added config parsing coverage for the new setting.
  • Updated app-server startup to select RemoteThreadConfigLoader from the initially loaded config, falling back to NoopThreadConfigLoader when unset.
  • Let ConfigManager replace its thread config loader after startup discovery so later config loads use the selected loader.
  • Updated in-process app-server client startup to pass RemoteThreadConfigLoader when its config has experimental_thread_config_endpoint set.

Verification

  • Added experimental_thread_config_endpoint_loads_from_config_toml.
  • Added runtime_start_args_use_remote_thread_config_loader_when_configured.
  • Ran cargo check -p codex-app-server --lib.
  • Ran cargo test -p codex-app-server-client.

@rasmusrygaard rasmusrygaard force-pushed the dev/rasmus/session_cfg_flag branch from e3b5c3b to fd9a3eb Compare April 22, 2026 22:15
@rasmusrygaard rasmusrygaard force-pushed the dev/rasmus/session_cfg_proto branch from 76adf66 to 77a8e29 Compare April 22, 2026 22:54
@rasmusrygaard rasmusrygaard force-pushed the dev/rasmus/session_cfg_flag branch from fd9a3eb to c98d372 Compare April 22, 2026 22:54
cloud_requirements: Arc<RwLock<CloudRequirementsLoader>>,
arg0_paths: Arg0DispatchPaths,
thread_config_loader: Arc<dyn ThreadConfigLoader>,
thread_config_loader: Arc<RwLock<Arc<dyn ThreadConfigLoader>>>,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

can we create loader early enough not to need hot-replace?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The tricky part is that we depend on the config to resolve config settings, similar to how the cloud requirements depend on chatgpt_base_url. We can resolve the config values again here if we want to but that also seems a bit dirty

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Yeah, circular dependencies here are brutal 😢

Comment thread codex-rs/app-server/src/config_manager.rs Outdated
Base automatically changed from dev/rasmus/session_cfg_proto to main April 23, 2026 17:06
@rasmusrygaard rasmusrygaard marked this pull request as ready for review April 23, 2026 17:09
@rasmusrygaard rasmusrygaard requested a review from a team as a code owner April 23, 2026 17:09
@rasmusrygaard rasmusrygaard force-pushed the dev/rasmus/session_cfg_flag branch from c98d372 to 8d5cbba Compare April 23, 2026 17:15
@rasmusrygaard rasmusrygaard changed the title Add a new config entry for session config Add remote thread config endpoint Apr 23, 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

thread_config_loader: Arc::new(NoopThreadConfigLoader),

P1 Badge Wire remote loader into in-process app-server startup

InProcessClientStartArgs::into_runtime_start_args always passes NoopThreadConfigLoader. Even when experimental_thread_config_endpoint is set in config, in-process app-server clients (used by TUI/exec paths) never instantiate RemoteThreadConfigLoader, so remote thread-scoped config is silently ignored in this runtime mode.

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

@rasmusrygaard rasmusrygaard merged commit f11583b into main Apr 23, 2026
25 checks passed
@rasmusrygaard rasmusrygaard deleted the dev/rasmus/session_cfg_flag branch April 23, 2026 18:46
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 23, 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