优化chatgpt检查

This commit is contained in:
2026-07-06 10:57:41 +08:00
parent e05db36f63
commit 713cca8f67
3 changed files with 10 additions and 23 deletions
+6 -2
View File
@@ -157,8 +157,12 @@ func conversationEndedWithoutImage(conversation map[string]any) bool {
}
if role == "assistant" {
if content, _ := message["content"].(map[string]any); content != nil {
if ct := stringValue(content["content_type"]); ct != "" && ct != "text" {
return false // code/multimodal turn — generation underway
// Only tool-invoking content types mean generation is underway.
// Context nodes (model_editable_context, thoughts, …) also appear
// on refused turns and must NOT suppress the detection.
switch stringValue(content["content_type"]) {
case "code", "multimodal_text":
return false
}
}
}