Gate the dev-channel flag on the installed agents SDK version#901
Merged
Conversation
Also normalizes an em dash in a nearby comment.
Pure relocation, no behavior change: the Python/Node binary finders and installed-version probes (plus the embedded node_resolve_version.js) move from cmd/lk into pkg/agentfs as exported functions, with agentfs.ResolveInstalledSDKVersion as the shared entry point, so callers outside the startup checks can reuse the resolver.
An SDK must not be handed a flag it predates: Node's CLI hard-fails on unknown options, so every released @livekit/agents (<= 1.5.0) dies at startup when passed --cli-addr. Resolve the installed agents version via the project's own runtime and choose accordingly — --cli-addr when positively at/above the first supporting release (1.6.6 Python, 1.5.1 Node, placeholders until those releases exist), otherwise the legacy --reload-addr for Python and no flag at all for Node. Undetermined versions always take the safe branch.
On Windows CI runners the first node.exe spawn can take several seconds (Defender scans the binary on first exec), which blows the SDK version probe's 5s timeout inside startAgent — the test then fails with '@livekit/agents not found' at exactly 5.04s before the crash-signal behavior under test ever runs (same flake seen on main). Spawn a throwaway Node process first to absorb the cold start.
davidzhao
approved these changes
Jul 10, 2026
davidzhao
added a commit
that referenced
this pull request
Jul 10, 2026
* fix `lk agent dev` with Agents-JS JS agents will also support the OnServerStart protocol * Gate the dev-channel flag on the installed agents SDK version (#901) * remove dead nil checks on devSrv, now created unconditionally Also normalizes an em dash in a nearby comment. * move interpreter-based SDK version resolution to pkg/agentfs Pure relocation, no behavior change: the Python/Node binary finders and installed-version probes (plus the embedded node_resolve_version.js) move from cmd/lk into pkg/agentfs as exported functions, with agentfs.ResolveInstalledSDKVersion as the shared entry point, so callers outside the startup checks can reuse the resolver. * pick the dev-channel flag from the installed SDK version An SDK must not be handed a flag it predates: Node's CLI hard-fails on unknown options, so every released @livekit/agents (<= 1.5.0) dies at startup when passed --cli-addr. Resolve the installed agents version via the project's own runtime and choose accordingly — --cli-addr when positively at/above the first supporting release (1.6.6 Python, 1.5.1 Node, placeholders until those releases exist), otherwise the legacy --reload-addr for Python and no flag at all for Node. Undetermined versions always take the safe branch. * remove agent_watcher_test.go * pre-warm node in TestAgentProcessFailSignal to avoid probe timeout On Windows CI runners the first node.exe spawn can take several seconds (Defender scans the binary on first exec), which blows the SDK version probe's 5s timeout inside startAgent — the test then fails with '@livekit/agents not found' at exactly 5.04s before the crash-signal behavior under test ever runs (same flake seen on main). Spawn a throwaway Node process first to absorb the cold start. --------- Co-authored-by: u9g <jason.lernerman@livekit.io>
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.
Stacked on #900's branch (
dz/fix-node-dev). Three commits, best reviewed in order:devSrvis now created unconditionally, so the nil guards inacceptSession/Runwere dead (plus an em-dash comment normalization).cmd/lkas exported functions withagentfs.ResolveInstalledSDKVersionas the shared entry point.@livekit/agents(≤ 1.5.0) dies at startup when passed--cli-addr(reproduced:error: unknown option '--cli-addr', exit 1, on every start and reload). The installed version is resolved via the project's own runtime (accurate for pnpm/workspace symlinks and loose constraints) and the flag chosen from it:--cli-addr(≥ 1.6.6)--reload-addr--cli-addr(≥ 1.5.1)Undetermined versions always take the safe branch. The cutover constants (1.6.6 / 1.5.1) are placeholders for the first releases that actually ship
--cli-addrsupport — bump them when those land.Verified end-to-end:
agent-starter-nodeon released 1.4.11 (hard-failed before) now starts cleanly with no flag;agent-starter-pythonon 1.6.0 still gets--reload-addrand runs. Unit tests cover the flag choice matrix.