Open a bot's own files from a workspace conversation

A workspace run saves to the bot's own folder unless it picks the
workspace's, but a file chip in a workspace conversation only looked in
the workspace's folder, so those refs rendered as dead text. The chip
now sends both ids and the single-file lookup also searches the bot's
own folder for a user who reaches that bot.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
2026-10-27 17:41:46 +01:00
co-authored by Claude Opus 5.5
parent 211599e0fc
commit 2d3c15e48b
3 changed files with 17 additions and 4 deletions
@@ -27,10 +27,13 @@ function fetchFile({
if (cached) return cached;
const query = new URLSearchParams({ file_id: String(file_id) });
/**
* Both ids in a workspace: a bot working there saves to its own folder
* unless it picks the workspace's, and the chip has to find either.
*/
const query = new URLSearchParams({ file_id: String(file_id), bot_id: String(bot_id) });
if (workspace_id) query.set("workspace_id", String(workspace_id));
else query.set("bot_id", String(bot_id));
const pending = fetchApi<{}, APIResponseObject<BotFileScopesPayload>>(
`/api/admin/bots/files?${query.toString()}`,