Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion src/common/AutoModel/modeling_qwen3_5_omni.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -793,7 +793,16 @@ NonStreamResult Qwen3_5_Omni::parse_nstream_content(const std::string response_t
if (func_end_pos != std::string::npos) {
block_end = func_end_pos + func_end_tag.length();
} else {
block_end = response_text.length();
// Neither closing tag is present, so generation stopped inside
// the call -- almost always because it hit the output limit
// while writing a large argument. Taking the remainder here
// fabricates a complete-looking call from a partial one: the
// arguments JSON is well formed, because it is rebuilt from the
// parsed parameters, so the client cannot tell it is truncated
// and runs it. A heredoc cut mid-body becomes an unterminated
// `cat <<EOF`. Drop the block instead; the response still
// carries finish_reason "length", which is the honest signal.
break;
}
search_from = block_end;
}
Expand Down
11 changes: 10 additions & 1 deletion src/common/AutoModel/modeling_qwen3_5vl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,16 @@ NonStreamResult Qwen3_5VL::parse_nstream_content(const std::string response_text
if (func_end_pos != std::string::npos) {
block_end = func_end_pos + func_end_tag.length();
} else {
block_end = response_text.length();
// Neither closing tag is present, so generation stopped inside
// the call -- almost always because it hit the output limit
// while writing a large argument. Taking the remainder here
// fabricates a complete-looking call from a partial one: the
// arguments JSON is well formed, because it is rebuilt from the
// parsed parameters, so the client cannot tell it is truncated
// and runs it. A heredoc cut mid-body becomes an unterminated
// `cat <<EOF`. Drop the block instead; the response still
// carries finish_reason "length", which is the honest signal.
break;
}
search_from = block_end;
}
Expand Down
11 changes: 10 additions & 1 deletion src/common/AutoModel/modeling_qwen3_6_moe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,16 @@ NonStreamResult Qwen3_6_MOE::parse_nstream_content(const std::string response_te
if (func_end_pos != std::string::npos) {
block_end = func_end_pos + func_end_tag.length();
} else {
block_end = response_text.length();
// Neither closing tag is present, so generation stopped inside
// the call -- almost always because it hit the output limit
// while writing a large argument. Taking the remainder here
// fabricates a complete-looking call from a partial one: the
// arguments JSON is well formed, because it is rebuilt from the
// parsed parameters, so the client cannot tell it is truncated
// and runs it. A heredoc cut mid-body becomes an unterminated
// `cat <<EOF`. Drop the block instead; the response still
// carries finish_reason "length", which is the honest signal.
break;
}
search_from = block_end;
}
Expand Down