MCPcopy Create free account
hub / github.com/AutoForgeAI/autoforge / has_agent_running

Function has_agent_running

autoforge_paths.py:174–193  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

172# ---------------------------------------------------------------------------
173
174def 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# ---------------------------------------------------------------------------

Callers 3

delete_projectFunction · 0.90
reset_projectFunction · 0.90
migrate_project_layoutFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected