Repository navigation
fix(setup): configure an empty Hermes config.yaml - #1983
Merged
morluto merged 2 commits intoOct 12, 2026
Merged
Conversation
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. |
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.
Configure zero-byte and newline-only config.yaml files through the real filesystem workflow, then read the registration back as aligned.
viniciusdsandrade
force-pushed
the
fix/setup-empty-hermes-config
branch
from
October 11, 2026 22:44
0457428 to
96f8321
Compare
3 tasks done
Owner
|
@viniciusdsandrade, thank you for catching the Hermes empty-file case and moving the existing empty-document rule ahead of YAML parsing. That small ordering fix lets first-run setup reach the serializer while keeping the separate comment-only YAML case clearly scoped. Glad to have you contributing to REA! |
10 tasks done
JayOfTheKeyboard
added a commit
to JayOfTheKeyboard/rea
that referenced
this pull request
Oct 13, 2026
comments, or only a `---` marker, also parses to a null YAML document.
Setup still rejected it as malformed ("expected record, received null")
and reported Hermes as invalid.
Treat a null Hermes document as holding no settings, as morluto#1983 does for
an empty file. The serializer already edits a comment-only document in
place. A bare `---` document holds a null scalar that takes no keys, so
replace it with a map and keep the comments written after the marker.
morluto
added a commit
that referenced
this pull request
Oct 13, 2026
* fix(setup): configure a comment-only Hermes config.yaml
comments, or only a `---` marker, also parses to a null YAML document.
Setup still rejected it as malformed ("expected record, received null")
and reported Hermes as invalid.
Treat a null Hermes document as holding no settings, as #1983 does for
an empty file. The serializer already edits a comment-only document in
place. A bare `---` document holds a null scalar that takes no keys, so
replace it with a map and keep the comments written after the marker.
* fix(setup): keep rejecting an explicit null Hermes root
Only a document with no root, or a bare --- marker whose null scalar has
no source text, holds no settings. An explicit null or ~ is a value, so
setup and uninstall reject it as before, the same as any other non-map
root.
* test(setup): split the Hermes empty-configuration tests under the function length limit
The Hermes YAML registration block reached 159 lines, past oxlint's
max-lines-per-function limit of 150. Move the empty-document cases and
the multiple-document rejection into their own block.
* fix(setup): type the Hermes edit document as a plain Document
parseDocument with options returns a Document.Parsed, whose contents
accept only parsed nodes, so assigning the new map for a bare --- root
failed typecheck (TS2322). Annotate the edited document as Document, as
the code did before it moved into HermesConfigurationYaml.ts.
* fix(ci): isolate Linux Hopper process fixture inventory
---------
Co-authored-by: morluto <76467478+morluto@users.noreply.github.com>
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.
Summary
rea setupfails for Hermes whenconfig.yamlexists but is empty. YAML parses an empty file tonull, and the Hermes branch ofparseDocumentchecked that value as an object before the shared empty-file rule, so the configuration was rejected as malformed. Apply the empty-file rule before the Hermes YAML parse, as #1117 did for JSON clients.Related: #1633 lists an empty Hermes
config.yamlas a fresh first-run state. It tracks a separate Hermes version warning, so this PR does not close it.Problem and expected behavior
parseDocumentinsrc/application/ClientConfigurationDocument.tsreturnsobjectSchema.parse(parseYaml(text))for Hermes before it reachesisEmptyClientConfigurationText. In yaml 2.9.0 an empty source composes to a document with null contents, soparse("")returnsnulland the object schema throws.configureClientConfigurationthen returns{ status: "failed", reason: "readback" }. Setup, uninstall, update maintenance and the shared configuration reader all parse throughparseClientConfiguration, so they reject the same file.A missing
config.yamlalready works, because setup parses"{}"in its place, andserializeHermesConfigurationalready writes a fresh document when the original text is empty; that branch could not be reached. Expected: an emptyconfig.yamlis configured like a missing one.Change and scope
Move the existing empty-file check above the Hermes branch. Pi still rejects empty files, TOML and Grok still parse directly, and JSON clients keep the same rule. A comment-only
config.yamlis not included: it also parses tonull, but the Hermes serializer edits the parsed YAML document in place and would need separate handling.Contract and boundary impact
parseDocument.docs/public/product-catalog.json), package, or installation impact: none.Evidence and regression coverage
tests/boundary/filesystem/hermesClientConfiguration.test.tsconfigures zero-byte and newline-onlyconfig.yamlfiles, checks the written YAML and reads the registration back as aligned.Composer.endcreates aDocumentwith null contents for an empty source andparsereturnsnull;objectSchema.parse(null)throws before the empty-file rule. The new test'sconfiguredassertion fails on the base revision.config.yaml; after, Hermes is configured.Validation performed
Compatibility, safety, and release
Review checklist
type(scope): outcome.