Skip to content

Add remote thread config loader protos#18892

Merged
rasmusrygaard merged 6 commits intomainfrom
dev/rasmus/session_cfg_proto
Apr 23, 2026
Merged

Add remote thread config loader protos#18892
rasmusrygaard merged 6 commits intomainfrom
dev/rasmus/session_cfg_proto

Conversation

@rasmusrygaard
Copy link
Copy Markdown
Contributor

@rasmusrygaard rasmusrygaard commented Apr 21, 2026

Why

Thread-scoped config needs a stable boundary between the app/session owner and the config stack. Instead of having call sites manually copy thread config fields into individual overrides, this adds the proto and Rust plumbing needed for a ThreadConfigLoader implementation to return typed sources that can be translated into ordinary config layer entries.

Keeping the remote payload typed also makes precedence easier to reason about: session-owned thread config maps back to the existing session config source, while user-owned thread config is represented separately without introducing a new config-layer source until it has TOML-backed fields.

What changed

  • Added the codex.thread_config.v1 protobuf service and generated Rust module for loading thread config sources.
  • Added RemoteThreadConfigLoader, which calls the gRPC service, parses SessionThreadConfig / UserThreadConfig, and validates provider fields such as wire_api, auth timeout, and absolute auth cwd.
  • Added proto generation tooling under config/scripts/generate-proto.sh and config/examples/generate-proto.rs.
  • Added ThreadConfigLoader::load_config_layers, plus static/no-op loader helpers, so tests and callers can use the same typed loader interface while config-layer translation stays centralized.

Verification

  • cargo test -p codex-config thread_config

@rasmusrygaard rasmusrygaard changed the title Add thread store config protos Add remote thread config loader protos Apr 21, 2026
@rasmusrygaard rasmusrygaard marked this pull request as ready for review April 21, 2026 22:33
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: 96609c22b3

ℹ️ 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/config/src/thread_config/remote.rs Outdated
Copy link
Copy Markdown
Contributor

@wiltzius-openai wiltzius-openai left a comment

Choose a reason for hiding this comment

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

seems reasonable

I think there's no local implementation yet? I opted to try to keep the local implementation of the interface ahead of the remote implementation, mainly because as I plumbed in the local version I found various details of the interface needed to change. Not a requirement just a thought about ordering.

@@ -0,0 +1,19 @@
use std::path::PathBuf;

fn main() -> Result<(), Box<dyn std::error::Error>> {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

would love a better place to put the proto generation than examples but I couldn't figure out a better way to do it with the repo build rules

@rasmusrygaard
Copy link
Copy Markdown
Contributor Author

Good flag! Local implementation is a no-op because since we don't inject any new config. I have the wiring in a stacked branch on top of this, but it just injects the NoOp loader

@rasmusrygaard rasmusrygaard force-pushed the dev/rasmus/session_cfg_proto branch from 76adf66 to 77a8e29 Compare April 22, 2026 22:54
@rasmusrygaard rasmusrygaard merged commit 0b4f694 into main Apr 23, 2026
25 checks passed
@rasmusrygaard rasmusrygaard deleted the dev/rasmus/session_cfg_proto branch April 23, 2026 17:06
@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.

4 participants