You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(kiro): discover the Windows kiro-cli token DB on login import (#710)
`ocx login kiro` could not import an existing Windows Kiro CLI session: it
reported no kiro-cli token and fell back to manual access-token paste even
while `kiro-cli whoami` showed an active login. The reader and token selector
were fine — only discovery was short. `nativeKiroCliSessionEntries()` listed
just the macOS and Linux stores, so `%LOCALAPPDATA%\Kiro-Cli\data.sqlite3`
was never a candidate. The reporter confirmed that pointing KIROCLI_DB_PATH
at it makes the import succeed with no manual paste.
Extract the candidate list into a pure `resolveKiroCliNativeSessionEntries(
env, platform, home)` and add the Windows store. Pure and parameterized
following src/claude/desktop-3p-paths.ts: `process.platform` is stubbable
here, but `os.platform()` does not follow it under Bun, so a resolver taking
its inputs is the reliable way to exercise the win32 branch and each of its
env fallback rungs from a macOS or Linux host.
Windows resolves LOCALAPPDATA -> %USERPROFILE%\AppData\Local -> injected
platform-native home. Deliberately not `userHome()`, which is
`HOME || homedir()`: Windows shells (Git Bash / MSYS / CI) routinely export a
POSIX-style HOME, which would aim the fallback at a non-native path. POSIX
branches keep `userHome()` so existing HOME-based fixtures still resolve.
The list returns one store per platform now instead of macOS+Linux on every
host. It also feeds forced-login snapshot/rollback, so naming the database
the local kiro-cli actually mutates is the correct contract; every consumer
already guards with existsSync.
Because the old cross-platform return value was load-bearing for fixtures,
four suites seeded the macOS layout unconditionally and would stop finding
their fixtures on the Linux and Windows CI legs. They now seed the
host-resolved layout and isolate LOCALAPPDATA/USERPROFILE, without which a
Windows runner could read the real user profile.
Also name the Windows store in the snapshot-failure repair message, which
Windows users can now reach.
Verification: bun run test 5987 pass / 1 skip / 0 fail (mandated by
src/AGENTS.md for OAuth changes); bun x tsc --noEmit clean; new suite 6 pass
covering all three win32 rungs by name; four amended suites 129 pass;
privacy scan passed.
Closes#710
0 commit comments