Mintplex-Labs/anything-llm · warning · Error

Could not update agent plugin config.

Error message

Could not update agent plugin config.

What it means

Thrown by AgentPlugins.updatePluginConfig when the POST to /experimental/agent-plugins/:hubId/config returns non-OK, with the fixed string 'Could not update agent plugin config.'. As with toggleFeature the .catch discards the server reason and returns false, leaving callers unable to distinguish validation errors from auth errors.

Source

Thrown at frontend/src/models/experimental/agentPlugins.js:33

        if (!res.ok) throw new Error("Could not update agent plugin status.");
        return true;
      })
      .catch((e) => {
        console.error(e);
        return false;
      });
  },
  updatePluginConfig: async function (hubId, updates = {}) {
    return await fetch(
      `${API_BASE}/experimental/agent-plugins/${hubId}/config`,
      {
        method: "POST",
        headers: baseHeaders(),
        body: JSON.stringify({ updates }),
      }
    )
      .then((res) => {
        if (!res.ok) throw new Error("Could not update agent plugin config.");
        return true;
      })
      .catch((e) => {
        console.error(e);
        return false;
      });
  },
  deletePlugin: async function (hubId) {
    return await fetch(`${API_BASE}/experimental/agent-plugins/${hubId}`, {
      method: "DELETE",
      headers: baseHeaders(),
    })
      .then((res) => {
        if (!res.ok) throw new Error("Could not delete agent plugin config.");
        return true;
      })
      .catch((e) => {
        console.error(e);

View on GitHub (pinned to 526360e320)

Solutions

  1. Validate the updates object shape against the plugin's schema before sending.
  2. Confirm the plugin is enabled and accepts config writes.
  3. Check the network response body for the real validation error.
  4. Re-authenticate if the response status is 401/403.

Example fix

// before
const ok = await AgentPlugins.updatePluginConfig(hubId, updates);

// after - guard inputs and inspect raw response on failure
const ok = await AgentPlugins.updatePluginConfig(hubId, updates);
if (!ok) {
  const r = await fetch(`${API_BASE}/experimental/agent-plugins/${hubId}/config`, { method:'POST', headers: baseHeaders(), body: JSON.stringify({ updates }) });
  showToast(`Config update failed (HTTP ${r.status})`, 'error');
}
Defensive patterns

Strategy: validation

Validate before calling

function validateConfigUpdates(hubId, updates) {
  if (!hubId) return 'hubId is required';
  if (!updates || typeof updates !== 'object' || Array.isArray(updates))
    return 'updates must be a plain object';
  return null;
}

Type guard

/** @param {unknown} r */
function isConfigResult(r) { return typeof r === 'boolean'; }

Try / catch

const ok = await AgentPlugins.updatePluginConfig(hubId, updates);
if (!ok) showToast('Could not update plugin config - check schema and permissions', 'error');

Prevention

When it happens

Trigger: updates object fails server-side schema validation; plugin config locked or read-only; hubId unknown; experimental flag off; non-admin caller.

Common situations: Sending a partial updates object missing required keys; plugin was disabled and rejects config writes; config field type mismatch (string vs object); backend version with a stricter schema than the frontend assumes.

Related errors


AI-assisted analysis of Mintplex-Labs/anything-llm@526360e320 (2026-08-13). Data as JSON: /api/errors/cf097b6aa4436c01. Report an issue: GitHub.