Skip to content

Feature: Display live logs in UI for crewai agents #9

@monkscode

Description

@monkscode

Motivation

CrewAI agents running inside this project produce logs during execution. Right now it's difficult for operators and developers to see live agent logs from the browser-service UI (if any UI exists) or to stream them to a web console. Exposing live logs in the UI will make debugging and monitoring agent activity much easier.

Proposal

Add support in the UI (or a simple web endpoint/WS) to stream live logs from running crewai agents. Components:

Backend: expose an endpoint (HTTP SSE or WebSocket) that streams log lines for a given agent/session. Implement log buffering and sensible retention/limits.
Agent integration: ensure crewai agents write logs through a central logger (or attach a handler) that forwards lines to the streaming endpoint or a pub/sub channel.
UI: small console view that subscribes to the stream and displays tailing logs with timestamps and level filtering.
Acceptance criteria

There is an endpoint (WS or SSE) that can stream log events for a specific agent or session.
Logs appear in near-real-time in the UI or an example client when subscribed.
Basic controls: pause/scroll, clear, and filter by level (INFO/WARN/ERROR).
Reasonable safety: rate limiting and a configurable max buffer per session to avoid unbounded memory use.
Tests or a short example showing end-to-end streaming from an agent to the UI.
Implementation notes / pointers

Relevant python modules to inspect: browser_service/agent/actions.py, browser_service/agent/registration.py, and logging helpers in browser_service/utils/logging_setup.py (if present). If a central logger isn't already used, add a logging.Handler that forwards to the stream.
Prefer using WebSocket for bi-directional needs; SSE is simpler for uni-directional streaming.
Keep the UI piece minimal — a basic tailing console is sufficient. If the repo has no front-end, provide an example HTML/JS client that connects to the stream.
Follow-ups (optional)

Persist streamed logs to storage (Rotating files, S3) for later inspection and search.
Integrate with structured logging (JSON) to support richer filtering.
Please assign this to anyone working on agent observability. If you'd like, I can propose a minimal API spec and a small prototype change to the backend to start the work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions