mirror of
https://github.com/All-Hands-AI/OpenHands.git
synced 2026-04-29 03:00:45 -04:00
* 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>
46 lines
674 B
Python
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.
|
|
"""
|