Skip to content

fix(honcho): sync_turn crashes on list input from image-bearing messages#22768

Open
ikelvingo wants to merge 1 commit into
NousResearch:mainfrom
ikelvingo:fix/honcho-sync-turn-multimodal
Open

fix(honcho): sync_turn crashes on list input from image-bearing messages#22768
ikelvingo wants to merge 1 commit into
NousResearch:mainfrom
ikelvingo:fix/honcho-sync-turn-multimodal

Conversation

@ikelvingo

Copy link
Copy Markdown
Contributor

What does this PR do?

Fix TypeError: expected string or bytes-like object, got 'list' in the Honcho memory plugin when processing messages that carry multimodal content (e.g. WeChat images, custom emoji, platform-native sticker packs).

Related Issue

Fixes #

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Security fix
  • Documentation update
  • Tests (adding or improving test coverage)
  • Refactor (no behavior change)
  • New skill (bundled or hub)

Changes Made

  • plugins/memory/honcho/__init__.pysync_turn:
    • Expand type annotation to str | list for both user_content and assistant_content
    • Add inline _extract_text() helper that extracts type=="text" parts from multimodal lists and discards image_url / other non-text parts
    • Before calling sanitize_context, normalize content through _extract_text()
  • Text is written to Honcho; image references are excluded from memory (memory providers should not store image URIs)

How to Test

  1. Send a WeChat message containing an image or custom emoji — observe no TypeError in honcho dialectic log
  2. Send a plain text message — confirm sync_turn behavior is unchanged (backward compatible)
  3. Run pytest tests/ -q if test suite exists for honcho plugin

Checklist

Code

  • I've read the Contributing Guide
  • My commit messages follow Conventional Commits (fix(scope):, feat(scope):, etc.)
  • I searched for existing PRs to make sure this isn't a duplicate
  • My PR contains only changes related to this fix/feature (no unrelated commits)
  • I've run pytest tests/ -q and all tests pass
  • I've added tests for my changes (required for bug fixes, strongly encouraged for features)
  • I've tested on my platform: Linux (Honcho Local self-hosted)

Documentation & Housekeeping

  • I've updated relevant documentation (README, docs/, docstrings) — or N/A
  • I've updated cli-config.yaml.example if I added/changed config keys — or N/A
  • I've updated CONTRIBUTING.md or AGENTS.md if I changed architecture or workflows — or N/A
  • I've considered cross-platform impact (Windows, macOS) per the compatibility guide — or N/A (pure Python logic, no platform-specific code)
  • I've updated tool descriptions/schemas if I changed tool behavior — or N/A

Screenshots / Logs

Before fix: TypeError: expected string or bytes-like object, got 'list' in honcho dialectic log when processing image-bearing messages.
After fix: Message is processed normally; only text content is written to Honcho; image references are discarded.

@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have comp/plugins Plugin system and bundled plugins tool/memory Memory tool and memory providers labels May 9, 2026
ikelvingo added a commit to ikelvingo/hermes-agent that referenced this pull request May 31, 2026
…stent session

Port of NousResearch#18251:
- model_tools.py: add _get_worker_session() with thread-local persistent
  aiohttp.ClientSession bound to each worker thread's event loop
- gateway/platforms/weixin.py: remove _LIVE_ADAPTERS lazy-reuse block in
  send_weixin_direct(), use _get_worker_session() instead

fix(honcho): sync_turn handles multimodal (list) content from image-bearing messages

Port of NousResearch#22768:
- plugins/memory/honcho/__init__.py: expand type annotation to str | list
  for user_content and assistant_content; add _extract_text() helper to
  extract text parts from multimodal lists before sanitize_context()
- image references are excluded from memory (memory providers should not
  store image URIs)
ikelvingo added a commit to ikelvingo/hermes-agent that referenced this pull request Jun 4, 2026
Port of upstream f24b7ed (fix: make Honcho startup fail open):
- plugins/memory/honcho/__init__.py: refactor startup to background thread
  via _start_session_init_background(), add _session_ready() guard, and
  new _init_thread/_init_lock/_init_error fields for fail-open behavior
- tests/test_honcho_startup_fail_open.py: add 357-line test suite

Port of NousResearch#22768 (fix(honcho): sync_urn crashes on list input from
image-bearing messages):
- plugins/memory/honcho/__init__.py: expand sync_urn type annotation
  to str | list for user_content and assistant_content; add _extract_text()
  helper to extract text parts from multimodal lists; image references
  are excluded from memory (memory providers should not store image URIs)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/plugins Plugin system and bundled plugins P3 Low — cosmetic, nice to have tool/memory Memory tool and memory providers type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants