Bug
Running codegraph install --target hermes (or interactive install selecting Hermes Agent) produces broken YAML in ~/.hermes/config.yaml. The platform_toolsets.cli section has - hermes-cli at the wrong indentation level, causing yaml.safe_load to raise a ParserError.
Broken output
platform_toolsets:
cli:
- mcp-codegraph
- hermes-cli # ← wrong: at cli: level instead of inside
Correct output (from --print-config)
platform_toolsets:
cli:
- hermes-cli
- mcp-codegraph
Note that --print-config produces correct YAML, but the actual writeHermesConfig() → upsertCodeGraphToolset() code path does not.
Error
yaml.parser.ParserError: while parsing a block mapping
in "config.yaml", line 547, column 3
expected <block end>, but found
Affected code
File: src/installer/targets/hermes.ts → compiled lib/dist/installer/targets/hermes.js
Function: upsertCodeGraphToolset (lines 259-281)
Three code paths:
!parent (no platform_toolsets: block) — appends correct YAML at EOF. ✅
!cli (block exists but no cli: child) — splices correct YAML. ✅
cli exists — either returns unchanged or appends mcp-codegraph at cli.end. ❓
The broken output (- hermes-cli outside cli:) does not match any of these insertion patterns, suggesting a subtle edge case in childRange end-boundary detection (line 178, regex /^\s\S/ on line 194) or topLevelRange (line 162) when there are other sibling children under platform_toolsets.
Environment
- codegraph version: 0.9.5
- Hermes Agent: latest
- config location:
~/.hermes/config.yaml (global)
- OS: Linux (arm64)
Additional context
The --print-config hermes output is correct — the bug manifests only in the actual file-writing path. This was discovered on a fresh install where platform_toolsets did not exist in the config beforehand (so the !parent branch was taken), yet the resulting YAML had the malformed structure shown above.
Bug
Running
codegraph install --target hermes(or interactive install selecting Hermes Agent) produces broken YAML in~/.hermes/config.yaml. Theplatform_toolsets.clisection has- hermes-cliat the wrong indentation level, causingyaml.safe_loadto raise aParserError.Broken output
Correct output (from --print-config)
Note that
--print-configproduces correct YAML, but the actualwriteHermesConfig()→upsertCodeGraphToolset()code path does not.Error
Affected code
File:
src/installer/targets/hermes.ts→ compiledlib/dist/installer/targets/hermes.jsFunction:
upsertCodeGraphToolset(lines 259-281)Three code paths:
!parent(noplatform_toolsets:block) — appends correct YAML at EOF. ✅!cli(block exists but nocli:child) — splices correct YAML. ✅cliexists — either returns unchanged or appendsmcp-codegraphatcli.end. ❓The broken output (
- hermes-clioutsidecli:) does not match any of these insertion patterns, suggesting a subtle edge case inchildRangeend-boundary detection (line 178, regex/^\s\S/on line 194) ortopLevelRange(line 162) when there are other sibling children underplatform_toolsets.Environment
~/.hermes/config.yaml(global)Additional context
The
--print-config hermesoutput is correct — the bug manifests only in the actual file-writing path. This was discovered on a fresh install whereplatform_toolsetsdid not exist in the config beforehand (so the!parentbranch was taken), yet the resulting YAML had the malformed structure shown above.