mirror of
https://github.com/mudler/LocalAI.git
synced 2026-11-06 04:23:15 -05:00
The host sent only the files a turn made or changed. A person who asked in a messaging app for a file that already existed got nothing. Add the attach_file tool. It is offered only in a chat that a connector started whose binding sends files, so a chat in Studio has no such tool. It takes a path as the file tools show it, checks the file against the chat's access (a scoped agent reaches only its folders), the type allowlist, the size limit and the count, and marks it. When it refuses, the result says why in plain words so the model can tell the person. sendFiles now sends the files the turn made, then the attached ones, each path once and at most five in all. It reads them with the chat's access resolved at send time. Delivery is the existing send_file op, so every connector add-on that implements it gets the feature with no code of its own. A failed send says "I could not send X" and adds the reason the add-on reports, cut to one short line. The marks are kept in the memory of the process, like the other per-turn state of the connector manager. Assisted-by: Claude Code:claude-sonnet-5-5 Signed-off-by: Ettore Di Giacinto <mudler@localai.io>