fix(web): broken tiles in the chat gallery (viewing_tile emitted before fetch)#24
Merged
Conversation
The agent pages through long articles by guessing chunk coordinates (0/0, 0/1, ... 1/5, 2/0), so some pixelrag_tile reads 404 past the end of an article — normal exploration. But the agent backend emitted viewing_tile BEFORE fetching, so failed reads still landed in the chat tile gallery as broken images (seen live on /api/tile/290066/1/5 while answering the Inter shots-on-target example). - agent-server.mjs + route.ts: emit viewing_tile only after a successful fetch - TileGallery: belt-and-braces onError — drop tiles whose image fails to load
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Symptom:
/api/tile/290066/1/5rendered as a broken image in the chat gallery while answering the Inter shots-on-target example.Root cause (from the session transcript): the agent pages through long articles by guessing chunk coordinates (it read 15 tiles of the 2010-final article; 3 guesses 404'd past the article's end — normal exploration). But the backend emitted
viewing_tilebefore fetching, so failed reads still entered the gallery. Search results themselves are clean (sampled 80 hits → 0 missing files).Fix: emit
viewing_tileonly after a successful fetch (agent-server + route.ts), plus anonErrorfallback in TileGallery that drops any tile whose image fails to load.