Description of the issue: When navigating to a YouTube video and opening the Leo AI sidebar, the option/suggestion chip to “Summarize this video” does not appear. The user must un-link the context, close the Leo sidebar and reopen it for the summarize option to trigger.
Steps to Reproduce:
Open Brave and navigate to a YouTube video URL.
Open the Leo AI sidebar (using the sidebar icon or shortcut).
Observe the available suggestion chips/options in the Leo interface.
Close the appended video link that appears above the text input and close the Leo sidebar.
Open the Leo sidebar again immediately.
Actual Result: On the first attempt (Step 3), the “Summarize this video” option is completely missing.
Expected Result: The “Summarize this video” option should be visible and available immediately upon opening Leo when a YouTube video is the active tab.
Reproduces how often: Consistent (Happens every time)
Reproducible on current live release (yes/no): Yes
Additional Information: The current workaround is to “unappend” the link, close the sidebar and reopen it. After reopening, the summarize button appears correctly.
This bug happens because Leo AI does not correctly attach page context on the first initialization of the sidebar when loading a YouTube video.
When you open Leo directly after navigating to a video:
The sidebar loads before Brave finishes providing the full page metadata, including the video URL and structured YouTube data.
Because of this incomplete context handoff, Leo fails to detect that the active page is a YouTube video, so the “Summarize this video” suggestion chip does not appear.
When you un-link the context and reopen Leo:
The sidebar initializes again, this time receiving the complete metadata, allowing Leo to correctly identify the video and show the “Summarize this video” option.
This means the issue is caused by a timing/context-sync bug in Leo’s sidebar initialization.
Suggested Fix / Way to Solve It
1. Fix the Context Initialization Timing
The Leo sidebar should be updated so that when it opens:
It waits for the Brave browser context injection to complete, OR
It re-queries the active tab’s metadata after the sidebar has fully loaded.
This ensures the YouTube video context is available on the first open.
2. Add a Fallback Context Refresh
If the initial context is empty or incomplete:
Leo should automatically perform a context refresh (re-fetch the current tab’s content metadata),
Instead of showing incomplete suggestion chips.
This fallback refresh prevents the missing “Summarize this video” button.
3. Improve the YouTube Page Detector
Strengthen the logic that detects when the user is on a YouTube video page, so detection doesn’t fail when:
The page is still partially loading
Brave delays content scripting
The sidebar loads faster than page metadata
Temporary Workaround (Already Known)
Until the bug is fixed, the user can:
Click X to un-link the context
Close Leo
Reopen Leo
This forces a re-fetch of the page metadata and makes the “Summarize this video” suggestion appear.
Summary (Short Version for Bug Report)
Root Cause:
Leo AI initializes before Brave sends complete page metadata, so YouTube video context is not detected on first load.
Fix:
Add a delay or re-fetch mechanism for page context during sidebar initialization so that Leo identifies YouTube videos correctly on first attempt.
Workaround:
Un-link context → close sidebar → reopen sidebar.