Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add agent control features: prompt enhancement, pause/resume, context… #200

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

iGotYourBackMr
Copy link

@iGotYourBackMr iGotYourBackMr commented Jan 29, 2025

Added Agent Control Features

This PR introduces three key quality-of-life improvements for users:

  1. Prompt Enhancement Button

    • Adds "Enhance" buttons next to task description, context input, and update context fields
    • Uses the currently selected LLM to improve prompts in-place
    • Maintains workflow continuity by avoiding context switching
  2. Pause/Resume Functionality ⏯️

    • Adds pause/resume controls for agent execution
    • Implements safe state management through _global_agent_state
    • Maintains browser context during pauses
  3. Context Update System 🧠

    • Allows mid-operation context updates via text input
    • Integrates with existing agent state management
    • Supports LLM-enhanced context updates using the same model

Implementation Details

  • State Management: Extended AgentState class with pause/resume capabilities
  • UI Integration: Added Gradio components with proper state synchronization
  • Safety: Ensured browser context persistence during pauses
  • Performance: Maintained existing execution patterns while adding new capabilities

Note:
While this may not be the fanciest implementation, it's been tested (with Gemini only but should work in general) to work reliably in these common scenarios:

  • Interrupting long-running operations
  • Updating context during complex tasks
  • Enhancing prompts across different LLM providers

Notes for Maintainers

  • Backwards compatible with existing workflows
  • No additional dependencies required
  • Includes error handling for state transitions
  • Follows existing patterns in the codebase

Screenshot :
image

(Worth noting, I have used Cursor to make this work, I am no programmer myself but I am learning)

@CLAassistant
Copy link

CLAassistant commented Jan 29, 2025

CLA assistant check
All committers have signed the CLA.

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.

2 participants