feat(gemini): support Extended Thinking in browser DOM mode and harden thinking mode selectors

Open
#511 1 comment 1 reaction 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
65/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active

Research direction

Start by examining geminiDeepThinkDomProvider.js and the selectGeminiExecutionMode function. Look for the existing DOM selector logic and the mode selection routing. The goal is to extend the provider to handle 'extended-thinking' and 'deep-think' modes by matching on aria-label, child text nodes, and data-test-id attributes. Test changes by running the browser automation with a Gemini model to ensure the correct thinking mode is selected.

Written by the indexing model from the issue text.

Description

clawsweeper:fix-shape-clear clawsweeper:needs-maintainer-review clawsweeper:needs-product-decision clawsweeper:no-new-fix-pr clawsweeper:source-repro issue-rating: 🦞 diamond lobster P3
Summary

Currently, Oracle's Gemini browser DOM provider (geminiDeepThinkDomProvider.js) only activates for gemini-3-pro-deep-think. When targeting gemini-3.1-pro (or any non-Deep-Think model), selectGeminiExecutionMode unconditionally routes to HTTP mode (StreamGenerate).

Additionally, the DOM selector in geminiDeepThinkDomProvider.js relies strictly on text.includes('deep think'), making it brittle to UI layout, subtext, and copy changes in the Gemini web application.

Motivation
  1. Browser DOM Automation for Extended Thinking:
    When running Oracle via Chrome CDP (--engine browser or remote CDP debugging session), users often want browser automation for standard Extended Thinking (gemini-3.1-pro) as well as Deep Thinking. Currently, if the HTTP endpoint encounters auth challenges, cookie sync issues, or schema drift, there is no way to automate Extended Thinking directly in the browser UI.

  2. Resilience to Gemini Web UI & Subtext Changes:
    In the Gemini web app, Google pairs each thinking mode with explicit subtext:

    • Extended Thinking: "Complex Problem Solving"
    • Deep Think / Deep Thinking: "Max Parallel Reasoning"

    Expanding the selector logic to recognize both primary labels and subtext attributes ensures Oracle does not break when Google tweaks the drawer UI or displays the subtext.

Proposed Changes
  1. Generalize DOM Provider to Support Both Thinking Modes:
    Refactor geminiDeepThinkDomProvider.js to accept a target thinking mode:
    • extended-thinking: Targets the thinking toggle or drawer item matching "extended thinking" or subtext "complex problem solving".
    • deep-think: Targets the drawer item matching "deep think", "deep thinking", or subtext "max parallel reasoning".
  2. Allow DOM Mode for gemini-3.1-pro:
    In selectGeminiExecutionMode, allow mode: "dom" when the user explicitly requests browser execution for gemini-3.1-pro with thinking enabled.
  3. Resilient Matchers:
    Update selectMode() to inspect:
    • item.getAttribute('aria-label')
    • Child title and description text nodes (matching either title or subtext)
    • [data-test-id] attributes where present
Dominant language
TypeScript
Stars
4.1k
Forks
433
Avg merge
1d 4h
Merged PRs (30d)
24

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from steipete/oracle

All issues in steipete/oracle

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.