codex-python 0.2.12__tar.gz → 0.2.13__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: codex-python
3
- Version: 0.2.12
3
+ Version: 0.2.13
4
4
  Classifier: Programming Language :: Python :: 3
5
5
  Classifier: Programming Language :: Python :: 3 :: Only
6
6
  Classifier: Programming Language :: Python :: 3.13
@@ -31,4 +31,4 @@ __all__ = [
31
31
  ]
32
32
 
33
33
  # Package version. Kept in sync with Cargo.toml via CI before builds.
34
- __version__ = "0.2.12"
34
+ __version__ = "0.2.13"
@@ -343,7 +343,7 @@ dependencies = [
343
343
 
344
344
  [[package]]
345
345
  name = "codex_native"
346
- version = "0.2.12"
346
+ version = "0.2.13"
347
347
  dependencies = [
348
348
  "anyhow",
349
349
  "clap",
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "codex_native"
3
- version = "0.2.12"
3
+ version = "0.2.13"
4
4
  edition = "2021"
5
5
 
6
6
  [lib]
@@ -1,7 +1,5 @@
1
1
  use anyhow::{Context, Result};
2
- use codex_core::config::{
3
- find_codex_home, load_config_as_toml_with_cli_overrides, Config, ConfigOverrides, ConfigToml,
4
- };
2
+ use codex_core::config::{find_codex_home, Config, ConfigOverrides, ConfigToml};
5
3
  use codex_core::protocol::{EventMsg, InputItem};
6
4
  use codex_core::{AuthManager, ConversationManager};
7
5
  // use of SandboxMode is handled within core::config; not needed here
@@ -274,10 +272,22 @@ fn build_config(
274
272
  }
275
273
 
276
274
  if load_default_config {
275
+ // Start from built-in defaults and apply CLI + typed overrides.
277
276
  Ok(Config::load_with_cli_overrides(cli_overrides, overrides_struct)?)
278
277
  } else {
278
+ // Do NOT read any on-disk config. Build a TOML value purely from CLI-style overrides
279
+ // and then apply the strongly-typed overrides on top. We still resolve CODEX_HOME to
280
+ // pass through for paths/auth handling, but we avoid parsing a config file.
279
281
  let codex_home = find_codex_home()?;
280
- let cfg = load_config_as_toml_with_cli_overrides(&codex_home, cli_overrides)?;
282
+
283
+ // Build a base TOML value from dotted CLI overrides only (no file IO).
284
+ let mut base_tbl: TomlTable = TomlTable::new();
285
+ for (k, v) in cli_overrides.into_iter() {
286
+ insert_dotted_toml(&mut base_tbl, &k, v);
287
+ }
288
+
289
+ let root_value = TomlValue::Table(base_tbl);
290
+ let cfg: ConfigToml = root_value.try_into().map_err(|e| anyhow::anyhow!(e))?;
281
291
  Ok(Config::load_from_base_config_with_overrides(cfg, overrides_struct, codex_home)?)
282
292
  }
283
293
  }
@@ -350,6 +360,41 @@ fn flatten_overrides(out: &mut Vec<(String, TomlValue)>, prefix: &str, val: Toml
350
360
  }
351
361
  }
352
362
 
363
+ /// Insert a TOML value into `tbl` at a dotted path like "a.b.c".
364
+ fn insert_dotted_toml(tbl: &mut TomlTable, dotted: &str, val: TomlValue) {
365
+ let parts: Vec<&str> = dotted.split('.').collect();
366
+ insert_parts(tbl, &parts, val);
367
+ }
368
+
369
+ fn insert_parts(current: &mut TomlTable, parts: &[&str], val: TomlValue) {
370
+ if parts.is_empty() {
371
+ return;
372
+ }
373
+ if parts.len() == 1 {
374
+ current.insert(parts[0].to_string(), val);
375
+ return;
376
+ }
377
+
378
+ let key = parts[0].to_string();
379
+ // Get or create an intermediate table at this segment.
380
+ if let Some(existing) = current.get_mut(&key) {
381
+ match existing {
382
+ TomlValue::Table(ref mut t) => {
383
+ insert_parts(t, &parts[1..], val);
384
+ }
385
+ _ => {
386
+ let mut next = TomlTable::new();
387
+ insert_parts(&mut next, &parts[1..], val);
388
+ *existing = TomlValue::Table(next);
389
+ }
390
+ }
391
+ } else {
392
+ let mut next = TomlTable::new();
393
+ insert_parts(&mut next, &parts[1..], val);
394
+ current.insert(key, TomlValue::Table(next));
395
+ }
396
+ }
397
+
353
398
  fn run_exec_stream_impl(prompt: String, config: Config, tx: mpsc::Sender<JsonValue>) -> Result<()> {
354
399
  let rt = tokio::runtime::Runtime::new()?;
355
400
  rt.block_on(async move {
File without changes
File without changes