:LovelaceHealth
Check the Lovelace daemon connection and authentication status.
Command Signature
:LovelaceHealth
Alias: :LHealth
Description
The :LovelaceHealth command performs a comprehensive health check of the Neovim extension's connection to the Localhost daemon and verifies authentication status. It displays results in a dedicated buffer with clear status indicators.
What it checks:
- Daemon connection status
- JSON-RPC communication
- Socket accessibility
- Authentication status
- Session validity
When to use:
- After initial installation
- When troubleshooting connection issues
- Before submitting important tasks
- After daemon restart or upgrade
Usage
Basic Usage
:LovelaceHealth
Opens a split window showing health check results.
From Lua
require("lovelace.commands").health()
Output Format
The health check buffer displays results in sections:
# Lovelace Extension Health Check
## Daemon Connection
✓ Socket found: /tmp/lovelace-localhost.sock
✓ Connection successful
✓ JSON-RPC protocol verified
## Authentication
✓ Authenticated as: user@example.com
✓ User ID: usr_abc123def456
✓ Session active
## Environment
- Plugin version: 0.1.0
- Socket path: /tmp/lovelace-localhost.sock
- Log level: info
Status Indicators
| Symbol | Meaning | Description |
|---|---|---|
| ✓ | Check passed | Component working correctly |
| ✗ | Check failed | Component has issues |
| ⚠ | Warning | Component working with caveats |
| ℹ | Information | Additional context provided |
Common Scenarios
Scenario 1: Fully Operational
All checks pass, extension ready to use:
## Daemon Connection
✓ Socket found: /tmp/lovelace-localhost.sock
✓ Connection successful
✓ JSON-RPC protocol verified
## Authentication
✓ Authenticated as: user@example.com
✓ Session active
Next step: Submit your first task with :LovelaceTask
Scenario 2: Connected but Not Authenticated
Daemon is running but authentication needed:
## Daemon Connection
✓ Socket found: /tmp/lovelace-localhost.sock
✓ Connection successful
✓ JSON-RPC protocol verified
## Authentication
✗ Not authenticated
ℹ Run :LovelaceAuth to authenticate
Next step: Run :LovelaceAuth to complete device authorization flow
Scenario 3: Daemon Not Running
Socket exists but daemon is not responding:
## Daemon Connection
✓ Socket found: /tmp/lovelace-localhost.sock
✗ Connection failed: Connection refused
ℹ Daemon may not be running
## Troubleshooting
1. Start the daemon: localhost-ctl start
2. Verify daemon status: localhost-ctl status
3. Check daemon logs: localhost-ctl logs
Next step: Start daemon with localhost-ctl start
Scenario 4: Socket Not Found
Socket file doesn't exist:
## Daemon Connection
✗ Socket not found
ℹ Checked locations:
- /tmp/lovelace-localhost.sock
- ~/.lovelace/localhost.sock
- /var/run/lovelace/localhost.sock
## Troubleshooting
1. Verify daemon is installed: localhost-ctl --version
2. Start the daemon: localhost-ctl start
3. Check socket path: localhost-ctl config
Next step: Install and start Localhost daemon
Scenario 5: Custom Socket Path
Using non-standard socket location:
## Daemon Connection
✗ Socket not found at default locations
⚠ Custom socket path configured: /custom/path/socket.sock
✓ Connection successful
## Authentication
✓ Authenticated
No action needed - Configuration is working correctly
Troubleshooting
Health Check Doesn't Open
Symptom: Running :LovelaceHealth shows no output or error
Solutions:
-
Check plugin is loaded:
vim:lua print(vim.inspect(package.loaded["lovelace"])) -
Verify installation:
vim:Lazy " Check lovelace.nvim is installed -
Check for errors:
vim:messages " Look for Lua errors
Connection Check Hangs
Symptom: Health check freezes at "Checking connection..."
Solutions:
-
Timeout and kill process:
vim<C-c> " Cancel health check -
Check daemon process:
bashps aux | grep localhost-daemon -
Increase timeout:
luarequire("lovelace").setup({ daemon = { retry_count = 1 -- Reduce retry attempts } })
Socket Path Issues
Symptom: "Socket not found" but daemon is running
Solutions:
-
Find actual socket path:
bashlocalhost-ctl config | grep socket -
Configure correct path:
luarequire("lovelace").setup({ daemon = { socket_path = "/actual/path/to/socket.sock" } }) -
Verify socket permissions:
bashls -la /tmp/lovelace-localhost.sock # Should be readable by your user
Authentication Failures
Symptom: "Authentication failed" or "Session expired"
Solutions:
-
Re-authenticate:
vim:LovelaceAuth -
Check token validity:
bashlocalhost-ctl auth status -
Clear stored credentials:
bashlocalhost-ctl auth logout
Integration with Workflows
Pre-Task Verification
Before submitting important tasks:
:LovelaceHealth
" Verify all checks pass
:LovelaceTask
" Submit task with confidence
Post-Installation Verification
After setting up the extension:
:LovelaceHealth
" Check 1: Daemon connection
" Check 2: Authentication
:LovelaceAuth
" If authentication needed
:LovelaceHealth
" Verify authentication succeeded
Debugging Session
When tasks aren't working:
:LovelaceHealth
" Identify which component is failing
:messages
" Check for detailed error messages
" Fix identified issues, then re-verify
:LovelaceHealth
Related Commands
| Command | Purpose |
|---|---|
| :LovelaceAuth | Authenticate with Lovelace |
| :LovelaceSession | View session information |
| :LovelaceTasks | List all tasks |
Next Steps
- :LovelaceAuth Command - Authenticate with device flow
- Health Check Guide - Detailed health check workflows
- Troubleshooting - Common issues and solutions
- Configuration Deep Dive - Customize daemon connection
Related Documentation
- Health Check Guide - Complete health check workflows
- Installation Guide - Setup and verification
- Configuration Deep Dive - Daemon configuration options