Problem
ui.screenshot() omits OpenTUI <image> renderables. Image-preview scenarios therefore produce screenshots with neither the bitmap nor reliable visual evidence of the image surface, even when the effective TUI config enables image previews.
Environment
opencode-drive v1.4.3
- Installed npm version:
1.4.3 (latest)
- Drive source:
3d451b503094bbc9f32e5115eba5afc83fe500ae (origin/main, 0 commits ahead/behind)
- OpenCode target:
origin/v2 / PR fixture based on 70853b1e5b
Deterministic reproduction
- Start a scripted Drive instance with
tuiConfig: { session: { image_preview: true } }.
- Admit or render a session message containing an inline
image/png attachment.
- Wait for the message to appear.
- Call
ui.screenshot("timeline-image-preview").
The generated .opencode/tui.jsonc was read back during the run and contained:
{
"session": {
"image_preview": true
}
}
Expected
The PNG includes the terminal image preview, matching what a real image-capable TUI displays.
Actual
The PNG contains only text cells and backgrounds. The image bitmap is absent.
Root cause
OpenCode Drive delegates ui.screenshot() to OpenCode simulation. packages/simulation/src/frontend/png.ts builds a canvas exclusively from renderer.currentRenderBuffer.getSpanLines(). CapturedFrame contains text spans (text, fg, bg, attributes, width) but no terminal image placements or pixel payloads, so terminal graphics cannot be represented by the screenshot exporter.
This is not a stale-version or config issue.
Suggested direction
Expose image placements from the test renderer/capture protocol and composite them in SimulationPng.screenshot, or provide a separate capture path that records the renderer output including terminal graphics. If the test renderer cannot expose image planes, Drive should document/reject image screenshot assertions rather than silently producing incomplete evidence.
Problem
ui.screenshot()omits OpenTUI<image>renderables. Image-preview scenarios therefore produce screenshots with neither the bitmap nor reliable visual evidence of the image surface, even when the effective TUI config enables image previews.Environment
opencode-drive v1.4.31.4.3(latest)3d451b503094bbc9f32e5115eba5afc83fe500ae(origin/main, 0 commits ahead/behind)origin/v2/ PR fixture based on70853b1e5bDeterministic reproduction
tuiConfig: { session: { image_preview: true } }.image/pngattachment.ui.screenshot("timeline-image-preview").The generated
.opencode/tui.jsoncwas read back during the run and contained:{ "session": { "image_preview": true } }Expected
The PNG includes the terminal image preview, matching what a real image-capable TUI displays.
Actual
The PNG contains only text cells and backgrounds. The image bitmap is absent.
Root cause
OpenCode Drive delegates
ui.screenshot()to OpenCode simulation.packages/simulation/src/frontend/png.tsbuilds a canvas exclusively fromrenderer.currentRenderBuffer.getSpanLines().CapturedFramecontains text spans (text,fg,bg,attributes,width) but no terminal image placements or pixel payloads, so terminal graphics cannot be represented by the screenshot exporter.This is not a stale-version or config issue.
Suggested direction
Expose image placements from the test renderer/capture protocol and composite them in
SimulationPng.screenshot, or provide a separate capture path that records the renderer output including terminal graphics. If the test renderer cannot expose image planes, Drive should document/reject image screenshot assertions rather than silently producing incomplete evidence.