[new ui] Switching to a thread in Duo Agentic Chat throws an error in console

Summary

The activeTab watcher, introduced in Add tests for the AI side rails toggle in agent... (!213066 - merged) throws a JS error in console

Screenshot_2025-12-01_at_13.32.37

Steps to reproduce

  1. Have the Duo Chat in Agentic mode
  2. Open DevTools
  3. Open "Duo Chat history" tab in the new UI
  4. Click any of the threads
  5. Observe the JS error in console
  6. Observe that the input field isn't focused in the opened thread

Example Project

gitlab.com

What is the current bug behavior?

The JS error is thrown and the input field in the opened thread isn't focused

What is the expected correct behavior?

  • No JS error
  • the input field in the opened thread correctly is focused

Output of checks

Essentially, this watcher calls the focusInput method on the duo_agentic_chat component which expects the web-agentic-duo-chat component (the chat ref) to be available. But it's not at the time this watcher kicks in.