Skip to content

Conversation

@tembo
Copy link
Contributor

@tembo tembo bot commented Oct 16, 2025

Description

Adds a new Gemini computer-use example template to Create Kernel App, demonstrating Gemini 2.5's CUA capabilities with Stagehand.

Implementation Checklist

  • Implemented this change in TypeScript
  • Implemented this change in Python

Testing

  • All tests pass locally
  • Linted
  • Added tests for new functionality (if applicable)

Docs

  • Link to a PR in our docs repo documenting your change (if applicable)

Visual Proof

Related Issue

Fixes KERNEL-429

Additional Notes

Changes

Introduced gemini-cua template, updated index.ts for template options, invoke samples, and deployment. Added templates/typescript/gemini-cua directory.


Want me to make any changes? Add a review or comment with @tembo and i'll get back to work!

tembo.io linear.app


Note

Introduces a TypeScript Gemini Computer Use Agent template using Stagehand and updates the CLI to support selection, deployment, and invocation.

  • Templates:
    • New TypeScript template templates/typescript/gemini-cua:
      • Implements Gemini 2.5 Computer Use via Stagehand and Kernel (index.ts), registers action gemini-cua-task, and supports local run.
      • Adds supporting files: README.md, package.json, tsconfig.json, _gitignore.
  • CLI (index.ts):
    • Adds gemini-cua to TemplateKey, constants, and TEMPLATES (TypeScript-only).
    • Registers invoke sample (kernel invoke ts-gemini-cua gemini-cua-task) and app name mapping (ts-gemini-cua).
    • Adds deploy command requiring GOOGLE_API_KEY and OPENAI_API_KEY for TypeScript gemini-cua.
    • Updates --template option help text to include gemini-cua.

Written by Cursor Bugbot for commit e570dea. This will update automatically on new commits. Configure here.

@tembo
Copy link
Contributor Author

tembo bot commented Oct 16, 2025

Requesting review from @dprevoznik who has experience with the following files modified in this PR:

  • index.ts

@tembo tembo bot requested a review from dprevoznik October 16, 2025 16:23
@mesa-dot-dev
Copy link

mesa-dot-dev bot commented Oct 16, 2025

Mesa Description

Description

Adds a new Gemini computer-use example template to Create Kernel App, demonstrating Gemini 2.5's CUA capabilities with Stagehand.

Implementation Checklist

  • Implemented this change in TypeScript
  • Implemented this change in Python

Testing

  • All tests pass locally
  • Linted
  • Added tests for new functionality (if applicable)

Docs

  • Link to a PR in our docs repo documenting your change (if applicable)

Visual Proof

Related Issue

Fixes KERNEL-429

Additional Notes

Changes

  • Added gemini-cua TypeScript Template:
    • Created a new template directory templates/typescript/gemini-cua that demonstrates a Computer Use Agent (CUA) with Google's Gemini 2.5 and Stagehand for browser automation.
    • The template includes a sample Kernel app that automates navigating to YCombinator, finding a company, and generating a blog post.
    • Includes all necessary configuration files (package.json, tsconfig.json, README.md).
  • Updated CLI (index.ts):
    • Integrated the new gemini-cua template into the CLI's list of available templates.
    • Added invoke samples, registered app names, and updated command-line help text.
    • Modified the post-creation instructions to inform users about the required GOOGLE_API_KEY and OPENAI_API_KEY environment variables for this template.

Description generated by Mesa. Update settings

Copy link

@mesa-dot-dev mesa-dot-dev bot left a comment

Choose a reason for hiding this comment

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

Performed full review of 7a08da2...cc51343

Analysis

  1. Insufficient error handling, particularly around resource cleanup in failure scenarios, which could lead to resource leaks

  2. Lack of defensive error handling when cleanup operations themselves fail, potentially causing secondary failures

  3. While the integration with Kernel SDK, Stagehand, and Gemini 2.5 follows good architectural patterns, the error management across these integration points appears to be a weak spot

Tip

⚡ Quick Actions

This review was generated by Mesa.

Actions:

Slash Commands:

  • /review - Request a full code review
  • /review latest - Review only changes since the last review
  • /describe - Generate PR description. This will update the PR body or issue comment depending on your configuration
  • /help - Get help with Mesa commands and configuration options

6 files reviewed | 0 comments | Review on Mesa | Edit Reviewer Settings

async function runStagehandTask(invocationId?: string): Promise<SearchQueryOutput> {
// Executes a Computer Use Agent (CUA) task using Gemini 2.5 and Stagehand
//
// This function supports dual execution modes:
Copy link
Contributor

Choose a reason for hiding this comment

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

@tembo this section of comments is tool long. Can you leave the top comment in and remove "This function..." through "...Logs the result of the agent execution?"

@tembo
Copy link
Contributor Author

tembo bot commented Oct 20, 2025

I've removed the detailed function comments as requested, keeping only the top line that describes the Computer Use Agent functionality.

Updated browser clean up process + added more robust error messasging to the output.
removed unused variable that was declared but not used.
Update dependencies for Kernel + Zod to fix viewport sizing.
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 314c283 into main Oct 21, 2025
6 checks passed
@dprevoznik dprevoznik deleted the tembo/kernel-429-create-kernel-app-add-gemini-computer-use-example-to-create branch October 21, 2025 23:48
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