Skip to main content

Configuration

The repo builds one binary, agent (cmd/agent). All of its configuration comes from environment variables. Most are read in internal/config/config.go (config.Load). A few are read elsewhere: LOG_LEVEL in cmd/agent/main.go, CORS_ALLOWED_ORIGINS in internal/adapters/inbound/http/router.go, and the OpenTelemetry variables in internal/observability/telemetry.go. Nothing is read from a file or a flag.

Startup fails, and the process exits with status 1, in four cases:

  1. DAILY_BRIEF_PATH_TARGETS is set but is not a JSON array of targets, or is an empty array or null (ADR 0017).
  2. LLM_MODE is not off, shadow, on or empty.
  3. LLM_MODE is shadow or on and ANTHROPIC_API_KEY is empty.
  4. A LLM_TOOL_ALLOWLIST entry is not of the form <upstream>/<tool>.

Every other bad value falls back to the default or turns the feature off. The startup log line warehouse-ops-agent listening reports which optional endpoints are configured (for example product_master_endpoint_configured: true) and how many path targets were loaded.

agent — every variable​

"Chart value" is the key in charts/warehouse-ops-agent/values.yaml that renders the variable. "none" means the chart does not set it; use extraEnv for those.

Listener, logging, CORS​

VariableDefaultRequiredMeaningSourceChart value
AGENT_ADDR:8095noListen address for every REST route and for /mcp.internal/config/config.goconfig.agentAddr
LOG_LEVELinfonodebug, warn (or warning), error; any other value means info. Logs are JSON on stdout.cmd/agent/main.goconfig.logLevel
CORS_ALLOWED_ORIGINShttp://localhost:5173noComma-separated origins allowed to call the API from a browser (warehouse-console).internal/adapters/inbound/http/router.goconfig.corsAllowedOrigins (rendered only when non-empty; charts/warehouse-ops-agent/tests/render_test.sh asserts it)

Daily brief​

VariableDefaultRequiredMeaningSourceChart value
DAILY_BRIEF_PATH_TARGETSone target: {"siteCode":"WH1","pathId":"pick-zone-a","processPath":"PICK","buildingId":"wh1","shiftId":"shift-1"}noJSON array of the process paths the daily brief monitors. Fields per target: siteCode (facility-layout site), pathId (wes-work-planning path), processPath (fulfillment-execution queue, PICK/PACK/SLAM), buildingId and shiftId (workforce-management), and the optional planningPathId, unitsPerOrder, packagesPerOrder for the capacity outlook. The pathId to processPath binding is also what GET /flow-balance/{pathId} uses to pick the labor-performance task type. Malformed, [] or null stops startup.internal/config/config.go (loadPathTargets)config.dailyBriefPathTargets
CAPACITY_OUTLOOK_HORIZON8hnoGo duration: how far ahead the warehouse-planning capacity window reaches. An unparseable or non-positive value means 8h. Used only when WAREHOUSE_PLANNING_MCP_ENDPOINT is set.internal/config/config.goconfig.capacityOutlookHorizon

Upstream MCP endpoints​

Each value is a Streamable HTTP endpoint, for example http://wes-work-planning-mcp.warehouse-systems.svc.cluster.local:8090/mcp. No credentials are sent (ADR 0006). When a variable is empty, no client is built for that upstream (newMCPClient in cmd/agent/main.go, ADR 0023). Nothing is ever dialled to an empty URL, and each use case treats the missing client as an unavailable upstream. The two groups below differ only in what that costs.

Core upstreams. The daily brief, the flow balance and detect_stranded_reservation stay wired without these clients and report the missing signal: an unavailable entry in the daily brief, a partial hold in the flow balance, an undetected hold from the stranded reservation check. Without facility-layout, GET /explain-travel-factor answers 503 (explain travel factor not configured) and the explain_travel_factor tool is not registered.

