Skip to content

feat(agents): add first-run diagnostics#5577

Open
shizhigu wants to merge 7 commits intolivekit:mainfrom
shizhigu:codex/first-run-diagnostics
Open

feat(agents): add first-run diagnostics#5577
shizhigu wants to merge 7 commits intolivekit:mainfrom
shizhigu:codex/first-run-diagnostics

Conversation

@shizhigu
Copy link
Copy Markdown

@shizhigu shizhigu commented Apr 28, 2026

Summary

  • Add a structured diagnostics layer for first-run checks, with stable JSON output and Rich table rendering.
  • Add python agent.py doctor with --json, --online, --deep, and --strict.
  • Run lightweight preflight diagnostics before console, dev, start, and connect; only fatal results block startup.
  • Add backwards-compatible plugin diagnostic metadata/hooks and initial metadata for OpenAI, Deepgram, Cartesia, ElevenLabs, Silero, and Turn Detector.
  • Document the first-run workflow in the root README and examples README.

The default doctor path is intentionally side-effect-free: it does not create rooms, call model providers, download files, mutate env, or write local files. --online only does a safe LiveKit URL/connectivity check, and --deep only runs checks that plugins explicitly expose.

A few compatibility edges are pinned by tests: legacy plugins stay quiet, plugin metadata imports are lazy so plugin import remains compatible with older agents installs, console --text skips audio-device preflight, empty CLI credential strings do not clear AgentServer values, credential-like details are redacted in JSON output, and Python versions newer than the tested range warn instead of blocking.

Non-goals

  • doctor does not validate provider tokens by calling provider APIs.
  • doctor does not download model files or create LiveKit rooms.
  • The plugin metadata is declarative; dynamic provider health checks can be added later behind explicit deep checks.

Tests

  • uv run --extra mcp pytest tests/test_cli_doctor.py tests/test_plugin_diagnostics.py tests/test_plugin_diagnostic_metadata.py tests/test_drain_timeout.py
    • 35 passed
  • make check
  • git diff --check
  • LIVEKIT_URL=wss://diagnostics-test.livekit.cloud LIVEKIT_API_KEY=api-key LIVEKIT_API_SECRET=api-secret uv run examples/voice_agents/basic_agent.py doctor --json

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Apr 28, 2026

CLA assistant check
All committers have signed the CLA.

Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 6 additional findings.

Open in Devin Review

@shizhigu shizhigu closed this Apr 28, 2026
@shizhigu shizhigu reopened this Apr 28, 2026
@shizhigu shizhigu changed the title Add first-run diagnostics for agents feat(agents): add first-run diagnostics Apr 28, 2026
devin-ai-integration[bot]

This comment was marked as resolved.

@shizhigu shizhigu force-pushed the codex/first-run-diagnostics branch from 7b01310 to de02fc8 Compare April 29, 2026 22:31
@shizhigu shizhigu force-pushed the codex/first-run-diagnostics branch from 2b405ea to 45274ab Compare May 1, 2026 17:06
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.

2 participants