Danny/kernel 716 cli gemini cua template action broken #58
+61
−44
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
domSettleTimeoutMs→domSettleTimeoutmodelNameandmodelClientOptionsfrom constructorUpdated page access:
stagehand.page→stagehand.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
startingUrlandinstructionpayload parametersChanged default example to use magnitasks.com Kanban board demo (more reliable than YCombinator search)
Added
CuaTaskInputinterface for typed payload support📚 Documentation Updates
OPENAI_API_KEYfrom setup requirements--env-file .envapproach.env.exampleto remove unnecessary OpenAI keyTesting
make buildpassesmake testpasses/qacursor command passesRelated
Fixes KERNEL-716
Note
Cursor Bugbot is generating a summary for commit 5678806. Configure here.