fix(codex): fix TOML parser double-quoting section keys + add macOS trust paths

- Minimal TOML parser (Python < 3.11 fallback) now strips quotes from section
  keys like [projects."/home"] — prevents double-quoting on re-parse
- Add /Users and /var/root to trust_paths on macOS

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
delta-cloud-208e
2026-03-10 17:58:17 +00:00
parent ab6be896bd
commit 495ce916b3

View File

@@ -46,7 +46,7 @@ except ModuleNotFoundError:
continue
m = _re.match(r'^\[([^\]]+)\]$', line)
if m:
keys = [k.strip() for k in m.group(1).split(".")]
keys = [k.strip().strip('"') for k in m.group(1).split(".")]
cur = result
for k in keys:
cur = cur.setdefault(k, {})
@@ -301,8 +301,12 @@ def generate_config_toml(existing, config):
for k, v in provider.items():
lines.append(f"{k} = {toml_value(v)}")
# Trust paths
trust_paths = config.get("trust_paths", ["/home", "/root", "/tmp"])
# Trust paths (add platform-specific paths)
trust_paths = list(config.get("trust_paths", ["/home", "/root", "/tmp"]))
if IS_MACOS:
for mp in ["/Users", "/var/root"]:
if mp not in trust_paths:
trust_paths.append(mp)
existing_projects = existing.get("projects", {})
# Add our trust paths