Skip to content

Calling tool stuck/frozen a lot while using gptel in agentic manner #1505

Description

@lucaspeixotot

Please update gptel first -- errors are often fixed by the time they're reported.

  • I have updated gptel to the latest commit and tested that the issue still exists

Bug Description

Gptel works perfectly if I try to use for simple things, using it like a google or something like that. However, if I try to use it in a more agentic way, to investigate code bases, to plan features, to work with MCP servers and so, it is currently impossible.

I use github copilot in te work but the same experience happen by using deepseek in my personal computer. More agentic you use it more buggy it becomes.

My main issue is "Calling tools" stuck, and the experience is like this:

Image

Usually I need to run gptel-abort many times, and ask new prompts until I get it unblocked. But either way in subsequent prompts the same error happens.

I'm not sure how to debug this. toggle-on-debug-error doesn't show anything. I have notice that some models are worse than others. GPT 5.5 is the one that works better, Opus is a disaster, and this gpt 5.6 looks bad as well.

I really love gptel and I would like to use it more and more in agentic manners. Even after the last meeting that Karthink participated where a new feature of invoking gptel outside an gptel buffer with floating windows is suppose to be release. But for me this kind of error is a blocker to use gptel for more things than googling it.

Backend

Other (please specify in Additional Context)

Steps to Reproduce

Just try to use gptel with gptel-agent, MCPs, and ask to do complex things like checking code on different repos, planning a change, doing a change, and so. This is what I want to do and I always get calling tools stuck.

Additional Context

I'm using emacs at "GNU Emacs 30.2.50 (build 4, x86_64-pc-linux-gnu, GTK+ Version 3.24.41, cairo version 1.18.0)
of 2026-07-03"

My emacs runs in a WSL2 Ubuntu. But in my personal computer with Arch Linux the same problem happens.

My emacs config is simple:

(use-package gptel
  :straight (gptel :host github :repo "karthink/gptel" :branch "master")
  :bind (
         ("C-c a n" . gptel)
         ("C-c a s" . gptel-send)
         ("C-c a r" . gptel-rewrite)
         ("C-c a m" . gptel-menu)
         ("C-c a a" . gptel-add)
         ("C-c a c a" . gptel-context-add)
         ("C-c a c f" . gptel-context-add-file)
         ("C-c a c R" . gptel-context-remove-all)
         )

  :custom
  (gptel-expert-commands t)
  (gptel-default-mode 'org-mode)
  :config
  (setf (alist-get 'org-mode gptel-prompt-prefix-alist) "@user\n")
  (setf (alist-get 'org-mode gptel-response-prefix-alist) "@assistant\n")
  (gptel-make-deepseek "PersonalDeepseek" ;Any name you want
    :stream t                             ;for streaming responses
    :key (getenv "DEEPSEEK_API_KEY_EMACS")) ;can be a function that returns the key
  (gptel-make-gh-copilot "copilot")

  ;; 1) The directive: the actual prompt instructions
  (setf (alist-get 'english-refine gptel-directives)

        "...")

  ;; 2) The preset: bundles the directive with useful defaults
  (gptel-make-preset 'english-refine
    :description "Rewrite English text with 4 variants and feedback"
    :system 'english-refine
    :include-reasoning nil)
  )

(use-package gptel-agent
  :straight (gptel-agent :host github :repo "karthink/gptel-agent" :branch "master")
  :config
  (advice-add 'gptel-agent--fontify-block :override 'ignore)
  ;;  SDLC marketplace: design-workflow agents and skills.
  ;; Agents dir: files are read directly (non-recursive) as agent definitions.
  (let ((my-workflow "~/.../"))
    (when (file-directory-p my-workflow)
      (add-to-list 'gptel-agent-dirs (expand-file-name "agents/" my-workflow))
      ;; Skills dir: scanned recursively for */SKILL.md.
      (add-to-list 'gptel-agent-skill-dirs (expand-file-name "skills/" my-workflow))))
  ;; Personal skills directory. Each skill is a sub-folder containing a
  ;; SKILL.md file (see https://agentskills.io).
  (add-to-list 'gptel-agent-skill-dirs "~/custom_skills/")
  (gptel-agent-update)
  )

Backtrace

I don't see any backtrace being raised.

Log Information

I enabled the log level to debug, but where is the log buffer? I couldn't know how to open it.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions