nikivdev/code · error

Lin.app is not running

Error message

Lin.app is not running

What it means

capture_trimmed_in-style helper in src/workflow.rs (line ~1232) runs a Command, captures output, and if the exit status is non-success bails with "command failed: <debug-rendered cmd>: <trimmed stderr>". Unlike the web.rs variant, it includes the child's stderr, making it the workflow-level wrapper for any external command (git, jj, etc.) that fails.

Source

Thrown at src/agent_setup.rs:116

error: Test suite requires DATABASE_URL environment variable
```
"#
    )
}

/// Run the auto-setup command.
pub fn run() -> Result<()> {
    println!("Setting up autonomous agent workflow...\n");

    // Check if Lin.app is running
    print!("Checking Lin.app... ");
    if !is_lin_running() {
        println!("not running");
        println!();
        println!("Lin.app is required for autonomous agent workflows.");
        println!("Please start Lin.app from /Applications/Lin.app");
        bail!("Lin.app is not running");
    }
    println!("running ✓");

    // Check if Lin.app exists
    let lin_app = PathBuf::from("/Applications/Lin.app");
    if !lin_app.exists() {
        println!();
        println!("Warning: Lin.app not found at /Applications/Lin.app");
        println!("The autonomous workflow requires Lin.app to be installed.");
    }

    let cwd = std::env::current_dir().context("failed to get current directory")?;

    // Load flow.toml to get project settings
    let flow_toml = cwd.join("flow.toml");
    let (project_name, primary_task) = if flow_toml.exists() {
        let cfg = config::load(&flow_toml).unwrap_or_default();
        let name = cfg

View on GitHub (pinned to a747e741ae)

Solutions

  1. Read the stderr in the message — it contains the actual git/jj error; fix that underlying condition.
  2. Run the exact rendered command manually in the repo root to reproduce and debug.
  3. Resolve repo state issues (conflicts, missing refs, auth credentials / SSH keys) before re-running the workflow.

Example fix

// before
bail!("command failed: 'jj git fetch':authenticated ssh failed")
// after (set up non-interactive auth)
+ eval "$(ssh-agent)" && ssh-add ~/.ssh/id_ed25519
+ # then re-run the flow command
Defensive patterns

Strategy: try-catch

Validate before calling

git status --porcelain && jj st # verify repo is in a healthy state before the workflow

Try / catch

match workflow_result {
    Err(e) if e.to_string().starts_with("command failed:") => {
        // message embeds the rendered cmd and stderr; log and surface stderr
        log::error!("workflow cmd failed: {e}");
    }
    Ok(v) => v,
}

Prevention

When it happens

Trigger: Any workflow step invoking the command-capture helper whose child process exits non-zero — git/jj operations failing (merge conflicts, auth failure, missing ref), or the binary not accepting given arguments.

Common situations: jj/git not configured (no user identity), authentication prompts in non-interactive environments, merge/divergence conflicts during workspace sync, wrong repo state for the requested operation.

Related errors


AI-assisted analysis of nikivdev/code@a747e741ae (2026-09-01). Data as JSON: /api/errors/f0047489e88f15ae. Report an issue: GitHub.