Skip to content

[Bug]: Guardrails against infinite loops #7960

@JGKle

Description

@JGKle

Is there an existing issue for the same bug? (If one exists, thumbs up or comment on the issue instead).

  • I have checked the existing issues.

Describe the bug and reproduction steps

The biggest "operational" issue I've noticed with OpenHands is that sometimes it gets stuck in a logical loop, and goes on infinitely, burning tokens until you notice & stop it. It seems like there should be some kind of guard rails against this. For example, I've seen it doing things like: Let me try to build the application; OK, first let's install (package X); Let me try to build the application; OK, first let's install (package X); and so on and so on, because one or the other didn't work.

Similar but not quite identical, I've seen it do things like "Let me fix the remaining indentation" many times in a row. I realized that it's actually continuing to go a few lines at a time changing the indentation, but this is a ton of back-and-forth / tokens, so it seems like it should be caught by a similar guardrail - i.e. at a certain point say "It looks like we might be stuck - would you like me to continue?" That way it won't just keep burning tokens on non-productive work.

OpenHands Installation

Docker command in README

OpenHands Version

0.33.0

Operating System

WSL on Windows

Logs, Errors, Screenshots, and Additional Context

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    StaleInactive for 40 daysbugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions