feat(windows/anthropic): fix service & track design/extra usage#72
Open
PavelA85 wants to merge 3 commits into
Open
feat(windows/anthropic): fix service & track design/extra usage#72PavelA85 wants to merge 3 commits into
PavelA85 wants to merge 3 commits into
Conversation
There was a problem hiding this comment.
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.
| return nil, fmt.Errorf("failed to stat log file %s: %w", path, err) | ||
| } | ||
|
|
||
| if err := os.MkdirAll(filepath.Dir(path), 0755); err != nil { |
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" |
|
|
||
| # 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 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 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 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.