Skip to content

fix: tolerate offline failures in cargo-globals and hyprpanel notifications#951

Open
shunkakinoki wants to merge 2 commits intomainfrom
fix/cargo-globals-offline-failure
Open

fix: tolerate offline failures in cargo-globals and hyprpanel notifications#951
shunkakinoki wants to merge 2 commits intomainfrom
fix/cargo-globals-offline-failure

Conversation

@shunkakinoki
Copy link
Owner

@shunkakinoki shunkakinoki commented Feb 26, 2026

Summary

  • cargo-globals: rustup toolchain install stable fails with DNS errors when network is unavailable at Home Manager activation time, causing the entire service to fail. Add --no-self-update and || true to make it non-fatal.
  • hyprpanel: Notifications from apps like Claude Code send an empty action (id: ""), which bypasses the get_actions().length guard and renders a blank pale bar. A postPatch overlay filters out empty-ID actions before the guard and the render map.

Test plan

  • Apply Home Manager config while offline — service should succeed
  • Apply Home Manager config while online — rustup installs/updates as normal
  • Trigger a Claude Code "waiting for input" notification — no empty action bar should appear
  • Trigger a notification with real actions — action buttons should still render normally

Summary by cubic

Prevent offline failures in cargo-globals and hide empty action bars in hyprpanel notifications. Home Manager activation no longer breaks without network, and notifications from apps like Claude Code render correctly.

  • Bug Fixes
    • cargo-globals: add --no-self-update and || true to rustup install/default so DNS/network errors are non-fatal; online installs still work as usual.
    • hyprpanel: overlay filters actions with empty id before the length check and map, removing blank action bars while keeping real action buttons.

Written for commit 5c7bb97. Summary will update on new commits.

@mesa-dot-dev
Copy link

mesa-dot-dev bot commented Feb 26, 2026

You do not have enough credits to review this pull request. Please purchase more credits to continue.

@coderabbitai
Copy link

coderabbitai bot commented Feb 26, 2026

Warning

Rate limit exceeded

@shunkakinoki has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 18 minutes and 36 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between d01e068 and 5c7bb97.

📒 Files selected for processing (2)
  • home-manager/modules/cargo-globals/default.nix
  • overlays/default.nix
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/cargo-globals-offline-failure

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @shunkakinoki, 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 enhances system robustness and user experience by addressing two distinct issues. It improves the reliability of Home Manager's cargo-globals activation by making rustup commands tolerant to offline conditions. Additionally, it refines the hyprpanel notification display by preventing the rendering of blank action bars caused by notifications with empty action IDs, leading to a cleaner user interface.

Highlights

  • Cargo Globals Offline Tolerance: Modified rustup commands in cargo-globals to include --no-self-update and || true. This prevents Home Manager activation from failing due to DNS errors when the network is unavailable, ensuring the service remains functional offline.
  • Hyprpanel Empty Notification Action Filtering: Implemented a postPatch overlay for hyprpanel to filter out notification actions with empty IDs. This resolves an issue where applications like Claude Code would send empty actions, causing a blank action bar to render in notifications.
Changelog
  • home-manager/modules/cargo-globals/default.nix
    • Added --no-self-update flag to rustup toolchain install stable command.
    • Appended || true to rustup toolchain install stable and rustup default stable commands to make them non-fatal on failure.
  • overlays/default.nix
    • Introduced a new overlay for hyprpanel to override its attributes.
    • Added a postPatch step to hyprpanel to substitute code in src/components/notifications/Notification/index.tsx and src/components/notifications/Actions/index.tsx.
    • Modified notification.get_actions().length to notification.get_actions().filter((a) => a.id !== "").length to filter out empty action IDs before checking length.
    • Modified notification.get_actions().map to notification.get_actions().filter((a) => a.id !== "").map to filter out empty action IDs before mapping.
Activity
  • No human activity has been recorded on this pull request yet.
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.

@mesa-dot-dev
Copy link

mesa-dot-dev bot commented Feb 26, 2026

Mesa Description

TL;DR

Tolerate offline failures in cargo-globals's rustup installation and filter out empty action notifications in hyprpanel.

What changed?

  • cargo-globals: Added --no-self-update and || true to rustup toolchain install stable to prevent DNS errors during offline Home Manager activation.
  • hyprpanel: Implemented a postPatch overlay to filter out notifications with empty action IDs, preventing the rendering of blank notification bars.

Description generated by Mesa. Update settings

Copy link
Contributor

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

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 improves robustness by making rustup commands in the cargo-globals module non-fatal to tolerate offline scenarios and patching hyprpanel to correctly handle notifications with empty actions. A security review found no specific vulnerabilities or critical issues. My review suggests logging a warning on failure instead of silently ignoring errors with || true for the cargo-globals change, and addressing code duplication in the hyprpanel patching logic for improved maintainability.

Comment on lines +20 to +21
$DRY_RUN_CMD ${pkgs.rustup}/bin/rustup toolchain install stable --no-self-update || true
$DRY_RUN_CMD ${pkgs.rustup}/bin/rustup default stable || true
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

