fix: change log path to user home and force uvx refresh in install scripts - #442
fix: change log path to user home and force uvx refresh in install scripts#442julienld wants to merge 2 commits into
Conversation
Summary of ChangesHello @julienld, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the robustness and user experience of the system by addressing critical issues related to file system permissions and package management. It ensures that logging operations are resilient in restricted environments and that users consistently receive the most up-to-date software during installation. Additionally, the PR streamlines the API by consolidating redundant blueprint and system information tools, leading to a more coherent and efficient toolset for Home Assistant interactions. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces several valuable improvements. The primary fixes of changing the log path to the user's home directory and forcing a refresh in the installation scripts effectively address the reported issues with read-only filesystems and stale caches.
The tool consolidation is a significant and well-executed refactoring. Merging ha_list_blueprints into ha_get_blueprint and consolidating system information tools into ha_get_overview improves the API's clarity and maintainability. The accompanying updates to the tests are thorough and ensure correctness. The new unit test for the tool count limit is an excellent addition to prevent future API bloat.
I have one suggestion to further improve the consistency of ha_get_overview by making the system_info section respect the detail_level parameter, which will help keep responses lean for lower detail levels.
| "config_dir": config.get("config_dir"), | ||
| "allowlist_external_dirs": config.get("allowlist_external_dirs", []), | ||
| "allowlist_external_urls": config.get("allowlist_external_urls", []), | ||
| "components": config.get("components", []), |
There was a problem hiding this comment.
The components list can be very large, and including it unconditionally can bloat the response for lower detail levels like 'minimal' or 'standard'. To make the tool more consistent and efficient, consider making the inclusion of this field, and other verbose fields like config_dir and allowlist_*, conditional on detail_level == 'full'. This would align the behavior of the system_info block with the rest of the ha_get_overview tool, which already respects the detail_level parameter.
For example:
config = await client.get_config()
system_info = { ... basic fields ... }
if detail_level == "full":
system_info.update({
"config_dir": config.get("config_dir"),
"components": config.get("components", []),
# ... other verbose fields ...
})
result["system_info"] = system_info4c6843c to
78eeda1
Compare
Description
Fixes issues where users encounter 'Read-only file system' errors because the default log path was relative to the current working directory, which can be read-only in restricted environments like uvx caches.
Also updates installation scripts to force 'uvx' to refresh the package version, ensuring users are not stuck on stale cached versions.
Changes
UsageLoggerto~/.ha-mcp/logs/mcp_usage.jsonl--refreshflag touvxcommands inscripts/install-macos.shandscripts/install-windows.ps1Related Issues