hermes-agent/gateway
Gutslabs 3af3c4eb8c fix(misc): three small defensive fixes from PR #1974
Salvages the three substantive low-severity fixes from Gutslabs' #1974
"misc bug fixes" bundle.  The other 8 claims in that PR were either
already fixed on main with superior implementations (state lock,
firecrawl lazy import, fcntl/msvcrt guard, path normalization, schema
migrations) or did not survive review.

- run_agent: `_materialize_data_url_for_vision` uses
  `NamedTemporaryFile(delete=False)`; if `base64.b64decode` raises on a
  corrupt data URL the temp file would persist forever.  Wrap the
  write in try/except and `os.unlink` the temp on failure.

- gateway/session: `append_to_transcript` JSONL write had no error
  handling, so disk-full / read-only-fs / permission errors crashed the
  message handler.  The SQLite write above is the primary store, so
  swallow OSError on the JSONL fallback with a debug log.

- gateway/status: `_read_pid_record` reads `pid_path.read_text()` after
  an `exists()` check; if the PID file is deleted between the two
  calls (concurrent gateway restart) we hit an unhandled OSError.
  Catch it and return None.

Adds a regression test for the tempfile cleanup; the other two paths
are defensive try/excepts on infrequent OSError that don't warrant
dedicated tests.

Co-authored-by: Teknium <127238744+teknium1@users.noreply.github.com>
2026-05-10 22:28:01 -07:00
..
assets fix: improve telegram topic mode setup 2026-05-04 12:07:17 -07:00
builtin_hooks
platforms perf(gateway): tune Telegram cadence + adaptive fast-path for short replies 2026-05-10 22:22:25 -07:00
__init__.py
channel_directory.py
config.py perf(gateway): tune Telegram cadence + adaptive fast-path for short replies 2026-05-10 22:22:25 -07:00
delivery.py fix(gateway): preserve case-sensitive chat IDs in DeliveryTarget.parse 2026-05-01 14:01:26 -07:00
display_config.py perf(gateway): tune Telegram cadence + adaptive fast-path for short replies 2026-05-10 22:22:25 -07:00
hooks.py
mirror.py
pairing.py fix(pairing): enforce lockout on approve_code, not just generate_code (#10195) (#21325) 2026-05-07 07:18:21 -07:00
platform_registry.py feat(plugins): add standalone_sender_fn for out-of-process cron delivery 2026-05-09 02:56:29 -07:00
restart.py
run.py fix(security): sanitize env and redact output in quick commands + remove write-only _pending_messages 2026-05-10 22:12:23 -07:00
runtime_footer.py
session.py fix(misc): three small defensive fixes from PR #1974 2026-05-10 22:28:01 -07:00
session_context.py
shutdown_forensics.py feat(gateway): shutdown forensics — non-blocking diag, per-phase timing, stale-unit warning (#23285) 2026-05-10 09:01:51 -07:00
slash_access.py feat(gateway): per-platform admin/user split for slash commands (salvage of #4443) (#23373) 2026-05-10 12:33:54 -07:00
status.py fix(misc): three small defensive fixes from PR #1974 2026-05-10 22:28:01 -07:00
sticker_cache.py
stream_consumer.py perf(gateway): tune Telegram cadence + adaptive fast-path for short replies 2026-05-10 22:22:25 -07:00
whatsapp_identity.py