Open
Description
Bug
Sending an empty prompt crashes foundry with:
Prompt cannot be empty
An unexpected error occurred.
Exception: Index was outside the bounds of the array.
Repro steps
foundry model run <model>
Send empty prompt (just hit enter).
The inference session terminates and foundry exits.
Example:
~/ foundry model run deepseek-r1-7b
Model deepseek-r1-distill-qwen-7b-generic-gpu was found in the local cache.
Interactive Chat. Enter /? or /help for help.
Interactive mode, please enter your prompt
> hi
🤖 <think>
</think>
Hello! How can I assist you today? 😊
>
Prompt cannot be empty
An unexpected error occurred.
Exception: Index was outside the bounds of the array.
This is especially annoying when you are in the middle of a longer chat session, and you lose everything. The error should be caught and session should be maintained.
Environment info
foundry --version
0.4.92+ec3b20cb26
MacOS Sequoia 15.5
M1 Pro