Description
In console text mode (console --text, or Ctrl+T), any assistant turn produced outside a typed exchange is never displayed. The most visible case: an agent that speaks first via session.generate_reply() in Agent.on_enter() — the documented greet-on-start pattern — shows nothing until the user types something. The greeting is generated (LLM metrics fire, conversation_item_added fires, the item lands in session.history), but the TUI stays silent. The same applies to any agent-initiated message between turns (e.g. a background tool result woven in while idle).
Audio mode is unaffected (these turns are heard via the transcript synchronizer).
Root cause
Text mode renders agent output exclusively from the events returned by session.run(user_input=...) (cli/_legacy.py::_text_mode), and it detaches the streaming path (sess.output.transcription = None in _update_sess_io). So the only messages that can ever appear are direct replies to typed input. The new TCP console has the same two decisions on the Python side (cli/cli.py).
Repro (minimal, no network)
# greeter_agent.py — FakeLLM from tests/fake_llm.py
class Greeter(Agent):
def __init__(self) -> None:
super().__init__(instructions="You are a test agent.")
async def on_enter(self) -> None:
self.session.generate_reply(instructions="GREET_NOW")
Run python greeter_agent.py console --text → expected: the greeting renders as an ● Agent block on start; actual: nothing until you type, and the greeting itself never appears.
Environment
Reproduced on livekit-agents 1.5.13 and on current main (1.6.7).
I have a fix ready — PR incoming.
Description
In
consoletext mode (console --text, or Ctrl+T), any assistant turn produced outside a typed exchange is never displayed. The most visible case: an agent that speaks first viasession.generate_reply()inAgent.on_enter()— the documented greet-on-start pattern — shows nothing until the user types something. The greeting is generated (LLM metrics fire,conversation_item_addedfires, the item lands insession.history), but the TUI stays silent. The same applies to any agent-initiated message between turns (e.g. a background tool result woven in while idle).Audio mode is unaffected (these turns are heard via the transcript synchronizer).
Root cause
Text mode renders agent output exclusively from the events returned by
session.run(user_input=...)(cli/_legacy.py::_text_mode), and it detaches the streaming path (sess.output.transcription = Nonein_update_sess_io). So the only messages that can ever appear are direct replies to typed input. The new TCP console has the same two decisions on the Python side (cli/cli.py).Repro (minimal, no network)
Run
python greeter_agent.py console --text→ expected: the greeting renders as an● Agentblock on start; actual: nothing until you type, and the greeting itself never appears.Environment
Reproduced on livekit-agents 1.5.13 and on current
main(1.6.7).I have a fix ready — PR incoming.