Skip to content

bug(platform): a chat reply says it attached a file, but no file card appears #5028

Closed

Description

@yannickmonney

Summary

A chat reply says it attached a file, but no file card appears under the reply and nothing can be opened or downloaded. It happens some of the time, not on every request. This was reported from a pilot deployment and has been seen again since.

Evidence

  • A request for a photorealistic image. The step list shows one step, Writing superheld-dunkle-gasse.svg (create_file), and the reply ends with "The image is attached as SVG". No card appears under the reply.
  • Other occurrences were reported without a trace: "sometimes attachments are not attached in the chat even though the agent reports it has them".

What main does

Observed at main a71d0d92e9.

  • create_file answers "Attached to the conversation." only after scope.artifacts.store(...) succeeded (services/platform/backend/domains/agent_tools/create-file.ts:56-61). Every earlier exit returns a failure result.
  • run_code attaches only new or changed files in /agent/output/ (backend/domains/agent_tools/run-code.ts:699-788). When there are none, it tells the model "No file was attached…" (run-code.ts:896).
  • The only guard against a false claim is the prompt: "never claim a file you did not make" (services/platform/lib/agent/ladder.ts:79). Nothing compares the reply with the files the turn actually stored.

Where it can break (to confirm with a reproduction)

  1. A work-tool call failed (invalid arguments, size cap, store error, sandbox error), and the model wrote "attached" anyway.
  2. The model claimed an attachment without calling a tool.
  3. The file was stored, but its card did not render: a media type such as image/svg+xml, a stream that ended early, a retried or branched reply, or a reload.
  4. run_code wrote outside /agent/output/, and the model ignored the "No file was attached" note.

Done when

  • The problem is reproduced at least once, with the step list, the tool results and the turn's app.file_metadata rows, and the cause is named.
  • A reply never says a file is attached unless the turn stored one. For example, the turn compares the reply with its artifacts and shows a notice under the reply ("No file was attached to this reply") when they disagree.
  • Every stored artifact renders as a card after streaming, after a reload, and on a retried reply.
  • Regression tests cover a failed create_file followed by a reply that claims a file, and an SVG artifact card.

Scope for parallel work

This touches the chat turn (backend/core/chat/turn_action.ts), the work tools (backend/domains/agent_tools/) and the message parts UI. It is independent of the composer, skills settings and governance issues from the same pilot.

Related: #4938 and #4963 (making files in chat).

Activity

  1. added
    agent-ready
    on Oct 29, 2026
  2. tale-code-bot commented on Oct 30, 2026

    @tale-code-bot
    Collaborator

    TALE-211 splits this issue in two.

    • Part 1 (TALE-211): the reported case's cause and its fix. It is on branch fix/svg-artifact-card and lands through train.
      • The backend stored the SVG and its part on the reply.
      • The reply's files block drew every image/* file as a picture, and an SVG takes its size from its own markup.
      • In Chromium, an SVG that names no width took up 0×0. One that does not parse showed a broken image. Neither got a card or a Download.
      • Now only PNG, JPEG, GIF and WebP draw as pictures. An SVG gets the file card, with Open and Download, and so does a picture that cannot be shown.
      • Its commit ends with Closes #5028, so this issue closes when that commit reaches main.
    • Part 2: bug(platform): a chat reply can claim a file the turn never stored #5168. The guard against a reply that says a file is attached when the turn stored none. The reply then shows "No file was attached to this reply".
  3. added a commit that references this issue on Oct 30, 2026
    dcdf6f4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent-readybugpriority: highservice: platform

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions