t3code icon indicating copy to clipboard operation
t3code copied to clipboard

Muse provider: image sets over ~7 MB fail turn start with generic error; pre-flight the MSP frame size

Open Ali-Al1 opened this issue 2 weeks ago • 0 comments

What happens: a few phone photos in one message on the Muse provider fail the turn with the generic "The provider could not start this turn." The real cause (Muse turn/start failed: frame exceeds the inbound limit) only lands in the provider session's lastError, so users can't tell it's a size problem.

Root cause:

  • packages/provider-muse/src/server/adapter.ts (prompt()) embeds every attached image as full-size base64 in a single turn/start frame, with no size check.
  • muse serve enforces a 10 MiB inbound frame budget, so ~9.9 MB of JPEGs (≈13.1 MB base64) is rejected at admission.
  • failure.ts curates the transport detail away, hence the generic message.

Repro: Muse provider, one message with 3 phone photos (4.4 + 2.9 + 2.1 MB). Turn fails in <1s, every time; text-only turns on the same session work.

Suggestions:

  1. Pre-flight the outgoing frame size in prompt() (budget ~9 MB to leave headroom under serve's 10 MiB).
  2. When over budget, degrade gracefully instead of failing: send text + the existing saved-path mentions and let Muse read the files itself (or keep one image inline + rest as paths), and/or downscale images before embedding.
  3. Add a curated failure reason (like attachment_unreadable) so the UI says the images are too large for one turn, with the ~7 MB/turn guidance.

Env: T3 nightly 0.1.10-nightly.20261114.4709, muse 1.4.20, @muse-code/sdk 1.4.6, Windows.

Ali-Al1 avatar Nov 15 '26 18:11 Ali-Al1