{"record":{"id":"f0047489e88f15ae","repo":"nikivdev/code","slug":"lin-app-is-not-running","errorCode":null,"errorMessage":"Lin.app is not running","messagePattern":"Lin\\.app is not running","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/agent_setup.rs","lineNumber":116,"sourceCode":"\nerror: Test suite requires DATABASE_URL environment variable\n```\n\"#\n    )\n}\n\n/// Run the auto-setup command.\npub fn run() -> Result<()> {\n    println!(\"Setting up autonomous agent workflow...\\n\");\n\n    // Check if Lin.app is running\n    print!(\"Checking Lin.app... \");\n    if !is_lin_running() {\n        println!(\"not running\");\n        println!();\n        println!(\"Lin.app is required for autonomous agent workflows.\");\n        println!(\"Please start Lin.app from /Applications/Lin.app\");\n        bail!(\"Lin.app is not running\");\n    }\n    println!(\"running ✓\");\n\n    // Check if Lin.app exists\n    let lin_app = PathBuf::from(\"/Applications/Lin.app\");\n    if !lin_app.exists() {\n        println!();\n        println!(\"Warning: Lin.app not found at /Applications/Lin.app\");\n        println!(\"The autonomous workflow requires Lin.app to be installed.\");\n    }\n\n    let cwd = std::env::current_dir().context(\"failed to get current directory\")?;\n\n    // Load flow.toml to get project settings\n    let flow_toml = cwd.join(\"flow.toml\");\n    let (project_name, primary_task) = if flow_toml.exists() {\n        let cfg = config::load(&flow_toml).unwrap_or_default();\n        let name = cfg","sourceCodeStart":98,"sourceCodeEnd":134,"githubUrl":"https://github.com/nikivdev/code/blob/a747e741ae92c09071d0ae946ab48488adcff1ce/src/agent_setup.rs#L98-L134","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Read the stderr in the message — it contains the actual git/jj error; fix that underlying condition.","Run the exact rendered command manually in the repo root to reproduce and debug.","Resolve repo state issues (conflicts, missing refs, auth credentials / SSH keys) before re-running the workflow."],"exampleFix":"// before\nbail!(\"command failed: 'jj git fetch':authenticated ssh failed\")\n// after (set up non-interactive auth)\n+ eval \"$(ssh-agent)\" && ssh-add ~/.ssh/id_ed25519\n+ # then re-run the flow command","handlingStrategy":"try-catch","validationCode":"git status --porcelain && jj st # verify repo is in a healthy state before the workflow","typeGuard":null,"tryCatchPattern":"match workflow_result {\n    Err(e) if e.to_string().starts_with(\"command failed:\") => {\n        // message embeds the rendered cmd and stderr; log and surface stderr\n        log::error!(\"workflow cmd failed: {e}\");\n    }\n    Ok(v) => v,\n}","preventionTips":["Configure non-interactive git/jj auth (credential helper, ssh-agent) especially in CI.","Set git user.name/email for jj/git identity requirements.","Resolve conflicts/divergence before launching workflow automation."],"tags":["subprocess","exit-code","git","jj","workflow"],"backgroundTag":"nonzero-exit-code-from-subprocess","analyzedSha":"a747e741ae92c09071d0ae946ab48488adcff1ce","analyzedAt":"2026-09-01T22:43:55.719Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}