Repository navigation
Description
Summary
After the chat generates an image, the reply can show it twice: once as the attached image, which works, and once as a large grey placeholder that does not open. The broken one is a Markdown image the chat model wrote itself, pointing at the image's internal s3: reference. The renderer cannot load that address, so it shows the placeholder, and the preview opens an empty image.
Reported as "Gemini 3.8 Flash Image Lite sometimes displays two images, and then one image is broken and cannot be viewed". Reproduced on main 7d7b1ee98 (2026-11-04) with Gemini 3.8 Flash as the chat model and the gateway's gemini-3.1-flash-image as the image model. The reporter confirmed that the image model was gemini-3.1-flash-image, as in this check. The gateway key lists no model called "Gemini 3.8 Flash Image Lite"; the name in the report most likely combines the chat model's name with the image model's.
What the code does today (main 7d7b1ee98)
generate_imageanswers the model with each image'sref(ans3:address), name and size (services/platform/backend/domains/agent_tools/image.ts:242-278). Its description says: "Answers with each image's ref and its size in pixels — report those, not the size you asked for." (services/platform/lib/agent/work-tools.ts:298-305).- The image itself is shown from the artifact part, with a presigned URL (
services/platform/app/features/chat/components/message-artifacts.tsx:141-233). - The reply text is rendered as Markdown; an image in it is drawn as given (
services/platform/app/features/shared/markdown/markdown-renderer.tsx:83-123). Ans3:address does not load, and theImagecomponent falls back to/assets/placeholder-image.png(services/platform/app/components/image.tsx:14-21). The preview dialog gets the same unusable source. - The only related guidance in the instructions: "When files are attached, say so in a sentence and do not paste their content again." (
services/platform/lib/agent/ladder.ts:92).
What was observed
Local stack, Bifrost gateway as an OpenAI-compatible custom provider, image generation pinned to the gateway's antigravity/gemini-3.1-flash-image. One new chat per prompt; the reply text was read from the stored message.
| Chat model | Replies | Reply contains  |
Prompts that asked to show the image |
|---|---|---|---|
| Gemini 3.8 Flash | 9 | 4 | 4 of 4 embedded; 0 of 5 other prompts did |
| Claude Sonnet 5.5 | 3 | 0 | Asked explicitly to embed: declined ("nur einen internen Verweis") |
The four that embedded: "Generate an image of a cozy reading nook with plants and show it to me.", "Erstelle ein Bild von einem Bergsee im Herbst und zeig es mir.", "Zeichne mir ein Bild von einem Roboter, der Kaffee kocht, und zeig es direkt hier.", "Make an image of a futuristic city at night and display it." Example reply text:
Here is your cozy reading nook with plants:

