diff --git a/api/src/opentrons/protocol_engine/state/commands.py b/api/src/opentrons/protocol_engine/state/commands.py index 8a4098b0a8b..cd20920c81e 100644 --- a/api/src/opentrons/protocol_engine/state/commands.py +++ b/api/src/opentrons/protocol_engine/state/commands.py @@ -520,6 +520,8 @@ def get_slice( queued_command_ids = self._state.command_history.get_queue_ids() total_length = self._state.command_history.length() + # TODO(mm, 2024-05-17): This looks like it's attempting to do the same thing + # as self.get_current(), but in a different way. Can we unify them? if cursor is None: if running_command is not None: cursor = running_command.index diff --git a/robot-server/robot_server/maintenance_runs/maintenance_run_data_manager.py b/robot-server/robot_server/maintenance_runs/maintenance_run_data_manager.py index 084a7552a3a..b18fa4eb4dd 100644 --- a/robot-server/robot_server/maintenance_runs/maintenance_run_data_manager.py +++ b/robot-server/robot_server/maintenance_runs/maintenance_run_data_manager.py @@ -184,7 +184,10 @@ def get_commands_slice( return the_slice def get_current_command(self, run_id: str) -> Optional[CurrentCommand]: - """Get the currently executing command, if any. + """Get the "current" command, if any. + + See `ProtocolEngine.state_view.commands.get_current()` for the definition + of "current." Args: run_id: ID of the run. diff --git a/robot-server/robot_server/runs/command_models.py b/robot-server/robot_server/runs/command_models.py index 281223bd155..e68ebb062d2 100644 --- a/robot-server/robot_server/runs/command_models.py +++ b/robot-server/robot_server/runs/command_models.py @@ -49,5 +49,9 @@ class CommandCollectionLinks(BaseModel): current: Optional[CommandLink] = Field( None, - description="Path to the currently running or next queued command.", + description=( + 'Information about the "current" command.' + ' The "current" command is the one that\'s running right now,' + " or, if there is none, the one that was running most recently." + ), ) diff --git a/robot-server/robot_server/runs/run_data_manager.py b/robot-server/robot_server/runs/run_data_manager.py index 311cfb93b40..060167a5a46 100644 --- a/robot-server/robot_server/runs/run_data_manager.py +++ b/robot-server/robot_server/runs/run_data_manager.py @@ -373,7 +373,10 @@ def get_commands_slice( ) def get_current_command(self, run_id: str) -> Optional[CurrentCommand]: - """Get the currently executing command, if any. + """Get the "current" command, if any. + + See `ProtocolEngine.state_view.commands.get_current()` for the definition + of "current." Args: run_id: ID of the run.