Mintplex-Labs/anything-llm · error · Error
Foundry Local crashed trying to reply to this message. You…
Error message
Foundry Local crashed trying to reply to this message. You should change the message or try again.
What it means
Failure sentinel in FoundryLLM.#handleFunctionCallChat: the local Foundry inference process crashed or terminated mid-reply, so no completion content is available; the message advises changing the input or retrying since the crash is typically input- or load-dependent.
Solutions
- Retry the message or rephrase it.
- Restart the Foundry Local service and confirm the model is loaded.
- Check Foundry Local logs for the crash reason.
Defensive patterns
Strategy: retry
When it happens
Trigger: Foundry Local provider crashes while generating a chat completion for a user message.
Common situations: This error is raised at runtime in server/utils/agents/aibitat/providers/foundry.js. It occurs when the required configuration for this provider is missing or invalid (unset environment variables, empty API key or base path), when the external service is unreachable or returns an unexpected response, or when invalid input reaches the call site. To prevent it, validate the relevant provider settings and environment variables at startup and confirm the service is reachable before this code path executes.
AI-assisted analysis of Mintplex-Labs/anything-llm@3aec848f28 (2026-08-18).
Data as JSON: /api/errors/dc93bb1b49459048.
Report an issue: GitHub.
Appendix: source
Thrown at server/utils/agents/aibitat/providers/foundry.js:136
async #handleFunctionCallChat({ messages = [] }) {
await this.#assertContextLimits();
return await this.client.chat.completions
.create({
model: this.model,
messages,
max_completion_tokens: FoundryLLM.promptWindowLimit(this.model),
})
.then((result) => {
if (!result.hasOwnProperty("choices"))
throw new Error("Microsoft Foundry Local chat: No results!");
if (result.choices.length === 0)
throw new Error("Microsoft Foundry Local chat: No results length!");
return result.choices[0].message.content;
})
.catch((e) => {
if (this.#isPrematureClose(e))
throw new Error(FoundryLLM.explainStreamError(e, this.model));
return null;
});
}
async #handleFunctionCallStream({ messages = [] }) {
await this.#assertContextLimits();
return await this.client.chat.completions.create({
model: this.model,
stream: true,
messages,
max_completion_tokens: FoundryLLM.promptWindowLimit(this.model),
});
}
/**
* Stream a chat completion with tool calling support.
* Uses native tool calling when supported, otherwise falls back to UnTooled.
*/View on GitHub (pinned to 3aec848f28)