From 0ec6255f23aedf65f287ca1f5af613af4b3813c9 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Wed, 11 Mar 2026 22:04:34 -0400 Subject: [PATCH] fix(llm): gptel-magit: interop w/ gptel-include-reasoning Resolves an upstream issue caused if `gptel-include-reasoning` is enabled. Solution is adapted from a reply to the report.. Ref: ragnard/gptel-magit#8 --- modules/tools/llm/config.el | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/modules/tools/llm/config.el b/modules/tools/llm/config.el index 7093494be..a34f71108 100644 --- a/modules/tools/llm/config.el +++ b/modules/tools/llm/config.el @@ -27,7 +27,19 @@ (use-package! gptel-magit :when (modulep! :tools magit) - :hook (magit-mode . gptel-magit-install)) + :hook (magit-mode . gptel-magit-install) + :config + ;; HACK: `gptel-include-reasoning' can break gptel-magit, and needs to be + ;; excluded if you use openrouter. + ;; REVIEW: Remove when ragnard/gptel-magit#8 is resolved. + (defadvice! +llm--fix-gptel-magit--omit-reasoning-a (fn &rest args) + :around #'gptel-magit--generate + (let ((gptel-include-reasoning nil) + (gptel--request-params + (if (eq gptel-magit-backend gptel--openrouter) + '(:reasoning (:exclude t :effort "minimal")) + nil))) + (apply fn args)))) (use-package! ob-gptel