windmill-labs/windmill · error
agent_config must be set in agent mode
Error message
agent_config must be set in agent mode
What it means
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.
Source
Thrown at backend/src/main.rs:1408
base_internal_url.clone(),
)?;
let mut workers = vec![];
for i in 0..num_workers {
let suffix = if i == 0 && first_suffix.is_some() {
first_suffix.as_ref().unwrap().clone()
} else {
resolve_worker_suffix(&hostname, i as usize + 1)?
};
let worker_conn = WorkerConn {
conn: if i == 0 || mode != Mode::Agent {
conn.clone()
} else {
Connection::Http(
agent_config
.as_ref()
.expect("agent_config must be set in agent mode")
.build_http_client(&suffix),
)
},
worker_name: checked_worker_name(
mode == Mode::Agent,
WORKER_GROUP.as_str(),
&suffix,
)?,
};
workers.push(worker_conn);
}
run_workers(
rx,
killpill_tx.clone(),
base_internal_url.clone(),
hostname.clone(),
&workers,View on GitHub (pinned to e474e8803c)
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
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at backend/src/main.rs:1408 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of windmill-labs/windmill@e474e8803c (2026-09-03).
Data as JSON: /api/errors/af32d445ecb51092.
Report an issue: GitHub.