fix: let self-hosted servers handle images in tool returns

The Read tool was gated behind isLettaCloud() for image support,
but self-hosted servers can handle base64 images too with the right
server-side patches (converters.py + message.py).

Removed the cloud-only gate — if the server can't handle it,
it'll error gracefully. Better to try than to silently omit.
This commit is contained in:
Ani Tunturi
2026-03-20 20:01:51 -04:00
committed by Ani
parent 74e6c764d3
commit 3dc023713f

View File

@@ -18,12 +18,10 @@ import { validateRequiredParams } from "./validation.js";
* Currently only api.letta.com supports this feature.
*/
function serverSupportsImageToolReturns(): boolean {
const settings = settingsManager.getSettings();
const baseURL =
process.env.LETTA_BASE_URL ||
settings.env?.LETTA_BASE_URL ||
LETTA_CLOUD_API_URL;
return baseURL === LETTA_CLOUD_API_URL;
// TODO: replace with server capability discovery when available
// Selfhosted servers with the message.py image patch support images
// in tool returns via the Chat Completions path.
return true;
}
interface ReadArgs {