Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions codex-rs/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions codex-rs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ members = [
"cli",
"connectors",
"config",
"config-schema",
"shell-command",
"shell-escalation",
"skills",
Expand Down Expand Up @@ -117,6 +118,7 @@ codex-cloud-tasks-client = { path = "cloud-tasks-client" }
codex-cloud-tasks-mock-client = { path = "cloud-tasks-mock-client" }
codex-code-mode = { path = "code-mode" }
codex-config = { path = "config" }
codex-config-schema = { path = "config-schema" }
codex-connectors = { path = "connectors" }
codex-core = { path = "core" }
codex-core-skills = { path = "core-skills" }
Expand Down
2 changes: 2 additions & 0 deletions codex-rs/app-server/src/message_processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,8 @@ impl MessageProcessor {
config.as_ref(),
auth_manager.clone(),
session_source,
config.model_catalog.clone(),
config.custom_models.clone(),
CollaborationModesConfig {
default_mode_request_user_input: config
.features
Expand Down
1 change: 1 addition & 0 deletions codex-rs/app-server/tests/common/models_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ use std::path::Path;
fn preset_to_info(preset: &ModelPreset, priority: i32) -> ModelInfo {
ModelInfo {
slug: preset.id.clone(),
request_model: None,
display_name: preset.display_name.clone(),
description: Some(preset.description.clone()),
default_reasoning_level: Some(preset.default_reasoning_effort),
Expand Down
1 change: 1 addition & 0 deletions codex-rs/codex-api/tests/models_integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ async fn models_client_hits_models_endpoint() {
let response = ModelsResponse {
models: vec![ModelInfo {
slug: "gpt-test".to_string(),
request_model: None,
display_name: "gpt-test".to_string(),
description: Some("desc".to_string()),
default_reasoning_level: Some(ReasoningEffort::Medium),
Expand Down
10 changes: 10 additions & 0 deletions codex-rs/config-schema/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
load("//:defs.bzl", "codex_rust_crate")

codex_rust_crate(
name = "config-schema",
crate_name = "codex_config_schema",
compile_data = ["//codex-rs/core:config.schema.json"],
rustc_env = {
"CARGO_MANIFEST_DIR": "codex-rs/config-schema",
},
)
27 changes: 27 additions & 0 deletions codex-rs/config-schema/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
[package]
name = "codex-config-schema"
version.workspace = true
edition.workspace = true
license.workspace = true

[lib]
doctest = false
name = "codex_config_schema"
path = "src/lib.rs"

[[bin]]
name = "codex-write-config-schema"
path = "src/bin/config_schema.rs"

[lints]
workspace = true

[dependencies]
anyhow = { workspace = true }
clap = { workspace = true, features = ["derive"] }
codex-config = { workspace = true }
codex-protocol = { workspace = true }
codex-utils-absolute-path = { workspace = true }
schemars = { workspace = true }
serde = { workspace = true, features = ["derive"] }
serde_json = { workspace = true }
20 changes: 20 additions & 0 deletions codex-rs/config-schema/src/bin/config_schema.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
use anyhow::Result;
use clap::Parser;
use std::path::PathBuf;

/// Generate the JSON Schema for `config.toml` and write it to `config.schema.json`.
#[derive(Parser)]
#[command(name = "codex-write-config-schema")]
struct Args {
#[arg(short, long, value_name = "PATH")]
out: Option<PathBuf>,
}

fn main() -> Result<()> {
let args = Args::parse();
let out_path = args.out.unwrap_or_else(|| {
PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("../core/config.schema.json")
});
codex_config_schema::write_config_schema(&out_path)?;
Ok(())
}
Loading
Loading