Skip to content

(inference): add debug metadata headers to inference requests#1208

Merged
toubatbrian merged 2 commits intomainfrom
adrian-cowham/inference-debug-headers
Apr 6, 2026
Merged

(inference): add debug metadata headers to inference requests#1208
toubatbrian merged 2 commits intomainfrom
adrian-cowham/inference-debug-headers

Conversation

@adrian-cowham
Copy link
Copy Markdown
Contributor

Summary

  • Adds buildMetadataHeaders() utility to inference/utils.ts that includes User-Agent (SDK version + Node version), X-LiveKit-Room-Id, and X-LiveKit-Job-Id headers
  • Injects metadata headers into all outgoing inference requests: LLM (OpenAI SDK extra_headers), interruption HTTP (ofetch), interruption WebSocket, and general connectWs() (used by STT/TTS)
  • Gracefully degrades when no job context is available (standalone inference usage)

Test plan

  • pnpm build:agents passes — no circular dependencies or type errors
  • pnpm test — all existing tests pass (hit the try/catch fallback path for job context)
  • pnpm lint / pnpm format:check — no new lint or formatting issues in modified files
  • Manual: run restaurant_agent.ts with --log-level=debug and verify headers appear in gateway logs or via network inspection

🤖 Generated with Claude Code

Adds User-Agent, X-LiveKit-Room-Id, and X-LiveKit-Job-Id headers to
outgoing HTTP and WebSocket requests from the inference module for
improved server-side observability and debugging.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 6, 2026

🦋 Changeset detected

Latest commit: 9cf61c2

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 22 packages
Name Type
@livekit/agents Patch
@livekit/agents-plugin-anam Patch
@livekit/agents-plugin-baseten Patch
@livekit/agents-plugin-bey Patch
@livekit/agents-plugin-cartesia Patch
@livekit/agents-plugin-deepgram Patch
@livekit/agents-plugin-elevenlabs Patch
@livekit/agents-plugin-google Patch
@livekit/agents-plugin-hedra Patch
@livekit/agents-plugin-inworld Patch
@livekit/agents-plugin-lemonslice Patch
@livekit/agents-plugin-livekit Patch
@livekit/agents-plugin-neuphonic Patch
@livekit/agents-plugin-openai Patch
@livekit/agents-plugin-phonic Patch
@livekit/agents-plugin-resemble Patch
@livekit/agents-plugin-rime Patch
@livekit/agents-plugin-sarvam Patch
@livekit/agents-plugin-silero Patch
@livekit/agents-plugins-test Patch
@livekit/agents-plugin-trugen Patch
@livekit/agents-plugin-xai Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

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 3 additional findings.

Open in Devin Review

@toubatbrian toubatbrian merged commit a044ea3 into main Apr 6, 2026
9 checks passed
@toubatbrian toubatbrian deleted the adrian-cowham/inference-debug-headers branch April 6, 2026 22:34
@github-actions github-actions Bot mentioned this pull request Apr 6, 2026
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