{"record":{"id":"af32d445ecb51092","repo":"windmill-labs/windmill","slug":"agent-config-must-be-set-in-agent-mode","errorCode":null,"errorMessage":"agent_config must be set in agent mode","messagePattern":"agent_config must be set in agent mode","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"backend/src/main.rs","lineNumber":1408,"sourceCode":"                        base_internal_url.clone(),\n                    )?;\n                    let mut workers = vec![];\n\n                    for i in 0..num_workers {\n                        let suffix = if i == 0 && first_suffix.is_some() {\n                            first_suffix.as_ref().unwrap().clone()\n                        } else {\n                            resolve_worker_suffix(&hostname, i as usize + 1)?\n                        };\n\n                        let worker_conn = WorkerConn {\n                            conn: if i == 0 || mode != Mode::Agent {\n                                conn.clone()\n                            } else {\n                                Connection::Http(\n                                    agent_config\n                                        .as_ref()\n                                        .expect(\"agent_config must be set in agent mode\")\n                                        .build_http_client(&suffix),\n                                )\n                            },\n                            worker_name: checked_worker_name(\n                                mode == Mode::Agent,\n                                WORKER_GROUP.as_str(),\n                                &suffix,\n                            )?,\n                        };\n                        workers.push(worker_conn);\n                    }\n\n                    run_workers(\n                        rx,\n                        killpill_tx.clone(),\n                        base_internal_url.clone(),\n                        hostname.clone(),\n                        &workers,","sourceCodeStart":1390,"sourceCodeEnd":1426,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/backend/src/main.rs#L1390-L1426","documentation":"Construction guard for WorkerConn in main.rs: when the server runs in Mode::Agent, each worker's connection must carry an agent configuration. The error fires when mode is Agent but no agent_config was supplied (missing/empty AGENT env or config file), so the WorkerConn would be unusable.","triggerScenarios":"Thrown at backend/src/main.rs:1408 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set the agent configuration required by agent mode (agent config file / AGENT_* settings) before starting the server","Start the server without agent mode if agent behavior is not intended","Verify the agent worker config env vars are present in the deployment environment"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e474e8803ce2ff5c2df09a58dab51d45f5c922ca","analyzedAt":"2026-09-03T12:38:19.024Z","contentChangedAt":"2026-09-03T12:38:19.024Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}