Repository navigation
Conversation
… keys The line editor took the first `enabled:` at any depth under `plugins:` and any `plugins:` at any indent, including text inside `|` / `>` block scalars. That produced invalid YAML (nested `enabled: true` patched instead of the list) or injected the plugin entry into a user's prompt text. Require `plugins:` at column 0, `enabled:` at the indent of plugins' direct children, and skip block scalar bodies. Uninstall shares the same lookup. Fixes rtk-ai#3405 Co-Authored-By: Claude Opus 5.5 <[email protected]>
📊 Automated PR Analysis
SummaryFixes the Hermes config patcher in Review Checklist
Linked issues: #3405 Analyzed automatically by wshm · This is an automated analysis, not a human review. |
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
rtk init --agent hermesedits~/.hermes/config.yamlline by line. It took the firstenabled:anywhere underplugins:(soplugins: / some-plugin: / enabled: truewas patched instead of the realplugins.enabledlist, leaving invalid YAML), and it took any line starting withplugins:at any indent, including text inside a|/>block scalar or under another key such asagent:.plugins:must now sit at column 0,enabled:must sit at the same indent as the other direct children ofplugins:, and lines inside block scalar bodies are never treated as keys. When no realplugins:exists the block is appended as before; the uninstall path uses the same lookup, so it no longer edits scalar text either..bakpath. Post-write re-parse validation is not included for the same reason (needs a parser).Fixes #3405
Test plan
cargo fmt --all --check && cargo clippy --all-targets && cargo teston Rust 1.99.1 (lib: 4439 passed, 1 failed; integration/doc suites 2+20+12+7+22 passed. The one failure is the known Windowsfind_cmd::tests::run_from_args_propagates_find_exit_status, unrelated to this change and not in a file touched here; clippy printed no warnings)rtkbinary.rtk initwrites to a home directory, so the change is exercised only by unit tests on in-memory strings and the existing temp-dir tests inhermes.rs.test_hermes_config_patch_ignores_nested_enabled_key,test_hermes_config_patch_adds_enabled_beside_nested_enabled_key,test_hermes_config_patch_skips_plugins_text_in_block_scalar,test_hermes_config_patch_appends_when_plugins_only_in_block_scalar,test_hermes_config_unpatch_leaves_block_scalar_text_alone,test_hermes_config_patch_ignores_indented_plugins_key. All six fail ondevelop(32b2ec4) and pass here; the 24 existinghermes_configtests pass on both (cargo test --lib hermes: 45 passed after the change).plugins: {enabled: [...]}; multi-line quoted scalars containingplugins:; a- key: |list-item scalar header is measured from the key column.Prepared with AI assistance (Claude Code) and reviewed by me (HetCreep) before submitting; the runs above were executed on Windows 11.
🤖 Generated with Claude Code