Using || true completely silences any errors from the rustup commands. While this prevents the activation from failing when offline, it also hides other potential errors (e.g., permissions issues, disk full) that might be important to know about.

Consider logging a warning message on failure instead. This would still allow the script to proceed but would make debugging easier if a non-network-related error occurs.

    $DRY_RUN_CMD ${pkgs.rustup}/bin/rustup toolchain install stable --no-self-update || echo "warning: rustup toolchain install failed, continuing..." >&2
    $DRY_RUN_CMD ${pkgs.rustup}/bin/rustup default stable || echo "warning: rustup default stable failed, continuing..." >&2

Comment on lines +43 to +50
substituteInPlace src/components/notifications/Notification/index.tsx \
--replace-fail \
'notification.get_actions().length' \
'notification.get_actions().filter((a) => a.id !== "").length'
substituteInPlace src/components/notifications/Actions/index.tsx \
--replace-fail \
'notification.get_actions().map' \
'notification.get_actions().filter((a) => a.id !== "").map'
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

This patch introduces duplication of the filtering logic notification.get_actions().filter((a) => a.id !== "") across two files. This harms maintainability, as any future changes to this logic would need to be applied in both places.

Consider if there's a way to apply this filter only once. For example, if Notification/index.tsx is the parent component, it could perform the filtering and pass the result down to Actions/index.tsx. This might require a more complex patch than substituteInPlace can easily handle (e.g., using a .patch file), but would result in cleaner code.

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 2 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="home-manager/modules/cargo-globals/default.nix">

<violation number="1" location="home-manager/modules/cargo-globals/default.nix:20">
P2: `|| true` silences all errors from `rustup`, not just network-related ones. This means legitimate failures (permissions issues, disk full, corrupted toolchain, etc.) will also be silently swallowed, making them very difficult to debug. Consider logging a warning on failure instead, so the activation still succeeds but the error is visible:
```nix
$DRY_RUN_CMD ${pkgs.rustup}/bin/rustup toolchain install stable --no-self-update || echo "warning: rustup toolchain install failed, continuing..." >&2
$DRY_RUN_CMD ${pkgs.rustup}/bin/rustup default stable || echo "warning: rustup default stable failed, continuing..." >&2
```</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Comment on lines +20 to +21
$DRY_RUN_CMD ${pkgs.rustup}/bin/rustup toolchain install stable --no-self-update || true
$DRY_RUN_CMD ${pkgs.rustup}/bin/rustup default stable || true
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Feb 26, 2026

Choose a reason for hiding this comment

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

P2: || true silences all errors from rustup, not just network-related ones. This means legitimate failures (permissions issues, disk full, corrupted toolchain, etc.) will also be silently swallowed, making them very difficult to debug. Consider logging a warning on failure instead, so the activation still succeeds but the error is visible:

$DRY_RUN_CMD ${pkgs.rustup}/bin/rustup toolchain install stable --no-self-update || echo "warning: rustup toolchain install failed, continuing..." >&2
$DRY_RUN_CMD ${pkgs.rustup}/bin/rustup default stable || echo "warning: rustup default stable failed, continuing..." >&2
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At home-manager/modules/cargo-globals/default.nix, line 20:

<comment>`|| true` silences all errors from `rustup`, not just network-related ones. This means legitimate failures (permissions issues, disk full, corrupted toolchain, etc.) will also be silently swallowed, making them very difficult to debug. Consider logging a warning on failure instead, so the activation still succeeds but the error is visible:
```nix
$DRY_RUN_CMD ${pkgs.rustup}/bin/rustup toolchain install stable --no-self-update || echo "warning: rustup toolchain install failed, continuing..." >&2
$DRY_RUN_CMD ${pkgs.rustup}/bin/rustup default stable || echo "warning: rustup default stable failed, continuing..." >&2
```</comment>

<file context>
@@ -17,8 +17,8 @@ in
     export CARGO_HOME="$HOME/.cargo"
-    $DRY_RUN_CMD ${pkgs.rustup}/bin/rustup toolchain install stable
-    $DRY_RUN_CMD ${pkgs.rustup}/bin/rustup default stable
+    $DRY_RUN_CMD ${pkgs.rustup}/bin/rustup toolchain install stable --no-self-update || true
+    $DRY_RUN_CMD ${pkgs.rustup}/bin/rustup default stable || true
     export PKG_CONFIG_PATH="${pkgs.openssl.dev}/lib/pkgconfig${libiconvPkgConfigPath}''${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}"
</file context>
Suggested change
$DRY_RUN_CMD ${pkgs.rustup}/bin/rustup toolchain install stable --no-self-update || true
$DRY_RUN_CMD ${pkgs.rustup}/bin/rustup default stable || true
$DRY_RUN_CMD ${pkgs.rustup}/bin/rustup toolchain install stable --no-self-update || echo "warning: rustup toolchain install failed, continuing..." >&2
$DRY_RUN_CMD ${pkgs.rustup}/bin/rustup default stable || echo "warning: rustup default stable failed, continuing..." >&2
Fix with Cubic

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.

1 participant