Repository navigation
fix(setup): treat empty client config files as new documents - #1117
Merged
morluto merged 3 commits intoOct 8, 2026
Merged
Conversation
An empty MCP config file (for example Antigravity's mcp_config.json, which the client can create with zero bytes) was reported as malformed, which blocked rea setup from configuring every other detected agent. Parse a whitespace- or BOM-only JSON/JSONC file as an empty document and write a fresh document over it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
# Conflicts: # src/application/ClientConfigurationDocument.ts
Owner
|
Merged How it was resolved:
Verification: |
This was referenced Oct 8, 2026
darsrc
pushed a commit
to darsrc/rea
that referenced
this pull request
Oct 10, 2026
…#1117) * fix(setup): treat empty client config files as new documents An empty MCP config file (for example Antigravity's mcp_config.json, which the client can create with zero bytes) was reported as malformed, which blocked rea setup from configuring every other detected agent. Parse a whitespace- or BOM-only JSON/JSONC file as an empty document and write a fresh document over it. * test(setup): use explicit unicode escape for BOM-only empty config case --------- Co-authored-by: morluto <[email protected]>
7 tasks done
viniciusdsandrade
added a commit
to viniciusdsandrade/rea
that referenced
this pull request
Oct 11, 2026
YAML parses an empty file to null, so Hermes configuration was checked as an object before the shared empty-file rule and rejected. Setup then failed its readback gate for a zero-byte config.yaml, although a missing file is configured and the Hermes serializer already writes a fresh document for empty original text. Apply the empty-file rule before the Hermes YAML parse, as morluto#1117 did for JSON clients.
morluto
pushed a commit
that referenced
this pull request
Oct 12, 2026
* fix(setup): treat an empty Hermes config.yaml as a new document YAML parses an empty file to null, so Hermes configuration was checked as an object before the shared empty-file rule and rejected. Setup then failed its readback gate for a zero-byte config.yaml, although a missing file is configured and the Hermes serializer already writes a fresh document for empty original text. Apply the empty-file rule before the Hermes YAML parse, as #1117 did for JSON clients. * test(setup): configure an empty Hermes config.yaml Configure zero-byte and newline-only config.yaml files through the real filesystem workflow, then read the registration back as aligned.
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
npx rea-agents setupstops withstatus: needs_humanand no planned actions when any detected client has a zero-byte MCP config file:Antigravity can leave
~/.gemini/config/mcp_config.jsonas an empty file.jsonc-parserreportsValueExpectedfor empty input, so setup reported the file as malformed and refused to configure every detected agent, not only Antigravity.Fix
parseDocument: a JSON/JSONC file that is empty, whitespace-only, or BOM-only parses as{}. TOML already behaved this way.serializeClientConfiguration: when the original text is empty, write a fresh document. In-place JSONC edits on a BOM-only file would otherwise put the BOM after the closing brace.Files with real syntax errors are still rejected, and the existing malformed-BOM test still passes.
Verification
clientConfigurationBom.test.ts) covers"","\n \n", and"": preflight → configure → readback →already_current. It fails without the fix and passes with it.npm run check:changedandnpm run check:fastpass.rea setup --all-detected --dry-runnow returnsstatus: plannedwith actions for all 8 detected clients, including Antigravity. Before the fix it returnedneeds_humanwith no actions.🤖 Generated with Claude Code