Skip to content

v0.3.0

Choose a tag to compare

@snonux snonux released this 07 Feb 19:48
· 518 commits to main since this release

Release v0.3.0

## Overview

This release of Hexai introduces major improvements to AI-powered code completion, expands provider support, and enhances developer experience and reliability. Notably, Hexai now offers native integration with GitHub Copilot's Codex code completion API, smarter completion triggering, and a streamlined developer workflow using Mage. Several bug fixes and usability enhancements are included.

---

## Features

### Native GitHub Copilot Codex Integration
- **What:** Hexai now natively supports GitHub Copilot's Codex-style code completion API, in addition to chat-based completions.
- **Why:** This enables faster, more relevant code suggestions by leveraging Copilot's specialized code completion endpoint, improving both speed and accuracy for users with Copilot access.

### Smarter Completion Triggering
- **What:** Completions are now triggered more intelligently:
  - Inline prompt markers like `;text;` or `;;text;` always trigger completions.
  - Minimal identifier prefix is required before triggering, reducing unwanted suggestions.
  - Manual invocation and certain structural triggers (e.g., after `.` or `:`) are handled more flexibly.
- **Why:** This reduces noise and distraction from premature or irrelevant completions, making AI suggestions more helpful and context-aware.

### Mage-based Developer Workflow
- **What:** Hexai now uses [Mage](https://magefile.org/) for build, test, and install tasks.
- **Why:** Mage simplifies development and onboarding, providing easy commands for building, testing, and installing Hexai.

---

## Improvements

- **Completion Caching:** Improved caching of recent completions, ignoring insignificant whitespace, for faster repeated suggestions.
- **Configurable Trigger Characters:** Completion trigger characters are now configurable, with sensible defaults and improved handling of whitespace and special cases.
- **Provider Abstraction:** The codebase now supports pluggable LLM providers, making it easier to add or switch between OpenAI, Ollama, and Copilot.
- **Logging Enhancements:** More readable and colorized logs, including better previews and error highlighting, to aid troubleshooting and transparency.
- **Test Coverage:** Added comprehensive unit tests for completion logic, prefix handling, and provider selection, improving reliability and maintainability.
- **Documentation:** Updated README and configuration examples to reflect new features and usage patterns.

---

## Bug Fixes

- **Duplicate Prefixes:** Fixed an issue where completions could include duplicate assignment prefixes.
- **Bare Double Semicolon Handling:** Improved detection to avoid unwanted completions when only `;;` is present without a prompt.
- **Manual Invocation:** Ensured manual completion requests work correctly even after whitespace or special triggers.
- **Config Loading:** Fixed CLI behavior to respect provider-specific configuration and not require an OpenAI key when using Ollama or Copilot.

---

## Breaking Changes & Migration Notes

- **Completion Throttling:** The previous time-based throttle for completions has been replaced with a smarter in-flight guard. This may affect how quickly repeated completions appear in some editors.
- **Trigger Character Defaults:** The default set of trigger characters has changed. If you rely on custom triggers, review and update your configuration.
- **Mage Required for Development:** Developer tasks now require Mage. Install it with `go install github.com/magefile/mage@latest`.
- **Copilot Auth:** Copilot provider now expects a valid Copilot-issued authentication token. See updated documentation for details.

---

## How to Upgrade

1. **Install Mage** (for development):  
   `go install github.com/magefile/mage@latest`
2. **Build or Install Hexai:**  
   - Build: `mage build`
   - Install: `mage install`
3. **Update Configuration:**  
   - Review trigger characters and provider settings in your config file.
   - For Copilot, ensure you have a valid session token as described in the README.

---

## Thanks

Thank you to all users and contributors for your feedback and testing!