The image has been generated and attached (1264 × 848 px).
On the page: the grey placeholder (/assets/placeholder-image.png, 1200×800) above the real image (1264×848). Clicking the placeholder opens Image preview with an image whose src is empty.
Also checked, and not the cause here:
- The gateway answered every successful image call with exactly one intact JPEG (6 of 6), never two.
- Under parallel load the gateway refused image calls with HTTP 503 "No available accounts" (4 of 10 parallel direct calls). In the chat, such a failure shows as a Generating an image · Failed row, and the model retried; no broken image resulted.
A second, separate way a chat image breaks after a while (an expired link in the preview) is filed as #5366.
Not examined: other chat models, image models other than gemini-3.1-flash-image, and agents in tasks.
How to reproduce
- Settings › Governance › Models › Image generation: on, pin an image model.
- New chat with Gemini 3.8 Flash: "Generate an image of a cozy reading nook with plants and show it to me."
- The reply shows a grey placeholder above the generated image.
Options (no preference)
- Resolve an
s3:reference in reply Markdown to the same presigned URL the artifact uses, when it names a file of this conversation, and skip duplicates of the attached image. - Render a Markdown image whose address is neither
http(s)nor a known file reference as text (its alt text or a link), not as a placeholder. - Change the tool's wording: the image is shown automatically; do not write it into the reply.
- Give the model a handle that cannot be mistaken for an address (a name or an index), not the storage ref.
- Remove Markdown images that point at the turn's own artifacts from the stored reply.
Related
- bug(platform): a chat image's preview breaks after 15 minutes — the page keeps presigned links past their lifetime #5366 (an image preview breaks once its link has expired)
- bug(platform): a chat reply says it attached a file, but no file card appears #5028 (a reply says it attached a file, but no card appears), perf(platform): serve chat and task image thumbnails instead of originals #5298 (thumbnails instead of originals in chat)
Decision (2026-11-05)
Fixed in two layers, so a reply never shows a placeholder for a file it made, whatever the model writes. Part of #5371.
- The tools say where files show.
generate_imageandcreate_filetell the model, in their descriptions and in their results, that the files show under the reply by themselves and that a ref is for later tool calls, never for the reply text. The work ladder says the same (options 3 and 4 above). - The reply renders a storage ref for what it is (options 1 and 2 above). In an assistant reply:
- a Markdown image whose address is the storage ref of a file the reply made is not drawn a second time: the picture under the reply is that image;
- an image naming another file of the conversation that the reader can open is drawn from the same signed link the gallery uses;
- a link to a storage ref opens the file's preview (with its download) instead of an empty link;
- an image that cannot be drawn (an unknown address, a file the reader cannot open, a failed load) shows its alt text instead of the grey placeholder, so no empty preview opens.
Not changed: the stored reply keeps the text the model wrote (option 5 is not taken; the REST API returns the text as written). The expired-link case stays #5366.
Done when
- The reproduction above (
beside the attached picture) shows exactly one picture, the attached one, while streaming, after the reply settles and after a reload. - A reply that links
[planets.csv](s3:…)opens that file's preview. in a reply reads "x"; no placeholder, no empty preview.- Unit and browser tests hold each case; a mock-model E2E spec holds the first two; a manual box in the chat suite covers it with a real image model.
Activity
tale-review-bot commentedon Nov 5, 2026
The agents leave this issue to you for now. Its task on the agents' board (TALE-442) waited in To do, where an agent would start building it, but
agent-readycame off this issue at 2026-11-05T00:53:48Z, in the edit that setpriority: high. That label is a maintainer's word that the agents may work an issue, so TALE-442 now waits in the Backlog and no agent builds it.If the agents should build it: put
agent-readyback on this issue, or say so in a comment here. It then lands on the stabletrainas a bug at the agents' priority p1, following the decision above, and it doesn't hold up #5361, #5362, #5363 or #5364. If you build it yourself, the task closes once your commit is onmain.— the Lead (Development)
fix(platform): show a file a reply's text names by its reference once
yannickmonney commentedon Nov 5, 2026
Landed on
trainin 9112f9a (fix(platform): show a file a reply's text names by its reference once). It closes when the train reachesmain.s3:scheme where the chat renders it. A picture of a file the reply made is not drawn again in the text, another stored picture only when the reader may open it, a link to a stored file is a button that opens its preview, and a picture nothing can draw reads as its description. Copy leaves the references out.create_file,generate_imageandrun_codetell the model that the files show under the reply and never to write their references.backend/domains/chat/spec.md; tests inmessage-markdown.test.tsx,incremental-markdown.test.tsxandstored-files-context.test.ts; manual box CHAT-F87; mock triggere2e:file-ref;files-and-skillsdocs in en, de and fr.fix(platform): renew the link of a stored picture a reply's text names
tale-review-bot commentedon Nov 5, 2026
Done upstream:
9112f9a12eadaab102a5b99b517a5ab1ff48efcc(fix(platform): show a file a reply's text names by its reference once,Closes #5358), ontrainsince 04:54:55Z. It reachesmainwith a merge train and ships in v0.5.101 at the earliest; see the Lead's decision on #5371 (#5371 (comment)). Board task TALE-442 is cancelled. If the commit leavestrainwithout reachingmain, the Lead reopens this issue.fix(platform): show a file a reply's text names by its reference once
fix(platform): show a file a reply's text names by its reference once