Skip to main content

Troubleshooting

Common issues and solutions for the Lovelace Neovim extension.

Table of Contents


Installation Issues

Plugin Not Loaded

Symptom: Commands like :LovelaceHealth are not recognized

Solutions:

  1. Verify plugin installation:

    vim
    :Lazy
    " Search for 'lovelace.nvim'
    " Should show installed and loaded
    
  2. Check plugin manager configuration:

    lua
    -- For lazy.nvim
    {
      "lovelace-ai/lovelace.nvim",
      event = "VeryLazy",
      config = function()
        require("lovelace").setup()
      end
    }
    
  3. Force reload:

    vim
    :Lazy reload lovelace.nvim
    
  4. Check for errors:

    vim
    :messages
    " Look for Lua errors
    

Dependency Missing

Symptom: Error about missing plenary.nvim or nui.nvim

Solution:

lua
-- Add dependencies to plugin spec
{
  "lovelace-ai/lovelace.nvim",
  dependencies = {
    "nvim-lua/plenary.nvim",
    "MunifTanjim/nui.nvim",
  }
}

Installation Script Fails

Symptom: ./install.sh errors during installation

Solutions:

  1. Check shell permissions:

    bash
    chmod +x ~/.local/share/nvim/lazy/lovelace.nvim/install.sh
    ./install.sh
    
  2. Check localhost-ctl availability:

    bash
    which localhost-ctl
    # Should return path to binary
    
  3. Manual installation:

    bash
    # Follow installation guide manually
    # See: /editor-extensions/neovim/installation
    

Connection Problems

"Socket not found" Error

Symptom: :LovelaceHealth shows "Socket not found"

Solutions:

  1. Verify daemon is running:

    bash
    localhost-ctl status
    
  2. Check socket path:

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

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

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

"Connection refused" Error

Symptom: Socket exists but connection fails

Solutions:

  1. Start the daemon:

    bash
    localhost-ctl start
    
  2. Check daemon process:

    bash
    ps aux | grep localhost-daemon
    
  3. Check daemon logs:

    bash
    localhost-ctl logs
    
  4. Restart daemon:

    bash
    localhost-ctl restart
    

Health Check Hangs

Symptom: :LovelaceHealth freezes at "Checking connection..."

Solutions:

  1. Cancel health check:

    vim
    <C-c>  " Cancel operation
    
  2. Check daemon responsiveness:

    bash
    timeout 5 localhost-ctl ping
    
  3. Reduce timeout in config:

    lua
    require("lovelace").setup({
      daemon = {
        connection_timeout = 3000,  -- 3 seconds
        retry_count = 1
      }
    })
    
  4. Restart both daemon and Neovim:

    bash
    localhost-ctl restart
    # Then restart Neovim
    

Authentication Errors

Device Code Expired

Symptom: "Device code expired" during authorization

Solution:

vim
" Restart authorization flow
:LovelaceAuth

" Complete within 10 minutes this time

Browser Doesn't Open

Symptom: Pressing o in device flow doesn't open browser

Solutions:

  1. Manual navigation:

    • Copy URL from device flow window
    • Open browser manually
    • Navigate to URL
  2. Check default browser:

    bash
    # macOS
    open https://uselovelace.com/device
    
    # Linux
    xdg-open https://uselovelace.com/device
    
  3. Set BROWSER environment variable:

    bash
    export BROWSER=firefox
    # Or chrome, safari, etc.
    

Code Copy Fails

Symptom: Pressing c doesn't copy device code

Solutions:

  1. Check clipboard support:

    vim
    :echo has('clipboard')
    " Should return 1
    
  2. Install clipboard provider (Linux):

    bash
    sudo apt install xclip  # or xsel
    
  3. Manual copy:

    • Select code with mouse
    • Copy with Cmd+C / Ctrl+C

"Authentication failed" After Device Flow

Symptom: Device flow completes but authentication still fails

Solutions:

  1. Verify account status:

  2. Check daemon auth:

    bash
    localhost-ctl auth status
    
  3. Clear credentials and retry:

    bash
    localhost-ctl auth logout
    
    vim
    :LovelaceAuth
    

"Session expired" Error

Symptom: Commands fail with "Session expired"

Solution:

vim
:LovelaceAuth
" Complete device authorization again

Task Submission Failures

"Task submission failed" Error

Symptom: :LovelaceTask immediately shows error

Solutions:

  1. Check authentication:

    vim
    :LovelaceAuth
    
  2. Verify daemon connection:

    vim
    :LovelaceHealth
    
  3. Check error details:

    vim
    :messages
    " Look for specific error
    
  4. Verify workspace:

    vim
    :LovelaceSession
    " Ensure workspace is set
    

"Context collection failed" Error

Symptom: Error about buffer content or selection

Solutions:

  1. Save the file first:

    vim
    :w
    
  2. Check file permissions:

    bash
    ls -la current-file.js
    
  3. Try without selection (normal mode):

    vim
    :LovelaceTask
    

Task Stuck in "Queued" State

Symptom: Task remains queued for extended period

Solutions:

  1. Check agent availability:

    vim
    :LovelaceAgents
    " Look for idle workers
    
  2. Verify agents are working:

    vim
    :LovelaceAgents
    " Check if busy agents show activity
    
  3. Check daemon logs:

    bash
    localhost-ctl logs | grep task
    
  4. Cancel and resubmit:

    vim
    :LovelaceCancel task_abc123
    :LovelaceTask
    

Task Execution Issues

Task Takes Too Long

Symptom: Task running for > 10 minutes with no progress

Solutions:

  1. Check task progress:

    vim
    :LovelaceTaskStatus task_abc123
    " See if progress updates are appearing
    
  2. Cancel if stuck:

    vim
    :LovelaceCancel task_abc123
    
  3. Resubmit with more specific description:

    vim
    :LovelaceTask
    " Be more specific about scope and requirements
    

Task Fails with Validation Error

Symptom: Task shows "Failed: Validation error"

Solutions:

  1. Read error details:

    vim
    :LovelaceTaskStatus task_abc123
    " Review error message
    
  2. Common causes:

    • Task description too vague
    • Selected code has syntax errors
    • File not saved before submission
  3. Fix and resubmit:

    vim
    " Save file
    :w
    
    " Resubmit with clearer description
    :LovelaceTask
    

No Result Buffer Opens

Symptom: Task completes but no result window appears

Solutions:

  1. Check UI configuration:

    lua
    require("lovelace").setup({
      ui = {
        result_window = "split"  -- Valid: split, vsplit, tab
      }
    })
    
  2. Manually view results:

    vim
    :LovelaceTaskStatus task_abc123
    
  3. Check for window conflicts:

    • Close extra windows
    • Try again

Agent Worker Problems

No Agents Available

Symptom: :LovelaceAgents shows empty list or all stopped

Solutions:

  1. Check daemon status:

    bash
    localhost-ctl status
    
  2. Restart daemon (spawns fresh agents):

    bash
    localhost-ctl restart
    
  3. Check daemon logs:

    bash
    localhost-ctl logs | grep agent
    

All Agents Busy

Symptom: All agents show "busy" for extended period

Solutions:

  1. Check task status:

    vim
    :LovelaceTasks
    " Verify tasks are progressing
    
  2. Cancel hung tasks:

    vim
    :LovelaceCancel task_abc123
    
  3. Wait for completion:

    • Complex tasks take time
    • Monitor with :LovelaceTasks

Agent Memory Leaks

Symptom: Agent memory grows continuously

Example:

Check 1 (10:00): 250 MB
Check 2 (10:15): 450 MB
Check 3 (10:30): 680 MB

Action: Report to daemon administrator with agent UUID


Session and Workspace Issues

"Session not found" Error

Symptom: :LovelaceSession shows "Session not found"

Solutions:

  1. Create session:

    vim
    :LovelaceHealth
    " Triggers session creation
    
    :LovelaceSession
    
  2. Re-authenticate:

    vim
    :LovelaceAuth
    
  3. Check daemon connection:

    vim
    :LovelaceHealth
    

Wrong Workspace Associated

Symptom: Session shows incorrect workspace

Solutions:

  1. Navigate to correct directory:

    vim
    :cd /path/to/correct/project
    :LovelaceSession
    
  2. Check git repository:

    bash
    cd /path/to/project
    git rev-parse --show-toplevel
    
  3. Restart Neovim in correct location:

    bash
    cd /path/to/correct/project
    nvim
    

