Skip to content

Conversation

@dprevoznik
Copy link
Contributor

@dprevoznik dprevoznik commented Dec 21, 2025

Fix: Update Gemini Computer Use template for Stagehand v3 compatibility

Description

Updates the Gemini Computer Use template to work with Stagehand v3 API, which introduced breaking changes from v2.

Changes

🔧 Stagehand v3 Migration (index.ts)

  • Removed OpenAI dependency: The template now only requires GOOGLE_API_KEY (Stagehand v3 no longer requires a separate OpenAI key for its internal operations)

  • Updated Stagehand initialization:

    • domSettleTimeoutMsdomSettleTimeout
    • Removed modelName and modelClientOptions from constructor
  • Updated page access: stagehand.pagestagehand.context.pages()[0]

  • Updated agent configuration to v3 format:
    // v2 (old)
    stagehand.agent({
    provider: "google",
    model: "gemini-2.5-...",
    instructions: "...",
    options: { apiKey: ... }
    })

    // v3 (new)
    stagehand.agent({
    cua: true,
    model: { modelName: "google/gemini-2.5-...", apiKey: ... },
    systemPrompt: "..."
    })

    ✨ Template Improvements

  • Made task configurable via startingUrl and instruction payload parameters

  • Changed default example to use magnitasks.com Kanban board demo (more reliable than YCombinator search)

  • Added CuaTaskInput interface for typed payload support

📚 Documentation Updates

  • Removed OPENAI_API_KEY from setup requirements
  • Added "Alternative Model Providers" section showing how to switch to OpenAI or Anthropic
  • Improved deployment instructions to use --env-file .env approach
  • Updated .env.example to remove unnecessary OpenAI key

Testing

  • make build passes
  • make test passes
  • /qa cursor command passes

Related

Fixes KERNEL-716


Note

Cursor Bugbot is generating a summary for commit 5678806. Configure here.

> Updated to stagehand v3 sdk conventions
> Added ability to specify starting url + instructions
> Removed openai api key requirement that was in stagehand v2 version
Update readmes for the general app and also the specific template to reflect the new situation and also to provide some initial insight into how you can use other model providers.
Updated qa.md with the changes made to the gemini computer use template
@dprevoznik dprevoznik self-assigned this Dec 21, 2025
@dprevoznik dprevoznik requested review from juecd and masnwilliams and removed request for archandatta December 22, 2025 13:27
Copy link
Contributor

@masnwilliams masnwilliams left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@dprevoznik dprevoznik merged commit b1a3793 into main Dec 22, 2025
2 checks passed
@dprevoznik dprevoznik deleted the danny/kernel-716-cli-gemini-cua-template-action-broken branch December 22, 2025 21:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants