Skip to content

Return value of gptel-make-anthropic causes a parse error in customize #1141

@albcorp

Description

@albcorp

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

WHAT I DID

Updated to 0.9.9.3

Created a backend for anthropic using the code in the README, namely:

        (setq gptel-backend
          (gptel-make-anthropic "Claude"
            :stream t
            :key 'gptel-api-key-from-auth-source))

Started a chat -- SUCCESS

Opened the customise group for gptel -- FAIL

WHAT I EXPECTED

To be able to access all the customise options

WHAT I FOUND

The customisation group is truncated, apparently by a parse error

Parent groups: Hypermedia

Gptel group: Interact with LLMs from anywhere in Emacs.
       State : UNKNOWN, you should not see this.
   
Show Value Gptel Api Key 
    State : UNINITIALIZED, you should not see this.
   An API key (string) for the default LLM backend. More

Hide Gptel Backend: Choice: Value Menu Other backend: 
#s(gptel-anthropic "Claude" "api.anthropic.com" #<subr
                   F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_26>
                   "https" t "/v1/messages" gptel-api-key-from-auth-source
                   (claude-sonnet-4-5-20250929 claude-haiku-4-5-20251001
                                               claude-sonnet-4-20250514
                                               claude-opus-4-1-20250805
                                               claude-opus-4-20250514
                                               claude-3-7-sonnet-20250219
                                               claude-3-5-sonnet-20241022
                                               claude-3-5-sonnet-20240620
                                               claude-3-5-haiku-20241022
                                               claude-3-opus-20240229
                                               claude-3-haiku-20240307)
                   "https://api.anthropic.com/v1/messages" nil nil nil)
    State : UNINITIALIZED, you should not see this.
   LLM backend to use. More

WORK AROUND

Revert to earlier version

Backend

Anthropic

Steps to Reproduce

Update to 0.9.9.3

Create a backend for Anthropic using the code in the README, namely:

        (setq gptel-backend
          (gptel-make-anthropic "Claude"
            :stream t
            :key 'gptel-api-key-from-auth-source))

Start a chat -- SUCCESS

Open the customise group for gptel -- FAILURE

Parent groups: Hypermedia

Gptel group: Interact with LLMs from anywhere in Emacs.
       State : UNKNOWN, you should not see this.
   
Show Value Gptel Api Key 
    State : UNINITIALIZED, you should not see this.
   An API key (string) for the default LLM backend. More

Hide Gptel Backend: Choice: Value Menu Other backend: 
#s(gptel-anthropic "Claude" "api.anthropic.com" #<subr
                   F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_26>
                   "https" t "/v1/messages" gptel-api-key-from-auth-source
                   (claude-sonnet-4-5-20250929 claude-haiku-4-5-20251001
                                               claude-sonnet-4-20250514
                                               claude-opus-4-1-20250805
                                               claude-opus-4-20250514
                                               claude-3-7-sonnet-20250219
                                               claude-3-5-sonnet-20241022
                                               claude-3-5-sonnet-20240620
                                               claude-3-5-haiku-20241022
                                               claude-3-opus-20240229
                                               claude-3-haiku-20240307)
                   "https://api.anthropic.com/v1/messages" nil nil nil)
    State : UNINITIALIZED, you should not see this.
   LLM backend to use. More

Additional Context

emacs-version is a variable defined in ‘C source code’.

Its value is "30.2"

Fedora 42

Backtrace

Log Information

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