Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion hermes_cli/kanban_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -1168,7 +1168,10 @@ def _cross_process_init_lock(path: Path):
else:
import fcntl

fcntl.flock(handle.fileno(), fcntl.LOCK_UN)
try:
fcntl.flock(handle.fileno(), fcntl.LOCK_UN)
except OSError:
pass
finally:
handle.close()

Expand Down
5 changes: 0 additions & 5 deletions mini_swe_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,11 +195,6 @@ def __init__(
self.cwd = cwd

# Setup logging
logging.basicConfig(
level=logging.DEBUG if verbose else logging.INFO,
format='%(asctime)s - %(levelname)s - %(message)s',
datefmt='%H:%M:%S'
)
self.logger = logging.getLogger(__name__)

# Initialize LLM client via centralized provider router.
Expand Down
5 changes: 4 additions & 1 deletion plugins/browser/firecrawl/provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,10 @@ def _headers(self) -> Dict[str, str]:
}

def create_session(self, task_id: str) -> Dict[str, object]:
ttl = int(os.environ.get("FIRECRAWL_BROWSER_TTL", "300"))
try:
ttl = int(os.environ.get("FIRECRAWL_BROWSER_TTL", "300"))
except (ValueError, TypeError):
ttl = 300

body: Dict[str, object] = {"ttl": ttl}

Expand Down
10 changes: 8 additions & 2 deletions plugins/platforms/discord/adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -588,8 +588,14 @@ def __init__(self, config: PlatformConfig):
self._voice_clients: Dict[int, Any] = {} # guild_id -> VoiceClient
self._voice_locks: Dict[int, asyncio.Lock] = {} # guild_id -> serialize join/leave
# Text batching: merge rapid successive messages (Telegram-style)
self._text_batch_delay_seconds = float(os.getenv("HERMES_DISCORD_TEXT_BATCH_DELAY_SECONDS", "0.6"))
self._text_batch_split_delay_seconds = float(os.getenv("HERMES_DISCORD_TEXT_BATCH_SPLIT_DELAY_SECONDS", "2.0"))
try:
self._text_batch_delay_seconds = float(os.getenv("HERMES_DISCORD_TEXT_BATCH_DELAY_SECONDS", "0.6"))
except (ValueError, TypeError):
self._text_batch_delay_seconds = 0.6
try:
self._text_batch_split_delay_seconds = float(os.getenv("HERMES_DISCORD_TEXT_BATCH_SPLIT_DELAY_SECONDS", "2.0"))
except (ValueError, TypeError):
self._text_batch_split_delay_seconds = 2.0
self._pending_text_batches: Dict[str, MessageEvent] = {}
self._pending_text_batch_tasks: Dict[str, asyncio.Task] = {}
self._voice_text_channels: Dict[int, int] = {} # guild_id -> text_channel_id
Expand Down
10 changes: 8 additions & 2 deletions plugins/platforms/google_chat/adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -540,8 +540,14 @@ def __init__(self, config: PlatformConfig):
# they don't sit in the chat forever as "Hermes is thinking…".
self._orphan_typing_messages: Dict[str, List[str]] = {}
# FlowControl knobs (env-configurable).
self._max_messages = int(os.getenv("GOOGLE_CHAT_MAX_MESSAGES", "1"))
self._max_bytes = int(os.getenv("GOOGLE_CHAT_MAX_BYTES", str(16 * 1024 * 1024)))
try:
self._max_messages = int(os.getenv("GOOGLE_CHAT_MAX_MESSAGES", "1"))
except (ValueError, TypeError):
self._max_messages = 1
try:
self._max_bytes = int(os.getenv("GOOGLE_CHAT_MAX_BYTES", str(16 * 1024 * 1024)))
except (ValueError, TypeError):
self._max_bytes = 16 * 1024 * 1024

# ------------------------------------------------------------------
# Configuration loading and validation
Expand Down
5 changes: 4 additions & 1 deletion plugins/platforms/irc/adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,10 @@ def __init__(self, config, **kwargs):

# Connection settings (env vars override config.yaml)
self.server = os.getenv("IRC_SERVER") or extra.get("server", "")
self.port = int(os.getenv("IRC_PORT") or extra.get("port", 6697))
try:
self.port = int(os.getenv("IRC_PORT") or extra.get("port", 6697))
except (ValueError, TypeError):
self.port = extra.get("port", 6697)
self.nickname = os.getenv("IRC_NICKNAME") or extra.get("nickname", "hermes-bot")
self.channel = os.getenv("IRC_CHANNEL") or extra.get("channel", "")
self.use_tls = (
Expand Down
5 changes: 4 additions & 1 deletion tools/browser_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -1178,7 +1178,10 @@ def _socket_safe_tmpdir() -> str:
# Session inactivity timeout (seconds) - cleanup if no activity for this long
# Default: 5 minutes. Needs headroom for LLM reasoning between browser commands,
# especially when subagents are doing multi-step browser tasks.
BROWSER_SESSION_INACTIVITY_TIMEOUT = int(os.environ.get("BROWSER_INACTIVITY_TIMEOUT", "300"))
try:
BROWSER_SESSION_INACTIVITY_TIMEOUT: int = int(os.environ.get("BROWSER_INACTIVITY_TIMEOUT", "300"))
except (ValueError, TypeError):
BROWSER_SESSION_INACTIVITY_TIMEOUT = 300

# Track last activity time per session
_session_last_activity: Dict[str, float] = {}
Expand Down
5 changes: 4 additions & 1 deletion tools/checkpoint_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,10 @@
]

# Git subprocess timeout (seconds).
_GIT_TIMEOUT: int = max(10, min(60, int(os.getenv("HERMES_CHECKPOINT_TIMEOUT", "30"))))
try:
_GIT_TIMEOUT: int = max(10, min(60, int(os.getenv("HERMES_CHECKPOINT_TIMEOUT", "30"))))
except (ValueError, TypeError):
_GIT_TIMEOUT = 30

# Max files to snapshot — skip huge directories to avoid slowdowns.
_MAX_FILES = 50_000
Expand Down
5 changes: 0 additions & 5 deletions trajectory_compressor.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,11 +352,6 @@ def __init__(self, config: CompressionConfig):
# Initialize OpenRouter client
self._init_summarizer()

logging.basicConfig(
level=logging.INFO,
format='%(asctime)s - %(levelname)s - %(message)s',
datefmt='%H:%M:%S'
)
self.logger = logging.getLogger(__name__)

def _init_tokenizer(self):
Expand Down
Loading