Generated images survive moves and renames
Agents tidy up folders after generating images (sort into subfolders, rename revisions); the image records kept the old path, so /api/images/<id>/file answered 404 and only the requesting device still showed them from its cache. - Generated images get a copy in the image store (images.blob, kept by the blob GC); existing ones are copied once on start-up. - Records follow: after bash commands with mv/rename (missing images of the owner from the last two weeks, found by name or by content hash), when moved with the file manager (file or folder), and on access (served from the copy, relocated in the background; without a copy found by file name). - Chat gallery falls back to the preview the model saw when the file is gone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
90d65ec654
commit
b99f71526a
9 files changed
+260
-13
No files matched your search
@@ -158,11 +158,25 @@ export function ToolCard({ call, result, running, baseDir }: { call: ToolCall; r
|
||||
)}
|
||||
{Array.isArray(meta?.image_ids) ? (
|
||||
<div className="gallery small">
|
||||
{meta.image_ids.map((id: string) => (
|
||||
<FileFigure key={id} url={`/api/images/${id}/file`} className="gallery-item">
|
||||
<img src={`/api/images/${id}/file`} alt="" />
|
||||
</FileFigure>
|
||||
))}
|
||||
{meta.image_ids.map((id: string, i: number) => {
|
||||
// The file may be gone (moved or deleted later): fall back to the preview the model saw.
|
||||
const preview = result?.images?.[i];
|
||||
return (
|
||||
<FileFigure key={id} url={`/api/images/${id}/file`} className="gallery-item">
|
||||
<img
|
||||
src={`/api/images/${id}/file`}
|
||||
alt=""
|
||||
onError={(e) => {
|
||||
const img = e.currentTarget;
|
||||
if (preview && !img.dataset.fallback) {
|
||||
img.dataset.fallback = "1";
|
||||
img.src = imageSrc(preview);
|
||||
}
|
||||
}}
|
||||
/>
|
||||
</FileFigure>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
) : (
|
||||
result?.images?.map((img, i) => (
|
||||
|
||||
Reference in new issue
Block a user