branch: externals/minuet commit df2478180b180d2a967e6f331535c1f8d45eaadb Author: Milan Glacier <d...@milanglacier.com> Commit: Milan Glacier <d...@milanglacier.com>
refactor: improve fim provider error message. Also add troubleshooting section in README. --- README.md | 15 +++++++++++++++ minuet.el | 7 +++++++ 2 files changed, 22 insertions(+) diff --git a/README.md b/README.md index b9c37c967b..fad4351afb 100644 --- a/README.md +++ b/README.md @@ -505,3 +505,18 @@ request timeout from outputing too many tokens. ``` </details> + +# Troubleshooting + +If your setup failed, there are two most likely reasons: + +1. You are setting the API key to a literal value instead of the environment + variable name. +2. You are using a context window that is too large, causing completion items + to timeout before returning. It is recommended to: + - Test with manual completion first + - Use a smaller context window (e.g., `context_window = 768`) + - Set a longer request timeout (e.g., `request_timeout = 5`) to + evaluate your provider's response time + +To diagnose issues, examine the buffer content from `*minut*` diff --git a/minuet.el b/minuet.el index 9e4af4be27..d8183d133f 100644 --- a/minuet.el +++ b/minuet.el @@ -739,6 +739,13 @@ Return nil if not exists or is an empty string." (getenv api-key) (when (functionp api-key) (funcall api-key))))) + (when (or (null key) + (string-empty-p key)) + (minuet--log + (if (stringp api-key) + (format "%s is not a valid environment variable. +If using ollama you can just set it to 'TERM'." api-key) + "The api-key function returns nil or returns an empty string"))) (and (not (equal key "")) key)))