fix(config): preserve unmanaged Codex TOML tables
Keep foreign tables such as mcp_servers and model_providers during config synchronization instead of dropping them; only setup-owned keys are replaced. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
1cba8850f9
commit
1a6cc4d46f
4 files changed
+16
-5
No files matched your search
@@ -129,11 +129,9 @@ def merge_toml(current_text, managed_text, statusline_enabled=True):
|
||||
owned_hook = any(re.search(r'(?:flashbang|statusline|record-compact|session-state-pointer)\.(?:ps1|sh)', line, re.I) for line in block)
|
||||
if plugin_table and header in managed_headers:
|
||||
raise ValueError('Cannot merge conflicting managed plugin tables.')
|
||||
if (plugin_table and header not in managed_headers) or (array_table and not owned_hook):
|
||||
if (header not in managed_headers and not array_table) or (array_table and not owned_hook):
|
||||
extras.extend(block)
|
||||
continue
|
||||
if header not in managed_headers:
|
||||
continue
|
||||
if array_table:
|
||||
continue
|
||||
generated_block = next(lines for name, lines in managed_sections if name == header)
|
||||
|
||||
Reference in new issue
Block a user