Repository navigation
api: SparkQwen 0.4.0 shared API fixes and defaults (errors, refusal content, unset max_tokens, effort default; ported from Enntity) - #285
Merged
Conversation
Keep the full blocking assistant answer when the heuristic refusal classifier matches, consistent with streaming. Retain refusal annotations, tool-call gating, and finish reasons. Add production assembly/serialization and streaming regressions; update the compatibility expectation. Reported in #172. (cherry picked from commit be67bd5)
queued_first::abandoned caught a streaming client that went away but not one that cancelled (cancel_flag), so a cancelled queued prompt still ran its first chunk. Test: a cancelled queued stream is freed with no chunk command. Co-Authored-By: Claude Opus 5.5 <[email protected]> (cherry picked from commit 2b1c812)
… only The INFO line for requests left pending said they waited for a batch slot even when the scheduling policy had admitted fewer than the free slots for its own reasons. admission_hold tells the two apart (every free slot taken, or the policy admitted fewer) and logs a change of (held, reason) only. The on-change state stays process-wide, as before: one scheduler loop runs per process; the module says so. Test: the two holds are told apart. Co-Authored-By: Claude Opus 5.5 <[email protected]> (cherry picked from commit bed416e)
The messages handler re-shaped every non-success outcome as `api_error`, so an Anthropic client saw the over-limit vision 400 (and every other 4xx) as a server fault. It now forwards through `openai_error_to_anthropic`, which count_tokens already used: the status is kept and a client error is an `invalid_request_error`. Co-Authored-By: Claude Opus 5.5 <[email protected]> (cherry picked from commit f93387a)
The chat layer names a message-borne error's field `messages` (an over-limit vision request); on /v1/responses that field is `input`. Both Responses paths now rewrite it, keeping the status and headers. Co-Authored-By: Claude Opus 5.5 <[email protected]> (cherry picked from commit 0169faf)
One TTFT_TRACE line per request on the tick its first token leaves: queue wait, admission cohort, setup, prefill submit, prefill sync (to the first sampled token), gap to the decode dispatch that emitted the first visible token (a spontaneous <think> is not streamed), that step's wall time and the total from queue arrival. Host timestamps only; disarmed every hook is one OnceLock load. Co-Authored-By: Claude Opus 5.5 <[email protected]> (cherry picked from commit 0f58f7a)
…fault With no reasoning_effort from the client or --default-chat-template-kwargs the render now leaves the variable undefined while thinking is on, as transformers and vLLM do, so the checkpoint template's default applies (Qwen3.8: xhigh). The "medium" fallback (2026-08-15) was a cross-template policy hidden in chat_render; a target that wants it says so in MODEL.toml [behavior].default_reasoning_effort, folded below the CLI default and template-side only (the thinking budget stays the model's, as before). The three Qwen3.8-27B targets and strix-hip Qwen3.8-Flash-Next pin "medium", so their prompts are unchanged. Mistral's override (unset = high = medium's mapping) and GLM's (unset = max = medium's) render the same bytes either way; Qwen3.5/3.6 never read the variable. An unknown or "none" value fails the boot. Co-Authored-By: Claude Opus 5.5 <[email protected]> (cherry picked from commit ebd9feb)
…the context vLLM's OpenAI server caps an unset max_tokens at max_model_len - prompt; Atlas capped it at 4096, so a template-default (xhigh) reasoning turn could end at "length" mid-think. ChatCompletionRequest / Responses now default to ir::MAX_TOKENS_UNSET, which the chat handler resolves to max_seq_len minus the prompt (ir::resolve_max_tokens) as soon as the prompt is tokenized; a client's own cap stands, and /v1/completions keeps its 4096. KV admission is unchanged: it reserves the resolved cap (honest, no preemption). A pool smaller than max_num_seqs full contexts queues the excess; ATLAS_KV_ADMIT_WATERMARK lets it overcommit instead, with decode-time preemption resuming the victims. Co-Authored-By: Claude Opus 5.5 <[email protected]> (cherry picked from commit 1349e8f)
… refusal fixture takes the current AppState/InferenceResponse shape
…ponses_stream/conv_items.rs
Contributor
Author
|
GB10 single-Spark confirmation (sparky, post-merge): this PR was gated as part of
|
This was referenced Nov 1, 2026
This was referenced Nov 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
SparkQwen 0.4.0's shared API fixes. Ported from Enntity (AGPL-3.0, data-angel):
be67bd5ca);2b1c81282);bed416e9d);/v1/messagesforwards client errors asinvalid_request_error(f93387ab6);input(0169faf6b);0f58f7a4b,ATLAS_TTFT_TRACE=1, off by default).Two shared default changes that affect every model (flagging for review):
ebd9feba2: a request that leaves reasoning effort unset gets the template's own default, via[behavior].default_reasoning_effort.1349e8f19: chat and Responses requests withoutmax_tokensget the rest of the context instead of 4096. This is vLLM's behaviour./v1/completionskeeps 4096.060199ebc(Anthropic error types) was already on main.Test plan
--tests) is clean.lp_api_probe.py13/13 (7 malformed requests across chat, messages and responses),api_parity.py26/26.Generated with Devin