Skip to content

[Bug] Stuck in 401 Invalid Authentication loop - No way to log out or reset token (macOS) #121

Description

@somalamacia

Description:
After using the extension happily for a few weeks, today it suddenly stopped working. Whenever I try to use the chat, I get the following system error:

Service temporarily unavailable. {"jsonrpc":"2.0","id":"2_1773085892405","error":{"code":-32003,"message":"Error code: 401 - {'error': {'message': 'Invalid Authentication', 'type': 'invalid_authentication_error'}}","data":null}}

There is no way to use the chat anymore.

What I have tried (unsuccessfully):
I tried to completely uninstall and reinstall the extension, but I find myself already logged in, with the same chat history, and the exact same 401 error message when trying to open a new chat.

To force a new login prompt, I also tried:

Renaming storage.json and state.vscdb inside ~/Library/Application Support/Code/User/globalStorage/moonshot-ai.kimi-code. The extension just recreated them automatically without asking for a new API key.

Running the VS Code command Kimi Code: Reset Kimi (in case of any issues/no response). It did nothing, the 401 error persists.

Checking settings.json and macOS Keychain for any hidden Kimi/Moonshot tokens to delete, but found nothing obvious.

The Core Issue:
There seems to be no UI button, command palette option (like Kimi: Sign Out), or clear local file to forcefully delete the current corrupted/expired token and input a new one. The extension is completely stuck in this authentication loop.

Environment:

OS: macOS

VS Code version: Latest

Kimi Code Extension version: Latest

How can I completely wipe the authentication state locally to force the extension to ask for my API key again?

Any help is greatly appreciated!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions