Skip to content

fix(agent): register --id flag on agent deploy#879

Open
mcdgavin wants to merge 1 commit into
livekit:mainfrom
mcdgavin:fix/agent-deploy-id-flag
Open

fix(agent): register --id flag on agent deploy#879
mcdgavin wants to merge 1 commit into
livekit:mainfrom
mcdgavin:fix/agent-deploy-id-flag

Conversation

@mcdgavin

Copy link
Copy Markdown

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

deployAgent resolves the agent via getAgentID, which reads cmd.String("id"),
but the deploy subcommand never registered the --id flag (unlike config, status,
restart, rollback). As a result `lk agent deploy --id CA_XXX` failed at parse time
with "flag provided but not defined: --id".

Add idFlag(false) to the deploy command's flags, matching the other subcommands.

Fixes livekit#830
@mcdgavin mcdgavin force-pushed the fix/agent-deploy-id-flag branch from 188bd00 to fe6e232 Compare June 17, 2026 17:52
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.

lk agent deploy reads --id flag but does not register it

1 participant