our agent in livekit cloud as stuck in starus pend...
# ask-ai
h
our agent in livekit cloud as stuck in starus pending who to change it's status?
t
Thanks for reaching out, Gabriel. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
You're seeing an agent stuck in status "pending" — I'll help you get it running. Quick checklist to move an agent out of "pending": 1. Deploy the agent with the CLI: ◦ Run:
lk agent create
to start the build/deploy process. 1. Check build and runtime logs: ◦ Build logs:
lk agent logs --log-type build
◦ Runtime logs:
lk agent logs
1. Verify deployment artifacts: ◦
Dockerfile
,
livekit.toml
, and agent code were uploaded and correct. 1. Confirm environment secrets are set (API keys for STT/LLM/TTS if used). 2. Check status after fixes: ◦
lk agent status
— status should change to "Running" or "Sleeping" after successful deployment. If you ran
lk agent create
and it still stays pending, what do you see in the build logs (
lk agent logs --log-type build
)? Please paste the last 10–20 lines of that output and the agent name/ID so I can help interpret them. Sources: Deploying to production | LiveKit Docs | Deploy and scale agents on LiveKit Cloud | Agent deployment CLI reference | LiveKit docs
h
we getting the error unable to delete agent: Error from intermediary with HTTP status code 401 "Unauthorized" for lk run deploy
t
Thanks — you're seeing a 401 Unauthorized when trying to delete an agent during deployment. I’ll help diagnose it. Quick checks to fix 401 Unauthorized: 1. Re-authenticate with LiveKit Cloud: ◦ Run
lk cloud auth
. 1. Ensure you're using the correct project: ◦ List projects:
lk project list
◦ Set default:
lk project set-default <project-id>
1. Verify your API key/secret and permissions allow agent management. 2. Use the documented agent CLI commands (not
lk run
): ◦ Deploy:
lk agent deploy
(or
lk agent create
when registering a new agent) ◦ Check status:
lk agent status
◦ View logs:
lk agent logs
and build logs
lk agent logs --log-type build
If the above looks correct, please provide: • The exact command you ran (copy/paste). • The agent name/ID. • Output of
lk cloud auth status
(or confirm you re-ran
lk cloud auth
). • The last 10–20 lines of
lk agent logs --log-type build
(if relevant). With those I can help pinpoint whether credentials, project selection, or CLI usage is causing the 401. Sources: Agent deployment CLI reference | LiveKit docs | LiveKit CLI project management | LiveKit docs | Deploying to production | LiveKit Docs
h
lk agent logs Using project [vo-to-action] Using agent [CA_vPoQU26cLjUo] failed to get logs: agent is sleeping due to inactivity - create a new session to wake it up and view logs - map[agent_id:CA_vPoQU26cLjUo project_id:p_3zkhb4vhqo5]
t
Thanks — I see two things to address: the 401 when deleting/deploying, and the logs message saying the agent is sleeping. To resolve the 401 Unauthorized • Re-authenticate: run
lk cloud auth
. • Confirm project:
lk project list
then
lk project set-default <project-id>
for the project shown (p_3zkhb4vhqo5). • Ensure the API key/secret used by the CLI are valid and have agent-management permissions. • Use the documented agent commands (not
lk run
):
lk agent deploy
/
lk agent create
/
lk agent delete
. To view logs while the agent is sleeping • The agent is asleep due to inactivity. Create a new session (connect a client or start an agent session) to wake it. • After the agent wakes, run
lk agent logs
(and
lk agent logs --log-type build
if you need build logs). Tell me: • The exact command you ran that produced the 401 (copy/paste). • Output of
lk cloud auth status
(or confirm you re-ran
lk cloud auth
). • Whether you can create a session now (so we can wake the agent and fetch logs). I’ll interpret the outputs and guide the next steps.
h
i have solve the401 error how now i activate the agnet
t
You're seeing a 401 and need to activate (wake) the agent — here’s a clear, step-by-step plan. 1) Fix the 401 Unauthorized • Re-authenticate: run
Copy code
lk cloud auth
• Confirm the correct project is selected:
Copy code
lk project list
  lk project set-default p_3zkhb4vhqo5
• Verify the CLI is using valid API key/secret with agent-management permissions. 2) Wake (activate) the agent • Create a new session (connect a client or start an agent session). Any client connection to the agent will wake it from "Sleeping" to "Running". • After it wakes, fetch logs:
Copy code
lk agent logs
  lk agent logs --log-type build
If you still get 401 after re-authenticating, please paste: • The exact command that returned 401 (copy/paste). • Output of
lk cloud auth status
(or confirm you ran
lk cloud auth
). • The agent ID:
CA_vPoQU26cLjUo
. I’ll diagnose the next step once you share those.
h
i have solve the and created new session but the agent still in sleep mode this is the log for rooms lk room list Using project [vo-to-action] ┌─────────────────┬───────────────────────────┬──────────────┬────────────┐ │ RoomID │ Name │ Participants │ Publishers │ ├─────────────────┼───────────────────────────┼──────────────┼────────────┤ │ RM_YdxKApLpEvC8 │ voice_assistant_room_9667 │ 1 │ 1 │ └─────────────────┴───────────────────────────┴──────────────┴────────────┘
t
Thanks — you created a session but the agent stayed sleeping. You're running a room with participants, but rooms alone don't wake agents — the agent must be dispatched to join the room. Options to wake the agent now (pick one): 1) Dispatch via CLI • Run:
Copy code
lk dispatch create --agent-name <your-agent-name> --room voice_assistant_room_9667
2) Dispatch when a participant connects (token-based) • Create a participant token that includes a room configuration dispatching your agent (use the RoomConfiguration / RoomAgentDispatch fields) and connect a client with that token. After dispatching: • Check status:
lk agent status
— it should move Sleeping → Waking → Running. • View logs:
lk agent logs
(once awake) and
lk agent logs --log-type build
for build issues. If it still doesn't wake, tell me: • The exact agent name/ID you used. • Output of
lk agent status
. • Any errors from
lk agent logs
after attempting dispatch. Sources: Deploying to production | LiveKit Docs | Agent dispatch | LiveKit docs | Rust SDKs | livekit/livekit_composite | DeepWiki | Agent deployment CLI reference | LiveKit docs