feat(inspector,engine): stream live traffic over WebSocket (/admin/traffic/ws) with polling fallback

Open
#6 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
55/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
fastapi, next.js, python, typescript

Research direction

Start with engine/app/inspector.py and trace how middleware captures traffic and how GET /admin/traffic returns it. Then read inspector/src/lib/api.ts, inspector/src/components/Workbench.tsx, and engine/tests/test_inspector.py to understand the client state and existing test patterns. Add the WebSocket stream, prefix filtering, Pause/Resume handling, and polling fallback; done means the WebSocket tests pass and the specified pytest, typecheck, and build commands succeed.

Written by the indexing model from the issue text.

Description

complexity: high engine inspector

Context

Currently the Next.js Inspector polls GET /admin/traffic every 2.5 seconds. Adding a FastAPI WebSocket stream will give developers instant sub-50ms request telemetry while keeping HTTP polling as an automatic fallback if the socket drops.

Scope & Target Files

  • engine/app/inspector.py (add WebSocket broadcaster + /admin/traffic/ws endpoint)
  • inspector/src/lib/api.ts and inspector/src/components/Workbench.tsx
  • Add WebSocket tests in engine/tests/test_inspector.py

Acceptance Criteria

  • Expose WS /admin/traffic/ws in engine/app/inspector.py pushing new captured request events as JSON frames immediately after middleware completion.
  • Respect optional prefix query filtering and Pause/Resume state on the client.
  • Fall back gracefully to HTTP polling if the WebSocket connection closes or fails.
  • Verify both pytest -v and npm run typecheck && npm run build pass cleanly.
Dominant language
Python
Stars
0
Forks
1
Avg merge
19h 43m
Merged PRs (30d)
5

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from sepbox-dev/sepbox

All issues in sepbox-dev/sepbox

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.