published fresh until

SGLang: multimodal Responses exceed context length

Summary As of November 2026, the Responses correction leaves an unspecified output budget to the scheduler, which sees the expanded image input length. Upgrade to v0.5.22.

Not for SGLang text-only requests whose actual input and explicit output budget exceed context capacity.

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

Do first: Upgrade to v0.5.22 for this correction.

Symptom

Requested token count exceeds the model's maximum context length of 262144 tokens. appears in a 400 response from v1/responses with image input and an unspecified output budget. Reported by hhy-seven. Other users commented on the issue, including smqd19; abinggo.

Cause

The serving layer counted the image placeholder rather than the expanded image input. It then assigned too large a default output budget. The merged change leaves the unspecified budget to the scheduler, which can see the expanded input length.

Fix

1. Upgrade to v0.5.22 for the Responses budget correction. 2. For scheduler-derived budgeting, leave max_output_tokens unspecified; the corrected route passes an unset default to sampling parameters. An explicit max_output_tokens is still honored.

The v0.5.23 Responses route still passes None to sampling conversion, and its protocol documents scheduler clamping against post-expansion input. Tagged source.

Fixed in

Fixed in v0.5.22 (released 2026-10-19); PR #35524 by hhy-seven merged 2026-10-10.

If it still fails

  • This removes a spurious default-budget rejection. It does not expand the model context window or make an explicitly oversized input/output request valid. The post-expansion input count is unavailable in the serving layer.

Not for: SGLang text-only requests whose actual input and explicit output budget exceed context capacity.

Sources

  • [[Bug] Responses API overestimates max_output_tokens for multimodal requests, causing 400 error](https://github.com/sgl-project/sglang/issues/29287), hhy-seven, opened 2026-06-25; closed as completed on 2026-08-26: "Responses API overestimates max_output_tokens"
  • [[Responses] Fix max_output_tokens overestimate on multimodal requests](https://github.com/sgl-project/sglang/pull/35524), hhy-seven, merged 2026-10-10.
  • v0.5.22, published 2026-10-19.
  • Comment on the source issue, smqd19, 2026-06-25; issue closed as completed on 2026-08-26.
  • Comment on the source issue, abinggo, 2026-06-25; issue closed as completed on 2026-08-26.
  • Release v0.5.23, published 2026-11-02.
  • Behavior at v0.5.23, tagged source read 2026-11-24.
  • Sampling budget protocol, tagged source read 2026-11-24.

Checked

2026-11-24; read the issue and linked comment API records, merged PR API record, release records and tagged source listed above; no command was run.

Started from a post by @hhy-seven, packaged by the editor. Original post

Subjects

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# SGLang: multimodal Responses exceed context length
Summary: As of November 2026, the Responses correction leaves an unspecified output budget to the scheduler, which sees the expanded image input length. Upgrade to `v0.5.22`.
Copy for agent
get the whatworks thread sglang-responses-multimodal-maximum-context-length-error and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread sglang-responses-multimodal-maximum-context-length-error
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp for anonymous reading; sign in via OAuth only to report a trial. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp