Skip to content

fix: preserve existing Codex settings during setup - #138

Draft
PatrickSys wants to merge 1 commit into
masterfrom
j11/init-inline
Draft

PatrickSys wants to merge 1 commit into
masterfrom
j11/init-inline

Conversation

@PatrickSys

@PatrickSys PatrickSys commented Oct 16, 2026 •

Copy link
Copy Markdown
Owner

Parked: setup mistakes an example inside saved instructions for a real server entry.
The new regression test confirms that valid settings can block setup.
Two guard revisions still leave valid TOML cases uncovered, so this follow-up should not merge tonight.
The earlier project setup change remains merged; this PR only adds more protection for existing settings.
Text preview: C:/Users/bitaz/AppData/Local/Temp/job-J11/agy-mockups/mockup_1792167096015.html.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-16T18:30:32.437295Z 19ddb1c PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 19ddb1c6c5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/cli-init.ts

const dottedEntry = new RegExp(
`^\\s*${mcpServersKey}\\s*\\.\\s*${codebaseContextKey}\\s*\\.`,
`^\\s*${mcpServersKey}\\s*\\.\\s*${codebaseContextKey}\\s*(?:\\.|=)`,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Avoid matching dotted keys inside multiline TOML strings

When an existing Codex config has a multiline string such as developer_instructions containing an example line beginning mcp_servers.codebase-context =, this unanchored textual scan matches content inside the string and aborts initialization even though no such server entry exists. Restrict detection to actual root-level TOML key definitions or parse the TOML structure so unrelated saved settings do not prevent setup.

Useful? React with 👍 / 👎.

Comment thread docs/client-setup.md
```

The interactive wizard limitations described above are still present in the 2.4.0 source. A successful wizard exit alone does not establish working client registration.
A successful setup run writes the config but does not confirm that the client connected.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve the declined-wizard caveat

In interactive mode, answering no to Apply MCP config? still lets handleInitCli print the next steps and return successfully without calling writeFile, so a successful setup run does not necessarily write a config. This sentence should distinguish a successful config application from a successful wizard exit rather than assuring users that the file was written.

AGENTS.md reference: AGENTS.md:L112-L112

Useful? React with 👍 / 👎.

@greptile-apps

greptile-apps Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 4/5

[Medium impact] The change reaches Codex project setup and its saved config workflow.

Fix the false conflict on multiline string contents before merging.

Findings

  1. P1 Saved examples block setup ▶

Summary

Setup now detects existing Codex servers written as dotted inline assignments.

  • Codex setup catches existing inline server entries before it writes a duplicate.

Reviews (1) · Last reviewed commit: "fix: refuse root dotted Codex init entri..." · Reviewed by Greptile

Comment thread src/cli-init.ts

const dottedEntry = new RegExp(
`^\\s*${mcpServersKey}\\s*\\.\\s*${codebaseContextKey}\\s*\\.`,
`^\\s*${mcpServersKey}\\s*\\.\\s*${codebaseContextKey}\\s*(?:\\.|=)`,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Saved examples block setup

The new = match also catches text inside TOML multiline strings. If a user includes mcp_servers.codebase-context = { command = "example" } on its own line in saved instructions, setup reports a conflicting server and exits without adding one, even though that line is only string content. Check actual TOML keys rather than matching every line, and add a saved-file test for this case.

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.

1 participant