YAML-level diffing & rollback #984
Replies: 2 comments 2 replies
|
Ha-mcp shouldn't touch any yaml directly unless you are using the opt-in beta yaml editing tool. I think that when it edits yaml with the beta yaml editing tool it is supposed to make backups. However, I highly recommend NOT using the yaml editing tool. We placed it into the dev server only for a reason. There is very little that it can do that the current tools cannot do. The tool really only exists for people that still have legacy things set up in configuration.yaml . Almost everything else can be handled by helpers, template sensors, that kind of thing. AIs are very happy to jump to saying "place this in configuration.yaml!" But it is very rare that that is actually needed. Just using all of the other tools in ha-mcp is very safe and relatively easy to roll back especially if you ask it to make backups ahead of time. |
|
For thread continuity: #1288 was filed as the implementation-tracking issue for this discussion. v1 scope is the backup capture + toggle; the browse/restore UI is a follow-up. |
Uh oh!
There was an error while loading. Please reload this page.
When coding with Claude, I like being able to keep an eye on it by looking at PRs and/or the commit history. And I can easily recover from any mistakes it makes with a few git or jj commands. This, in turn, gives me the confidence to lean into it more.
I'm slightly hesitant about letting it run amok over my sprawling HA config, however, because I don't have that fine-grained recovery to fall back on if everything goes kablooey. The agent does seem pretty good about showing me diffs as it works, but that's still not an easy recovery unless I keep careful track of them. I might not notice an issue with an automation right away. I could restore a full HA backup, but that's slow, and would lose entity data between the last good backup and whenever I notice an issue. And I'm wary of the way I've seen these agents silently scope-creep and start rewriting things they shouldn't be touching.
Is there room for a rollback process built into the MCP server itself? One that automatically captures the YAML being edited before and after each change it sends to HA. I don't think it needs a very sophisticated UX, I'd be happy just to have timestamped files somewhere I could look at by hand. I don't suppose the agent goes wrong that often or nobody would use it. But nevertheless, this would buy me some peace of mind, and that would make me more confident to use it more extensively. I suspect I'm not alone in this.
(I would be happy to try and put a PR together if this is a good idea!)
All reactions