Send console server info to CLI host#2000
Conversation
🦋 Changeset detectedLatest commit: 4440f7c The changes in this PR will be included in the next version bump. This PR includes changesets to release 36 packages
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 |
| if (this.options.serverInfo) { | ||
| const msg = new AgentDev.AgentDevMessage({ | ||
| message: { | ||
| case: 'serverInfo', | ||
| value: new AgentDev.ServerInfo(this.options.serverInfo), | ||
| }, | ||
| }); | ||
| await this.sendFramed(msg.toBinary()); | ||
| } |
There was a problem hiding this comment.
🔍 Server info handshake uses a different protobuf type than session messages on the same TCP stream
The start() method at agents/src/voice/remote_session.ts:308-316 sends an AgentDev.AgentDevMessage over the same length-prefixed TCP stream that subsequently carries pb.AgentSessionMessage frames. The broker (LiveKit CLI host) must know to parse the first frame as AgentDevMessage rather than AgentSessionMessage. This is a protocol-level contract that isn't enforced or documented in this codebase — correctness depends on the broker implementation matching this expectation. If the broker doesn't handle this, the first frame will be silently misinterpreted or cause a parse error.
Was this helpful? React with 👍 or 👎 to provide feedback.
|
replaced with #2015 |
Summary
AgentDev.ServerInfoto the local CLI host immediately after the console TCP transport connects.agentNameandwsURLfrom CLIServerOptionsintorunConsoleso the CLI can surface agent/project context.@livekit/agents.Source diff coverage
Coverage classification
livekit-agents/livekit/agents/cli/watcher.py: adapted toagents/src/console.ts,agents/src/cli.ts, andagents/src/voice/remote_session.ts. The JS target does not have Python's dev hot-reload watcher; the equivalent CLI host path isrunConsoleusingTcpSessionTransport. The port sends anAgentDev.ServerInfoframe immediately after TCP connect, withagentNameandwsURLpassed from CLIServerOptions.livekit-agents/pyproject.toml: not applicable. The target counterpart isagents/package.json; its declared@livekit/protocolrange already includes1.48.0, andAgentDev.ServerInfoexists in@livekit/protocol@1.48.0.uv.lock: not applicable. The target counterpart ispnpm-lock.yaml; no protocol dependency bump is needed, so there is no lockfile update to port.Validation
pnpm --filter @livekit/agents typecheckpassed.pnpm --filter @livekit/agents lintpassed with existing warnings.pnpm --filter @livekit/agents buildpassed.pnpm prettier --check "agents/src/cli.ts" "agents/src/console.ts" "agents/src/voice/remote_session.ts" ".changeset/console-server-info.md"passed.git diff --checkpassed.pnpm vitest run agents/srcfailed: 90 files passed,agents/src/voice/amd.test.tsfailed 11 AMD assertions/timeouts unrelated to this TCP console change.pnpm vitest run agents/src/voice/amd.test.tsfailed with the same 11 AMD failures.pnpm --filter @livekit/agents api:checkfailed because API Extractor does not support generatedexport * as ___syntax inagents/dist/index.d.ts:10.No target infrastructure gaps were identified.
Ported from livekit/agents#6260
Original PR description
No description.