Skip to content

fix(cli): handle multimodal interrupt payloads in re-queue - #12751

Closed
nicoechaniz wants to merge 1 commit into
NousResearch:mainfrom
nicoechaniz:fix/interrupt-multimodal-requeue
Closed

fix(cli): handle multimodal interrupt payloads in re-queue#12751
nicoechaniz wants to merge 1 commit into
NousResearch:mainfrom
nicoechaniz:fix/interrupt-multimodal-requeue

Conversation

@nicoechaniz

Copy link
Copy Markdown
Contributor

Summary

When a multimodal interrupt payload (e.g. pasted/attached images) is queued after Ctrl+C, the requeue logic in HermesCLI crashes because it tries to "\n".join() a list containing (text, images) tuples.

Problem

The interrupt queue can contain tuples when the incoming message has image attachments. The existing code does:

combined = "\n".join(all_parts)

This fails with a TypeError when all_parts contains tuples.

Fix

Normalize multimodal payloads before joining:

  • Split text and images from tuples
  • Combine text parts with \n as before
  • Preserve image attachments by returning (combined_text, images) when images are present
  • Update the preview logic to use only the text portion

Testing

  • Manually tested with interrupt requeue containing pasted images
  • Flat text interrupts continue to work unchanged

@nicoechaniz
nicoechaniz force-pushed the fix/interrupt-multimodal-requeue branch from d6e069c to b0dcde0 Compare April 20, 2026 05:28
@nicoechaniz

Copy link
Copy Markdown
Contributor Author

Hi @teknium1 — this fixes a crash when multimodal payloads (pasted images) get re-queued after Ctrl+C interrupt. Rebased on latest main and ready for review. Thanks!

@nicoechaniz
nicoechaniz force-pushed the fix/interrupt-multimodal-requeue branch from b0dcde0 to 37a2d8a Compare April 22, 2026 02:24
@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/cli CLI entry point, hermes_cli/, setup wizard labels Apr 22, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Related to #5202 — same multimodal interrupt requeue fix. May be duplicate.

@alt-glitch

Copy link
Copy Markdown
Collaborator

Related to #5202.

When a user interrupts with an image paste/attachment, the payload is a
tuple (text, images). The post-interrupt re-queue code did
'\n'.join(all_parts) which crashed with:

  TypeError: sequence item 0: expected str instance, tuple found

Split text and images from each part, combine text with join, and
preserve image attachments so process_loop can unpack them normally.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/cli CLI entry point, hermes_cli/, setup wizard P2 Medium — degraded but workaround exists type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants