Mintplex-Labs/anything-llm · error
e.message
Error message
e.message
What it means
GET /agent-skills/filessystem-agent/is-available responds 500 with {available:false, error:e.message} when require('../utils/agents/aibitat/plugins/filesystem/lib') fails or isToolAvailable() throws. In stock builds isToolAvailable only reads env vars (true when NODE_ENV=development or ANYTHING_LLM_RUNTIME=docker), so it virtually never throws; the realistic cause is the require failing in trimmed/custom installs.
Solutions
- Run require('server/utils/agents/aibitat/plugins/filesystem/lib') in node on the server host to surface the module-resolution error directly
- Reinstall dependencies (npm ci) so the plugin's dependency graph is complete
- Treat the `available:false` in the response as authoritative and disable the filesystem skill in the UI until fixed
Defensive patterns
Strategy: fallback
Validate before calling
async function filesystemAgentAvailable() {
try {
const res = await fetch('/api/agent-skills/filesystem-agent/is-available');
const body = await res.json();
return body.available === true;
} catch {
return false; // endpoint itself failing means treat as unavailable
}
} Try / catch
try {
const { available } = await checkAvailability('filesystem-agent');
if (!available) disableSkillUI('filesystem-agent');
} catch (err) {
disableSkillUI('filesystem-agent'); // fallback: feature off on any error
console.warn('availability probe failed:', err.message);
} Prevention
- Never hard-fail a page on the availability probe — always degrade to 'skill unavailable'
- After dependency changes, smoke-test the require chain: node -e "require('.../filesystem/lib')"
- Expect available:false outside docker/development; it reflects ANYTHING_LLM_RUNTIME and NODE_ENV, not an error
When it happens
Trigger: The filesystem plugin module or one of its transitive deps (e.g. 'diff') missing from node_modules — partial install, tree-shaken docker image, or file removed; a syntax/require error inside the plugin's dependency graph.
Common situations: Custom Docker images that prune files; npm install interrupted; upgrading with lockfile drift where 'diff' was dropped.
Understand the failure class
Background: "X is not installed. Please install it with pip install Y": missing optional dependency errors — ImportError/ValueError raised when a library's optional extra was never installed — this error's family across 22 libraries.
Related errors
AI-assisted analysis of Mintplex-Labs/anything-llm@3aec848f28 (2026-08-18).
Data as JSON: /api/errors/9b828fe444ff3077.
Report an issue: GitHub.
Appendix: source
Thrown at server/endpoints/agentSkillWhitelist.js:24
ROLES,
} = require("../utils/middleware/multiUserProtected");
function agentSkillWhitelistEndpoints(app) {
if (!app) return;
app.get(
"/agent-skills/filesystem-agent/is-available",
[validatedRequest],
async (_request, response) => {
try {
const filesystemTool = require("../utils/agents/aibitat/plugins/filesystem/lib");
return response
.status(200)
.json({ available: filesystemTool.isToolAvailable() });
} catch (e) {
console.error(e);
return response
.status(500)
.json({ available: false, error: e.message });
}
}
);
app.get(
"/agent-skills/create-files-agent/is-available",
[validatedRequest],
async (_request, response) => {
try {
const createFilesTool = require("../utils/agents/aibitat/plugins/create-files/lib");
return response
.status(200)
.json({ available: createFilesTool.isToolAvailable() });
} catch (e) {
console.error(e);
return response
.status(500)View on GitHub (pinned to 3aec848f28)