Skip to main content

:LovelaceHealth

Check the Lovelace daemon connection and authentication status.

Command Signature

vim
: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

vim
:LovelaceHealth

Opens a split window showing health check results.

From Lua

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

SymbolMeaningDescription
Check passedComponent working correctly
Check failedComponent has issues
WarningComponent working with caveats
InformationAdditional 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:

  1. Check plugin is loaded:

    vim
    :lua print(vim.inspect(package.loaded["lovelace"]))
    
  2. Verify installation:

    vim
    :Lazy
    " Check lovelace.nvim is installed
    
  3. Check for errors:

    vim
    :messages
    " Look for Lua errors
    

Connection Check Hangs

Symptom: Health check freezes at "Checking connection..."

Solutions:

  1. Timeout and kill process:

    vim
    <C-c>  " Cancel health check
    
  2. Check daemon process:

    bash
    ps aux | grep localhost-daemon
    
  3. Increase timeout:

    lua
    require("lovelace").setup({
      daemon = {
        retry_count = 1  -- Reduce retry attempts
      }
    })
    

Socket Path Issues

Symptom: "Socket not found" but daemon is running

Solutions:

  1. Find actual socket path:

    bash
    localhost-ctl config | grep socket
    
  2. Configure correct path:

    lua
    require("lovelace").setup({
      daemon = {
        socket_path = "/actual/path/to/socket.sock"
      }
    })
    
  3. Verify socket permissions:

    bash
    ls -la /tmp/lovelace-localhost.sock
    # Should be readable by your user
    

Authentication Failures

Symptom: "Authentication failed" or "Session expired"

Solutions:

  1. Re-authenticate:

    vim
    :LovelaceAuth
    
  2. Check token validity:

    bash
    localhost-ctl auth status
    
  3. Clear stored credentials:

    bash
    localhost-ctl auth logout
    

Integration with Workflows

Pre-Task Verification

Before submitting important tasks:

vim
:LovelaceHealth
" Verify all checks pass
:LovelaceTask
" Submit task with confidence

Post-Installation Verification

After setting up the extension:

vim
:LovelaceHealth
" Check 1: Daemon connection
" Check 2: Authentication

:LovelaceAuth
" If authentication needed

:LovelaceHealth
" Verify authentication succeeded

Debugging Session

When tasks aren't working:

vim
:LovelaceHealth
" Identify which component is failing

:messages
" Check for detailed error messages

" Fix identified issues, then re-verify
:LovelaceHealth

Related Commands

CommandPurpose
:LovelaceAuthAuthenticate with Lovelace
:LovelaceSessionView session information
:LovelaceTasksList all tasks

Next Steps

Related Documentation