Skip to content

fix: change log path to user home and force uvx refresh in install scripts - #442

Closed
julienld wants to merge 2 commits into
masterfrom
fix-log-path-and-install-scripts
Closed

fix: change log path to user home and force uvx refresh in install scripts#442
julienld wants to merge 2 commits into
masterfrom
fix-log-path-and-install-scripts

Conversation

@julienld

Copy link
Copy Markdown
Member

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

  • Changed default log file path in UsageLogger to ~/.ha-mcp/logs/mcp_usage.jsonl
  • Added --refresh flag to uvx commands in scripts/install-macos.sh and scripts/install-windows.ps1
  • Added unit test for default log path behavior

Related Issues

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @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

  • Log Path Relocation: The default log file path for UsageLogger has been changed to ~/.ha-mcp/logs/mcp_usage.jsonl to prevent 'Read-only file system' errors in restricted environments.
  • Force UVX Refresh: Installation scripts for macOS and Windows now include the --refresh flag for uvx commands, ensuring that the latest version of ha-mcp is always fetched and installed, avoiding stale cached versions.
  • Blueprint Tool Consolidation: The ha_list_blueprints tool has been removed, and its functionality has been merged into ha_get_blueprint. The ha_get_blueprint tool can now list all blueprints when no path is provided, or retrieve details for a specific blueprint when a path is given.
  • System Information Tool Consolidation: The ha_get_system_info and ha_get_system_version tools have been removed. Their comprehensive system information retrieval capabilities have been integrated into the ha_get_overview tool, which now provides a more complete system overview.
  • New Unit Tests: New unit tests have been added to verify the default log path behavior and to enforce a total tool count limit, ensuring maintainability and adherence to platform constraints.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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", []),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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_info

@julienld
julienld force-pushed the fix-log-path-and-install-scripts branch from 4c6843c to 78eeda1 Compare January 17, 2026 10:52
@julienld julienld closed this Jan 17, 2026
@julienld
julienld deleted the fix-log-path-and-install-scripts branch January 17, 2026 11:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] OSError: [Errno 30] Read-only file system: 'logs' Read-only file system errors from Claude (macOS)

1 participant