I am unable to delete an agent although it shows t...
# ask-ai
c
I am unable to delete an agent although it shows the same agent in
lk agent list
t
Thanks for reaching out, Subham. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Hey there! Could you share the exact error message you see when you try to delete the agent? Also, if you could run
lk agent status --id <your-agent-id>
and send me the output, that would be super helpful. This way, we can figure out what's going on together. Sources: Agent deployment CLI reference | LiveKit Docs | cmd/lk/dispatch.go | protobufs/livekit_cloud_agent.proto | agent_client.go
c
Copy code
lk agent delete CA_bW45Dv6m7JQg 
Using project [qualif]
Using agent [CA_JXLuvxSFsCTb]
Why does it select a different agent for deletion?
t
Hey there! The
lk agent delete
command figures out which agent to delete by following this priority order: 1. If you use the
--id
flag, it picks the agent with that ID to delete. 2. If you don’t provide the
--id
flag, it looks for a
livekit.toml
config file in your current folder to find a default agent ID. 3. If neither of those is found, it’ll ask you to choose an agent interactively from the list of available agents. From what you’re describing, it sounds like the command is defaulting to an agent set in the config or some fallback. To make sure you delete the right one, just use the
--id
flag with the agent ID you want, like this:
Copy code
lk agent delete --id CA_bW45Dv6m7JQg
Give that a try and let me know if it helps or if you want me to walk you through it! Sources: autocomplete/fish_autocomplete | Agent deployment CLI reference | LiveKit Docs | LiveKit CLI | livekit/livekit_composite | DeepWiki