Back to docs
Runtime Operations

Agents are useful only when Midfleet can reach them.

Runtime operations connect workspace config, tunnels, console routes, relay, and live agent processes into one routable system.

Pull runtime config before spawning agents

midfleet config pull-runtime
midfleet config doctor
midfleet config redact --json

# If local runtime values are stale:
midfleet config reset --runtime
midfleet config pull-runtime
midfleet runtime install \
  --bundle ./<workspace>-midfleet-runtime-bundle.json \
  --expected-workspace <workspace>

midfleet runtime status --bundle ~/.midfleet/runtimes/<workspace>

Do not manually split the Midfleet and Cloudflared files. The complete bundle installer materializes both and registers the host. Use --dry-run before changing an existing runtime.

FieldMeaningCheck
consoleRouter.publicBaseUrlPublic URL Midfleet uses for chat and terminal routes.Use this exact value as --serve-public-base-url.
consoleRouter.listenPortLocal router port.Router process should listen on this port.
relay.listenPortLocal relay port.Relay should accept runtime events.
auth.workspace_api_keyWorkspace automation credential.Saved locally and redacted in evidence.

For first-time setup, follow the Provisioning guide. For tunnel route setup, follow Tunnels and console relay.

Keep relay and console router separate

ComponentResponsibilityFailure symptom
Console routerRoutes public chat, terminal, and health paths to agent serve ports.Control cannot open terminal/chat or public health route fails.
RelayAccepts authenticated hub spawn requests and starts safe midfleet start commands.Spawn request fails even though existing agents may still be reachable.
Cloudflare tunnelForwards public hostname traffic to the runtime host.Browser sees Cloudflare/Access/HTML response instead of Midfleet route response.
export MIDFLEET_RELAY_TOKEN=<relay-token>
midfleet internal relay start --host 127.0.0.1 --port 8787 --daemon
midfleet internal relay status
midfleet internal relay health

# Public relay shape:
# https://relay-<workspace>.midfleet.io/spawn
# Header: x-midfleet-relay-token: <relay-token>

Start serve-backed agents with unique workdirs and ports

midfleet start \
 --name backend-agent \
 --command opencode \
 --model openai/gpt-5.5 \
 --workdir /srv/agents/midfleet/workspaces/backend-agent \
 --team-id <team-id> \
 --serve \
 --serve-port 4341 \
 --serve-public-base-url <console-url-from-runtime-config> \
 --worker \
 --autonomous
  • Use one workdir per running agent.
  • Use one serve port per running agent.
  • Register agents into a real team and project, not a blank pool.
  • Verify both local serve health and public console route health.

Verify the public route, not only localhost

midfleet list
midfleet internal inbox --name backend-agent --json
midfleet internal nudge backend-agent "Reply exactly: SPAWN-OK"
curl -i https://console-<workspace>.midfleet.io/<workspace>/agents/<agent-id>/global/health

# Use the exact host printed by:
midfleet config show
# Runtime -> console / consoleRouter.publicBaseUrl