Repository navigation
Brainstem 1.4.0
Small agent tasks and the groundwork for multi-core: a generic agentOS runner for cheap, bounded agent work, destinations that hand results back to the core, a log file input, telemetry and a core registry that identify cores and destinations, and a Web UI flow built on them.
Upgrading:
- Migrations
0003_coresand0004_node_statsrun automatically on start. - The Docker image omits optional dependencies (the agentOS VM runtime). Build with
--build-arg INSTALL_OPTIONAL=trueto useagentos-runnerin Docker. - Handed-off observations no longer pretend to come from an input named
destination:<id>: theirinputis empty andoriginnames the destination. Consumers of telemetry or output envelopes that relied on that input id should readorigin. - Web UI destination nodes show
deliveredinstead ofoutputs. Per-node totals start counting from the upgrade; earlier history isn't backfilled.
Changes:
-
Per-node totals: the API counts polls, observations, decisions, completed deliveries, handoffs, errors and the last event time per flow node in a new
stat_nodestable (migration0004_node_stats) as telemetry arrives, and returns them asnodesinGET /api/stats. The Flow page shows these totals, so node counters no longer reset when events leave the 2000-event window. Destination nodes now showdelivered(completed deliveries) instead ofoutputs, which only ever counted the HTTP JSON destination's output events. -
agentos-runnerfails fast and clearly: a missing model API key is reported before a VM boots, and a sidecar that can't start (EPIPEand similar) becomes a permanent, readable error ("the agentOS sidecar could not start … on NixOS enable programs.nix-ld") instead of retried pipe errors. On NixOS, nix-ld is now the recommended setup; the real-VM test runs whenever nix-ld (orAGENTOS_SIDECAR_BIN) is available. -
Fix:
npm run checknow fails on syntax errors (it usedfind -exec, which ignored them) and also checksbrainstem-api.mjsand the Web UI flow model. -
Web UI Flow page brought up to date with the runtime: structure from
/api/topology(one node per configured id, so tasks of the same plugin are no longer merged), a core pool node and a Cores panel from the core registry, handoffs shown only while they happen (a short-lived "handing off" pill node linked to the destination) instead of fakedestination:<id>input nodes, and an inspector that matches destinations by id and shows each decision's origin and core. Falls back to snapshot events against an older backend. The graph logic moved into a pure, unit-testedweb/src/flow/model.js. -
Core registry and
GET /api/topology: each runtime registers in a newcorestable (migration0003_cores) with its role, queues, version and loaded topology, heartbeats everyruntime.cores.heartbeatMs(default 10 s) and marks itself stopped on shutdown. Cores that miss 3 heartbeats are reported aslost, and rows unseen for 24 h are pruned./api/topologyserves the cores plus the inputs and destinations (with ids) from the freshest running core, and flags running cores that loaded different configs. The Web UI no longer has to derive structure from snapshot events. -
Telemetry identity fields for multi-core and handoffs: every event carries
coreId(runtime.coreId/BRAINSTEM_CORE_ID, also the job worker id); decisions and output envelopes carryorigin({ kind: "input", id }or{ kind: "destination", id, depth, lineage }); the snapshot and destination plugin logs carry destinationids; a newbrainstem.destination.emittedevent marks each handoff. A handed-off observation no longer pretends to come from an input nameddestination:<id>. Itsinputis empty andoriginnames the destination. Jobs queued by the previous version are still understood. -
Destinations can hand observations back to the core with
ctx.emit(observation). They are enqueued in the same transaction that marks the delivery delivered, never routed back to a destination already in their chain, and limited byruntime.handoff.maxDepth(default 2) andmaxPerDelivery(default 5). -
agentos-runnergainshandoff: a successful run's report becomes anagent_reportobservation (withfacts.minimum_decision) that Matrix or a bigger agent can pick up. -
New
log-fileinput: watches a log file and emits new matching lines (defaultERROR|FATAL|CRITICAL|PANIC) as one bounded observation per poll, with offset checkpoints and truncation/rotation handling. -
Fix: the agentOS prompt and docs used
observation.summary, which doesn't exist; they now usetitle,messageandsource.type/source.name. -
New
agentos-runnerdestination: runs a configured task in a Rivet agentOS VM for each matching decision. One plugin serves many tasks; each destination entry has its own filters,command(or agentprompt), network allowlist, read-only mounts, env, and host-side tools. Tools are validated, limited bymaxCalls, can berequired, and are replayed instead of repeated when a delivery is retried.runOnce: "revision"skips re-emitted observations by default. Seedocs/plugins/agentos-runner.md. -
prompttasks run a host-side agent loop against any OpenAI-compatible endpoint (model: { baseUrl, name, apiKeyEnv }). The model getsrun_command(inside the VM) plus the entry's tools. Every run is bounded bylimits(turns, output tokens, commands, tool output size, prompt size, conversation size, request spacing), duplicate calls are refused, and a delivery that already talked to the model fails permanently instead of being retried (maxAgentAttempts: 1). -
@rivet-dev/agentos-coreis an optional dependency. The Docker image omits optional dependencies unless built with--build-arg INSTALL_OPTIONAL=true.