Skip to content

Mimo Token Plan API Key intermittently fails ("invalid/illegal key"), toggling the model switch on/off recovers it #32

Description

@BlessedChild

When using the Xiaomi Mimo Token Plan (CN) model, the API key periodically fails validation with an "invalid/illegal key" error during connection or testing. However, the key itself is correct — the issue can be resolved by repeatedly toggling the "Xiaomi Mimo" and "Xiaomi Token Plan (CN)" switches on and off. After a few toggle attempts, the key passes validation again.

This suggests a transient state issue in the API key management layer rather than an actual invalid key.

Steps to reproduce

  1. Configure the Xiaomi Mimo Token Plan (CN) model in Finch.
  2. Test the API connection or send a message.
  3. Observe: the validation fails with "invalid/illegal key" error.
  4. Toggle the "Xiaomi Mimo" switch off and on.
  5. Toggle the "Xiaomi Token Plan (CN)" switch off and on.
  6. Repeat steps 4-5 a few times.
  7. Observe: the key now passes validation and the model works.

Expected behavior

  • A valid API key should consistently pass validation without needing to toggle switches.
  • If the key is truly invalid, the error should persist; if it's valid, it should always work.

Actual behavior

  • The same API key intermittently fails and succeeds validation.
  • Toggling the model switches (on/off) recovers it, indicating a state management issue.

Suggested fix direction

  • Check how API keys are cached, stored, or transmitted between toggles — is there a stale token or session state that gets cleared on toggle?
  • Verify that the Token Plan endpoint is correctly handling concurrent or repeated validation requests.

Screenshots

Image

Environment

  • App: Finch 1.4.2 (build 853) — Desktop
  • OS: macOS 26.4.1 (25E253)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions