You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: Pi read of an image shows no preview in the work log because the Pi adapter never sets viewedImagePath #37467
I searched existing issues and did not find a duplicate.
I included enough detail to reproduce or investigate the problem.
Area
packages/provider-pi
Steps to reproduce
Start a thread with a Pi model. I reproduced it with xai/grok-latest and openrouter/deepseek/deepseek-v4.1-flash-1017.
Ask the agent to look at a local PNG, so Pi calls its read tool on the file.
Look at the work log for that turn.
Expected behavior
Each image read shows the eye-icon row with the image preview, as it does for Claude Read and Codex view_image in the same app.
Actual behavior
The row shows only Read <path>.png, with no preview. The model still gets the image. In the Pi session file, every such read result has a text block Read image file [image/png] followed by an image/png block of 70 to 150 KB of base64.
The cause is in emitToolItem in packages/provider-pi/src/server/adapter.ts. It has branches for bash, powershell, edit, and write. Every other tool, read included, becomes a plain dynamic_tool item without viewedImagePath. The work log builds read-file previews from viewedImagePath, as the comment on stripUnservedToolOutputImageBytes in apps/server/src/orchestration-v2/toolOutputImageBytes.ts says. The Claude and Codex adapters set this field:
ClaudeAdapterV2.ts (around line 7062) sets it when the Read path passes isWorkspaceImagePreviewPath.
CodexAdapterV2.ts (around line 5757) sets it from the imageView item path.
Suggested fix
Set viewedImagePath in the dynamic_tool branch of emitToolItem the same way the Claude adapter does:
Desktop app with WSL runtime 0.1.2. The same code is on main @ 0813f49.
Environment
Windows desktop app with the server in WSL2, Pi provider. I hit it in delegated subagent threads. Codex and Claude subagents in the same parent thread show previews for the same kind of screenshot reads.
Workaround
None in the UI.
#32193 reported the same missing preview for the Codex adapter and is fixed. #15869 covered image blocks dropped by the Pi MCP bridge.
Claude Opus 5.5 wrote this issue on behalf of @boom-bang.
Activity