Files
OpenHands/opendevin/schema/task.py
Leo 1356da8795 feat: support controlling agent task state. (#1094)
* feat: support controlling agent task state.

* feat: add agent task state to agent status bar.

* feat: add agent task control bar to FE.

* Remove stop agent task action.

* Merge pause and resume buttons into one button; Add loading and disabled status for action buttons.

* Apply suggestions from code review

---------

Co-authored-by: Robert Brennan <accounts@rbren.io>
2024-04-18 11:09:00 +00:00

46 lines
674 B
Python

from enum import Enum
class TaskState(str, Enum):
INIT = 'init'
"""Initial state of the task.
"""
RUNNING = 'running'
"""The task is running.
"""
PAUSED = 'paused'
"""The task is paused.
"""
STOPPED = 'stopped'
"""The task is stopped.
"""
FINISHED = 'finished'
"""The task is finished.
"""
ERROR = 'error'
"""An error occurred during the task.
"""
class TaskStateAction(str, Enum):
START = 'start'
"""Starts the task.
"""
PAUSE = 'pause'
"""Pauses the task.
"""
RESUME = 'resume'
"""Resumes the task.
"""
STOP = 'stop'
"""Stops the task.
"""