Skip to content

Task execution bus

The task execution bus answers what agent work is running in this BMO process right now? It is an in-process registry (internal/taskexec) owned by *app.App. It does not replace durable run history (agent_runs) or the composed task aggregate read model.

SurfaceCommand
CLI statusbmo config show-task-execution
TUI/task-bus or sidebar Task bus
HTTP status (`bmo service start httpautopilot`)
Agent statusget_task_execution_status
MCP statusbmo_get_task_execution_status when listed in services.mcp.exposed_tools
Raw HTTPGET /v1/task-execution
Raw MCPbmo_get_task_execution_snapshot

By default bmo config show-task-execution attempts a loopback-safe live read from a local HTTP or autopilot service and falls back to a degraded config-projection when no compatible runtime is attached. Use --source=config to force the detached shape-only projection.

The status family is distinct from the raw registry snapshot. Status adds source, freshness, posture, bounded stale-row issues, and runtime_attached; the raw surfaces keep the original running-task JSON shape for callers that only need the live registry payload.

  • Surfaces: tui, mcp, internal
  • Kinds: interactive_agent, noninteractive_agent
  • Shell background jobs: aggregate count only (not per-job rows in v1)

Entry paths:

  • TUI interactive runs via App.RunAgent
  • MCP bmo_run (surface tag mcp)
  • Internal non-interactive runs (recipes, scheduler, CLI without MCP)
  • not_attached + shape_only: detached/config-only view; no live runtime was observed.
  • idle + live: attached runtime with no running agent tasks or shell jobs.
  • active + live: attached runtime with running agent tasks and/or shell background jobs.
  • degraded + degraded: attached or attempted-live view where terminal run truth could not safely reconcile one or more running rows. The issues[] payload explains the bounded stale-row condition instead of silently claiming idle truth.

App.CancelTaskExecutionBySession(sessionID) marks matching registry rows canceled and calls Coordinator.Cancel(sessionID) when a coordinator is present.

Structured logs use bounded task_exec.fired and task_exec.action events at the registry choke point. Filter examples:

Terminal window
bmo logs --tail 1000 | jq -c 'select(.msg|startswith("task_exec."))'
Terminal window
bmo logs --tail 1000 | jq -c 'select(.msg=="task_exec.action" and (.outcome=="canceled" or .outcome=="failed" or .outcome=="cancel_by_session"))'

Maintainer detail: task-bus topic and Agent tracing recipes.