Skip to content

feat(lk): send LK_SOURCE as X-LiveKit-Source on Public API requests - #1116

Merged
JackNDwyer merged 2 commits into
mainfrom
jack/source-header
Nov 16, 2026
Merged

JackNDwyer merged 2 commits into
mainfrom
jack/source-header

Conversation

@JackNDwyer

@JackNDwyer JackNDwyer commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Why

The DevEx Q4 goal "80% of agents built by coding agents follow our skills and templates" needs a way to tell whether an agent followed them. The plan from #team-devex-internal is a watermark: a value that only our skills and templates tell the agent to send. When it arrives on a request, the agent was following them, and the value says which one.

What changed

  • When LK_SOURCE is set, every Public API request sends it as X-LiveKit-Source, e.g. LK_SOURCE=skills lk analytics session list --user-auth. It's cleaned like the coding-agent name: lowercase letters, digits, dots and dashes, at most 64 characters.
  • It's an environment variable, not a hidden flag. If a skill tells agents to pass a flag, every user on an older CLI gets "flag provided but not defined" and the command fails. An unknown environment variable is ignored, so the skills can start using this before everyone updates.
  • Nothing in the docs or --help mentions it. Only the skills and templates will, so a value on a request can't come from somewhere else.
  • Coding-agent detection also covers Codex and Cursor. Neither sets AI_AGENT, so both showed up as no agent. Codex sets CODEX_VERSION on every command it runs (source), and Cursor sets CURSOR_AGENT in its agent's terminal (docs).

livekit/public-api-server#160 records the header as source on the public_api_request event.

How I tested it

  • New tests: the header reaches the server, it's left out when unset, and the value is cleaned and capped. Detection cases for Codex and Cursor.
  • go test ./pkg/public/ and go vet ./pkg/public/ ./cmd/lk/ pass.

🤖 Generated with Claude Code

Lets LiveKit's skills and templates tell a coding agent to set LK_SOURCE, so
the request event shows which of them the agent followed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

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

Copy link
Copy Markdown

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 bugs or issues to report.

Devin Review

Neither sets AI_AGENT. Codex sets CODEX_VERSION on every command it
runs, and Cursor sets CURSOR_AGENT in its agent's terminal.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@JackNDwyer
JackNDwyer merged commit 624d3d1 into main Nov 16, 2026
27 checks passed
@JackNDwyer
JackNDwyer deleted the jack/source-header branch November 16, 2026 17:41
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