mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-05 02:31:47 +00:00
fcntl is not available on Windows. This adds msvcrt.locking as a fallback for cross-process advisory locking on Windows. msvcrt.locking is not reentrant within the same thread, unlike fcntl.flock. This matters because resolve_codex_runtime_credentials holds the lock and then calls _save_codex_tokens, which tries to acquire it again. Without reentrancy tracking, this deadlocks on Windows after a 15-second timeout. Uses threading.local() to track lock depth per thread, allowing nested acquisitions to pass through without re-acquiring the underlying lock. Also handles msvcrt-specific requirements: file must be opened in r+ mode (not a+), must have at least 1 byte of content, and the file pointer must be at position 0 before locking. |
||
|---|---|---|
| .. | ||
| __init__.py | ||
| auth.py | ||
| banner.py | ||
| callbacks.py | ||
| codex_models.py | ||
| colors.py | ||
| commands.py | ||
| config.py | ||
| cron.py | ||
| doctor.py | ||
| gateway.py | ||
| main.py | ||
| models.py | ||
| pairing.py | ||
| runtime_provider.py | ||
| setup.py | ||
| skills_hub.py | ||
| status.py | ||
| tools_config.py | ||
| uninstall.py | ||