kimi-code/packages/oauth
7Sageer 1294a0e1ad
fix(agent-core-v2): keep invalidated OAuth flows observable during login (#1663)
* fix(agent-core-v2): keep invalidated OAuth flows observable during login

invalidateFlows() deleted flows outright when the provider configuration
changed, including terminal ones. That voided the TERMINAL_RETENTION_MS
window and, worse, left the status guards in handleSuccess /
finalizeAuthentication blind when the invalidation landed in the
microtask gap after toolkit.login resolved: setTerminal then wrote
'authenticated' onto an orphaned state the client could never observe,
so the login hung after a successful browser authorization.

Transition affected pending flows to a visible 'cancelled' terminal
status instead, mirroring abortExisting().

Also normalize the KIMI_CODE_BASE_URL env override at the source in
kimiCodeBaseUrl(): provision persists it verbatim while the model
refresh rewrites it normalized, and the deep-equal diff between the two
shapes fired a spurious providers-changed event mid-login.

* style(agent-core-v2): drop non-header comments from the oauth login fix

* chore: cover agent-core-v2 in the oauth login fix changeset
2026-07-14 12:16:28 +08:00
..
examples Kimi For Coding 2026-05-22 15:54:50 +08:00
src fix(agent-core-v2): keep invalidated OAuth flows observable during login (#1663) 2026-07-14 12:16:28 +08:00
test fix(agent-core-v2): keep invalidated OAuth flows observable during login (#1663) 2026-07-14 12:16:28 +08:00
CHANGELOG.md ci: release packages (#390) 2026-06-04 21:45:01 +08:00
package.json chore: drop #/ import array fallbacks and custom resolution plugins (#1594) 2026-07-13 16:37:35 +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