Skip to content

feat(auth): add Kimi Code OAuth login - #851

Closed
euxaristia wants to merge 4 commits into
Twigpine:mainfrom
euxaristia:feat/kimi-oauth-login
Closed

euxaristia wants to merge 4 commits into
Twigpine:mainfrom
euxaristia:feat/kimi-oauth-login

Conversation

@euxaristia

@euxaristia euxaristia commented Jul 31, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Adds Kimi Code as an OAuth login option alongside ChatGPT, using the device-code flow with Kimi's required X-Msh-* vendor-identity headers
  • Introduces a dedicated internal/kimiidentity package to manage the per-device Kimi identity file, including lazy creation, abandoned/empty-file repair with an ownership-safe lock, and stripping the identity headers when a request retargets off the Kimi catalog endpoint
  • Provider catalog, CLI (zero auth kimi), and TUI onboarding all route through the shared device-code flow, with the desktop Enter key routed to device code and polling cancelled on every quit path

Test plan

  • go test ./internal/kimiidentity/... ./internal/oauth/... ./internal/providercatalog/... ./internal/tui/... ./internal/cli/...

Summary by CodeRabbit

  • New Features

    • Added Kimi Code as an OAuth provider with device-code authentication and managed coding endpoints.
    • Added the dedicated zero auth kimi login command.
    • Expanded OAuth setup guidance and automatic presets for Kimi Code, xAI, ChatGPT, and Hugging Face.
  • Bug Fixes

    • OAuth device login now cancels cleanly when exiting, navigating, or timing out.
    • Prevented stale login results and outdated provider headers from overwriting current settings.
    • Improved support for configured headers during OAuth requests.
    • Preserved custom headers when provider endpoints are overridden.
    • Improved secure handling and persistence of OAuth credentials and provider identity settings.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants