Generate a stable-enough per-process instance identifier.
()
| 36 | |
| 37 | |
| 38 | def _default_instance_id() -> str: |
| 39 | """Generate a stable-enough per-process instance identifier.""" |
| 40 | host = socket.gethostname() or "unknown" |
| 41 | pid = os.getpid() |
| 42 | suffix = uuid.uuid4().hex[:8] |
| 43 | return f"{host}-{pid}-{suffix}" |
| 44 | |
| 45 | |
| 46 | def _default_agent_template_dir() -> str: |