Skip to content

HERD-36: a message with pictures no longer stays on "Sending…" - #121

Merged
makefunstuff merged 5 commits into
mainfrom
task/36-image-message-stuck-on-sending-issue-100
Nov 8, 2026
Merged

makefunstuff merged 5 commits into
mainfrom
task/36-image-message-stuck-on-sending-issue-100

Conversation

@makefunstuff

@makefunstuff makefunstuff commented Nov 8, 2026 •

Copy link
Copy Markdown
Owner

Fixes #100

In an agent's chat, a message sent with pictures stayed on Sending… until the chat was rebuilt (Terminal and back).

Why: a sent message stays pending until the agent's transcript shows it, and it is matched by its text. The app sends pictures as @path mentions in front of the words. Some agents record the pictures their own way: Claude Code as [Image #1] [Image #2] words, Codex and pi as image blocks next to the words. The pending copy then never matched. Rebuilding the chat dropped it, so the message then showed as sent.

What changed (core/…/chat/SentMatch.kt):

  • A picture message is matched by its words, without the mentions and the agent's marks ([Image #N], Codex's [image WxH …]). Pictures alone match a picture-only message. The same holds for the screen fallback.
  • Picture messages count up with the messages that have the same words, so each of two such messages needs its own match.
  • The pending check moved from AgentChat into SentMatch.unseen. It is tested with a Claude Code transcript line that has the marks and image blocks.
  • The bubble no longer shows Claude's [Image #N] among the words ("2 images attached" says it). The rest of the text is left exactly as written.

Checked for: classic herdr and herdr-core (both send the same text through AgentPort, and the matching is the same), one picture or several, and pictures alone. The Assistant and task chats confirm by the message's cid, not its text, so they never had this bug.

Tests: 14 new tests in SentMatchTest. Of the first 7, written before the fix, 5 failed on the old matching. ./gradlew -p core test and ./gradlew :app:testDebugUnitTest pass. New preview scene chat-pictures-sent: the fake agent records the two pictures as Claude Code does.

Shots (chat-pictures-sent)

before (dark) before (light) after (dark) after (light)

Task: HERD-36

🤖 Generated with Claude Code

makefunstuff and others added 5 commits November 8, 2026 14:31
A sent message stays pending until the transcript shows it, matched by its
text. A message with pictures goes as `@path` mentions before the words,
but an agent may record the pictures its own way: Claude Code as
`[Image #1]`, Codex and pi as image blocks beside the words. The pending
copy then never matched, and stayed on "Sending…" until the chat was
rebuilt (terminal and back).

SentMatch now takes a picture message as matched by its words (or, with
only pictures, by another picture-only message), in the transcript and on
the screen. The bubble no longer shows Claude's `[Image #N]` marks among
the words; "2 images attached" says it. New scene chat-pictures-sent.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s, unseen tested

- Pictures alone are found on the screen by Claude Code's `[Image #` too.
- Only the agents' own marks count as pictures (`[Image #1]`, Codex's
  `[image 1024x768 PNG]`); the person's own `[image of …]` stays words,
  on both sides of the match.
- The pending check moved from AgentChat to SentMatch.unseen, tested with a
  Claude Code transcript line that carries its marks and image blocks.
- The regexes are built once.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…bble keeps its spacing

- unconfirmed keys a picture message by its words, so two picture messages
  (or two with the same words) each need their own match.
- The bubble strips only the agent's marks (SentMatch.withoutMarks): an
  indented trace sent with a screenshot keeps its indentation.
- The screen count's limit for pictures alone is written down.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… count up together

- unconfirmed keys a picture message by its words, like a plain one; only
  pictures alone get their own key. The match goes both ways (words sent
  alone match a message the agent shows with picture marks), so neither of
  two such messages is confirmed early or left pending.
- withoutMarks takes a mark's line break with it and keeps the first line's
  indentation; text without a mark is left as it is.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@makefunstuff
makefunstuff merged commit 8916b0f into main Nov 8, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Image upload stays stuck on "sending" in the chat view

1 participant