Mintplex-Labs/anything-llm · error

No valid updates provided.

Error message

No valid updates provided.

What it means

The 400 reply from POST /telegram/update-config when the request carries nothing the endpoint can apply. The only updatable field is voice_response_mode, and it is accepted solely when it is a truthy string equal to 'text_only', 'mirror', or 'always_voice'. Any other value, a missing field, or a differently-named key leaves the updates object empty and triggers this error before any database write.

Source

Thrown at server/endpoints/telegram.js:310

  app.post(
    "/telegram/update-config",
    [validatedRequest, isSingleUserMode],
    async (request, response) => {
      try {
        const { voice_response_mode } = reqBody(request);
        const updates = {};

        if (
          voice_response_mode &&
          ["text_only", "mirror", "always_voice"].includes(voice_response_mode)
        ) {
          updates.voice_response_mode = voice_response_mode;
        }

        if (Object.keys(updates).length === 0) {
          return response
            .status(400)
            .json({ success: false, error: "No valid updates provided." });
        }

        const { error } = await ExternalCommunicationConnector.updateConfig(
          "telegram",
          updates
        );
        if (error) {
          return response.status(500).json({ success: false, error });
        }

        // Update the running bot's config so changes take effect immediately
        const service = new TelegramBotService();
        if (service.isRunning) service.updateConfig(updates);

        return response.status(200).json({ success: true });
      } catch (e) {
        console.error(e.message, e);

View on GitHub (pinned to 3aec848f28)

Solutions

  1. Send exactly one of: {"voice_response_mode": "text_only" | "mirror" | "always_voice"} with Content-Type: application/json.
  2. Check casing - the comparison is exact ('text_only', not 'TextOnly').
  3. If you intended a different setting (workspace, approved users), use the dedicated endpoints; update-config only manages voice_response_mode.

Example fix

// before
{ "voice_response_mode": "always" }

// after
{ "voice_response_mode": "always_voice" }
Defensive patterns

Strategy: validation

Validate before calling

const VOICE_MODES = ["text_only", "mirror", "always_voice"];
function updateVoiceMode(mode) {
  if (!VOICE_MODES.includes(mode)) throw new Error(`voice_response_mode must be one of ${VOICE_MODES.join(" | ")}`);
  return fetch("/api/telegram/update-config", {
    method: "POST", headers: { "Content-Type": "application/json" },
    body: JSON.stringify({ voice_response_mode: mode }),
  });
}

Type guard

const isVoiceResponseMode = (v) =>
  v === "text_only" || v === "mirror" || v === "always_voice";

Prevention

When it happens

Trigger: POST /telegram/update-config with voice_response_mode set to an unsupported value ('voice', 'always', 'TEXT_ONLY'), with a typo'd key (voiceResponseMode), or with an entirely empty body. The whitelist check is case-sensitive, so capitalization also fails.

Common situations: Frontend dropdown values drifting from the supported enum; client sending the whole config object instead of the single field; API consumers guessing the value names without reading the enum.

Understand the failure class

Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.

Related errors


AI-assisted analysis of Mintplex-Labs/anything-llm@3aec848f28 (2026-08-18). Data as JSON: /api/errors/b6f5a1fe1dd4d3c4. Report an issue: GitHub.