#1055·claudian

Sending an image to a non-multimodal model permanently poisons the conversation

Author: hufangyu99Created Aug 5, 2026Updated Sep 30, 2026
Labelsstale

Bug Report: Sending an image to a non-multimodal model permanently poisons the conversation

Plugin: Claudian (realclaudian) Version: 2.1.0 (also present in 2.0.21) Author: Yishen Tu Severity: High — conversation becomes permanently unusable Vault: designerdoc (Obsidian)


Summary

When a user selects a non-multimodal model (e.g. deepseek-v4-flash) and attaches/sends an image in a conversation, the turn errors out, and that conversation becomes permanently unusable — every subsequent retry fails with a conversation error and the conversation can never be used again.

Root cause: image support is gated by a constant per-provider flag (supportsImageAttachments: true) that ignores whether the specific selected model is multimodal. When the non-multimodal runtime rejects the image block, the plugin clears the native provider session; on the next turn it then replays the full conversation history — including the failed image message — which gets rejected again, producing an infinite failure loop.


Reproduction

  1. In Claudian, create a conversation and select a non-multimodal model (e.g. deepseek-v4-flash).
  2. Attach an image (paste/drag) and send it.
  3. The turn errors out ("conversation error").
  4. Send any follow-up message → fails again. The conversation is now permanently broken; only creating a new conversation works.

Observed persisted state

In the vault's .claudian/sessions/<conv>.inputs.json, the poisoned conversation contains a user record for the image with:

json
{
  "state": "accepted",
  "images": [ { "mediaType": "image/png", "data": "<base64>" } ],
  "providerUserMessageId": "<uuid>"
}

…but no providerAssistantMessageId — the message was recorded as accepted but never completed. Follow-up messages in the same conversation also lack an assistant id.


Root cause / code trace

All code below is from realclaudian/main.js (minified).

1. Image support is a constant per provider, not per model

The capability flag is baked into each provider's frozen capability object:

javascript
var CLAUDE_PROVIDER_CAPABILITIES = {
  providerId: "claude",
  supportsImageAttachments: true,   // <-- constant
  ...
};
// same for codex / grok / opencode / pi — all true

This flag is applied to the UI regardless of the selected model:

javascript
u.setAgentService(...);
(p = t.ui.imageContextManager) == null || p.setEnabled(n.supportsImageAttachments);

There is no check anywhere that the currently-selected model is multimodal before enabling image attach or before sending.

2. The image is unconditionally embedded in the outgoing message

javascript
function iat(t, e) {
  let n = [];
  for (let i of (e != null ? e : []))
    n.push({ type: "image", source: { type: "base64", media_type: i.mediaType, data: i.data } });
  return t.trim() && n.push({ type: "text", text: t }), n;
}

and later:

javascript
// user payload
input: [ ...(t.canonicalText ? [{ type: "text", text: t.canonicalText }] : []),
         ...t.images.map(n => ({ type: "image", image: n })) ],

The non-multimodal model rejects this block → the runtime emits a native_error.

3. A generic native_error clears the provider session

javascript
if (d.type === "native_error") {
  this.activeRun
    ? this.finishError(this.activeRun, new Error(d.message),
        d.code === "provider_session_missing" ? d.providerSessionId : void 0)
    : ...
}

finishError clears the session for any category other than provider_session_missing:

javascript
function mpe(t, e, n) { ... { category: "provider", ... recoverable: !0 } }

finishError(...) {
  let r = mpe(n, this.providerSessionId);
  r.category === "configuration" || r.category === "authentication"
    ? this.setStatus("idle")
    : (r.category !== "provider-session-missing" && this.clearProviderSession(), ...)
}
javascript
clearProviderSession() { this.providerSessionId = null; this.deleteProviderStateValue("providerSessionId"); }

4. With the session cleared, the next turn REPLAYS full history — including the failed image

javascript
shouldReplayConversationHistory(e) {
  return (n = e.conversationHistory) != null && n.length
    ? this.config.nativePersistence === "disabled-if-supported"
      ? !0
      : !this.getNativeResumeSessionId() || this.replayHistoryOnNextTurn
    : !1;
}

getNativeResumeSessionId() returns null right after clearProviderSession(), so shouldReplayConversationHistory returns true. The replay path re-encodes the whole history:

javascript
// encode(): conversationHistory folded back into the prompt
if ((o = t.conversationHistory) != null && o.length) {
  let s = [...t.conversationHistory];
  i = nl(fa(s), i, i, s);
}

Because the failed image record was persisted with state: "accepted" and a providerUserMessageId, it is treated as already-delivered history and replayed → rejected again → clearProviderSession() again → replay again. Infinite loop.


Why the conversation is "permanently" broken

  • The image message is committed to the input ledger as accepted and carries a providerUserMessageId, so the plugin believes it was successfully delivered and will not drop it.
  • Because it has no providerAssistantMessageId, the turn never completed, and there is no valid native session to resume.
  • Every retry re-enters the replay loop with the same unsupported image block, so it fails identically forever.

Suggested fixes

  1. Gate image support by model, not by provider. Determine per-model multimodality (e.g. from the model catalog / provider metadata) and set supportsImageAttachments accordingly, or reject image attachment in the composer before send when the selected model is not multimodal.

  2. Do not replay uncompleted (no providerAssistantMessageId) user messages in history replay. When a native_error triggers clearProviderSession + history replay, drop any user record that has a providerUserMessageId but no corresponding providerAssistantMessageId (and no successful assistant completion), instead of feeding it back into the replay.

  3. On replay, skip image blocks whose model is not multimodal rather than re-sending them and looping.

  4. Consider marking the image send as staged/not accepted until the assistant confirms, so a rejected send can be rolled back from history instead of being committed.


Workaround for users

  • Avoid attaching images when a non-multimodal model is selected.
  • To recover an already-poisoned conversation: rewind/truncate before the image message (via the plugin's rewind, which calls truncateConversationInputsFrom and releases the session binding), or manually remove the image record (and any subsequent orphaned records) from the conversation's .claudian/sessions/<conv>.inputs.json, or simply start a new conversation.

Prepared from static analysis of realclaudian/main.js v2.1.0 and inspection of persisted conversation state in the vault.