Repository navigation
Conversation
… no longer swaps which video plays (pingdotgg#42331) Co-authored-by: Julius Marminge <julius0216@outlook.com>
… preview Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ill decode Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
smirea
force-pushed
the
fix/viewed-image-percent-path
branch
from
November 24, 2026 19:24
160a77e to
f62ae31
Compare
Owner
Author
|
Opened upstream as pingdotgg#42369 (issue pingdotgg#42368). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
Claude Opus 5.5 writing on behalf of Stefan.
Problem
When an agent reads an image whose path contains
%,#or?, the work log shows "Image unavailable" instead of the image. Grok hits this on every image it generates, because it saves them under~/.grok/sessions/%2FUsers%2F<user>%2F<workspace>/<session>/images/N.jpg. That directory name literally contains%2F.resolveViewedImageAssetpasses the tool's raw path through markdown destination resolution, which URL-decodes it (%2F→/) and treats#and?as the start of a fragment or query. The client then asks the server for…/sessions//Users/<user>/…/1.jpg, which doesn't exist.Change
resolveViewedImageAssetnow escapes%,#and?(new helperviewedImageMarkdownSource) before running the existing markdown classification, so the decoding step gives back the literal path the tool reported. Afile:URL is left as it is and still decodes. Workspace-relative joining, Windows paths and the network-path block all behave as before. On mobile,renderViewedImagebuilds the image's actions source (Copy full path, Open in file viewer) from the same escaped source, so those actions get the literal path too. Markdown images in messages still decode their destinations as they did. Only work-log viewed images change, because their paths come from tool input (viewedImagePathfrom Claude, Codex and ACP Reads, or a Read row'sdetail).Scope
Fixes #ISSUE
This covers every route that shows a viewed image: the web work-group image strip and expanded Read row (
TimelineWorkEntryRow.tsx), and the mobile strip and work-log row (ThreadFeed.tsxrenderViewedImage). All of them go throughresolveViewedImageAsset. Desktop uses the web client. Markdown images in assistant messages are left alone on purpose, because their destinations really are URL-encoded.Open PR pingdotgg#41930 also changes viewed-image previews, so that each Read shows its stored output image. I ran the scenario below on its head (
1276053356) and it still fails, since a call without a stored image falls back to this same path resolution.Verification
Re-runnable on a Linux VM with no provider account:
packages/client-runtime/src/work-log/presentation.test.tschecks that a path containing%2F,#and?resolves to amedia-fileresource with the literal path. It fails onmain: the received path has%2Fdecoded to/.readof a PNG at<project>/sessions/%2Fhome%2Fme%2Fdemo/images/1.png.vp run scenarios:prove … --base origin/mainprinted: Proven: the scenario fails on base01962d4c0band passes on headc8e96aec57.main)file:///repo/my%20shot.pngstill resolves to/repo/my shot.png./repo/sessions/%2Fhome%2Fme/images/1.pngthroughresolveMarkdownMediaPreview(viewedImageMarkdownSource(path))in a throwaway test. The actions reference came back as the literal path; without the helper it was/repo/sessions//home/me/images/1.png. I did not run the iOS app itself.vp run check:changedpasses. When I revertedpresentation.tsalone, the unit test failed.Needs a real Grok account (found on macOS): a live Grok thread generated images with its image tool and then Read them from
~/.grok/sessions/%2FUsers%2F…/images/1.jpgthrough4.jpg. The thread showed "Image unavailable". Those files exist on disk, and the client asks for the%2F-decoded path. Grok's own adapter isn't involved: the scenario reproduces the same client path with a generic ACP agent.Scenario:
scripts/scenarios/viewed-image-percent-path.e2e.tsClaude Opus 5.5 via Claude Code.