OpenHands icon indicating copy to clipboard operation
OpenHands copied to clipboard

feat(frontend): Add Continue button for rate-limited agent state

Open paul-wade opened this issue 7 months ago • 2 comments

  • [x] This change is worth documenting at https://docs.all-hands.dev/
  • [x] Include this change in the Release Notes. If checked, you must provide an end-user friendly description for your change below

End-user friendly description of the problem this fixes or functionality this introduces.

Added a "Continue" button that appears when the AI agent encounters rate limiting from LLM providers. This eliminates confusion around rate limit messages and provides an intuitive way to resume conversations without requiring users to manually type "continue" or guess how to restart the agent.


Summarize what the PR does, explaining any non-trivial design decisions.

This PR introduces a Continue button feature that improves the user experience when agents encounter rate limiting:

Problem Solved

When agents hit rate limits, users were left with unclear messaging and no obvious way to proceed. Many users found it repetitive to type "continue" repeatedly, while others found it non-intuitive to know what to do next, leading to workflow interruption and user frustration.

Solution

  • ActionSuggestions Component: New reusable component that displays contextual action buttons
  • Rate Limit Detection: Automatically shows Continue button when agent state is RATE_LIMITED
  • One-Click Resume: Users can resume their conversation with a single button click
  • Clear Visual Cue: Button appears prominently above the input area for maximum visibility

Technical Implementation

  • Component integrates seamlessly into existing chat interface
  • Maintains backward compatibility with all existing chat features
  • Uses existing agent state management and message sending infrastructure
  • Follows established patterns for internationalization and testing

Files Changed Summary

Core Implementation

  • frontend/src/components/features/chat/action-suggestions.tsx - Main component with Continue button logic
  • frontend/src/components/features/chat/chat-interface.tsx - Integration into chat interface
  • frontend/src/components/features/chat/action-suggestions.test.tsx - Comprehensive unit tests

Internationalization

  • frontend/src/i18n/translation.json - Multi-language support for Continue button
  • frontend/src/i18n/declaration.ts - TypeScript declarations for new translation keys

Testing

  • Unit tests cover component rendering, user interactions, and edge cases
  • Tests verify proper integration with agent state management
  • Maintains existing test coverage for chat interface functionality

paul-wade avatar Jun 13 '25 01:06 paul-wade

I was using this today and hit a rate limit and it was just very convenient... I thought a screenshot might help image

paul-wade avatar Jun 14 '25 15:06 paul-wade

Thanks for the PR! Since this is a UI change, I'll get back to this after a short discussion with other team members

amanape avatar Jun 16 '25 15:06 amanape

Hi! I think typically when the agent is rate-limited it will retry automatically. I have a PR to make this more obvious: https://github.com/All-Hands-AI/OpenHands/pull/9281

But I think we might not actually need a continue button here, since it will continue automatically anyway? In which case this PR could be closed (but thanks for helping out either way @paul-wade !)

I'll let @amanape pitch in too though.

neubig avatar Jun 23 '25 17:06 neubig

@neubig, if that's the case, I agree with you. However, in my experience, I created this for myself because the agent would often sit idle, rate-limited, and wouldn't retry until I provided further instructions.

I'll check to see if I can find anything about that. If there is a retry, then maybe the "fix" is to simply display the countdown in the rate limit message.

paul-wade avatar Jun 23 '25 17:06 paul-wade

We use to have a continue button in the past but removed it for UI/lack of necessity reasons

I'd prefer @neubig's solution since we already have a retry mechanism in place. Thanks for the PR but I'll close this issue for now.

amanape avatar Jun 30 '25 13:06 amanape