INNER CODE UNIT · Python
_get_agent_branch
browser-use/bux · agent/box_agent.py:66
def _get_agent_branch() -> str:
"""Branch the agent repo is currently tracking. Lets the cloud surface
"on stable" vs "on main" so users know whether they're pinned."""
try:
import subprocess
out = subprocess.run(
['git', '-C', str(REPO_DIR), 'rev-parse', '--abbrev-ref', 'HEAD'],
capture_output=True,
text=True,
timeout=3,
)
if out.returncode == 0:
return out.stdout.strip()
except Exception:
pass
return 'unknown'