Skip to content

Conversation

@atchudhansg
Copy link

Add Custom Task System for BrowserGym

Summary

Adds a custom task framework that allows users to create domain-specific BrowserGym tasks without depending on official benchmark packages.

Changes

  • Custom task framework: Base classes, models, and registry system for creating tasks
  • Example tasks: Copy-paste (single-tab) and copy-paste-multitab implementations
  • Documentation: Comprehensive guide in README with examples and best practices
  • Example script: browsergym_custom_example.py demonstrating usage
  • Test coverage: Basic tests for custom task system

Key Features

  • No BrowserGym package dependencies required
  • Direct Playwright browser control
  • Simple registration system
  • Rapid prototyping for domain-specific tasks
  • Follows MiniWoB design philosophy (minimal HTML, functional UI)

Usage

env = BrowserGymEnv(environment={
    "BROWSERGYM_BENCHMARK": "custom",
    "BROWSERGYM_TASK_NAME": "copy-paste"
})

Files Changed

  • custom - Custom task system implementation
  • README.md - Updated with custom tasks documentation
  • browsergym_custom_example.py - Usage example
  • .gitignore - Added myenv to exclude virtual environments

- Add custom task framework with base classes and models
- Implement copy-paste tasks (single-tab and multi-tab)
- Add comprehensive documentation in README
- Include example script for custom tasks
- Update .gitignore to exclude virtual environments
@meta-cla meta-cla bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 16, 2025
@atchudhansg atchudhansg changed the title feat: Add custom task system for BrowserGym environment Add custom task system for BrowserGym environment Nov 16, 2025
@pankit-eng
Copy link
Contributor

@atchudhansg - thanks for sharing this PR. Supporting generic integration with training tasks is definitely part of the roadmap(cc: @Darktex ) but we are still in early stages of other features. That being said, does it make sense to have an RFC on how we will support tasks more generically that run inside/alongside OpenEnv? This wont be specific to browser tasks only. Let me know what you think.

@atchudhansg
Copy link
Author

Thanks for the feedback! I completely agree that a generic approach for custom tasks across all OpenEnv environments (not just BrowserGym) would be valuable.

I've drafted an RFC (RFC 005) to propose a standardized interface for this. The core idea is to allow users to inject task logic (rewards, observations, termination) at runtime without needing to rebuild containers or modify the core environment code.

I've added the RFC file (rfcs/005-generic-task-integration.md) to this PR for review. Let me know your thoughts on the proposed interface!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants