Conversation
- Add file state management (addFiles, removeFile, clearFiles) to InputStore - Add file upload button (Paperclip icon) at bottom-left of input area - Show file preview with name, size, and remove button for attached files - Integrate existing FileUpload component with drag & drop support - Update send button to allow sending when files are attached (even without text) - Clear attached files after sending message Co-Authored-By: David Mu <weigezailushang@gmail.com>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
| await stream.task({ input: this.input }); | ||
| this.clearFiles(); |
There was a problem hiding this comment.
🔴 Attached files are never sent to the backend and are silently discarded
The PR adds UI for file uploads and allows sending messages with only files attached (no text). However, in handleSend(), stream.task() is called with only { input: this.input } — the files array is never included in the request payload. Immediately after, this.clearFiles() discards the files. This means the entire file upload feature is non-functional: users can attach files and see them in the UI, but clicking send silently drops them. This is especially problematic when a user sends a message with files but no text input, as the TaskReq at packages/agent-core/src/service/handlers/task.ts:6-9 only accepts { input: string; sessionId?: string }, so the backend would receive an empty input string with no files.
Prompt for agents
The files collected in InputStore.files are never passed to stream.task() at input-store.ts:42. The call is `await stream.task({ input: this.input })` but the files are simply cleared on the next line. To fix this properly:
1. The TaskReq interface in packages/agent-core/src/service/handlers/task.ts needs to be extended to support file attachments (e.g., add a `files?: File[]` field).
2. The stream.task() method in app/web-app/src/stream/stream.ts needs to accept and forward the files.
3. The backend pipeline (TaskCtx, AgentController, etc.) needs to handle file content.
4. InputStore.handleSend() needs to pass `this.files` (as a plain array copy via `this.files.slice()`) to stream.task().
Without backend support for files, the UI should either not allow file uploads or should show an error when files are attached, rather than silently discarding them.
Was this helpful? React with 👍 or 👎 to provide feedback.
Summary
在聊天输入框左下角添加文件上传按钮,支持点击上传和拖拽上传文件。
具体改动:
InputStore 增加文件状态管理(
input-store.ts)filesobservable 数组存储已选文件addFiles()、removeFile()、clearFiles()方法Footer 组件集成文件上传功能(
footer.tsx)FileUpload/FileUploadTrigger/FileUploadContent组件justify-end改为justify-between,左侧上传按钮、右侧发送按钮Review & Testing Checklist for Human
Notes
TaskReq仅支持input: string,文件数据暂时只在 UI 层管理。后续可扩展TaskReq以支持将文件内容传递给 Agent 处理。FileUpload组件之前未被使用,本 PR 首次将其集成到实际功能中。Link to Devin session: https://app.devin.ai/sessions/d385bb1a2d7f41b4892cb0c13f7e2b34
Requested by: @RichDavidMu