Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 29 additions & 29 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,19 @@ jobs:
run: dotnet restore

- name: Build Shared Library
run: dotnet build src/Moltbot.Shared -c Debug
run: dotnet build src/OpenClaw.Shared -c Debug

- name: Build Tray App (WinForms)
run: dotnet build src/Moltbot.Tray -c Debug
run: dotnet build src/OpenClaw.Tray -c Debug

- name: Build Tray App (WinUI)
run: dotnet build src/Moltbot.Tray.WinUI -c Debug
run: dotnet build src/OpenClaw.Tray.WinUI -c Debug

- name: Build Tests
run: dotnet build tests/Moltbot.Shared.Tests -c Debug
run: dotnet build tests/OpenClaw.Shared.Tests -c Debug

- name: Run Tests
run: dotnet test tests/Moltbot.Shared.Tests --no-build -c Debug --verbosity normal
run: dotnet test tests/OpenClaw.Shared.Tests --no-build -c Debug --verbosity normal

outputs:
semVer: ${{ steps.gitversion.outputs.semVer }}
Expand All @@ -67,13 +67,13 @@ jobs:
dotnet-version: 10.0.x

- name: Restore WinUI Tray App
run: dotnet restore src/Moltbot.Tray.WinUI -r ${{ matrix.rid }}
run: dotnet restore src/OpenClaw.Tray.WinUI -r ${{ matrix.rid }}

- name: Build WinUI Tray App (Release)
run: dotnet build src/Moltbot.Tray.WinUI --no-restore -c Release -r ${{ matrix.rid }} -p:Version=${{ needs.test.outputs.semVer }}
run: dotnet build src/OpenClaw.Tray.WinUI --no-restore -c Release -r ${{ matrix.rid }} -p:Version=${{ needs.test.outputs.semVer }}

- name: Publish WinUI Tray App
run: dotnet publish src/Moltbot.Tray.WinUI -c Release -r ${{ matrix.rid }} --self-contained -p:Version=${{ needs.test.outputs.semVer }} -o publish
run: dotnet publish src/OpenClaw.Tray.WinUI -c Release -r ${{ matrix.rid }} --self-contained -p:Version=${{ needs.test.outputs.semVer }} -o publish

- name: Azure Login for Signing
if: startsWith(github.ref, 'refs/tags/v')
Expand All @@ -100,7 +100,7 @@ jobs:
- name: Upload Tray Artifact
uses: actions/upload-artifact@v4
with:
name: moltbot-tray-${{ matrix.rid }}
name: openclaw-tray-${{ matrix.rid }}
path: publish/

build-extension:
Expand All @@ -119,16 +119,16 @@ jobs:
dotnet-version: 10.0.x

- name: Restore Command Palette Extension
run: dotnet restore src/Moltbot.CommandPalette
run: dotnet restore src/OpenClaw.CommandPalette

- name: Build Command Palette Extension
run: dotnet build src/Moltbot.CommandPalette -c Debug -p:Platform=${{ matrix.platform }}
run: dotnet build src/OpenClaw.CommandPalette -c Debug -p:Platform=${{ matrix.platform }}

- name: Upload Extension Artifact
uses: actions/upload-artifact@v4
with:
name: moltbot-commandpalette-${{ matrix.platform }}
path: src/Moltbot.CommandPalette/bin/${{ matrix.platform }}/Debug/
name: openclaw-commandpalette-${{ matrix.platform }}
path: src/OpenClaw.CommandPalette/bin/${{ matrix.platform }}/Debug/

release:
needs: [test, build, build-extension]
Expand All @@ -143,32 +143,32 @@ jobs:
- name: Download win-x64 tray artifact
uses: actions/download-artifact@v4
with:
name: moltbot-tray-win-x64
name: openclaw-tray-win-x64
path: artifacts/tray-win-x64

- name: Download win-arm64 tray artifact
uses: actions/download-artifact@v4
with:
name: moltbot-tray-win-arm64
name: openclaw-tray-win-arm64
path: artifacts/tray-win-arm64

- name: Download win-x64 cmdpal artifact
uses: actions/download-artifact@v4
with:
name: moltbot-commandpalette-x64
name: openclaw-commandpalette-x64
path: artifacts/cmdpal-x64

- name: Download win-arm64 cmdpal artifact
uses: actions/download-artifact@v4
with:
name: moltbot-commandpalette-arm64
name: openclaw-commandpalette-arm64
path: artifacts/cmdpal-arm64