VariableDefaultRequiredUpstream and useSourceChart value
WES_WORK_PLANNING_MCP_ENDPOINTemptyneeded by the daily brief and flow balanceget_backlog_telemetry, get_rebalance_recommendationinternal/config/config.goupstreams.wesWorkPlanning.endpoint
FULFILLMENT_EXECUTION_MCP_ENDPOINTemptyneeded by the daily brief, flow balance and detect_stranded_reservationget_queue_status, diagnose_stuck_tasksinternal/config/config.goupstreams.fulfillmentExecution.endpoint
WORKFORCE_MANAGEMENT_MCP_ENDPOINTemptyneeded by the daily brief and flow balanceget_staffing_gapinternal/config/config.goupstreams.workforceManagement.endpoint
FACILITY_LAYOUT_MCP_ENDPOINTemptyneeded by explain-travel-factor; the brief only loses site nameslist_sites, estimate_travel_distanceinternal/config/config.goupstreams.facilityLayout.endpoint
INVENTORY_STORAGE_MCP_ENDPOINTemptyneeded by detect_stranded_reservationcheck_availability, get_bin_occupancyinternal/config/config.goupstreams.inventoryStorage.endpoint
LABOR_PERFORMANCE_MCP_ENDPOINTemptyno; without it the flow balance has no utilization overlayget_task_type_utilizationinternal/config/config.goupstreams.laborPerformance.endpoint
ORDER_MANAGEMENT_MCP_ENDPOINTemptyno; without it the daily brief carries no promiseHealth sectionget_promise_health (ADR 0024)internal/config/config.goupstreams.orderManagement.endpoint

Optional upstreams. Without the client the feature is off. Nothing else changes.

