Repository navigation
Commit ae578bc
committed
fix(install): Hermes hook edit no longer refuses unrelated YAML sections (DeusData#2209)
`install` on a Hermes Agent config wrote the mcp_servers entry and the skill,
then failed op=pre_llm_hook_install on the same config.yaml. The stock Hermes
config (cli-config.yaml.example) reproduces it on its own.
Root cause: the nested-sequence editor behind the hooks.pre_llm_call item
validated EVERY line of the document and refused any flow collection or block
scalar anywhere. The stock config carries flow sequences in sections the hook
edit never reads or rewrites (`platform_toolsets:` -> `cli: [hermes-cli]`,
reporters' `plugins:` -> `enabled: [...]`). The mapping-entry editor that
writes mcp_servers into the same file already treats other top-level sections
as opaque user content, which is why that op succeeded.
Fix: yaml_sequence_validate_document now validates only the top-level section
the edit descends into (the first sequence_path key). The root mapping is
still validated at parse time, so section boundaries stay sound. An absent
section is appended as a new top-level key and touches no existing line.
Inside the edited `hooks` subtree the fail-closed rules are unchanged. This
also unblocks uninstall (op=pre_llm_hook_uninstall), which shares the analyzer.
Tests: new config_yaml_edit case with foreign flow sequences plus `|`/`>`
block scalars (install, byte-idempotent reinstall, remove). The two DeusData#1924
"still refuses" pins now place the unsupported construct inside `hooks:`,
where the refusal still applies byte-identically.
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>1 parent 64c23fa commit ae578bc
2 files changed
Lines changed: 86 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2698 | 2698 | | |
2699 | 2699 | | |
2700 | 2700 | | |
2701 | | - | |
2702 | | - | |
| 2701 | + | |
| 2702 | + | |
| 2703 | + | |
| 2704 | + | |
| 2705 | + | |
| 2706 | + | |
| 2707 | + | |
| 2708 | + | |
| 2709 | + | |
| 2710 | + | |
| 2711 | + | |
| 2712 | + | |
| 2713 | + | |
| 2714 | + | |
| 2715 | + | |
| 2716 | + | |
| 2717 | + | |
| 2718 | + | |
| 2719 | + | |
| 2720 | + | |
| 2721 | + | |
| 2722 | + | |
2703 | 2723 | | |
2704 | 2724 | | |
2705 | 2725 | | |
| |||
2947 | 2967 | | |
2948 | 2968 | | |
2949 | 2969 | | |
2950 | | - | |
| 2970 | + | |
2951 | 2971 | | |
2952 | 2972 | | |
2953 | 2973 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1228 | 1228 | | |
1229 | 1229 | | |
1230 | 1230 | | |
1231 | | - | |
1232 | | - | |
| 1231 | + | |
| 1232 | + | |
| 1233 | + | |
| 1234 | + | |
1233 | 1235 | | |
1234 | | - | |
1235 | | - | |
1236 | | - | |
| 1236 | + | |
| 1237 | + | |
| 1238 | + | |
1237 | 1239 | | |
1238 | 1240 | | |
1239 | 1241 | | |
| |||
1250 | 1252 | | |
1251 | 1253 | | |
1252 | 1254 | | |
1253 | | - | |
1254 | | - | |
1255 | | - | |
1256 | | - | |
| 1255 | + | |
| 1256 | + | |
| 1257 | + | |
| 1258 | + | |
1257 | 1259 | | |
1258 | 1260 | | |
1259 | 1261 | | |
| |||
2027 | 2029 | | |
2028 | 2030 | | |
2029 | 2031 | | |
| 2032 | + | |
| 2033 | + | |
| 2034 | + | |
| 2035 | + | |
| 2036 | + | |
| 2037 | + | |
| 2038 | + | |
| 2039 | + | |
| 2040 | + | |
| 2041 | + | |
| 2042 | + | |
| 2043 | + | |
| 2044 | + | |
| 2045 | + | |
| 2046 | + | |
| 2047 | + | |
| 2048 | + | |
| 2049 | + | |
| 2050 | + | |
| 2051 | + | |
| 2052 | + | |
| 2053 | + | |
| 2054 | + | |
| 2055 | + | |
| 2056 | + | |
| 2057 | + | |
| 2058 | + | |
| 2059 | + | |
| 2060 | + | |
| 2061 | + | |
| 2062 | + | |
| 2063 | + | |
| 2064 | + | |
| 2065 | + | |
| 2066 | + | |
| 2067 | + | |
| 2068 | + | |
| 2069 | + | |
| 2070 | + | |
| 2071 | + | |
| 2072 | + | |
| 2073 | + | |
| 2074 | + | |
| 2075 | + | |
| 2076 | + | |
| 2077 | + | |
| 2078 | + | |
| 2079 | + | |
| 2080 | + | |
| 2081 | + | |
| 2082 | + | |
2030 | 2083 | | |
2031 | 2084 | | |
2032 | 2085 | | |
| |||
2192 | 2245 | | |
2193 | 2246 | | |
2194 | 2247 | | |
| 2248 | + | |
2195 | 2249 | | |
2196 | 2250 | | |
2197 | 2251 | | |
| |||
0 commit comments