feat: log image descriptions at INFO level for debugging

Show the generated (or cached) image description in logs so users can
verify what the vision model produced and diagnose issues.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
dj-oyu 2026-03-19 22:42:25 +09:00
parent bc45e31227
commit 4c73ae213b

View file

@ -262,7 +262,10 @@ func (al *AgentLoop) describeImage(
hash := mediacache.HashData([]byte(dataURL)) hash := mediacache.HashData([]byte(dataURL))
if al.mediaCache != nil { if al.mediaCache != nil {
if cached, ok := al.mediaCache.Get(hash, mediacache.TypeImageDesc); ok { if cached, ok := al.mediaCache.Get(hash, mediacache.TypeImageDesc); ok {
logger.DebugCF("agent", "Image description cache hit", map[string]any{"hash": hash}) logger.InfoCF("agent", "Image description (cached)", map[string]any{
"hash": hash,
"description": cached,
})
return cached return cached
} }
} }
@ -317,6 +320,11 @@ func (al *AgentLoop) describeImage(
desc := strings.TrimSpace(resp.Content) desc := strings.TrimSpace(resp.Content)
logger.InfoCF("agent", "Image described", map[string]any{
"hash": hash,
"description": desc,
})
// Store in cache // Store in cache
if al.mediaCache != nil { if al.mediaCache != nil {
if cErr := al.mediaCache.Put(hash, mediacache.TypeImageDesc, desc); cErr != nil { if cErr := al.mediaCache.Put(hash, mediacache.TypeImageDesc, desc); cErr != nil {