Skip to content

Session image resend exceeds gateway 8-image cap per request #192

Open

Description

@Siddhesh2377

What is broken

A coding session resends earlier images on every later turn. The whole conversation history is sent as one request to the hosted chat gateway.

The gateway allows at most 8 images per request (InferenceInfra constants.toml [chat_images] max_per_request = 8, shared by every chat model that accepts pictures: deepseek-v4.1-flash and glm-5.3-flash). Pasting a 9th image into a new message in the same session is rejected even when that message alone has only one image.

Gateway error text: This request carries N images; {model} takes at most 8 per request.

GET /v1/models does not expose an image count, so Wally cannot read the cap from the catalog. MiMo (mimo-v2.6-pro) is text-only. Eve is a decisions model and is not under this cap.

Only Claude Code and Claude Desktop send traffic through Wally's Anthropic translator. OpenCode, Hermes, OpenClaw, the DeepSeek harness (dsh), and Prime Agent post the session themselves.

Why

Multi-turn sessions accumulate image blocks in the payload. There is no client-side trim aligned with the gateway limit before the request is sent (or before translation), so a later turn can exceed 8 images total while the user only added one new image in that turn.

What is already in the working tree

Branch: fix/deepseek-session-images (not finished as a PR).

Pushed (commit b251c4a): The Claude translator drops older images only when the model id contains "deepseek".

Local, uncommitted, installed into the machine's Wally 0.8.7 binary for testing (not on remote):

  • Claude Code and Claude Desktop: same trim for every vision model, not only DeepSeek. Oldest images that are not in the latest user turn are replaced until 8 remain. Images in the current turn are kept. If the latest turn itself has more than 8, the body is left unchanged so the gateway can refuse. Text-only models still strip images.
  • Other cloud harnesses: loopback proxy forwards to the console and applies the same 8-image trim on POST /chat/completions. A model id containing "mimo" has its images removed instead.
  • OpenCode, OpenClaw, Prime Agent, and the DeepSeek harness: declare image input from the catalog (text+image when the catalog lists image, text otherwise).
  • Hermes: no model list Wally may invent; vision comes only from model.supports_vision in ~/.hermes/config.yaml (or $HERMES_HOME/config.yaml). Wally now sets that key from the catalog. Ollama's Hermes launcher (cmd/launch/hermes.go) writes that file but stores model names as plain strings and never sets supports_vision.
  • Prime Agent 0.10.0 rejected Wally's old -e extension flag (Error: Unknown option: -e). The Rust CLI reads ~/.prime/agent/models.json (or $PRIME_AGENT_CODING_AGENT_DIR/models.json). Wally now writes the runanywhere provider there and launches with --model runanywhere/<id>.

What is still unverified

  • None of the uncommitted work is committed or in a PR.
  • Live confirmation is still pending: a 9th image in an existing session on Claude Code, OpenCode, Hermes, OpenClaw, DeepSeek harness, and Prime Agent. Hermes and Prime Agent were the last two installs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

P2Follow-up priority: important improvement or deferred scope.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions