little-cat-27217
11/21/2025, 9:28 AMtall-airline-16756
11/21/2025, 9:28 AMtall-airline-16756
11/21/2025, 9:28 AMAgentSession 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 Docsflaky-scooter-85113
11/21/2025, 9:37 AMtall-airline-16756
11/21/2025, 9:38 AMlk.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:
// 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:
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?flaky-scooter-85113
11/21/2025, 9:43 AMagent.on('text', (evt) =>... is bogus.tall-airline-16756
11/21/2025, 9:44 AMAgent 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:
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:
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:
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 docsflaky-scooter-85113
11/21/2025, 9:51 AMreader.forEach does not exist...
Still going around in circles, chasing advice which is bogus, still my agent ignores text.tall-airline-16756
11/21/2025, 9:52 AMchatMessage 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:
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):
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 docsflaky-scooter-85113
11/21/2025, 9:54 AMtall-airline-16756
11/21/2025, 9:55 AMsession.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 docsflaky-scooter-85113
11/21/2025, 9:57 AMinputOptions is noiseCancellation and a textInputCallback to log captured events.
I'm familiar with the browser Network tab, but "WS" ?tall-airline-16756
11/21/2025, 9:57 AM"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:
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.flaky-scooter-85113
11/21/2025, 10:00 AMtall-airline-16756
11/21/2025, 10:00 AM"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.flaky-scooter-85113
11/21/2025, 10:01 AMtall-airline-16756
11/21/2025, 10:01 AMsession.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:
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