← Back to Workflow
Skill

Gemini (gemini.google.com) Deep Think and Deep Research

Guides headed browser automation on gemini.google.com, focusing on Deep Think, Deep Research, and screenshot verification.

Gemini (gemini.google.com) Deep Think and Deep Research

This skill defines the UI interactions for automating gemini.google.com (specifically Deep Think and Deep Research) using the headed playwright_browser MCP server.

Core Rules

[!CAUTION] MANDATORY PRE-FLIGHT STATE CHECK. Take a screenshot and assess the state before submitting. Is generation in progress? Is there already a completed response? If a response to your prompt is already visible, DO NOT resubmit. Switch to extraction mode.

[!CAUTION] ONE PROMPT = ONE SUBMISSION. Submit as a single message via clipboard paste or page.fill + Send. DO NOT submit additional text while Gemini is generating.

[!IMPORTANT] MANDATORY POLLING: Once you submit a prompt, actively monitor its progress by scheduling a recurring 30-second timer (schedule tool). Keep polling and taking screenshots until complete.

[!TIP] MAXIMIZE BROWSER WINDOW: Always maximize the browser window immediately after launching or connecting. This forces the standard wide desktop layout and prevents responsive elements (like the model selector dropdown) from shifting or collapsing.

Specific UI Mechanics & Selectors

1. Model & Feature Selectors

  • Mode Picker Button: button.input-area-switch or button[aria-label*="mode picker"]

    [!NOTE] Responsive / Narrow Layout Behavior: If the browser window is narrow (mobile view), the model picker (e.g. Gemini Pro or Pro) moves to the top header instead of the input area. To select the model in narrow view, look for the button containing "Pro" or the active model name at the top left. Alternatively, maximize the browser window to restore the standard wide desktop layout.

  • Upload & Tools Button: button[aria-label="Upload & tools"]
  • Deep Research Active Badge (Verification): button[aria-label="Deselect Deep research"]
  • Textbox Editor: div[role="textbox"] (with class .ql-editor.textarea)
  • Send Message Button: button[aria-label="Send message"]

2. Deep Research Submission Flow

[!IMPORTANT] Thinking Level Limits: Deep Research is incompatible with "Deep Think". The maximum thinking level you can use with Deep Research is Extended.

  1. Click Upload & tools (button[aria-label="Upload & tools"]).
  2. Click Deep research from the opened list. Use JS bypass: await page.locator('text="Deep research"').first.evaluate("node => node.click()").
  3. Focus the Textbox Editor, enter prompt, and click Send message.
  4. Wait for the "Generating research plan" phase. YOU MUST CLICK the blue "Start research" button (button:has-text("Start research")) to kick off the research.
  5. Take a screenshot to verify it says "Researching...".

3. Deep Think Activation Flow

[!IMPORTANT] Standalone mode: Activating "Deep Think" will automatically disable "Deep Research".

  1. Click the Model Picker (button with text "Pro").
  2. Click Thinking level using JS bypass: await page.locator('text="Thinking level"').first.evaluate("node => node.click()").
  3. Click Deep Think using JS bypass: await page.locator('text="Deep Think"').first.evaluate("node => node.click()").
  4. Verify picker button text indicates Deep Think is active (e.g. Pro\nDeep Think).

4. Extraction

[!IMPORTANT] CHECK PRIOR WORK: Before attempting to extract a response, check your workspace/history to ensure you haven't already extracted and saved it in a previous step during this session!

  • For Deep Think Responses: The Deep Think output is simply the standard text block directly below the user's prompt. There is NO special "Thinking Process" accordion or dropdown in the UI. Extract it exactly like a standard chat response: scroll to the bottom and click the Copy response icon (overlapping pages) under the newest response, or scrape the text block directly.
  • For Deep Research Reports: Click the main report body (container #extended-response-message-content), press Ctrl+A then Ctrl+C to copy, and save the result.
  • For Multi-Turn/Chat Responses: Scroll to the bottom of the message, click the Copy response icon.

5. Accessing History / Recent Chats

  1. Click the hamburger menu or button[aria-label="Open sidebar"] / button[aria-label="Toggle Recents"].
  2. Locate the links inside the sidebar (a[href*="/app/"]) and click the one matching your chat title.

6. Troubleshooting Stagnant Generations

If stuck in "Analyzing results..." for > 3-5 minutes, run page.reload(wait_until="domcontentloaded") and sleep for 5-10 seconds. This forces the page to reload the chat history and display the completed report if the websocket desynced.

This is used in: