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.
- {codex_python-0.2.12 → codex_python-0.2.13}/PKG-INFO +1 -1
- {codex_python-0.2.12 → codex_python-0.2.13}/codex/__init__.py +1 -1
- {codex_python-0.2.12 → codex_python-0.2.13}/crates/codex_native/Cargo.lock +1 -1
- {codex_python-0.2.12 → codex_python-0.2.13}/crates/codex_native/Cargo.toml +1 -1
- {codex_python-0.2.12 → codex_python-0.2.13}/crates/codex_native/src/lib.rs +49 -4
- {codex_python-0.2.12 → codex_python-0.2.13}/LICENSE +0 -0
- {codex_python-0.2.12 → codex_python-0.2.13}/README.md +0 -0
- {codex_python-0.2.12 → codex_python-0.2.13}/codex/api.py +0 -0
- {codex_python-0.2.12 → codex_python-0.2.13}/codex/config.py +0 -0
- {codex_python-0.2.12 → codex_python-0.2.13}/codex/event.py +0 -0
- {codex_python-0.2.12 → codex_python-0.2.13}/codex/native.py +0 -0
- {codex_python-0.2.12 → codex_python-0.2.13}/codex/protocol/_base_model.py +0 -0
- {codex_python-0.2.12 → codex_python-0.2.13}/codex/protocol/types.py +0 -0
- {codex_python-0.2.12 → codex_python-0.2.13}/codex/py.typed +0 -0
- {codex_python-0.2.12 → codex_python-0.2.13}/crates/codex_native/src/bin/protocol_schema.rs +0 -0
- {codex_python-0.2.12 → codex_python-0.2.13}/pyproject.toml +0 -0
|
@@ -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
|
-
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|