fix(look-at): remove isJsonParseError band-aid (root cause fixed)
This commit is contained in:
parent
55dc64849f
commit
fad7354b13
@ -245,27 +245,7 @@ Original error: ${createResult.error}`
|
||||
const errorMessage = promptError instanceof Error ? promptError.message : String(promptError)
|
||||
log(`[look_at] Prompt error:`, promptError)
|
||||
|
||||
const isJsonParseError = errorMessage.includes("JSON") && (errorMessage.includes("EOF") || errorMessage.includes("parse"))
|
||||
if (isJsonParseError) {
|
||||
return `Error: Failed to analyze ${isBase64Input ? "image" : "file"} - received malformed response from multimodal-looker agent.
|
||||
|
||||
This typically occurs when:
|
||||
1. The multimodal-looker model is not available or not connected
|
||||
2. The model does not support this ${isBase64Input ? "image format" : `file type (${mimeType})`}
|
||||
3. The API returned an empty or truncated response
|
||||
|
||||
${isBase64Input ? "Source: clipboard/pasted image" : `File: ${args.file_path}`}
|
||||
MIME type: ${mimeType}
|
||||
|
||||
Try:
|
||||
- Ensure a vision-capable model (e.g., gemini-3-flash, gpt-5.2) is available
|
||||
- Check provider connections in opencode settings
|
||||
${!isBase64Input ? "- For text files like .md, .txt, use the Read tool instead" : ""}
|
||||
|
||||
Original error: ${errorMessage}`
|
||||
}
|
||||
|
||||
return `Error: Failed to send prompt to multimodal-looker agent: ${errorMessage}`
|
||||
throw promptError
|
||||
}
|
||||
|
||||
log(`[look_at] Prompt sent, fetching messages...`)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user