Skip to content

feat(cli): stream live call events + build logs (crew observability, phase 1) - #100

Open
abhishekmishragithub wants to merge 1 commit into
mainfrom
feat-cli-crew-observability
Open

feat(cli): stream live call events + build logs (crew observability, phase 1)#100
abhishekmishragithub wants to merge 1 commit into
mainfrom
feat-cli-crew-observability

Conversation

@abhishekmishragithub

Copy link
Copy Markdown
Collaborator

Phase 1 of crew observability: surface data the platform already emits but the CLI never exposed. No platform or pipecat change needed — these endpoints are session-authed and the CLI already holds a session token.

New commands

  • smallestai calls events <callId> — stream a live call's events over SSE (GET /atoms/v1/events?callId=): transcript turns, per-turn latency, node transitions, tool calls, KB lookups, and errors, live while the call runs. --json for raw frames. Clear messages for 400 (call already finished → use transcript) and 404.
  • smallestai calls transcript <callId> --follow — the same stream, filtered to conversation turns.
  • smallestai agent-crew logs [buildId] — stream a build's compile + deploy logs (GET .../builds/:buildId/stream); defaults to the latest build. Revives the previously-disabled logs command.

Under the hood

Two SSE helpers on the CLI HTTP client (stream_call_events, stream_agent_build) share one data: frame parser. Tests cover frame parsing (keep-alives, non-JSON, no-space data:) and the event renderers (known + unknown event types).

Scope notes

  • The /events stream is only as rich as what the crew runtime publishes today (transcript, TTS, latency, node state, tool calls, errors). Phase 3 (enriching pipecat + crew runtime events, and persisting them for post-call pull) is a separate design pass.
  • Phase 2 (exposing these to the pure API-key SDK) needs a platform change to add API-key auth to /events and the build endpoints, which are verifyToken-only today.

Green locally: ruff 0.16.1 (check + format), pytest (CLI + crew slice 40 passed). cli/ is excluded from CI mypy by repo config.

Held for review.

Surfaces observability data that the platform already emits but the CLI did
not expose:

- smallestai calls events <callId> — stream a live call's events over SSE
  (GET /events): transcript turns, per-turn latency, node transitions, tool
  calls, and errors, as they happen. 400 (call finished) and 404 map to clear
  messages.
- smallestai calls transcript <callId> --follow — same stream, filtered to
  the conversation turns.
- smallestai agent-crew logs [buildId] — stream a build's compile + deploy
  logs (GET .../builds/:id/stream); defaults to the latest build. Revives the
  previously-disabled logs command.

Adds two SSE helpers to the CLI HTTP client (stream_call_events,
stream_agent_build) sharing one data-frame parser. All use the session token
the CLI already holds. Tests cover SSE frame parsing and the event renderers.
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