Skip to content

[BUG] OpenAI API Error: #28

Backlog
Backlog

Description

@weltenseglr

Describe the bug
API Error: Unsupported parameter: 'max_tokens' is not supported with this model. Use 'max_completion_tokens' instead.

To Reproduce

  1. Go to extension settings
  2. Navigate to API Key Configuration, select a model newer that at least GPT-5, e.g. gpt-5-nano-2025-08-07 or gpt-6-luna
  3. Click 'Test API Connection'

Expected behavior
API connection test succeeds, any model can be used

Screenshots
image

Environment:

  • Thunderbird Version: 160.0 (x64)
  • AutoSort+ Version: 1.4.1
  • OS: archlinux

Logs

Settings retrieved: 
Object { hasApiKey: true, provider: "openai", labels: (14) […], enableAi: true }
[background.js:921:17](moz-extension://7b97a684-fb87-4d4b-a02f-049fade04fbe/background.js)
Making API request to OpenAI... [background.js:1066:21](moz-extension://7b97a684-fb87-4d4b-a02f-049fade04fbe/background.js)
API response status: 400 [background.js:1233:21](moz-extension://7b97a684-fb87-4d4b-a02f-049fade04fbe/background.js)
API Error details: Unsupported parameter: 'max_tokens' is not supported with this model. Use 'max_completion_tokens' instead. [background.js:1252:25](moz-extension://7b97a684-fb87-4d4b-a02f-049fade04fbe/background.js)
API response status: 400 [background.js:1233:21](moz-extension://7b97a684-fb87-4d4b-a02f-049fade04fbe/background.js)
API Error details: Unsupported parameter: 'max_tokens' is not supported with this model. Use 'max_completion_tokens' instead. [background.js:1252:25](moz-extension://7b97a684-fb87-4d4b-a02f-049fade04fbe/background.js)
API response status: 400 [background.js:1233:21](moz-extension://7b97a684-fb87-4d4b-a02f-049fade04fbe/background.js)
API Error details: Unsupported parameter: 'max_tokens' is not supported with this model. Use 'max_completion_tokens' instead. [background.js:1252:25](moz-extension://7b97a684-fb87-4d4b-a02f-049fade04fbe/background.js)
[AutoSort+] AutoSort+ Batch Complete: Processed 53 message(s): 0 sorted, 53 skipped, 0 failed [background.js:712:13](moz-extension://7b97a684-fb87-4d4b-a02f-049fade04fbe/background.js)
Top

Activity

  1. added
    bug
    on Nov 30, 2026
  2. github-actions commented on Nov 30, 2026

    @github-actions
    Contributor

    👋 Welcome and thanks for opening your first issue!

    We appreciate you taking the time to contribute or report a problem. Someone will review this as soon as possible. In the meantime, please make sure you've included all relevant details (like logs, steps to reproduce, or environment info).

  3. Nigel1992 commented on Nov 30, 2026

    @Nigel1992
    Owner

    Thanks for the detailed report, @weltenseglr — this is fixed in v1.4.2 🎉

    📥 Download

    What changed

    • OpenAI requests now use max_completion_tokens instead of max_tokens.
    • If a newer model rejects another parameter (for example a non-default temperature), AutoSort+ automatically retries without it.
    • Older models that only accept max_tokens still work.
    • The Test API Connection button uses the same compatibility logic.
    • The OpenAI completion budget was increased so reasoning models have room for hidden reasoning before returning the folder label.

    Install in Thunderbird

    1. Download autosortplus.xpi using the link above.
    2. Open Thunderbird → Menu (☰) → Add-ons and Themes.
    3. Click the gear icon → Install Add-on From File...
    4. Select the downloaded .xpi file.
    5. Click Add and restart Thunderbird if prompted.

    Please give it a try with gpt-5-nano-2025-08-07 (or another GPT-5+ model) and let me know if it works. I'll leave this issue open until you confirm — thanks again!

  4. Nigel1992 commented on Dec 4, 2026

    @Nigel1992
    Owner

    @weltenseglr Could you kindly confirm this is now fixed?

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

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions