Summary
Running omx setup against a Codex config.toml that already has a multiline root-level notify = [ ... ] array can produce invalid TOML.
Reproduction
Given an existing ~/.codex/config.toml root section like:
approval_policy = "on-request"
sandbox_mode = "workspace-write"
web_search = "live"
notify = [
"terminal-notifier",
"-title", "Codex ECC",
"-message", "Task completed!",
"-sound", "default",
]
persistent_instructions = "Follow project AGENTS.md guidelines."
Run:
Actual Result
The merged config keeps the tail of the original multiline array after inserting the OMX-managed notify line, producing invalid TOML like:
notify = ["node", "/path/to/notify-hook.js"]
...
web_search = "live"
"terminal-notifier",
"-title", "Codex ECC",
"-message", "Task completed!",
"-sound", "default",
]
Codex then fails to start with an error such as:
Error loading configuration: ~/.codex/config.toml:6:9: key with no value, expected `=`
Expected Result
omx setup should fully remove or replace the existing root-level notify value, including multiline arrays, and leave a valid TOML file.
Root Cause
In dist/config/generator.js, stripRootLevelKeys() removes only the notify = ... first line for managed root keys. It does not remove the following lines when the value is a multiline array.
The problematic logic is around:
stripRootLevelKeys()
buildMergedConfig() calling stripOmxTopLevelKeys(existing) before reinserting OMX-managed top-level keys
Minimal Fix
When a managed root key starts an array value like notify = [, the stripper should continue discarding lines until the closing ] is reached.
Workaround
Keep notify as a single-line value before running omx setup, or remove the existing multiline notify block before setup.
Extra Context
I locally patched stripRootLevelKeys() to discard multiline arrays for managed root keys, and the issue stopped reproducing. The patched merge output parsed successfully as TOML and codex login status worked again.
Summary
Running
omx setupagainst a Codexconfig.tomlthat already has a multiline root-levelnotify = [ ... ]array can produce invalid TOML.Reproduction
Given an existing
~/.codex/config.tomlroot section like:Run:
Actual Result
The merged config keeps the tail of the original multiline array after inserting the OMX-managed notify line, producing invalid TOML like:
Codex then fails to start with an error such as:
Expected Result
omx setupshould fully remove or replace the existing root-levelnotifyvalue, including multiline arrays, and leave a valid TOML file.Root Cause
In
dist/config/generator.js,stripRootLevelKeys()removes only thenotify = ...first line for managed root keys. It does not remove the following lines when the value is a multiline array.The problematic logic is around:
stripRootLevelKeys()buildMergedConfig()callingstripOmxTopLevelKeys(existing)before reinserting OMX-managed top-level keysMinimal Fix
When a managed root key starts an array value like
notify = [, the stripper should continue discarding lines until the closing]is reached.Workaround
Keep
notifyas a single-line value before runningomx setup, or remove the existing multilinenotifyblock before setup.Extra Context
I locally patched
stripRootLevelKeys()to discard multiline arrays for managed root keys, and the issue stopped reproducing. The patched merge output parsed successfully as TOML andcodex login statusworked again.