(path: Path | None, fallback: torch.Tensor, last_mtime: float | None)
| 114 | |
| 115 | |
| 116 | def _read_command_file(path: Path | None, fallback: torch.Tensor, last_mtime: float | None) -> tuple[torch.Tensor, float | None]: |
| 117 | if path is None or not path.exists(): |
| 118 | return fallback, last_mtime |
| 119 | stat = path.stat() |
| 120 | if last_mtime is not None and math.isclose(stat.st_mtime, last_mtime): |
| 121 | return fallback, last_mtime |
| 122 | command = _parse_handover_command(path.read_text(encoding="utf-8")) |
| 123 | return command, stat.st_mtime |
| 124 | |
| 125 | |
| 126 | @hydra_task_config(args_cli.task, args_cli.agent) |
no test coverage detected