JuliusBrussee/caveman · error
empty render text
Error message
empty render text
What it means
renderGeminiInlineDataParts is the entry point that turns text into Gemini inlineData image parts; it rejects an empty input string up front because there is nothing to rasterize and returning zero parts would silently signal 'rendered fine'. Any caller must pass non-empty text.
Source
Thrown at engine/pixel/transform_gemini.go:967
}
}
return lastClosed
}
func maybeGeminiReflow(text string, enabled bool) string {
if !enabled {
return text
}
safe := NeutralizeSentinel(text)
if packed, ok := Reflow(safe); ok {
return packed
}
return safe
}
func renderGeminiInlineDataParts(model, mediaResolution, text string, cols, numCols int, shrinkWidth bool, maxCharsPerImage int, style RenderStyle) (geminiRenderResult, error) {
if text == "" {
return geminiRenderResult{}, errors.New("empty render text")
}
if cols <= 0 {
cols = DefaultCols
}
if maxCharsPerImage <= 0 {
maxCharsPerImage = ReadableCharsPerImage
}
effectiveCols := cols
if shrinkWidth {
effectiveCols = MeasureContentCols(text, cols, 1)
}
effectiveNumCols := max(1, numCols)
if effectiveCols < cols {
effectiveNumCols = 1
}
var imgs []RenderedImage
var err error
if effectiveNumCols > 1 {View on GitHub (pinned to 27d5a3981a)
Solutions
- Guard the call site: skip rendering when strings.TrimSpace(text) == ""
- Investigate why upstream produced empty text (over-aggressive stripping) if empty input is unexpected
- Pass a meaningful placeholder only if the API contract allows non-empty stand-ins
Example fix
// before
res, err := renderGeminiInlineDataParts(model, res0, text, cols, numCols, shrink, maxChars, style)
// after
if text == "" {
return nil // nothing to render
}
res, err := renderGeminiInlineDataParts(model, res0, text, cols, numCols, shrink, maxChars, style) Defensive patterns
Strategy: validation
Validate before calling
if text == "" {
return nil, nil // nothing to render
}
res, err := renderGeminiInlineDataParts(...) Type guard
func renderable(t string) bool { return t != "" } Prevention
- Check for empty text after any stripping/compression stage, not just at intake
- Log when text becomes empty unexpectedly — it usually signals over-aggressive filtering
When it happens
Trigger: Calling the render function with "" after upstream text was fully stripped (NeutralizeSentinel/Reflow removed everything), when a message body is empty, or when a slice/text field defaults to empty before the call.
Common situations: Pipeline where compression or sentinel-neutralization reduces input to empty string; UI code rendering an optional field that is absent; tests invoking the renderer with placeholder empty strings.
Related errors
- unsupported image token profile
- body must be a JSON object
- cachebench: nil corpus reader
- message exceeds byte limit
- tool message requires tool_call_id
AI-assisted analysis of JuliusBrussee/caveman@27d5a3981a (2026-08-15).
Data as JSON: /api/errors/662ef0777121b145.
Report an issue: GitHub.