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
- Configure the Xiaomi Mimo Token Plan (CN) model in Finch.
- Test the API connection or send a message.
- Observe: the validation fails with "invalid/illegal key" error.
- Toggle the "Xiaomi Mimo" switch off and on.
- Toggle the "Xiaomi Token Plan (CN)" switch off and on.
- Repeat steps 4-5 a few times.
- 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
Environment
- App: Finch
1.4.2 (build 853) — Desktop
- OS: macOS
26.4.1 (25E253)
Steps to reproduce
Expected behavior
Actual behavior
Suggested fix direction
Screenshots
Environment
1.4.2 (build 853)— Desktop26.4.1 (25E253)