fix(dashboard): correct TOML round-trip corruption in codex config serializer - #1438
Merged
diegosouzapw merged 3 commits intoApr 20, 2026
Merged
diegosouzapw merged 3 commits into
diegosouzapw merged 3 commits into
Conversation
Auto-syncs main branch from upstream diegosouzapw/OmniRoute every 6 hours. Also triggerable manually via workflow_dispatch. Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
…rializer parseToml did not strip quotes from keys, so quoted TOML keys like "gpt-5.3-codex" were stored with quotes intact. toToml then added another quote layer producing ""gpt-5.3-codex"". Additionally, toToml wrapped all values in double quotes, so array values like ["a", "b"] became "["a", "b"]" which is invalid TOML. - Strip quotes from keys in parseToml (matching existing value behavior) - Add formatTomlValue() to preserve arrays/booleans/numbers unquoted - Only string values get double-quoted in toToml output Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Code Review
This pull request improves TOML handling in the codex-settings API route by adding support for quoted keys during parsing and implementing a formatTomlValue helper to correctly serialize different data types like booleans, numbers, and arrays. A review comment correctly identified redundant code in the new formatting logic that should be simplified.
Comment on lines
+74
to
+75
| if (typeof value === "string") return `"${value}"`; | ||
| return `"${value}"`; |
Contributor
There was a problem hiding this comment.
diegosouzapw
merged commit Apr 20, 2026
77f326e
into
diegosouzapw:release/v3.7.0
1 of 2 checks passed
Merged
Poid-ZA
pushed a commit
to Poid-ZA/OmniRoute
that referenced
this pull request
Aug 5, 2026
…rializer (diegosouzapw#1438) Integrated into release/v3.7.0. Thanks @benzntech for this great contribution! 🎉 We've removed the unrelated sync-fork.yml file and it's now merged into the release branch.
muhamadgalihsaputra
pushed a commit
to niyatna/NiyatnaRoute
that referenced
this pull request
Sep 27, 2026
…rializer (diegosouzapw#1438) Integrated into release/v3.7.0. Thanks @benzntech for this great contribution! 🎉 We've removed the unrelated sync-fork.yml file and it's now merged into the release branch.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The
parseToml/toTomlround-trip incodex-settings/route.tscorrupted the Codexconfig.toml, causing Codex to fail with parse errors like:Root causes
parseTomldid not strip quotes from keys — TOML quoted keys like"gpt-5.3-codex"were stored with quotes intact.toTomlthen added another quote layer, producing""gpt-5.3-codex"".toTomlwrapped ALL values in double quotes — array values like["a", "b"]became"["a", "b"]", which is invalid TOML. Boolean/number values were also incorrectly quoted.Fix
parseToml(matching existing value dequoting behavior)formatTomlValue()helper that:[and ending with])true/falsewithout quotesTesting
Verified with inline round-trip test: parsed -> serialized -> reparsed produces identical structure. Arrays, quoted keys with dots, and string values all survive the round-trip correctly.
Files changed
src/app/api/cli-tools/codex-settings/route.ts--parseTomlkey dequoting +formatTomlValuefortoToml