fix: render private repository file images in Markdown - #1038
Conversation
Pull request and issue descriptions often embed screenshots that are committed to the repository and linked through a GitHub web URL such as `https://github.com/{owner}/{repo}/blob/{branch}/docs/image.png?raw=true`. For a private repository the browser cannot load that URL: the image request carries no GitHub session, so GitHub answers with a 404 page and the browser shows a broken image. Only `user-attachments` uploads went through the authenticated image proxy. The proxy now also serves files from the route's own repository, referenced by `blob` or `raw` web URLs on the platform host or by `raw.githubusercontent.com` on github.com. The daemon reads them through the contents API with the normal read credential chain. Files in other repositories keep loading directly, because a public repository's file already works in the browser and the route's credential is only known to be valid for its own repository. Web URLs do not separate the branch name from the file path, and branch names may contain slashes, so the daemon tries the shortest ref first and moves past 404s until the file resolves. The contents API labels every raw response with its own media type, so the image type is sniffed from the bytes before it is served. Generated with Claude Code (claude-fable-5-1) Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
roborev: Combined Review (
|
Repository file images are addressed by a branch or tag, so the bytes behind one URL can change when the branch moves. The image route told browsers to keep every proxied image for a year as immutable, and the daemon kept it on disk for two weeks, which was only correct for content-addressed attachment uploads. Providers now mark ref-addressed images as mutable, and the route caches those for five minutes in the browser and on disk while attachments keep the long immutable policy. The disk cache was keyed by the owner/name route. Owner/name is a mutable route in kenn-forge: a repository can be deleted and a different one created under the same name, and the catalog treats that as a distinct repository. With the old key the replacement repository would have been served the previous repository's private image bytes for up to two weeks. The key now uses the stable provider repository ID, matching the identity rule the rest of the catalog follows. The cache file format gains a mutability line, so entries written by earlier builds are treated as misses and fetched again. Generated with Claude Code (claude-fable-5-1) Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
|
Both review findings are addressed in 3a365dc.
The failed |
roborev: Combined Review (
|
Pull request and issue descriptions in private repositories often embed screenshots that are committed to the repository and linked as
https://github.com/{owner}/{repo}/blob/{branch}/docs/image.png?raw=true. The browser cannot load that URL without a GitHub session, so kenn-forge showed a broken image where GitHub shows the screenshot. Onlyuser-attachmentsuploads went through the authenticated image proxy.bloborrawweb URLs orraw.githubusercontent.com, now render through the repo-scoped image proxy.Generated with Claude Code