livekit-cli icon indicating copy to clipboard operation
livekit-cli copied to clipboard

fix(agent): register --id flag on `agent deploy`

Open mcdgavin opened this issue 5 months ago • 0 comments

Summary

lk agent deploy resolves the target agent via getAgentID, which reads cmd.String("id") — but the deploy subcommand never registered the --id flag (unlike config, status, restart, and rollback). As a result lk agent deploy --id CA_XXX failed at flag-parse time with flag provided but not defined: --id, and the id lookup was effectively dead code on the deploy path.

This adds idFlag(false) to the deploy command's flags, matching the sibling subcommands. --id remains optional and falls back to livekit.toml as before.

Test

  • TestAgentDeployRegistersIDFlag introspects the real agent deploy command and asserts it registers --id (fails before this change).
  • Verified lk agent deploy --help now lists --id; go test ./cmd/lk/ and gofmt pass.

Thanks to @MSameerAbbas for the precise diagnosis in the issue.

Fixes #830

mcdgavin avatar Jun 17 '26 17:06 mcdgavin