Skip to content

feat(live): zero-dependency real-time run dashboard (EventBus + SSE) - #897

Merged
AmitoVrito merged 1 commit into
mainfrom
feat/live-eventbus-dashboard-896
Aug 1, 2026
Merged

AmitoVrito merged 1 commit into
mainfrom
feat/live-eventbus-dashboard-896

Conversation

@AmitoVrito

Copy link
Copy Markdown
Collaborator

Phases 1–2 of #896. Watch what SynapseKit is doing, live in the browser — with zero new dependencies.

What's here

  • synapsekit.live.EventBus — one in-process pub/sub every finished observe span publishes to. Bounded history (replays to late-joining tabs), drop-on-backpressure (never blocks the agent), and a no-op when disabled (single attribute read) so there's zero overhead in production.
  • Stdlib SSE server — http.server + Server-Sent Events. No FastAPI/uvicorn/websockets. Serves one self-contained dashboard.html (light theme, SynapseKit green logo, Story/Trace toggle, live cost/token meters) straight from the wheel.
  • Enable it with SYNAPSEKIT_LIVE=1 (auto-starts on the first span), synapsekit ui --live, or synapsekit.live.enable().
  • Security — bound to 127.0.0.1, /events token-gated. Nothing leaves the machine.
  • Hook — observe.end_span now streams spans to the bus (additive, guarded — observe tests unaffected).

Lightweight contract (verified)

  • 0 new mandatory dependencies — stdlib only; core-import guard stays green.
  • Dashboard is a single ~12KB HTML file, shipped in the wheel (confirmed present in the built wheel).
  • Publishing is a no-op when Live is off (tested).

Try it

python examples/live_dashboard.py       # opens http://127.0.0.1:7900
# or, in your own code:
SYNAPSEKIT_LIVE=1 python my_agent.py

Tests

10 live tests (real EventBus + real HTTP/SSE via urllib, token-gate 403, no-op-when-off, observe→bus) + the existing observe suite (134) still green. Mock target: the design artifact.

Refs #896 (P1 EventBus + P2 stdlib dashboard; P3 story/replay + P4 demote-FastAPI-to-extra to follow).

SynapseKit Live lets you watch an agent/RAG/graph run live in the browser
with no new dependencies. Phase 1+2 of #896:

- synapsekit.live.EventBus: one in-process pub/sub every finished observe
  span publishes to (bounded history, drop-on-backpressure, no-op when
  disabled so there is zero prod overhead).
- Stdlib http.server + Server-Sent Events server (no FastAPI/uvicorn/
  websockets) serving a single self-contained dashboard.html from the wheel
  (light theme, SynapseKit green, Story/Trace toggle, live cost/token meters).
- Enable via SYNAPSEKIT_LIVE=1 (auto-start on first span), `synapsekit ui
  --live`, or synapsekit.live.enable(). Bound to 127.0.0.1, token-gated.
- observe.end_span now streams spans to the bus (additive, guarded).
- Tests (real bus + real HTTP/SSE, no mocks) and examples/live_dashboard.py.

Refs #896
@AmitoVrito
AmitoVrito merged commit d9290c3 into main Aug 1, 2026
21 checks passed
@AmitoVrito
AmitoVrito deleted the feat/live-eventbus-dashboard-896 branch August 1, 2026 18:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant