Skip to content

Conversation

@mikejmorgan-ai
Copy link
Member

Summary

Implements #444 - WiFi/Bluetooth Driver Auto-Matcher for problematic wireless chips.

Features

  • Hardware Detection: PCI devices via lspci, USB devices via lsusb
  • Vendor Recognition: Realtek, Intel, Mediatek, Broadcom, Atheros, Ralink
  • Driver Database: Pre-configured for common problematic chips:
    • RTL8821CE, RTL8822CE, RTL8852AE/BE (Realtek)
    • MT7921, MT7922 (Mediatek)
    • Intel AX series
    • BCM4350 (Broadcom)
  • Install Automation: Package, DKMS, and kernel driver installation
  • Connectivity Check: WiFi and Bluetooth status verification

Commands

cortex wifi status          # Show devices and connectivity
cortex wifi detect          # Detect wireless hardware
cortex wifi recommend       # Show driver recommendations
cortex wifi install         # Install missing drivers
cortex wifi connectivity    # Check connection status

Testing

  • 42 tests with comprehensive mocking
  • All edge cases covered (missing tools, unknown hardware)

Fixes #444

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 15, 2026

Warning

Rate limit exceeded

@mikejmorgan-ai has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 3 minutes and 46 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 3a9137e and 2627299.

📒 Files selected for processing (3)
  • cortex/cli.py
  • cortex/wifi_driver.py
  • tests/test_wifi_driver.py

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.


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 @mikejmorgan-ai, 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 delivers a significant new feature to the cortex CLI: an automated WiFi/Bluetooth driver matcher. This tool is designed to simplify the often-frustrating process of identifying, recommending, and installing correct drivers for wireless hardware on Linux systems. By integrating hardware detection, a curated driver database, and installation automation, it aims to provide users with a streamlined solution for resolving common wireless connectivity issues.

Highlights

  • New wifi subcommand: Introduced a new wifi subcommand to the cortex CLI for managing WiFi and Bluetooth drivers, offering actions like status, detect, recommend, install, and connectivity.
  • Automated Hardware Detection: Implemented automatic detection of wireless hardware, identifying both PCI and USB devices, along with vendor recognition for common manufacturers such as Realtek, Intel, Mediatek, Broadcom, Atheros, and Ralink.
  • Comprehensive Driver Database: Developed a curated driver database to recommend and automate the installation of drivers for known problematic WiFi/Bluetooth chips, including specific Realtek, Mediatek, Intel, and Broadcom models.
  • Connectivity Verification: Added functionality to check and display the current WiFi and Bluetooth connectivity status, including connected SSID and Bluetooth power state.
  • Extensive Testing: Included 42 comprehensive unit tests with mocking to cover various scenarios and edge cases, ensuring the reliability of the driver auto-matcher.
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.

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 introduces a new feature for WiFi/Bluetooth driver auto-matching, which is a valuable addition for users experiencing wireless connectivity issues. The implementation in cortex/wifi_driver.py is well-structured, utilizing enums and dataclasses for clear data modeling, and includes robust command execution with error handling. The cli.py changes correctly integrate the new wifi command into the existing CLI framework. Furthermore, the accompanying test file tests/test_wifi_driver.py provides comprehensive unit and integration tests, demonstrating a strong commitment to code quality and reliability. Overall, this is a solid and well-executed feature.


WIFI = "wifi"
BLUETOOTH = "bluetooth"
COMBO = "combo" # Combined WiFi + Bluetooth
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The DeviceType.COMBO enum is defined but does not appear to be used anywhere in the detect_pci_devices or detect_usb_devices methods. Currently, combo cards are classified as either WIFI or BLUETOOTH based on keyword presence. Consider updating the detection logic to explicitly identify and use COMBO for devices that support both, which could provide more accurate device representation.

device_id=device_id,
vendor=self._detect_vendor(name),
driver_loaded=driver,
is_working=bool(driver),
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The is_working flag is currently determined solely by whether a kernel driver is loaded. While this is a good initial indicator, a driver being loaded doesn't always guarantee full functionality. For a more robust check, consider adding additional verification steps, such as checking rfkill status for the device or parsing dmesg output for driver-specific errors, to confirm the device is truly operational.

- Detect PCI and USB wireless devices via lspci/lsusb
- Driver database for Realtek, Mediatek, Intel, Broadcom, Atheros
- Auto-match devices to appropriate drivers (kernel, DKMS, package)
- Check WiFi and Bluetooth connectivity status
- Generate install commands for problematic chips
- Support for common problematic chips (RTL8821CE, MT7921, etc.)
- 42 tests with full coverage

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@mikejmorgan-ai mikejmorgan-ai force-pushed the feature/issue-444-wifi-bluetooth-driver branch from 7d25e28 to 2627299 Compare January 15, 2026 08:20
@mikejmorgan-ai mikejmorgan-ai merged commit 4f4d886 into main Jan 15, 2026
11 of 13 checks passed
@mikejmorgan-ai mikejmorgan-ai deleted the feature/issue-444-wifi-bluetooth-driver branch January 15, 2026 08:20
@sonarqubecloud
Copy link

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.

WiFi/Bluetooth Driver Auto-Matcher

2 participants