Repository navigation
Conversation
Move the `protocol` submodule to 59034411 (livekit/protocol#1866), which generates the telemetry semantic conventions under otel/gen. `cargo run -p lk-agents-codegen -- --write` copies the Rust and Python files into lk-agents-abi and the Python package. `--check` reports a stale copy like a stale host view. The agents-rust layout gets no copy.
Span names, event names, attribute keys, enum values and metric units now come from the vendored semconv constants in Rust and Python. Every emitted string stays byte-identical. Pin tests freeze each value, and one scan per language rejects a new literal name at an emitter site.
…agent name keys Move the `protocol` submodule to 948b07e7 (livekit/protocol#1866), which registers lk.track_source, lk.disconnect_reason and lk.agent_name under the Agents spelling, and regenerate the vendored copies. trace_types now takes the three keys from `_semconv`, and the scan allowlist no longer exempts them. A new pin checks that every protobuf enum name room_io emits for the track source and disconnect reason is a registered value. The emitted strings do not change.
types.py kept lk.simulation.enabled, lk.simulation.run_id, lk.simulation.job_id and lk.redaction.enabled as literals because importing the telemetry package from it is circular. The vendored `_semconv` module imports nothing, so it moves from livekit.agents.telemetry to livekit.agents, where types.py can import it without loading the telemetry package. lk-agents-codegen writes the copy to the new path, and the scan allowlist for types.py now lists its non-telemetry keys instead of exempting the file. The emitted strings do not change.
`uv sync` builds the package, and lk-agents-storage reads protocol/livekit/agent/thread_schema_v1.sql at build time. Without the submodule the build fails before mypy runs.
`uv sync` builds the package, and lk-agents-storage reads protocol/livekit/agent/thread_schema_v1.sql at build time. Without the submodule the build fails before the tests run.
Move the `protocol` submodule to 41166317 (livekit/protocol#1866, schema 0.7.0) and regenerate the vendored copies. The three GenAI duration metric names and their units, the six finish reason values, the shipped `mistral_ai` provider value and the ten session report log-record keys now come from the generated constants in Python and Rust. The tool-argument repair warning takes its `lk.pii.*` keys as parenthesized constants, and its test looks them up by constant, so a bare identifier key fails it. Pins cover the newly bound strings, and every emitted string stays byte-identical.
Move the `protocol` submodule to 25657ad3 (livekit/protocol#1866), which drops the `SCHEMA_URL` constant until a producer emits it, and regenerate the two vendored copies. Agents never referenced the constant, so nothing else changes.
pblazej
marked this pull request as ready for review
October 20, 2026 11:54
Move the `protocol` submodule to 8b2aa35d (livekit/protocol#1872), which groups each attribute's Python values under a class with the TypeScript const-object name and removes the 141 flat value constants. Regenerate the Python copy; the Rust copy does not change. The trace_types aliases keep their names and values and now read the class members, and the pin test looks up the track source and disconnect reason values the same way. Every exposed string stays byte-identical.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Agents 2.0 now takes all of its telemetry names from the semantic conventions registry in livekit/protocol#1866. Semantic conventions are the agreed names, types and units of telemetry data. Every span name, event name, attribute key, enum value, metric unit and log key comes from generated constants. Only the
lk.sip.prefix stays a literal, because it is a prefix and not a key.The emitted telemetry is byte-identical to
agents-2.0. Pin tests in Rust and Python freeze each value. Two scans fail when a new literal name appears at an emitter site.Protocol change
This PR depends on three stacked protocol PRs: livekit/protocol#1866 (the registry), livekit/protocol#1872 (TypeScript values grouped by attribute) and livekit/protocol#1881 (the same grouping for Python). The
protocolsubmodule points at8b2aa35d, the head of #1881. All three must merge first. After they merge, move the submodule to the merged commit and regenerate the copies as the next section describes.How Agents regenerates the conventions
Agents does not run Weaver.
lk-agents-codegencopies the generated files from the submodule torust/crates/lk-agents-abi/src/telemetry/semconv.rsandlivekit-agents/livekit/agents/_semconv.py, next to the host views. To change a name, change it in livekit/protocol first, asotel/README.mdthere describes. Then do these steps:protocolsubmodule to the new protocol commit.rust/, runcargo run -p lk-agents-codegen -- --write.Do not edit the copies by hand. The next
--writeoverwrites them.cargo run -p lk-agents-codegen -- --checkexits 1 when a copy differs from the submodule.Local testing
git submodule updatefetches8b2aa35dfrom the #1881 branch, so a normal checkout works.If your default Rust toolchain is older than 1.95,
uv runfails while it rebuilds the extension. Useuv run --no-sync, or setRUSTUP_TOOLCHAIN=1.96.0. The last command exits 1 and names only_generated/storage.py, which is already stale onagents-2.0.Known gaps
agents-2.0. This PR fixes only the missingprotocolcheckout in the type-check and realtime jobs.lk-agents-codegen --check.lk.*names, and Agents span names have no prefix.lk.speech_idis a string in Python and a number in the Node binding. The registry types it as a string.