# Create ZIP files for Updatum auto-update (needs "win-x64" in filename)
- name: Create Release ZIPs
run: |
Compress-Archive -Path artifacts/tray-win-x64/* -DestinationPath MoltbotTray-${{ needs.test.outputs.majorMinorPatch }}-win-x64.zip
Compress-Archive -Path artifacts/tray-win-arm64/* -DestinationPath MoltbotTray-${{ needs.test.outputs.majorMinorPatch }}-win-arm64.zip
Compress-Archive -Path artifacts/tray-win-x64/* -DestinationPath OpenClawTray-${{ needs.test.outputs.majorMinorPatch }}-win-x64.zip
Compress-Archive -Path artifacts/tray-win-arm64/* -DestinationPath OpenClawTray-${{ needs.test.outputs.majorMinorPatch }}-win-arm64.zip

# Inno Setup installer for x64
- name: Install Inno Setup
Expand Down Expand Up @@ -225,18 +225,18 @@ jobs:
with:
generate_release_notes: true
files: |
Output/MoltbotTray-Setup-x64.exe
Output/MoltbotTray-Setup-arm64.exe
MoltbotTray-${{ needs.test.outputs.majorMinorPatch }}-win-x64.zip
MoltbotTray-${{ needs.test.outputs.majorMinorPatch }}-win-arm64.zip
Output/OpenClawTray-Setup-x64.exe
Output/OpenClawTray-Setup-arm64.exe
OpenClawTray-${{ needs.test.outputs.majorMinorPatch }}-win-x64.zip
OpenClawTray-${{ needs.test.outputs.majorMinorPatch }}-win-arm64.zip
body: |
## Moltbot Windows Hub ${{ github.ref_name }}
## OpenClaw Windows Hub ${{ github.ref_name }}

### Downloads
- **Installer (x64)**: `MoltbotTray-Setup-x64.exe` - Intel/AMD 64-bit
- **Installer (ARM64)**: `MoltbotTray-Setup-arm64.exe` - Windows on ARM (Surface, etc.)
- **Portable x64**: `MoltbotTray-${{ needs.test.outputs.majorMinorPatch }}-win-x64.zip`
- **Portable ARM64**: `MoltbotTray-${{ needs.test.outputs.majorMinorPatch }}-win-arm64.zip`
- **Installer (x64)**: `OpenClawTray-Setup-x64.exe` - Intel/AMD 64-bit
- **Installer (ARM64)**: `OpenClawTray-Setup-arm64.exe` - Windows on ARM (Surface, etc.)
- **Portable x64**: `OpenClawTray-${{ needs.test.outputs.majorMinorPatch }}-win-x64.zip`
- **Portable ARM64**: `OpenClawTray-${{ needs.test.outputs.majorMinorPatch }}-win-arm64.zip`

### Features
- 🦞 System tray integration with gateway status
Expand All @@ -247,7 +247,7 @@ jobs:
### Requirements
- Windows 10 version 1903 or later
- [WebView2 Runtime](https://developer.microsoft.com/en-us/microsoft-edge/webview2/)
- Moltbot gateway running locally
- OpenClaw gateway running locally
- PowerToys (for Command Palette extension)

### Quick Start
Expand Down
25 changes: 13 additions & 12 deletions CODE_REVIEW.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# Code Review - Moltbot Windows Hub
# Code Review - OpenClaw Windows Hub

## Overview
This document provides a comprehensive code review of the Moltbot Windows Hub repository, focusing on correctness, security, and best practices.
This document provides a comprehensive code review of the OpenClaw Windows Hub repository, focusing on correctness, security, and best practices.

## Executive Summary
✅ **Overall Assessment: Good** - The codebase is well-structured with proper separation of concerns, event-driven architecture, and correct async/await patterns. Some potential issues were identified around error handling, reconnection logic, and edge cases.

## Project Structure
- **Moltbot.Shared**: WebSocket gateway client and data models (✅ Cross-platform compatible)
- **Moltbot.Tray**: Windows system tray application (⚠️ Windows-only)
- **Moltbot.CommandPalette**: PowerToys extension (⚠️ Windows-only)
- **OpenClaw.Shared**: WebSocket gateway client and data models (✅ Cross-platform compatible)
- **OpenClaw.Tray**: Windows system tray application (⚠️ Windows-only)
- **OpenClaw.CommandPalette**: PowerToys extension (⚠️ Windows-only)

## Code Quality Analysis

Expand All @@ -18,7 +18,7 @@ This document provides a comprehensive code review of the Moltbot Windows Hub re
1. **Architecture & Design Patterns**
- Clean separation between networking (Shared) and UI (Tray)
- Event-driven architecture with proper use of C# events
- Dependency injection for logging (IMoltbotLogger interface)
- Dependency injection for logging (IOpenClawLogger interface)
- IDisposable pattern correctly implemented

2. **Async/Await Usage**
Expand All @@ -40,7 +40,7 @@ This document provides a comprehensive code review of the Moltbot Windows Hub re

#### 1. JSON Parsing Robustness (Medium Priority)

**Location**: `MoltbotGatewayClient.ParseSessions()` (lines 638-717)
**Location**: `OpenClawGatewayClient.ParseSessions()` (lines 638-717)

**Issue**: Complex parsing logic with multiple format variations makes it fragile to schema changes.

Expand All @@ -61,7 +61,7 @@ else if (sessions.ValueKind == JsonValueKind.Object) { /* ... */ }

#### 2. Reconnection Loop Edge Cases (Medium Priority)

**Location**: `MoltbotGatewayClient.ReconnectWithBackoffAsync()` (lines 164-185)
**Location**: `OpenClawGatewayClient.ReconnectWithBackoffAsync()` (lines 164-185)

**Issue**: Multiple paths can trigger reconnection simultaneously:
- Manual reconnect in `CheckHealthAsync()` (line 92)
Expand Down Expand Up @@ -232,7 +232,7 @@ public async Task SendChatMessageAsync(string message)
- `SessionInfo`: Display text, ShortKey for various key formats
- `GatewayUsageInfo`: Token formatting (K/M suffixes), cost display

2. **MoltbotGatewayClient Utilities** - Coverage of:
2. **OpenClawGatewayClient Utilities** - Coverage of:
- `ClassifyNotification()`: All notification types (health, urgent, email, etc.)
- `ClassifyTool()`: All tool-to-activity mappings
- `ShortenPath()`: Path truncation edge cases
Expand Down Expand Up @@ -260,7 +260,7 @@ public async Task SendChatMessageAsync(string message)

### 🐛 Issue: TruncateLabel Off-by-One Error

**Location**: `MoltbotGatewayClient.TruncateLabel()` line 849
**Location**: `OpenClawGatewayClient.TruncateLabel()` line 849

**Current Code**:
```csharp
Expand All @@ -282,7 +282,7 @@ All display text generation in Models.cs is correct:

### ⚠️ Cross-Platform Compatibility

**Moltbot.Shared** is mostly cross-platform, but:
**OpenClaw.Shared** is mostly cross-platform, but:
- `SessionInfo.ShortKey` uses `Path.GetFileName()` which behaves differently on Windows vs Linux
- On Linux, backslashes in paths are NOT treated as separators
- **Recommendation**: Explicitly replace backslashes before using `Path.GetFileName()`
Expand Down Expand Up @@ -349,7 +349,7 @@ if (Key.Contains('/') || Key.Contains('\\'))

## Conclusion

The Moltbot Windows Hub codebase demonstrates good software engineering practices with proper async/await usage, event-driven architecture, and resource management. The main areas for improvement are:
The OpenClaw Windows Hub codebase demonstrates good software engineering practices with proper async/await usage, event-driven architecture, and resource management. The main areas for improvement are:

1. **Testing**: Now addressed with 88 unit tests covering core functionality
2. **Error Handling**: Could be more consistent
Expand All @@ -364,3 +364,4 @@ All critical functionality has been validated through the new unit test suite. T
**Reviewer**: GitHub Copilot Coding Agent
**Test Coverage**: 88 tests, all passing
**Overall Grade**: B+ (Good, with room for improvement)

61 changes: 33 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 🦞 Moltbot Windows Hub
# 🦞 OpenClaw Windows Hub

A Windows companion suite for [Moltbot](https://moltbot.com) - the AI-powered personal assistant.
A Windows companion suite for [OpenClaw](https://openclaw.ai) - the AI-powered personal assistant.

*Made with 🦞 love by Scott Hanselman and Molty*

Expand All @@ -14,9 +14,9 @@ This monorepo contains three projects:

| Project | Description |
|---------|-------------|
| **Moltbot.Tray** | System tray application for quick access to Moltbot |
| **Moltbot.Shared** | Shared gateway client library |
| **Moltbot.CommandPalette** | PowerToys Command Palette extension |
| **OpenClaw.Tray** | System tray application for quick access to OpenClaw |
| **OpenClaw.Shared** | Shared gateway client library |
| **OpenClaw.CommandPalette** | PowerToys Command Palette extension |

## 🚀 Quick Start

Expand All @@ -32,12 +32,12 @@ dotnet build

### Run Tray App
```bash
dotnet run --project src/Moltbot.Tray
dotnet run --project src/OpenClaw.Tray
```

## 📦 Moltbot.Tray (Molty)
## 📦 OpenClaw.Tray (Molty)

Modern Windows 11-style system tray companion that connects to your local Moltbot gateway.
Modern Windows 11-style system tray companion that connects to your local OpenClaw gateway.

### Features
- 🦞 **Lobster branding** - Pixel-art lobster tray icon with status colors
Expand All @@ -62,7 +62,7 @@ Modern Windows 11-style system tray companion that connects to your local Moltbo

### Mac Parity Status

Comparing against [moltbot-menubar](https://github.com/magimetal/moltbot-menubar) (macOS Swift menu bar app):
Comparing against [openclaw-menubar](https://github.com/magimetal/openclaw-menubar) (macOS Swift menu bar app):

| Feature | Mac | Windows | Notes |
|---------|-----|---------|-------|
Expand Down Expand Up @@ -90,28 +90,28 @@ These features are available in Windows but not in the Mac app:
| Toast notifications | Clickable Windows notifications |
| Channel control | Start/stop Telegram & WhatsApp |
| Modern flyout menu | Windows 11-style with dark/light mode |
| Deep links | `moltbot://` URL scheme with IPC |
| Deep links | `openclaw://` URL scheme with IPC |
| First-run welcome | Guided onboarding for new users |
| PowerToys integration | Command Palette extension |

