Skip to content

fix: resolve Homebrew install failures and improve setup.sh error handling#146

Merged
marcusquinn merged 1 commit intomainfrom
fix/homebrew-install-issues
Jan 21, 2026
Merged

fix: resolve Homebrew install failures and improve setup.sh error handling#146
marcusquinn merged 1 commit intomainfrom
fix/homebrew-install-issues

Conversation

@marcusquinn
Copy link
Owner

@marcusquinn marcusquinn commented Jan 21, 2026

Summary

Fixes installation issues reported in user session where Homebrew install failed and curl install from wrong directory caused errors.

Changes

  • Homebrew formula fix: Install aidevops.sh to libexec instead of bin to avoid "Will not overwrite" error when the wrapper script is created
  • Source directory validation: Add check in deploy_aidevops_agents() to catch curl installs run from wrong directory with clear error message
  • Python upgrade instructions: Show actionable upgrade commands when Python 3.10+ not found for AI orchestration
  • dev-browser error visibility: Show actual error output when setup fails instead of silent failure
  • DSPy error visibility: Show pip error output when dependency install fails for debugging

Root Cause Analysis

Homebrew Double-Write Bug

The formula was writing to bin/aidevops twice:

  1. Line 19: bin.install "aidevops.sh" => "aidevops"
  2. Line 29: (bin/"aidevops").write <<~EOS

This caused RuntimeError: Will not overwrite even on fresh installs.

Curl Install from Wrong Directory