VariableDefaultRequiredEffect when emptySourceChart value
WAREHOUSE_PLANNING_MCP_ENDPOINTemptynoNo capacityOutlook in the daily brief (ADR 0013).internal/config/config.goupstreams.warehousePlanning.endpoint
PRODUCT_MASTER_MCP_ENDPOINTemptynoGET /master-data-gaps answers 503 and find_master_data_gaps is not registered (ADR 0020).internal/config/config.goupstreams.productMaster.endpoint
INBOUND_RECEIVING_MCP_ENDPOINTemptynoGET /inbound-outlook answers 503 and get_inbound_outlook is not registered (ADR 0021).internal/config/config.goupstreams.inboundReceiving.endpoint
NETWORK_INVENTORY_PLANNING_MCP_ENDPOINTemptynoThe three /transfer-watch/* routes answer 503 and the three transfer-watch tools are not registered (ADR 0019).internal/config/config.goupstreams.networkInventoryPlanning.endpoint
SLOTTING_OPTIMIZATION_MCP_ENDPOINTemptynoNo slotPlanWatch section in the daily brief (ADR 0024); nothing else changes.internal/config/config.goupstreams.slottingOptimization.endpoint
RETURNS_PROCESSING_MCP_ENDPOINTemptynoNo returns-processing client is built (fail-open; wired, no consuming use case yet, so nothing else changes).internal/config/config.goupstreams.returnsProcessing.endpoint
EXCEPTION_MANAGEMENT_MCP_ENDPOINTemptynoNo exception-management client is built (fail-open; wired, no consuming use case yet, so nothing else changes).internal/config/config.goupstreams.exceptionManagement.endpoint

| CUSTOMER_ORDERING_MCP_ENDPOINT | empty | no | No customer-ordering client is built (fail-open, ADR 0025; wired, no consuming use case yet, so nothing else changes). | internal/config/config.go | upstreams.customerOrdering.endpoint | | DELIVERY_PROMISE_MCP_ENDPOINT | empty | no | No delivery-promise client is built (fail-open, ADR 0025; wired, no consuming use case yet, so nothing else changes). | internal/config/config.go | upstreams.deliveryPromise.endpoint | | LAST_MILE_DELIVERY_MCP_ENDPOINT | empty | no | No last-mile-delivery client is built (fail-open, ADR 0025; wired, no consuming use case yet, so nothing else changes). | internal/config/config.go | upstreams.lastMileDelivery.endpoint | | LINEHAUL_TRANSPORTATION_MCP_ENDPOINT | empty | no | No linehaul-transportation client is built (fail-open, ADR 0025; wired, no consuming use case yet, so nothing else changes). | internal/config/config.go | upstreams.linehaulTransportation.endpoint | | NODE_PERFORMANCE_MCP_ENDPOINT | empty | no | No node-performance client is built (fail-open, ADR 0025; wired, no consuming use case yet, so nothing else changes). | internal/config/config.go | upstreams.nodePerformance.endpoint | | NODE_TOPOLOGY_MCP_ENDPOINT | empty | no | No node-topology client is built (fail-open, ADR 0025; wired, no consuming use case yet, so nothing else changes). | internal/config/config.go | upstreams.nodeTopology.endpoint | | OFFER_AVAILABILITY_MCP_ENDPOINT | empty | no | No offer-availability client is built (fail-open, ADR 0025; wired, no consuming use case yet, so nothing else changes). | internal/config/config.go | upstreams.offerAvailability.endpoint | | ORDER_SOURCING_MCP_ENDPOINT | empty | no | No order-sourcing client is built (fail-open, ADR 0025; wired, no consuming use case yet, so nothing else changes). | internal/config/config.go | upstreams.orderSourcing.endpoint | | SHIPPING_AND_TRACKING_MCP_ENDPOINT | empty | no | No shipping-and-tracking client is built (fail-open, ADR 0025; wired, no consuming use case yet, so nothing else changes). | internal/config/config.go | upstreams.shippingAndTracking.endpoint | | SELLER_INBOUND_MCP_ENDPOINT | empty | no | No seller-inbound client is built (fail-open, ADR 0023; wired, no consuming use case yet, ADR 0027). | internal/config/config.go | upstreams.sellerInbound.endpoint | | VENDOR_CONNECTIVITY_MCP_ENDPOINT | empty | no | No vendor-connectivity client is built (fail-open, ADR 0025; wired, no consuming use case yet, so nothing else changes). | internal/config/config.go | upstreams.vendorConnectivity.endpoint | | TASK_INTERLEAVING_MCP_ENDPOINT | empty | no | No task-interleaving client is built (fail-open, ADR 0025; wired, no consuming use case yet, so nothing else changes). | internal/config/config.go | upstreams.taskInterleaving.endpoint | | PICK_FACE_REPLENISHMENT_MCP_ENDPOINT | empty | no | No pick-face-replenishment client is built (fail-open, ADR 0025; wired, no consuming use case yet, so nothing else changes). | internal/config/config.go | upstreams.pickFaceReplenishment.endpoint | | INBOUND_STALE_RECEIPT_AGE | none | no | Go duration, e.g. 6h. An Open receipt older than this is listed in staleReceipts. Unset, unparseable or non-positive means the section is omitted with the reason INBOUND_STALE_RECEIPT_AGE is not configured. There is deliberately no default. | internal/config/config.go | config.inboundStaleReceiptAge | | SLOT_PLAN_STALE_AGE | 24h | no | Go duration, e.g. 12h. An Approved slot plan whose moves are not fully executed this long after approval is listed in the daily brief's slotPlanWatch.stale. Unset, unparseable or non-positive means 24h. Used only when SLOTTING_OPTIMIZATION_MCP_ENDPOINT is set. | internal/config/config.go | config.slotPlanStaleAge |

The process-path-management client was removed (ADR 0024, gap A9); PROCESS_PATH_MANAGEMENT_MCP_ENDPOINT is no longer read. The endpoint stays configured in warehouse-infra's terraform until the orchestrator removes it in a later infra change.

console-bff REST base URLs​

The order-lifecycle route calls the OLTP APIs, and the two dashboards call each context's separate *-reports reader binary. Every client uses a 5 s timeout. A wrong or unreachable URL degrades the stage or section; it never fails startup.

VariableDefaultRequiredCalled byRequestsSourceChart value
ORDER_MANAGEMENT_REST_URLhttp://localhost:8086noGET /console/orders/{id}/lifecycleGET /orders/<id>internal/config/config.gorestUrls.orderManagement
INVENTORY_STORAGE_REST_URLhttp://localhost:8082noorder lifecycleGET /reservations?demandRef=internal/config/config.gorestUrls.inventoryStorage
WES_WORK_PLANNING_REST_URLhttp://localhost:8083noorder lifecycleGET /work-units?reference=internal/config/config.gorestUrls.wesWorkPlanning
FULFILLMENT_EXECUTION_REST_URLhttp://localhost:8084noorder lifecycleGET /tasks?orderRef=internal/config/config.gorestUrls.fulfillmentExecution
FACILITY_LAYOUT_REPORTS_REST_URLhttp://localhost:8101noGET /console/reports/wms, section catalog-growthGET /reports/catalog-growth and /freshnessinternal/config/config.goreportsUrls.facilityLayout
INVENTORY_STORAGE_REPORTS_REST_URLhttp://localhost:8102noWMS dashboard, section inventory-flow-accuracyGET /reports/flow-accuracy and /freshnessinternal/config/config.goreportsUrls.inventoryStorage
WES_WORK_PLANNING_REPORTS_REST_URLhttp://localhost:8103noGET /console/reports/wes, section planning-throughputGET /reports/throughput and /freshnessinternal/config/config.goreportsUrls.wesWorkPlanning
FULFILLMENT_EXECUTION_REPORTS_REST_URLhttp://localhost:8104noWES dashboard, section fulfillment-throughputGET /reports/throughput and /freshnessinternal/config/config.goreportsUrls.fulfillmentExecution
WORKFORCE_MANAGEMENT_REPORTS_REST_URLhttp://localhost:8105noWES dashboard, section labor-managementGET /reports/labor and /freshnessinternal/config/config.goreportsUrls.workforceManagement
ORDER_MANAGEMENT_REPORTS_REST_URLhttp://localhost:8106noWMS dashboard, section order-funnelGET /reports/funnel and /freshnessinternal/config/config.goreportsUrls.orderManagement
LABOR_PERFORMANCE_REPORTS_REST_URLhttp://localhost:8107noWES dashboard, section labor-performanceGET /reports/performance and /freshnessinternal/config/config.goreportsUrls.laborPerformance

The 8101–8107 defaults are a local port assignment made in config.go. Every *-reports binary itself defaults to :8092, so run them with per-service overrides when several run on one machine. The chart renders a *_REST_URL or *_REPORTS_REST_URL key only when its value is non-empty, so with empty values the binary falls back to these localhost defaults. In the kind cluster, warehouse-infra (terraform/ops-agent.tf) sets all eleven to the in-cluster Services, for example http://order-management-reports.warehouse-systems.svc.cluster.local:80.

Runtime signals​

VariableDefaultRequiredMeaningSourceChart value
PROMETHEUS_URLemptynoPrometheus base URL for GET /runtime-signals (queries /api/v1/query). Empty means a stub reader that returns no samples: every metric reads 0 and prometheus is not listed as unavailable.internal/config/config.go, cmd/agent/main.go (newTelemetryReader)prometheus.url
LOKI_URLemptynoLoki base URL (queries /loki/api/v1/query_range). Empty means no log reader, and loki is listed in unavailableSources.internal/config/config.go, cmd/agent/main.go (newLogReader)runtimeSignals.lokiUrl
RUNTIME_SIGNALS_NAMESPACEwarehouse-systemsnoKubernetes namespace the Loki query is scoped to.internal/config/config.goruntimeSignals.namespace
RUNTIME_SIGNALS_SERVICESorder-management,inventory-storage,wes-work-planning,fulfillment-execution,workforce-management,facility-layout,labor-performance,process-path-managementnoComma-separated Istio destination_service_name values (and Loki app labels) to report on. product-master, warehouse-planning, inbound-receiving and the network contexts are not in the default.internal/config/config.goruntimeSignals.services (a list, joined with commas)

warehouse-infra's terraform/ops-agent.tf (origin/develop) sets neither PROMETHEUS_URL nor LOKI_URL. In the kind cluster /runtime-signals therefore reports zeros and lists loki as unavailable until the chart values prometheus.url and runtimeSignals.lokiUrl are set.

LLM reasoner (ADR 0004)​

These variables matter only for GET /flow-balance/{pathId} and get_flow_balance_exception. The deterministic policy always runs first; see ADR 0004 and ADR 0011.

VariableDefaultRequiredMeaningSourceChart value
LLM_MODEoffnooff: the model is never called. shadow: the model is called, its plan is logged and counted, and the deterministic decision is returned. on: a valid plan replaces the action, heads and rationale, and the deterministic decision is the fallback on error, timeout or invalid output. Any other value stops startup.internal/config/config.go, cmd/agent/reasoner.go, internal/domain/policy/arbitrate.gollm.mode
ANTHROPIC_API_KEYemptyyes when LLM_MODE is shadow or onSent as the x-api-key header to the Anthropic Messages API. Never logged.internal/config/config.gocredentials.anthropicApiKey, or a Secret named by credentials.existingSecret with key ANTHROPIC_API_KEY; the env entry is rendered only when llm.mode is not off
LLM_MODELempty, which the adapter turns into claude-sonnet-4-5noModel id sent in every request.internal/config/config.go, internal/adapters/outbound/llm/anthropic/reasoner.gollm.model
LLM_BASE_URLempty, which means https://api.anthropic.comnoBase URL for POST /v1/messages; for tests and proxies.internal/config/config.go, internal/adapters/outbound/llm/anthropic/reasoner.gonone
LLM_TIMEOUT8snoGo duration bounding one whole reasoning call (every tool-use turn). An unparseable or non-positive value means 8s.internal/config/config.gollm.timeout
LLM_TOOL_ALLOWLISTwes-work-planning/get_backlog_telemetry,wes-work-planning/get_rebalance_recommendation,workforce-management/get_staffing_gap,fulfillment-execution/get_queue_status,fulfillment-execution/diagnose_stuck_tasksnoComma-separated <upstream>/<tool> MCP read tools the model may call. Only five upstream names have a session in the reasoner: wes-work-planning, fulfillment-execution, workforce-management, inventory-storage, facility-layout. An entry for any other upstream is accepted but never offered to the model.internal/config/config.go, cmd/agent/reasoner.gollm.toolAllowList (a list)

warehouse-infra runs the kind cluster with llm.mode = "shadow" and the key in the Secret warehouse-ops-agent-anthropic (terraform/ops-agent.tf).

Act slice (ADR 0027)​

The human-confirmed release_next_work write. Opt-in: with WES_WORK_PLANNING_A2A_URL unset the agent is read-only and both POST /act/release-next-work/* routes answer 503. None of these has a chart value yet; warehouse-infra sets them through extraEnv.

VariableDefaultRequiredEffectSourceHelm value
WES_WORK_PLANNING_A2A_URLempty (act slice off)noBase URL of the wes-work-planning A2A agent, e.g. http://wes-work-planning-a2a.warehouse-systems.svc.cluster.local:8093/. Its Agent Card is discovered under it on first use. Setting it builds the only write adapter in this agent.internal/config/config.go, cmd/agent/act.gonone (extraEnv)
APPROVAL_TTL5mnoGo duration: how long a confirmation token stays valid. Must be positive and at most 1h. A malformed or non-positive value aborts startup (it is never defaulted: it is a security parameter).internal/config/config.go, internal/domain/approval/approval.gonone (extraEnv)
APPROVAL_SIGNING_KEYempty, which generates an ephemeral per-process keynoHMAC key for confirmation tokens, at least 32 bytes; a shorter value aborts startup. Never logged. Empty is only coherent with replicaCount: 1: a token minted by one process does not verify in another.internal/config/config.gonone (a Secret via extraEnv)

Labor reallocation act slice (ADR 0029)​

The second human-confirmed write: assign_labor at workforce-management. Opt-in: with WORKFORCE_MANAGEMENT_A2A_URL unset the act is off and both POST /labor-reallocation/* routes answer 503; the read-only labor_reallocation_outlook MCP tool needs only WORKFORCE_MANAGEMENT_MCP_ENDPOINT. The token settings APPROVAL_TTL and APPROVAL_SIGNING_KEY above apply to this slice too (it keeps its own ephemeral key when none is pinned, so a release token never verifies here). Unlike the ADR 0027 variables, this one has a chart value, rendered into both the ConfigMap and the Deployment env (always rendered; empty = off).

VariableDefaultRequiredEffectSourceHelm value
WORKFORCE_MANAGEMENT_A2A_URLempty (act off)noBase URL of the workforce-management A2A agent, e.g. http://workforce-management-a2a.warehouse-systems.svc.cluster.local:8093/. Its Agent Card is discovered under it on first use. Setting it builds the second write adapter in this agent. A value that is not an absolute http(s) URL with a host aborts startup, and so does setting it while WORKFORCE_MANAGEMENT_MCP_ENDPOINT is unset (a proposal needs its staffing reads).internal/config/config.go, cmd/agent/act.goupstreams.workforceManagement.a2aEndpoint

Advisory exception context (ADR 0028)​

Read-only, advisory: when the act slice proposes a release, the agent also asks the exception-management A2A agent what is open. It never gates or changes the proposal. None of these has a chart value; warehouse-infra sets them through extraEnv.

VariableDefaultRequiredEffectSourceHelm value
EXCEPTION_MANAGEMENT_A2A_URLempty (lookup off)noBase URL of the exception-management A2A agent, e.g. http://exception-management-a2a.warehouse-systems.svc.cluster.local:8093/. Unset: proposals carry exceptionContext.status = "disabled" and behave exactly as under ADR 0027. Set: each successful proposal asks find_exceptions (status: OPEN) under a 3 s bound and returns ok with a summary, or unavailable if the peer fails or is slow (the proposal still succeeds). A value that is not an absolute http(s) URL with a host aborts startup (it is never silently disabled). Has no effect while WES_WORK_PLANNING_A2A_URL is unset (no propose route).internal/config/config.go, cmd/agent/act.gonone (extraEnv)

OpenTelemetry​

VariableDefaultRequiredMeaningSourceChart value
OTEL_EXPORTER_OTLP_ENDPOINTlocalhost:4317noOTLP/gRPC Collector address for traces and metrics. A bare host:port gets http:// prepended. An unreachable Collector only drops telemetry and logs opentelemetry error.internal/observability/telemetry.gootel.endpoint (rendered when otel.enabled)
OTEL_SERVICE_NAMEwarehouse-ops-agentnoservice.name resource attribute, and the service name passed to otelchi.internal/observability/telemetry.gootel.serviceName
SERVICE_VERSIONdevnoservice.version resource attribute.internal/observability/telemetry.gothe image tag, or the chart appVersion
ENVIRONMENTlocalnodeployment.environment.name resource attribute.internal/observability/telemetry.goenvironment

Fixed values (not configurable)​

These are constants in the code. Changing one needs a code change.

ValueSettingSource
Upstream MCP tool call timeout10 s per call, with a fresh MCP session per callinternal/adapters/outbound/mcpclient/session.go
REST client timeout (OLTP and *-reports)5 scmd/agent/main.go
Prometheus and Loki client timeout5 scmd/agent/main.go
Runtime-signals window and Loki line limit10 minutes, 50 linescmd/agent/main.go, internal/application/usecases/runtime_signals.go
Stuck-task window for the flow balance15 minutes (withinSeconds = 900)internal/application/usecases/flow_balance_advisory.go
Master-data and inbound scan bound500 records per page, 10 pagesinternal/application/usecases/master_data_gaps.go, inbound_outlook.go
Transfer-watch page limitat most 200internal/application/usecases/transfer_watch.go
Reasoner per-attempt timeout, retries12 s per Anthropic call, at most 3 attempts with jittered backoff (100 ms to 1 s) on transport errors and 5xxinternal/adapters/outbound/llm/anthropic/reasoner.go
Reasoner turns and tokens6 tool-use turns, 1024 max tokens per requestinternal/adapters/outbound/llm/anthropic/reasoner.go
Reasoner circuit breakeropens after 5 consecutive failures, or more than 50% failures once 10 requests are counted in a 30 s window; stays open 30 s; 1 probe when half-openinternal/resilience/breaker.go
Reasoner tool discovery at startupbounded by 15 scmd/agent/reasoner.go
HTTP serverReadHeaderTimeout 5 s; on SIGINT or SIGTERM in-flight requests get 10 s to finishcmd/agent/main.go

Example: a local run against the e2e harness​

The ports match e2e-tests/env.sh. The agent moves to :8096 because the harness puts workforce-management's MCP server on :8095:

export FACILITY_LAYOUT_MCP_ENDPOINT=http://localhost:8091/mcp
export INVENTORY_STORAGE_MCP_ENDPOINT=http://localhost:8092/mcp
export WES_WORK_PLANNING_MCP_ENDPOINT=http://localhost:8093/mcp
export FULFILLMENT_EXECUTION_MCP_ENDPOINT=http://localhost:8094/mcp
export WORKFORCE_MANAGEMENT_MCP_ENDPOINT=http://localhost:8095/mcp
export AGENT_ADDR=:8096
export DAILY_BRIEF_PATH_TARGETS='[{"siteCode":"WH1","pathId":"pick-zone-a","processPath":"PICK","buildingId":"wh1","shiftId":"shift-1"}]'
go run ./cmd/agent