INNER CODE UNIT · Python
get_active_cmd_ids
yohey-w/multi-agent-shogun · scripts/slim_yaml.py:106
def get_active_cmd_ids():
"""Return command IDs in shogun_to_karo that are not terminal."""
queue_dir = get_queue_dir()
shogun_file = queue_dir / 'shogun_to_karo.yaml'
data = load_yaml(shogun_file)
key = 'commands' if 'commands' in data else 'queue'
commands = data.get(key, []) if isinstance(data, dict) else []
if not isinstance(commands, list):
return set()
active = set()
for cmd in commands:
if not isinstance(cmd, dict):
continue
if cmd.get('id') is None:
continue
if get_item_status(cmd) in TERMINAL_STATUSES: