Repository navigation
fix(setup): preserve unrelated Hermes YAML line formatting - #1754
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 989e0fb8a8
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| else yamlDocument.setIn([serversKey, PRODUCT_IDENTITY.mcpServerKey], entry); | ||
| return yamlDocument.toString(); | ||
| // Editing REA must not reflow unrelated user prompts or other YAML scalars. | ||
| return yamlDocument.toString({ lineWidth: 0 }); |
There was a problem hiding this comment.
Preserve pre-wrapped unrelated YAML scalars
For an existing Hermes file whose long plain scalar is already split at YAML's normal 80-column boundary, lineWidth: 0 disables folding for every node, so adding or removing mcp_servers.rea joins that unrelated value onto a single physical line. Such a file was stable under the previous default serializer, so this replaces the one-line reflow bug with the inverse regression; preserve source layout for untouched nodes (or scope the no-wrap behavior to the inserted REA node) instead of setting a document-wide option.
AGENTS.md reference: AGENTS.md:L9-L9
Useful? React with 👍 / 👎.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
N0zoM1z0
left a comment
There was a problem hiding this comment.
Reproduced the reported setup reflow on freshly built latest main e5699d23: the contributor regression fails exactly on the unchanged long YAML scalar, while five controls pass. After independent review, freshly compiled exact head 989e0fb8 passes all six production-boundary Hermes tests, including parsed configuration preservation, comments, idempotent registration and uninstall recovery. All 31 exact-head CI checks are successful. The existing-document emitter change is narrowly scoped; no unrelated software installation or real user configuration is involved. Original contributor commit/credit is preserved. The uninstall exact-text test covers recovery; it is not an independent claim about every YAML deletion serialization shape.
When REA updates or removes its Hermes MCP entry, the YAML serializer uses its default line width and rewraps unrelated long values, including user prompts. Disable that wrapping for existing documents so the change stays confined to the REA registration.
The regression test writes a long personality value, runs the production setup and uninstall paths, and checks that the original line survives setup and the complete original file is restored after uninstall. The test fails on current main and passes with this change.
Validation on macOS ARM64:
npm run check:fast: typecheck and lint passed.npm run build:cached: passed.Follow-up to #1403. This does not change configuration values or MCP registration fields.