No Workspace Associated

Symptom: "No workspace associated" warning

Solutions:

  1. Navigate to project directory:

    vim
    :cd ~/Projects/my-project
    :LovelaceSession
    
  2. Initialize git repository:

    bash
    cd /path/to/project
    git init
    

Performance and Responsiveness

Slow Command Execution

Symptom: Commands take > 5 seconds to respond

Solutions:

  1. Check daemon load:

    bash
    localhost-ctl status
    
  2. Reduce log level:

    lua
    require("lovelace").setup({
      log_level = "warn"  -- Less verbose
    })
    
  3. Check system resources:

    bash
    top
    # Look for high CPU/memory usage
    

UI Freezes

Symptom: Neovim freezes when running Lovelace commands

Solutions:

  1. Reduce timeout:

    lua
    require("lovelace").setup({
      daemon = {
        connection_timeout = 2000  -- 2 seconds
      }
    })
    
  2. Check for blocking operations:

    vim
    :messages
    " Look for warnings
    
  3. Disable auto-refresh:

    lua
    require("lovelace").setup({
      ui = {
        auto_refresh = false
      }
    })
    

Plugin Loading Issues

Commands Not Available

Symptom: :LovelaceHealth shows "Not an editor command"

Solutions:

  1. Check plugin loaded:

    vim
    :lua print(vim.inspect(package.loaded["lovelace"]))
    " Should show table with functions
    
  2. Verify lazy loading config:

    lua
    {
      "lovelace-ai/lovelace.nvim",
      cmd = {
        "LovelaceHealth",
        "LovelaceAuth",
        "LovelaceTask",
        "LovelaceTasks",
        "LovelaceAgents",
        "LovelaceTaskStatus",
        "LovelaceCancel",
        "LovelaceSession",
      }
    }
    
  3. Force load manually:

    vim
    :lua require("lovelace")
    

Lua Errors on Startup

Symptom: Error messages when starting Neovim

Solutions:

  1. Check error details:

    vim
    :messages
    
  2. Common issues:

    • Missing dependencies
    • Incompatible Neovim version
    • Conflicting plugins
  3. Verify Neovim version:

    vim
    :version
    " Requires Neovim 0.9.0+
    

Diagnostic Commands

When troubleshooting, gather information with these commands:

Extension Diagnostics

vim
:LovelaceHealth          " Connection and auth status
:LovelaceSession         " Session and workspace info
:LovelaceAgents          " Agent worker status
:LovelaceTasks           " Task queue and history
:messages                " Vim error messages

System Diagnostics

bash
localhost-ctl status     # Daemon status
localhost-ctl logs       # Daemon logs
localhost-ctl config     # Configuration
localhost-ctl ping       # Connection test

Neovim Diagnostics

vim
:checkhealth lovelace    " Plugin health check
:Lazy                    " Plugin manager status
:lua print(vim.inspect(require("lovelace").config))  # Config

Getting Help

If you've tried the solutions above and still have issues:

  1. Check daemon logs:

    bash
    localhost-ctl logs --tail 100 > lovelace-logs.txt
    
  2. Gather diagnostic info:

    vim
    :LovelaceHealth
    :LovelaceSession
    " Save output
    
  3. Check version information:

    vim
    :version
    " Note Neovim version
    
    bash
    localhost-ctl --version
    # Note daemon version
    
  4. Report issue with:

    • Steps to reproduce
    • Error messages
    • Diagnostic output
    • Version information

Common Error Messages Reference

Error MessageMost Likely CauseQuick Fix
"Socket not found"Daemon not runninglocalhost-ctl start
"Connection refused"Daemon stoppedlocalhost-ctl restart
"Authentication failed"Session expired:LovelaceAuth
"Task submission failed"Not authenticated:LovelaceAuth
"No agents available"Daemon not runninglocalhost-ctl restart
"Session not found"Never authenticated:LovelaceAuth
"Task not found"Invalid task IDCheck :LovelaceTasks
"Workspace not found"Not in project directory:cd /path/to/project

Related Documentation