Repository navigation
Use current Kimi Desktop session and recheck it before each request - #892
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
# Conflicts: # CHANGELOG.md
Summary
Ports upstream steipete#4416 / steipete#3536 (
985e603c3,6acc6b2da): Kimi China uses only the current Kimi Desktop session and rechecks it before every request.https://www.kimi.com/access_tokenrecord from%APPDATA%\kimi-desktop\Local Storage\leveldbthrough a new strict single-key LevelDB reader (read_current_value_strict). MissingCURRENT, links/junctions, oversized or malformed files, torn logs, or a directory that changes mid-read all fail closed, so an older record is never recovered.nonealg,typ=access, futureexp,audcontainingkimi.com, pastnbfif present (signature not verified, same as upstream).kimi-authheaders, and the session must still hold the same token. A failed check sticks for all copies of the credential. A changed session is a non-auth error, so the chain stops instead of trying other tokens; Code API enrichment keeps the quota result.Windows adaptation: upstream's POSIX
realpath/O_NOFOLLOWwalk is replaced by link/junction rejection on each profile directory plusFILE_FLAG_OPEN_REPARSE_POINT. The macOS build flag and SweetCookieKit pairing are not applicable.Commands run
cargo test --manifest-path rust/Cargo.toml --no-fail-fast: 4642 passed, 1 failed (token_activity::codex_activity_leaves_the_shared_cost_coverage_alone, a pre-existing time-zone test bug on main fixed by Fix time-zone flake in token activity test #890), 1 ignoredcargo test --manifest-path apps/desktop-tauri/src-tauri/Cargo.toml: 729 passedcargo clippy --manifest-path rust/Cargo.toml --all-targets -- -D warnings: cleancargo fmt --all: no changesSummary by CodeRabbit