{"slug": "aiclaw-now-returns-tool-output-attachments-you-can-actually-download", "title": "AIClaw Now Returns Tool Output Attachments You Can Actually Download", "summary": "AIClaw has updated its agent system to make tool-generated file attachments directly downloadable. The change collects, deduplicates, and exposes files in API responses and streaming chunks, linking them in the final assistant message with stable download URLs. This closes the loop between tool execution and user-visible results, improving usability for artifact-producing workflows.", "body_md": "AIClaw already let agents run tools, generate files, and continue working across steps. The weak point was the handoff back to the user: a tool might create a report, image, or data file, but the final answer did not always make that output obvious or directly downloadable.\n\nRecent AIClaw changes tightened that workflow. Tool-generated files are now collected, deduplicated, exposed in API responses and streaming completion chunks, linked into the final assistant message, and rendered by the chat UI through stable `/public/files/<uuid>`\n\ndownload URLs.\n\nThis is not a cosmetic change. It closes the loop between tool execution and user-visible results.\n\nIn a tool-using agent system, “I created the file” is not enough. Users need to:\n\nWithout that, generated artifacts are easy to lose, especially when an agent uses multiple tools or delegates work to sub-agents.\n\nThe recent attachment work is visible across the backend and frontend.\n\nOn the execution side, AIClaw now:\n\n`sub_agent`\n\nresultsYou can see that in the tool execution path:\n\n`/Users/yu/go/src/github.com/chowyu12/aiclaw/internal/agent/tool_call.go`\n\n`/Users/yu/go/src/github.com/chowyu12/aiclaw/internal/agent/executor.go`\n\nThe final assistant response now appends an attachment section with Markdown links such as:\n\n```\nAttachment List:\n- [report.csv](/public/files/<uuid>)\n- [chart.png](/public/files/<uuid>)\n```\n\nIn the current Chinese codebase revision, that section is rendered as `附件列表`\n\nin the saved final content.\n\nThe response payload also includes files directly:\n\n`files`\n\n`done`\n\nchunks now include `files`\n\nThat path is visible in:\n\n`/Users/yu/go/src/github.com/chowyu12/aiclaw/internal/model/message.go`\n\n`/Users/yu/go/src/github.com/chowyu12/aiclaw/internal/handler/chat.go`\n\n`/Users/yu/go/src/github.com/chowyu12/aiclaw/web/src/api/chat.ts`\n\nOn the frontend, the chat view turns those file objects into clickable downloads through `/public/files/${file.uuid}`\n\n:\n\nThis feature is useful anywhere an AIClaw agent produces artifacts instead of pure text.\n\nExamples:\n\n`code_interpreter`\n\ntask generates a CSV and a PNG chart.Before this improvement, users could still end up asking, “Where did the file go?”\n\nNow the expected workflow is much cleaner:\n\nThat means AIClaw behaves more like a practical work system and less like a text-only chatbot that happens to call tools.\n\nOne useful part of this change is that file outputs are not limited to the top-level agent.\n\nThe executor now extracts file references from `sub_agent`\n\nresults and folds them back into the parent response. That matters because many real AIClaw workflows split research, scraping, or data prep into delegated tasks. If child artifacts disappear at the parent boundary, the system feels unreliable.\n\nBringing those files back into the parent answer makes nested agent execution much easier to trust.\n\nThe same change set also adds SSE ping support in chat streaming handlers. That is separate from attachments, but it helps long-running tool workflows stay alive while the agent is still working.\n\nFor attachment-heavy runs, that pairing is useful:\n\n`done`\n\nchunk can carry the generated filesThis is a good example of AIClaw’s local-first, tool-oriented design philosophy. The platform is not just trying to produce a nice paragraph. It is trying to complete work and return the artifacts that work produces.\n\nGenerated files are often the real output. Making them first-class in the response path is the right move.\n\nIf you are building with AIClaw, this is the kind of feature that improves daily usability more than another abstract prompt tweak.", "url": "https://wpnews.pro/news/aiclaw-now-returns-tool-output-attachments-you-can-actually-download", "canonical_source": "https://dev.to/chowyu12/aiclaw-now-returns-tool-output-attachments-you-can-actually-download-23jo", "published_at": "2026-06-28 11:48:42+00:00", "updated_at": "2026-06-28 12:33:48.588612+00:00", "lang": "en", "topics": ["ai-agents", "developer-tools", "ai-infrastructure"], "entities": ["AIClaw", "Chow Yu"], "alternates": {"html": "https://wpnews.pro/news/aiclaw-now-returns-tool-output-attachments-you-can-actually-download", "markdown": "https://wpnews.pro/news/aiclaw-now-returns-tool-output-attachments-you-can-actually-download.md", "text": "https://wpnews.pro/news/aiclaw-now-returns-tool-output-attachments-you-can-actually-download.txt", "jsonld": "https://wpnews.pro/news/aiclaw-now-returns-tool-output-attachments-you-can-actually-download.jsonld"}}