`NullPointerException` in `chat/prompt*` when no model is selected — crashes all commands including `/doctor` and `/login`
Describe the bug
When starting ECA with no provider configured (fresh install, empty or no ~/.config/eca/config.json), every command — including /doctor, /login, and any chat prompt — crashes with a NullPointerException in eca.features.chat/prompt*. The clojure.string/split at chat.clj:1498 receives nil instead of a string (likely the model name), causing Pattern.split to NPE.
This makes it impossible to complete the initial /login flow without a workaround.
To Reproduce
- Install eca-emacs, let it auto-download the ECA server
- Ensure
~/.config/eca/config.jsonis either absent or{} - Ensure no cached credentials exist (
~/.cache/eca/has no prior auth) M-x ecato start- Type
/doctoror/loginor any text and press RET
Expected behavior
/login shows the provider selection flow; /doctor shows diagnostic info.
Doctor
Doctor command returns the same error.
Workaround
Setting eca-chat-custom-model in Emacs to a valid model name (e.g. "anthropic/claude-sonnet-4.5") before starting ECA allows /login to succeed. After login completes and credentials are cached, the custom model override can be removed.
Root cause
clojure.string/split at chat.clj:1498 is called on a nil value (likely the selected model name) without a nil guard. The prompt* function should either check for nil before splitting or gracefully handle the no-model-selected state, especially for commands like /login and /doctor that don't require a model.
Hence reporting it here and not on eca-emacs.
Additional context
ECA version: 0.101.0 (nightly)
Editor: Emacs 30.2, eca-emacs from MELPA
OS: Fedora 43
**Backtrace**
#error {
:cause nil
:via
[{:type java.lang.NullPointerException
:message nil
:at [java.util.regex.Matcher getTextLength Matcher.java 1806]}]
:trace
[[java.util.regex.Matcher getTextLength Matcher.java 1806]
[java.util.regex.Matcher reset Matcher.java 459]
[java.util.regex.Matcher
Good catch! I will fix it, it was a recent regression
Excellent, many thanks!