hermes-agent/agent
teknium1 33ab5cec82 fix: handle None message content across codebase (fixes #276)
The OpenAI API returns content: null on assistant messages with tool
calls. msg.get('content', '') returns None when the key exists with
value None, causing TypeError on len(), string concatenation, and
.strip() in downstream code paths.

Fixed 4 locations that process conversation messages:
- agent/auxiliary_client.py:84 — None passed to API calls
- cli.py:1288 — crash on content[:200] and len(content)
- run_agent.py:3444 — crash on None.strip()
- honcho_integration/session.py:445 — 'None' rendered in transcript

13 other instances were verified safe (already protected, only process
user/tool messages, or use the safe pattern).

Pattern: msg.get('content', '') → msg.get('content') or ''

Fixes #276
2026-03-02 02:23:53 -08:00
..
__init__.py Refactor Terminal and AIAgent cleanup 2026-02-21 22:31:43 -08:00
auxiliary_client.py fix: handle None message content across codebase (fixes #276) 2026-03-02 02:23:53 -08:00
context_compressor.py fix(agent): handle None content in context compressor (fixes #211) 2026-03-02 01:35:52 -08:00
display.py fix(display): use spaces instead of ANSI \033[K in print_above() for prompt_toolkit compat 2026-02-28 23:19:23 -08:00
model_metadata.py Refactor Terminal and AIAgent cleanup 2026-02-21 22:31:43 -08:00
prompt_builder.py Harden agent attack surface: scan writes to memory, skills, cron, and context files 2026-02-25 23:43:15 -05:00
prompt_caching.py Refactor Terminal and AIAgent cleanup 2026-02-21 22:31:43 -08:00
redact.py refactor(cli, auth): Add Codex/OpenAI OAuth Support - finalized 2026-02-28 21:56:27 -08:00
skill_commands.py feat(skills): implement dynamic skill slash commands for CLI and gateway 2026-02-28 11:18:50 -08:00
trajectory.py Refactor Terminal and AIAgent cleanup 2026-02-21 22:31:43 -08:00