t3code icon indicating copy to clipboard operation
t3code copied to clipboard

[Bug]: #38619 breaks title generation for text-only custom models on Claude provider (need an option to disable sending images)

Open KevinXC5 opened this issue 1 week ago • 1 comments

Before submitting

  • [x] I searched existing issues and did not find a duplicate.
  • [x] I included enough detail to reproduce or investigate the problem.

Area

apps/server

Steps to reproduce

  1. Configure a Claude provider instance backed by a text-only model via an Anthropic-compatible endpoint (e.g., InceptionAI Mercury 3, which does not support image inputs).
  2. Set Text Generation model (textGenerationModelSelection) to that text-only model.
  3. Open a thread that contains at least one image attachment.
  4. Trigger Regenerate title (or start a new thread with an image attachment).

Expected behavior

Title generation / regeneration should work when using a text-only model for text generation.

Specifically, it would be great to have a setting/toggle to disable sending image attachments for text generation (either in the Text Generation settings or per custom model), so users who intentionally pick a fast text-only model for titles/branch names can turn image uploads off instead of hitting 400 errors. (Optionally, falling back to text-only on image rejection would also avoid hard failures.)

Actual behavior

Since #38619 (9415a2e), ClaudeTextGeneration.ts unconditionally reads image attachments via readImageBlocks and sends them as base64 image blocks over stream-json. Because the configured text generation model does not support image inputs, title regeneration fails with a 400 Bad Request error.

Before #38619, text-only models worked fine because only the text prompt and attachment metadata were sent.

Impact

Major degradation or frequent failure

Version or commit

0.1.11-nightly.20261120.4979 (after #38619 / 9415a2e)

Environment

macOS, T3 Code (Nightly) 0.1.11-nightly.20261120.4979, Claude provider with text-only custom model (InceptionAI Mercury 3)

Logs or stack traces

Claude CLI command failed: API Error: 400 InceptionAI: 400 Bad Request: {'error': {'message': '[{"type":"value_error","loc":["body"],"msg":"Value error, Image inputs a...'}}

Workaround

Switch the Text Generation model to a vision-capable model, or avoid regenerating titles on threads containing images.

KevinXC5 avatar Nov 20 '26 11:11 KevinXC5

Thanks for the super fast fix in #39684! I tested v0.1.12-nightly.20261120.4994 and confirmed that title regeneration on threads with image attachments now succeeds instead of failing outright.

However, checking the local proxy logs and server.trace.ndjson revealed a notable side effect of relying solely on retry-on-failure:

  • On the first runClaudeCommand attempt (with image blocks), when the upstream endpoint returns 400 invalid_request_error ("Image inputs are not supported for this model"), Claude Code CLI itself retries 4 times internally (adjusting tool/parameter payloads while still keeping the ~350 KB base64 image block on every attempt) before exiting non-zero.
  • Only after all 4 failed HTTP requests does T3 Code fall back to the second text-only runClaudeCommand, which succeeds on the first try (~20 KB payload).

Measured on a single title regeneration:

  1. 1st claude -p (with image, 4× 400 inside Claude CLI): 3.89 s, uploading ~350 KB of image data 4 times
  2. 2nd claude -p (text-only fallback, 1× 200): 2.00 s

Since the main reason to pick a fast text-only model like Mercury 3 for text generation is low latency, spending ~4 extra seconds and sending 4 redundant 400 requests with image payloads on every thread containing images is quite wasteful (and pollutes proxy error metrics / failure counters).

Would it be possible to also add either:

  1. A toggle to disable sending images for text generation (e.g., in Text Generation settings or per custom model like supportsImages: false), and/or
  2. Remembering in-memory (or per model selection) when a model rejects image inputs so subsequent calls skip the image attempt directly?

KevinXC5 avatar Nov 20 '26 13:11 KevinXC5