kimi-code/packages/oauth
7Sageer 843a731097
fix: classify OAuth token refresh errors by cause (#838)
Map OAuth token-fetch failures to distinct public error codes instead of collapsing them all to auth.login_required:

- missing/revoked tokens or 401/403 from the refresh endpoint -> auth.login_required
- transport failures and 429/5xx after internal retries -> provider.connection_error
- anything else is rethrown as-is (surfaces as internal) rather than guessed

The refresh helper already retries internally, so the agent loop does not
re-retry these. Both the managed provider and the standalone SDK provider
share the same mapping.
2026-06-17 18:34:42 +08:00
..
examples Kimi For Coding 2026-05-22 15:54:50 +08:00
src fix: classify OAuth token refresh errors by cause (#838) 2026-06-17 18:34:42 +08:00
test fix: classify OAuth token refresh errors by cause (#838) 2026-06-17 18:34:42 +08:00
CHANGELOG.md ci: release packages (#390) 2026-06-04 21:45:01 +08:00
package.json ci: release packages (#390) 2026-06-04 21:45:01 +08:00
README.md Kimi For Coding 2026-05-22 15:54:50 +08:00
tsconfig.json Kimi For Coding 2026-05-22 15:54:50 +08:00
tsdown.config.ts Kimi For Coding 2026-05-22 15:54:50 +08:00
vitest.config.ts Kimi For Coding 2026-05-22 15:54:50 +08:00

@moonshot-ai/kimi-code-oauth

OAuth toolkit for Kimi Code managed authentication.

Part of the Kimi Code monorepo.

See the main repository for documentation, issues, and contribution guidelines.

License

MIT