Check whether any agent or dev-server lock file exists at either location. Inspects the legacy root-level paths, the old ``.autocoder/`` paths, and the new ``.autoforge/`` paths so that a running agent is detected regardless of project layout. Returns: ``True`` if any ``.ag
(project_dir: Path)
| 172 | # --------------------------------------------------------------------------- |
| 173 | |
| 174 | def has_agent_running(project_dir: Path) -> bool: |
| 175 | """Check whether any agent or dev-server lock file exists at either location. |
| 176 | |
| 177 | Inspects the legacy root-level paths, the old ``.autocoder/`` paths, and |
| 178 | the new ``.autoforge/`` paths so that a running agent is detected |
| 179 | regardless of project layout. |
| 180 | |
| 181 | Returns: |
| 182 | ``True`` if any ``.agent.lock`` or ``.devserver.lock`` exists. |
| 183 | """ |
| 184 | lock_names = (".agent.lock", ".devserver.lock") |
| 185 | for name in lock_names: |
| 186 | if (project_dir / name).exists(): |
| 187 | return True |
| 188 | # Check both old and new directory names for backward compatibility |
| 189 | if (project_dir / ".autocoder" / name).exists(): |
| 190 | return True |
| 191 | if (project_dir / ".autoforge" / name).exists(): |
| 192 | return True |
| 193 | return False |
| 194 | |
| 195 | |
| 196 | # --------------------------------------------------------------------------- |
no outgoing calls
no test coverage detected