When using the Livekit agents playground interface...
# ask-ai
l
When using the Livekit agents playground interface the voiceagent ignores text entered in the "messages" channel using the node version. This works fine on the Livekit KITT demo, please confirm why it doesnt work on the node version?
t
Thanks for reaching out, Chris. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
You're saying the voice agent in the Agents playground ignores text you type into the "messages" channel when running the Node.js agent, while the KITT demo handles it — I can help troubleshoot that. Quick checklist (most common causes): 1. Confirm you're using
AgentSession
in your Node.js agent (v1.0+ requires this). 2. Ensure
text_enabled: true
is set in
RoomInputOptions
(default is true, but may be overridden). 3. Verify the agent is listening on the
lk.chat
text stream/topic (playground forwards messages there via
sendText()
). 4. Check for any custom
textInputCallback
or
inputOptions
that might block the built-in handler. 5. Look at agent logs when you send text — any errors or warnings when messages are posted? If those look correct, please tell me: • Node agent version and LiveKit SDK version you’re using • Whether you started from the starter template or from the KITT demo code • Any relevant log lines shown when you send a message With those details I’ll suggest targeted fixes or sample config/code to make the Node agent process
messages
the same way KITT does. Would you like that? Sources: Text and transcriptions | LiveKit docs | Live Conversations with AI using ChatGPT and WebRTC | Agent session | LiveKit docs | Agents v0.x migration guide - Python | LiveKit docs | Agents v0.x migration guide - Node.js | LiveKit Docs
f
1. AgentSession: check 2. 'text_enabled' is not overriden. 3. Other research suggests this is not needed - suggesting this is performed by the agent framework itself. 4. Checked. It's clear. 5. No logs. • Successive versions of the Agent JS framework up to v1.0.19. About to try v1.0.20 shortly. • Our agent code is based on the Typescript Starter Agent • No logs!
t
Thanks — I see you’ve checked AgentSession, text_enabled, callbacks, and there are no logs, and you’re on v1.0.19 (about to try v1.0.20) using the TypeScript Starter Agent. Let’s narrow this down. Quick targeted steps to isolate the problem: 1. Confirm the playground is sending messages to
lk.chat
• In the agent process, add a short listener that logs incoming text events from the
lk.chat
topic to confirm the agent actually receives the messages:
Copy code
// inside your AgentSession/agent init
agent.on('text', (evt) => {
  console.log('TEXT EVENT', evt);
});
If you see these logs, the playground is sending text and the issue is downstream. 1. Verify AgentSession input routing is active • Ensure you’re creating the
AgentSession
with default input handling (no custom session wrappers). Paste or confirm the code that constructs
AgentSession
(the
new AgentSession(...)
call and any
inputOptions
) so I can review for anything that disables routing. 1. Check message format and channel/topic • Confirm the messages you type show up in the playground network/devtools as topic
lk.chat
(or the payload contains
text
field). If the frontend uses a different topic or custom metadata, the agent’s default handler won’t pick it up. 1. Temporary debug: force-create a text input event • If you can, simulate a
lk.chat
event from the agent side to see if processing logic responds:
Copy code
agent.handleTextInput?.({ text: 'test message', from: 'debug' });
If that triggers behavior, your issue is that the playground messages are not being passed into the agent runtime. 1. If you still see nothing in logs • Run the agent with verbose logging enabled (increase logger level) or temporarily add console logs at the top of text handling code paths in the starter agent to catch incoming payloads. If you want, paste: • The
AgentSession
constructor call +
inputOptions
snippet • Any text-handling callbacks in your agent • A screenshot/snippet of the network event when you send a message from the playground I’ll review those and point out any specific changes to make. Would you like to try v1.0.20 first and report whether the behavior changes, or paste the snippets now?
f
• How can I confirm about playground sending messages? • The agent class does not have an 'on' method, so your suggestion about
agent.on('text', (evt) =>...
is bogus.
t
Sorry about the incorrect suggestion — you’re right that the
Agent
class has no
on
method. I’ll clarify exactly how to confirm the playground is sending messages and how to debug this in a Node.js agent. What I’m responding to: how to confirm the playground sends messages to
lk.chat
and the correct Node.js way to receive them. 1) Confirm the playground is sending messages • In the browser playground, open DevTools → Network or Console and watch for calls that publish text. The playground uses
room.localParticipant.sendText(..., { topic: 'lk.chat' })
. • In the browser console you can also log incoming text streams:
Copy code
room.on('textStream', (stream, participant) => {
  console.log('text stream topic:', stream.info.topic);
  const reader = new TextStreamReader(stream);
  (async () => {
    console.log('message:', await reader.readAll());
  })();
});
If you see topic
lk.chat
and message text here, the playground is publishing correctly. 2) Correct Node.js approach to receive text (AgentSession) • Use
AgentSession
input options and register a
textInputCallback
. Example:
Copy code
const inputOptions = {
  textInputCallback: (session, event) => {
    console.log('Text input received:', event.text, 'from', event.from);
    // respond or route as needed
    // session.generateReply({ userInput: event.text });
  },
  textEnabled: true, // confirm true
};

