feat: add comprehensive logging for scene VLM tags parsing

- Log VLM response content (first 500 chars)
- Log JSON extraction success/failure
- Log JSON parsing success/failure
- Log missing 'summary' field
- Log parsed objects and tags count
- Helps debug why vlm_tags may be empty in some cases
This commit is contained in:
Accusys
2026-10-24 13:44:42 +08:00
parent b6cf793e1b
commit 7251a12469
+11
View File
@@ -653,6 +653,11 @@ Rules:
None => anyhow::bail!("VLM returned empty content"),
};
tracing::debug!(
"[Scene VLM] VLM response content (first 500 chars): {}",
&content[..content.len().min(500)]
);
// Parse structured JSON; fall back to heuristic extraction if it fails.
if let Some(json_str) = Self::extract_json_object(&content) {
tracing::debug!("[Scene VLM] Extracted JSON object ({} chars)", json_str.len());
@@ -681,8 +686,14 @@ Rules:
tags.len()
);
return Ok((description, objects, tags));
} else {
tracing::warn!("[Scene VLM] JSON missing 'summary' field or summary is empty");
}
} else {
tracing::warn!("[Scene VLM] Failed to parse extracted JSON: {}", json_str);
}
} else {
tracing::warn!("[Scene VLM] Failed to extract JSON object from VLM response");
}
tracing::warn!(