### Deep Links

Moltbot registers the `moltbot://` URL scheme for automation and integration:
OpenClaw registers the `openclaw://` URL scheme for automation and integration:

| Link | Description |
|------|-------------|
| `moltbot://settings` | Open Settings dialog |
| `moltbot://chat` | Open Web Chat window |
| `moltbot://dashboard` | Open Dashboard in browser |
| `moltbot://dashboard/sessions` | Open specific dashboard page |
| `moltbot://send?message=Hello` | Open Quick Send with pre-filled text |
| `moltbot://agent?message=Hello` | Send message directly (with confirmation) |
| `openclaw://settings` | Open Settings dialog |
| `openclaw://chat` | Open Web Chat window |
| `openclaw://dashboard` | Open Dashboard in browser |
| `openclaw://dashboard/sessions` | Open specific dashboard page |
| `openclaw://send?message=Hello` | Open Quick Send with pre-filled text |
| `openclaw://agent?message=Hello` | Send message directly (with confirmation) |

Deep links work even when Molty is already running - they're forwarded via IPC.

## 📦 Moltbot.CommandPalette
## 📦 OpenClaw.CommandPalette

PowerToys Command Palette extension for quick Moltbot access.
PowerToys Command Palette extension for quick OpenClaw access.

### Commands
- **🦞 Open Dashboard** - Launch web dashboard
Expand All @@ -125,13 +125,13 @@ PowerToys Command Palette extension for quick Moltbot access.
1. Build the solution in Release mode
2. Deploy the MSIX package via Visual Studio
3. Open Command Palette (Win+Alt+Space)
4. Type "Moltbot" to see commands
4. Type "OpenClaw" to see commands

## 📦 Moltbot.Shared
## 📦 OpenClaw.Shared

Shared library containing:
- `MoltbotGatewayClient` - WebSocket client for gateway protocol
- `IMoltbotLogger` - Logging interface
- `OpenClawGatewayClient` - WebSocket client for gateway protocol
- `IOpenClawLogger` - Logging interface
- Data models (SessionInfo, ChannelHealth, etc.)
- Channel control (start/stop channels via gateway)

Expand All @@ -141,9 +141,9 @@ Shared library containing:
```
moltbot-windows-hub/
├── src/
│ ├── Moltbot.Shared/ # Shared gateway library
│ ├── Moltbot.Tray/ # System tray app
│ └── Moltbot.CommandPalette/ # PowerToys extension
│ ├── OpenClaw.Shared/ # Shared gateway library
│ ├── OpenClaw.Tray/ # System tray app
│ └── OpenClaw.CommandPalette/ # PowerToys extension
├── docs/
│ └── molty1.png # Screenshot
├── moltbot-windows-hub.sln
Expand All @@ -155,8 +155,8 @@ moltbot-windows-hub/
### Configuration

Settings are stored in:
- Settings: `%APPDATA%\MoltbotTray\settings.json`
- Logs: `%LOCALAPPDATA%\MoltbotTray\moltbot-tray.log`
- Settings: `%APPDATA%\OpenClawTray\settings.json`
- Logs: `%LOCALAPPDATA%\OpenClawTray\openclaw-tray.log`

Default gateway: `ws://localhost:18789`

Expand All @@ -170,3 +170,8 @@ On first run without a token, Molty displays a welcome dialog that:
## License

MIT License - see [LICENSE](LICENSE)

---

*Formerly known as Moltbot, formerly known as Clawdbot*

Loading
Loading