await session.start({
  agent: new MyAgent(),
  room: ctx.room,
  inputOptions,
});
• Add console logs inside that callback to confirm it fires when you send messages from the playground. 3) Low-level confirmation in the agent process (optional) • Register a text stream handler on the Room to see raw incoming streams:
Copy code
room.registerTextStreamHandler('lk.chat', (reader, participant) => {
  reader.forEach(chunk => console.log('raw chunk:', chunk));
});
If this logs, text reaches the room even before agent routing. 4) Next things to check if callback never fires • Confirm
session.start()
completes and logs show the session is active. • Ensure no other
inputOptions
or custom session wrapper replaces/omits
textInputCallback
. • Try upgrading to v1.0.20 (you said you were about to) and re-test. If you’d like, paste: • Your
session.start(...)
call and
inputOptions
snippet, and • A browser Console/Network capture showing the
sendText
or textStream event I’ll review those and point out the exact fix. Would you like to paste those now? Sources: Text and transcriptions | LiveKit docs
f
you've just told me to add a 'textStream' event to room... but it does not have a 'textStream' event! I do see a 'chatMessage' amonst the list of events. As for .room.registerTextStreamHandler()...
reader.forEach
does not exist... Still going around in circles, chasing advice which is bogus, still my agent ignores text.
t
Thanks — I hear your frustration. You’re right to call out the bad suggestions. I’ll be concise and accurate. What I’m responding to: you see a
chatMessage
event in the playground, `reader.forEach`/`textStream` suggestions were wrong, and your Node agent still ignores text. Correct, final facts and exact actions to debug now: 1) Confirm the playground is sending text • In the browser Console, send a message and watch Network or Console for a call to
sendText(...)
or a
chatMessage
log. If you see a
chatMessage
or
sendText
to topic
lk.chat
, the client published text. 2) Correct Node.js handling (how to receive text) • The agent receives text via AgentSession/Room IO. Use
inputOptions.textInputCallback
when calling
session.start(...)
. Add a console log there to prove receipt:
Copy code
await session.start({
  room: ctx.room,
  agent: new MyAgent(),
  inputOptions: {
    textEnabled: true,
    textInputCallback: (session, event) => {
      console.log('TEXT EVENT:', event.text, event.from);
    }
  }
});
3) If the callback never fires, do this low-level check in the agent process • Register a text stream handler on the Room and read with async iteration (NOT
forEach
):
Copy code
ctx.room.registerTextStreamHandler('lk.chat', async (reader, participantInfo) => {
  console.log('text stream opened from:', participantInfo.identity);
  try {
    for await (const chunk of reader) {
      console.log('raw chunk:', chunk);
    }
  } catch (err) {
    console.error('read error:', err);
  }
});
If this logs nothing, text isn’t reaching the agent process; if it logs, the issue is in AgentSession routing. 4) Common misconfigurations to verify (exact checks) • Confirm
session.start()
completes successfully and shows the session active in logs. • Ensure no other
inputOptions
or wrappers override
textInputCallback
or set
textEnabled
false. • Confirm the playground and your agent are connected to the same room/instance. 5) Please paste (so I can pinpoint the issue) • The exact
session.start({...})
call you use (full snippet with
inputOptions
). • Any agent startup logs around session start (even “connected to room” lines). • A browser Console/Network capture showing the `sendText`/`chatMessage` event when you press send. I’ll review those and give the exact change — no more guessing. Sources: Agents v0.x migration guide - Node.js | LiveKit Docs | Text and transcriptions | LiveKit docs | Agent session | LiveKit docs | Sending text | LiveKit docs
f
I see no network/console activity in the Playground app.
t
Thanks — helpful info. You said there’s no network/console activity in the Playground when you send a message. That means the client isn’t even attempting to publish text. Let’s confirm two quick things so I can pinpoint why: Please tell me exactly: 1. Which Playground are you using — the hosted LiveKit Agents Playground or a local clone? 2. Do you see the Send button in the Messages box and are you clicking it (not just typing)? 3. In the browser DevTools → Console, any errors shown when you press Send? 4. Paste your
session.start(...)
call (full snippet with
inputOptions
) and the agent package version (
@livekit/agents
version). If you prefer to run one quick check first: open DevTools → Network (WS) while sending a message; filter WebSocket frames and watch for a frame that contains
"kind":"data"
or a
sendText
payload. Paste a screenshot or the raw frame contents if you see it. Send those details and I’ll tell you the exact next step. Sources: Text and transcriptions | LiveKit docs
f
1. Local clone, sorry I don't have much detail on it. 2. Send button yes. 3. No errors. 4. My session.start() is complex. The only bit in
inputOptions
is
noiseCancellation
and a
textInputCallback
to log captured events. I'm familiar with the browser Network tab, but "WS" ?
t
You’re right to be frustrated — thanks for the details. I’ll be direct and practical. 1) About the browser “WS” filter • Open DevTools → Network → click the WebSocket (WS) connection for the Playground room. • With it selected, watch the Messages/Frames tab while you press Send in the Messages box. Look for frames containing JSON with keys like
"kind":"data"
,
"topic":"lk.chat"
, or any
sendText
payload. That confirms the client attempted to publish text. 2) Quick checks to run now (one-liners) • Does your
textInputCallback
log anything at all when you press Send? (You said it logs captured events — confirm an absence/presence.) • Temporarily add a very obvious console log at session start and inside the callback:
Copy code
console.log('SESSION STARTED');
textInputCallback: (session, event) => {
  console.log('TEXT CALLBACK FIRED', event);
}
If you see "SESSION STARTED" but never "TEXT CALLBACK FIRED", the agent process is connected but not receiving the text. 3) From your answers I need these exact items to diagnose: • The full
session.start({...})
snippet (including how you construct
inputOptions
) — paste it. • Your
@livekit/agents
package version. • Whether your local Playground has any frontend edits (or is an unmodified clone). 4) If you see nothing in WS frames • That means the Playground client is not publishing text. Reconfirm you’re clicking Send and try in an incognito window (to rule out extensions). If WS frames show publish to a different topic than
lk.chat
, paste that frame. If you paste the three items above (session.start code, package version, a WS frame if present), I’ll pinpoint the exact cause and the minimal change to fix it.
f
Yeah I guessed WS = WebSocket... click what exactly?
t
Thanks — good call. Short, corrected steps plus one tip to pick the right WS if there are multiple. 1. DevTools → Network → click the "WS" filter. 2. Find the WebSocket whose URL contains your LiveKit server host or the room name / long query string (token). That’s the room connection. 3. Click that connection → open the "Messages" or "Frames" panel. 4. In the Playground, press Send in the Messages box and watch for new frames. Inspect the JSON for keys like
"kind":"data"
,
"topic":"lk.chat"
, or the chat text. 5. If no frame appears when you press Send, the client isn’t publishing text. Please paste: • The full
session.start({...})
snippet (including
inputOptions
) • Your
@livekit/agents
version • If you see a frame, paste one frame’s JSON I’ll pinpoint the exact fix.
f
I don't think what you're talking about exists.
t
You’re right — you’ve been getting mixed guidance. Let’s stop the back-and-forth and get a definitive check that isolates where the text is being lost. What I need from you (paste these three things): 1. The exact
session.start({...})
snippet you run (full
inputOptions
contents). 2. The
@livekit/agents
package version (
pnpm list @livekit/agents
output). 3. A copy of any console output from your agent process when it starts (the first ~50 lines is fine). If you want to run one quick test while you paste those: • In your agent code, add these minimal, guaranteed logs before/after starting the session and inside the text callback:
Copy code
console.log('AGENT: starting session');
await session.start({...});
console.log('AGENT: session started');

textInputCallback: (session, event) => {
  console.log('AGENT: textInputCallback fired', { text: event.text, from: event.from });
}
Then in the Playground: click Send and tell me whether you see: • "AGENT: textInputCallback fired ..." in agent logs (means message reached agent), or • "AGENT: session started" but no text callback logs (means messages aren’t reaching the agent process). If you prefer, paste the three items first and I’ll point out exactly what to change. Sources: Text and transcriptions | LiveKit docs | Agents v0.x migration guide - Python | LiveKit docs | Agent session | LiveKit docs