console text mode never displays agent-initiated messages (e.g. the on_enter greeting)
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.
Hi, I'm Himanshu, a new contributor. I saw #6578 updates the legacy console path. Would a FakeLLM regression test for the on_enter greeting and an idle background reply be useful? I'd also like guidance on whether the newer TCP console path needs separate coverage. I haven't reproduced it yet and would coordinate with the existing PR.