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
This commit is contained in:
Henrik Lissner 2026-03-11 22:04:34 -04:00
parent 21e372b531
commit 0ec6255f23
No known key found for this signature in database
GPG key ID: B60957CA074D39A3

View file

@ -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