ripe-secretary-47716
12/23/2025, 12:50 AM_self_.agent.update_chat_ctx. Is this intentional update of how context is handled in the update or is there a bug here?tall-airline-16756
12/23/2025, 12:50 AMtall-airline-16756
12/23/2025, 12:51 AMself.agent.update_chat_ctx after upgrading to livekit‑agents 1.3.9 and want to know if that's intentional or a bug.
I don't have version‑specific release notes here, so I need a bit more information to investigate:
• Which realtime model/plugin are you using? (link or name from the Realtime model plugins)
• A short code snippet showing how you call self.agent.update_chat_ctx and how you later observe the context is lost.
• Are there any errors, warnings, or log lines around the time the context disappears?
• Did you also change model/provider settings or other agent/runtime config during the upgrade?
• Does downgrading back to the previous livekit‑agents version restore the expected behavior?
With those details I can reproduce the flow and determine whether this is an intentional change (and point to alternatives) or a bug we should escalate.
Sources: Realtime model plugins | LiveKit Docs | Agents (Python) | livekit/livekit_composite | DeepWikiripe-secretary-47716
12/23/2025, 12:54 AMchat_ctx = ChatContext(items=[ChatMessages])
await self.agent.update_chat_ctx(chat_ctx)
self.agent = AvatarAgent(
ctx=self.ctx,
llm=new_llm,
instructions="",
tts=new_tts,
stt=new_stt,
vad=new_vad,
turn_detection=new_turn_detector,
)
self.session.update_agent(self.agent)tall-airline-16756
12/23/2025, 12:54 AMself.agent.update_chat_ctx isn’t being preserved when you replace the agent instance (self.agent = AvatarAgent(...) + self.session.update_agent(...)). The behavior you observed — working in 1.3.8 and broken in 1.3.9 — strongly indicates it’s not an intended change.
Two practical workarounds you can use immediately:
• After creating the new AvatarAgent, re-apply the chat context before calling `self.session.update_agent(...)`:
a. Create self.agent = AvatarAgent(...)
b. Call await self.agent.update_chat_ctx(chat_ctx)
c. Then self.session.update_agent(self.agent)
• Or preserve the prior agent’s chat_ctx and pass it into the new agent on construction (if your agent constructor accepts it) so the context is available immediately.
Please continue using 1.3.8 as a temporary workaround if those changes aren’t convenient. If you’d like, share logs around update_chat_ctx and session.update_agent calls and I can help verify whether the context is being dropped at agent construction or during session handoff.
Sources: Realtime model plugins | LiveKit Docs | Pipeline nodes and hooks | LiveKit docs | Agents and handoffs | LiveKit docs