anthropics / anthropics/claude-code

[BUG]

オープン
#91,112 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
area:core area:providers bug platform:macos
主要言語
Python
スター
145k
フォーク
23.1k
PR マージ指標
PR 指標を取得中

説明

### Preflight Checklist

- [x] I have searched [existing issues](https://github.com/anthropics/claude-code/issues?q=is%3Aissue%20state%3Aopen%20label%3Abug) and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code

### What's Wrong?

# Bug: image input kills the session — glm-5.3:cloud via Ollama

**Date:** 2026-08-31 · **Found in:** Claude Code (VS Code terminal, macOS 26 / Apple Silicon)

## Symptom

- Pasting/reading an image in Claude Code fires a red `API Error` instantly.
- Every subsequent prompt repeats the same error — the session is permanently bricked.
- Bricked session produces no handoff or memory updates for the next instance.

## Root cause — two separate failures

**Layer 1 — the 400 itself is the provider's, and it is correct:**
- Claude Code → local Ollama (`ANTHROPIC_BASE_URL=http://127.0.0.1:11434`, v0.31.1) → ollama.com cloud (`glm-5.3:cloud`).
- CC forwarded the image intact; server replied `400 this model does not support image input (ref: b1feda6a-…)`.
- `ollama show glm-5.3:cloud` confirms: capabilities are **completion, thinking, tools** — **no vision**. The model card's image claim doesn't hold for the `:cloud` serving path.

**Layer 2 — the brick is Claude Code's:**
- The rejected image stayed in the conversation history as a 634KB tool_result.
- A deterministic 400 can't be fixed by retry, but CC re-sends full history every turn → every prompt re-fails identically, with no recovery affordance offered.

## Recovery

- **Live session:** press **Esc Esc** (rewind) to the point *before* the image was fetched — this truncates the transcript and un-bricks the session.
- **Closed session:** strip the image from the on-disk transcript (with backup), then `claude --resume`:
`~/.claude/projects/-Volumes-HOMEX-…-clients-wcb/48397606-b5d4-4222-8f41-56f0cdf48f38.jsonl` (image at line 12).

## Prevention

- Treat `glm-5.3:cloud` as text-only in Claude Code. Check `ollama show ` for a vision capability before pasting images.
- On any deterministic 400: rewind immediately (Esc Esc) rather than continuing to prompt.

## Reported upstream

- Claude Code feedback report drafted (session-brick behavior): a deterministic 400 should offer to strip the offending message from history instead of re-failing forever.

### What Should Happen?

CC should be able to absorb the image and chat about it.

### Error Messages/Logs

```shell
See report above
```

### Steps to Reproduce

See report above

### Claude Model

Other

### Is this a regression?

I don't know

### Last Working Version

I don't know

### Claude Code Version

Claude Code v2.1.252

### Platform

Other

### Operating System

macOS

### Terminal/Shell

Terminal.app (macOS)

### Additional Information

Nope. Thought you should know. Doubt if you care...but your user community might!

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

調査の方向性

No source file or test is named. Start by reproducing the unsupported-image 400 with Ollama's glm-5.3:cloud model, then inspect the session transcript path and the Esc Esc rewind behavior described in the report. Done means a deterministic provider rejection no longer bricks the session and the user has a recovery path without repeated failures.

索引モデルが issue の本文から書いたものです。

評価

技術スタック
macos, ollama, python
領域
backend, cli
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
活発
明瞭さ
おおむね明確
初心者へのやさしさ
48/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。