Skip to content

feat(windows/anthropic): fix service & track design/extra usage#72

Open
PavelA85 wants to merge 3 commits into
onllm-dev:mainfrom
PavelA85:fix/windows-service-setup
Open

feat(windows/anthropic): fix service & track design/extra usage#72
PavelA85 wants to merge 3 commits into
onllm-dev:mainfrom
PavelA85:fix/windows-service-setup

Conversation

@PavelA85
Copy link
Copy Markdown

@PavelA85 PavelA85 commented May 7, 2026

This PR resolves LocalSystem service startup and logging issues on Windows. Additionally, it adds tracking for Claude Design and Extra Usage (with Euro currency support) to the Anthropic provider, and introduces a new 1080p-optimized 'Wall Mode' for dedicated displays featuring a high-density, scroll-free layout with a floating exit toggle.

Copilot AI review requested due to automatic review settings May 7, 2026 22:49
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes Windows Service startup failures under the LocalSystem account by ensuring log directories exist before opening log files, and by providing a documented NSSM-based installation workflow.

Changes:

  • Add a PowerShell script to install/configure the onWatch Windows Service via NSSM, including service logging and environment injection.
  • Ensure log parent directories are created before opening rotating log files.
  • Update Windows setup documentation with automatic + manual service installation instructions.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.

File Description
scripts/setup-windows-service.ps1 New NSSM setup script for installing/configuring onWatch as a Windows Service.
internal/config/config.go Create the log directory before opening the rotating log file.
docs/WINDOWS_SETUP.md Document recommended (scripted) and manual NSSM setup for running as a Windows Service.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread scripts/setup-windows-service.ps1 Outdated
Comment thread scripts/setup-windows-service.ps1 Outdated
Comment thread docs/WINDOWS_SETUP.md
Comment thread internal/config/config.go
Comment thread internal/config/config.go Outdated
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 6 comments.

Comment thread internal/config/config.go
return nil, fmt.Errorf("failed to stat log file %s: %w", path, err)
}

if err := os.MkdirAll(filepath.Dir(path), 0755); err != nil {
Comment thread setup-service.ps1
Comment on lines +4 to +7
$NSSM = "C:\Users\Paul\AppData\Local\Microsoft\WinGet\Packages\NSSM.NSSM_Microsoft.WinGet.Source_8wekyb3d8bbwe\nssm-2.24-101-g897c7ad\win64\nssm.exe"
$BIN = "C:\Projects\onllm\onwatch\onwatch.exe"
$DIR = "C:\Projects\onllm\onwatch"
$LOG = "C:\Projects\onllm\onwatch\service.log"
Comment thread setup-service.ps1

# Configure environment variables so that LocalSystem accesses Paul's home directory
# This allows auto-detecting Claude/Codex/Gemini credentials and saves data to Paul's .onwatch folder
& $NSSM set $SVC AppEnvironmentExtra "USERPROFILE=C:\Users\Paul`0HOME=C:\Users\Paul`0"
Comment thread cleanup-services.ps1
Comment on lines +4 to +17
Write-Host "Please ensure the 'Services' (services.msc) window and 'Task Manager' are CLOSED." -ForegroundColor Yellow

$NSSM = "C:\Users\Paul\AppData\Local\Microsoft\WinGet\Packages\NSSM.NSSM_Microsoft.WinGet.Source_8wekyb3d8bbwe\nssm-2.24-101-g897c7ad\win64\nssm.exe"
$Services = @("onWatch", "onWatchApp", "onWatchService")

foreach ($svc in $Services) {
Write-Host "`nCleaning up: $svc" -ForegroundColor Cyan

# 1. Stop the service
& $NSSM stop $svc 2>$null
Start-Sleep -Seconds 1

# 2. Try removing via NSSM
& $NSSM remove $svc confirm 2>$null
Comment thread cleanup-services.ps1
Comment on lines +22 to +27
# 4. Force delete from the Windows Registry to clear "marked for deletion" lock
$regPath = "HKLM:\SYSTEM\CurrentControlSet\Services\$svc"
if (Test-Path $regPath) {
Write-Host "Forcefully removing registry keys for $svc..." -ForegroundColor Yellow
Remove-Item -Path $regPath -Recurse -Force -ErrorAction SilentlyContinue
} else {
Comment thread docs/WINDOWS_SETUP.md
Comment on lines +284 to +291
```powershell
# If you cloned the repository:
.\scripts\setup-windows-service.ps1

# Or download and review the script before running:
Invoke-WebRequest -Uri https://raw.githubusercontent.com/onllm-dev/onwatch/main/scripts/setup-windows-service.ps1 -OutFile setup-windows-service.ps1
.\setup-windows-service.ps1
```
Adds tracking for Claude Design and Extra Usage (with currency support) to the Anthropic provider. Introduces a new 'Wall Mode' optimized for 1080p dedicated displays, featuring a high-density, scroll-free layout.
@PavelA85 PavelA85 changed the title fix(windows): resolve LocalSystem service startup and logging issues feat(windows/anthropic): fix service & track design/extra usage May 11, 2026
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.

2 participants