When running bash <(curl -fsSL https://aidevops.sh/install) from a non-aidevops directory, the bootstrap function clones the repo but the rsync command still used the original BASH_SOURCE[0] path, causing:

rsync(31609): error: /dev/fd/.agent/: (l)stat: No such file or directory

Testing

  • ShellCheck passes on modified files
  • Secretlint passes
  • Local linters pass (pre-existing issues unrelated to this PR)

Summary by CodeRabbit

  • Bug Fixes

    • Enhanced error handling with more detailed diagnostics and remediation guidance during setup operations.
    • Added validation checks to detect missing resources earlier in initialization.
    • Improved debugging output with captured error details for troubleshooting.
  • Chores

    • Reorganized CLI installation structure for improved package management.

✏️ Tip: You can customize this high-level summary in your review settings.

…dling

- Fix Homebrew formula double-write bug: install aidevops.sh to libexec
  instead of bin to avoid 'Will not overwrite' error when wrapper is created
- Add source directory validation in deploy_aidevops_agents() to catch
  curl installs run from wrong directory with clear error message
- Add Python upgrade instructions when 3.10+ not found for AI orchestration
- Show actual error output when dev-browser setup fails instead of silent failure
- Show pip error output when DSPy dependency install fails for debugging

Fixes installation issues reported in user session where:
- brew install failed with 'RuntimeError: Will not overwrite'
- curl install from non-aidevops directory caused rsync errors
- Missing dependencies had no actionable upgrade instructions
@gemini-code-assist
Copy link

Summary of Changes

Hello @marcusquinn, 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-friendliness of the installation and setup process. It addresses critical installation failures, particularly with Homebrew and curl-based setups, and vastly improves error visibility and guidance for Python and specific tool installations like dev-browser and DSPy. The changes aim to provide clearer feedback and actionable steps to users encountering setup issues.

Highlights

  • Homebrew Formula Fix: Resolved a "Will not overwrite" error in the Homebrew formula by installing aidevops.sh to libexec instead of bin, and then creating a wrapper in bin.
  • Improved Curl Install Error Handling: Added a validation check in deploy_aidevops_agents() to detect and provide clear error messages when curl installs are run from the wrong directory.
  • Enhanced Python Setup Guidance: Implemented actionable upgrade/install instructions for Python 3.10+ when it's not found, improving user experience for AI orchestration setup.
  • Better Error Visibility for dev-browser: Modified the dev-browser setup to display actual error output instead of failing silently, aiding in debugging.
  • Detailed DSPy Dependency Error Reporting: Updated the DSPy dependency installation process to show pip error output directly, facilitating troubleshooting.
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.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 21, 2026

Walkthrough

The PR relocates the CLI script installation from bin to libexec in the Homebrew formula while introducing a wrapper script in bin, and enhances setup.sh with comprehensive error handling, pre-checks, and user-facing guidance for common failure scenarios.

Changes

Cohort / File(s) Summary
Homebrew Formula Installation
homebrew/aidevops.rb
Relocated aidevops.sh from bin to libexec and created a new wrapper script in bin that exports AIDEVOPS_SHARE and delegates execution to the libexec-hosted script, resolving bin-write conflicts.
Setup Script Error Handling & Diagnostics
setup.sh
Enhanced error handling across multiple functions (deploy_aidevops_agents, setup_python_env, setup_browser_tools, setup_ai_orchestration) by capturing command outputs, validating pre-conditions (e.g., agent directory existence), displaying last error lines on failure, and providing explicit OS-specific guidance for Python installation/upgrade scenarios.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Possibly related PRs

Poem

🛠️ Scripts now dwell in libexec's nest,
While wrappers guide from bin's request—
Error messages bloom with debugging light,
Pre-checks and guidance make failures bright! ✨
DevOps automation, polished just right.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the two main changes: fixing Homebrew install failures and improving error handling in setup.sh.
Docstring Coverage ✅ Passed Docstring coverage is 80.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

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.

@sonarqubecloud
Copy link

Copy link

@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 effectively addresses several critical installation and error handling issues, significantly improving the robustness and user experience of the AI DevOps Framework. The Homebrew formula fix correctly resolves the double-write conflict by installing aidevops.sh to libexec, preventing installation failures. The enhanced error handling in setup.sh for deploy_aidevops_agents(), DSPy dependency installation, and dev-browser setup provides much clearer and actionable feedback to the user, which will greatly aid in debugging and self-resolution. Additionally, the detailed Python upgrade and installation instructions are a valuable addition for users encountering version compatibility issues. Overall, these changes are well-implemented and directly tackle reported problems, making the setup process more reliable and user-friendly.

@github-actions
Copy link

🔍 Code Quality Report

�[0;35m[MONITOR]�[0m Code Review Monitoring Report

�[0;34m[INFO]�[0m Latest Quality Status:
SonarCloud: 0 bugs, 0 vulnerabilities, 353 code smells

�[0;34m[INFO]�[0m Recent monitoring activity:
Wed Jan 21 17:01:50 UTC 2026: Code review monitoring started
Wed Jan 21 17:01:51 UTC 2026: SonarCloud - Bugs: 0, Vulnerabilities: 0, Code Smells: 353
Wed Jan 21 17:01:51 UTC 2026: Qlty - 0 issues found, auto-formatting applied
Wed Jan 21 17:01:53 UTC 2026: Codacy analysis completed with auto-fixes

📈 Current Quality Metrics

  • BUGS: 0
  • CODE SMELLS: 353
  • VULNERABILITIES: 0

Generated on: Wed Jan 21 17:03:08 UTC 2026


Generated by AI DevOps Framework Code Review Monitoring

@marcusquinn marcusquinn merged commit 1bae698 into main Jan 21, 2026
8 of 9 checks passed
@augmentcode
Copy link

augmentcode bot commented Jan 21, 2026

🤖 Augment PR Summary

Summary: This PR fixes installer reliability issues, especially around Homebrew installs and debugging failed setup steps.

Changes:

  • Homebrew formula now installs aidevops.sh into libexec and keeps a thin wrapper in bin to avoid “Will not overwrite” conflicts.
  • setup.sh validates the agent source directory before rsync/copy to catch curl-based installs run from an unexpected location.
  • Improves visibility of failures by surfacing error output for dev-browser setup and DSPy dependency installation.
  • Adds actionable Python 3.10+ upgrade/install guidance when AI orchestration prerequisites are missing.

Technical Notes: The updated setup paths and captured stderr output should make installation failures easier to diagnose without changing core setup behavior.

🤖 Was this summary useful? React with 👍 or 👎

Copy link

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

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

Review completed. 2 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

# Install the CLI script
bin.install "aidevops.sh" => "aidevops"
# Install the CLI script to libexec (not bin, to avoid double-write conflict)
libexec.install "aidevops.sh"
Copy link

Choose a reason for hiding this comment

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

Installing aidevops.sh into libexec means the wrapper later execs it directly; if the script doesn’t have the executable bit in the tarball, the wrapper will fail at runtime with Permission denied. Worth double-checking that the packaged aidevops.sh is always installed with executable permissions in this new location.

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎

# Validate source directory exists (catches curl install from wrong directory)
if [[ ! -d "$source_dir" ]]; then
print_error "Agent source directory not found: $source_dir"
print_info "This usually means setup.sh was run from the wrong directory."
Copy link

Choose a reason for hiding this comment

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

This new “wrong directory” error path will also trigger in cases where .agent isn’t located at $script_dir/.agent (e.g., packaged installs where the agent files live elsewhere), so the remediation guidance (cd ~/Git/aidevops ...) may be misleading. Consider clarifying the message to distinguish “curl/clone re-exec didn’t happen” vs “install layout doesn’t have .agent next to setup.sh."

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
homebrew/aidevops.rb (1)

18-33: Make the bin wrapper executable.

(bin/"aidevops").write creates a non-executable file by default, so the CLI will fail with "permission denied." Add chmod 0755 after writing, or use the Homebrew helper bin.write_exec_script (preferred) which handles this automatically.

🔧 Proposed fix (Option 1: chmod)
     (bin/"aidevops").write <<~EOS
       #!/usr/bin/env bash
       export AIDEVOPS_SHARE="#{share}/aidevops"
       exec "#{libexec}/aidevops.sh" "$@"
     EOS
+    (bin/"aidevops").chmod 0755
🔧 Proposed fix (Option 2: Homebrew helper – recommended)
     libexec.install "aidevops.sh"
     libexec.install "setup.sh"
     (share/"aidevops").install ".agent"
     (share/"aidevops").install "VERSION"
     
-    (bin/"aidevops").write <<~EOS
-      #!/usr/bin/env bash
-      export AIDEVOPS_SHARE="#{share}/aidevops"
-      exec "#{libexec}/aidevops.sh" "$@"
-    EOS
+    bin.write_exec_script("aidevops", libexec/"aidevops.sh", {"AIDEVOPS_SHARE" => "#{share}/aidevops"})

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