Skip to content

refactor(kimi): read stored OAuth token without refreshing - #5

Merged
xxchan merged 1 commit into
mainfrom
kimi-usage-only
Aug 30, 2026
Merged

xxchan merged 1 commit into
mainfrom
kimi-usage-only

Conversation

@xxchan

@xxchan xxchan commented Aug 30, 2026

Copy link
Copy Markdown
Member

Per the usage-only ruling (只查 usage,不做刷新), oar no longer refreshes or rewrites Kimi's CLI-owned credential store.

  • oauth-token.ts shrinks from 283 to ~50 lines: storedKimiAccessToken(auth) reads access_token as-is; missing/unparsable credential → KimiReauthError. No expiry check needed — a stale token surfaces as the usage endpoint's 401/403, which account-usage.ts already maps to reauth_required.
  • Removes proper-lockfile + @types/proper-lockfile (no more lockfile/atomic-rotation machinery).
  • Replaces the refresh/lock test with read-only coverage: expired token is sent as-is and 401 maps to reauth; missing token reports reauth without any network request.

🤖 Generated with Claude Code

Per the usage-only ruling, oar no longer refreshes or rewrites Kimi's
credential store. storedKimiAccessToken reads the CLI-owned token as-is;
a stale token surfaces as the usage endpoint's 401/403, which the reader
already maps to reauth_required. Drops the refresh/lock apparatus and the
proper-lockfile dependency.

Co-Authored-By: Claude Fable 5 <[email protected]>
@xxchan
xxchan merged commit 04c4a00 into main Aug 30, 2026
13 checks passed
@xxchan
xxchan deleted the kimi-usage-only branch October 3, 2026 07:50
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