Skip to content

fix(cli): handle quoted Codex TOML server tables - #3150

Open
Iams4kura wants to merge 2 commits into
upstash:masterfrom
Iams4kura:bugfix/codex-quoted-toml-20260907t040319z
Open

fix(cli): handle quoted Codex TOML server tables#3150
Iams4kura wants to merge 2 commits into
upstash:masterfrom
Iams4kura:bugfix/codex-quoted-toml-20260907t040319z

Conversation

@Iams4kura

Copy link
Copy Markdown

Summary

  • Fixes: A valid Codex config whose Context7 table uses a quoted or spaced dotted key is treated as unconfigured, so HTTP setup appends a second logical mcp_servers.context7 table and leaves invalid duplicate TOML.
  • Root cause: The general TOML setup, detection, and removal paths matched only the literal [mcp_servers.context7] spelling instead of reusing the TOML editor's normalized header recognition for equivalent quoted and spaced keys.
  • Uses one header classifier for setup, detection, removal, and stdio editing; unrelated tables stay intact, while multiline strings fail closed without writes.

Regression evidence

  • Before: npx -y -p node@20 -p pnpm@10 sh -c 'pnpm --filter ctx7 exec vitest run src/__tests__/setup.test.ts -t "recognizes and replaces"' exited 1

  • After: npx -y -p node@20 -p pnpm@10 sh -c 'pnpm --filter ctx7 exec vitest run src/__tests__/setup.test.ts -t "recognizes and replaces"' exited 0

Verification

  • npx -y -p node@20 -p pnpm@10 sh -c 'pnpm --filter ctx7 test'
  • npx -y -p node@20 -p pnpm@10 sh -c 'pnpm lint:check && pnpm format:check && pnpm build && pnpm typecheck'

The full workspace test command also reaches five live Bedrock tests in packages/tools-ai-sdk; without AWS_REGION, they fail identically on this tree and the exact upstream base.

Scope

  • 4 files changed, +145 / -55 lines

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants