OpenProgram Docs

Framework signal routing

SubsystemWithout a busOn the bus
EventBusUnusedThe sole hub: process singleton, one Event format, subscription by type
WebUI serverEvery signal wired to _broadcast with its own JSON, making a UI component the routing pointOrdinary subscriber, forwards to the frontend WebSocket
Agent loopInternal AgentEvent stream; hook returns discardedKeeps that stream and emits at key points; tool.before can veto
Dispatcheron_event chain to the WebUIKeeps the chain and emits user.prompt_submitted and related events
Task runnerDirect job_status broadcastEmits subagent.*; the broadcast comes through ws.frame
AuthCorrect events, almost no subscribersUnchanged; a bridge translates AuthEvent
Contexton_event callbackEmits context.* from that callback
ChannelsDirect channel_turn broadcastEmits channel.*; the direct frontend connection stays
MemoryPolled, no signalEmits at processing start and end
File changesNo signalFile tools emit file.changed
Plugin hooksObserve onlyRemain a plugin API on bus subscriptions

A new consumer plugs in with one subscribe(types=…) instead of integrating five or six mechanisms, some moments of which had no signal at all.

  • tool.before is the tool interception point. It sits outside the approval wrapper and applies to subagents. turn.stop is the other gate.
  • A bridge is the pattern for a subsystem that already models its events well: nothing inside auth knows the bus exists.
  • Connecting a source is additive: the bus gets a copy and the old path keeps running, so each source is verifiable and reversible alone.
  • Switching the WebUI uses a pass-through envelope: broadcast frames are byte-for-byte the same, so no shadow comparison is needed and the frontend does not notice.

Left untouched

ComponentWhat stays
DispatcherSeven-stage turn orchestration; the signature of process_user_turn
Session storageGit DAG and contextgit
JobRunnerThread-pool model
ApprovalRegistryUnchanged
AuthStoreBridged, not modified
FrontendWebSocket protocol

Implementation status

The bus, class-A and class-B sources, file.changed, the tool.before gate and the WebUI subscription are in place; producers across runtime, tools and channels send ws.frame instead of importing the WebUI. The proactive rule layer consumes the bus and adds no sources; its engine is not yet installed.

Event layer

Last updated · 2026-11-25