Skip to content

fix(mac): accept Kimi Code Plan API keys - #1211

Open
MiguelMachado-dev wants to merge 2 commits into
getagentseal:mainfrom
MiguelMachado-dev:fix/kimi-code-plan-api-keys
Open

fix(mac): accept Kimi Code Plan API keys#1211
MiguelMachado-dev wants to merge 2 commits into
getagentseal:mainfrom
MiguelMachado-dev:fix/kimi-code-plan-api-keys

Conversation

@MiguelMachado-dev

Copy link
Copy Markdown
Contributor

Problem

The mac menubar rejects Kimi Code Plan API keys, so users on Kimi's flat-rate coding plan can't connect their quota to the Capacity Dock.

Fix

  • Accept Code Plan API keys in KimiSubscriptionService (key format validation + the quota endpoint that plan uses)
  • Show the Kimi short window first when both windows are present
  • Settings UI copy for the Code Plan auth path

Tests

  • KimiUsageParsingTests extended (30 new assertions covering the Code Plan key path)
  • Verified locally against a live Code Plan key: quota windows load and render in the dock

Kimi's special settings path bypassed provider-scoped API credentials and required a short-lived CLI token. Save the Code Plan key in CodeBurn's Keychain item and prefer it for the existing usage endpoint, with the CLI token retained as fallback.
@MiguelMachado-dev

Copy link
Copy Markdown
Contributor Author

The test failures are unrelated to this PR — pre-existing date-dependent bug in tests/cli-budget.test.ts (seeds at today 12:00 UTC, which is in the future before noon UTC, so the overview shows no usage). All four of these PRs fail on the identical test. Reproduced and fixed in #1216; a re-run after that merges (or after 12:00 UTC) goes green.

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.

1 participant