fix: copy user skills and clean up OAuth UX#31
Conversation
The first-launch migration previously left ~/.kimi/skills/ behind: the new scanner only reads ~/.kimi-code/skills/ and ~/.agents/skills/, so any custom skills authored against kimi-cli silently disappeared after the upgrade. Adds a skills step that copies top-level entries from ~/.kimi/skills/ into ~/.kimi-code/skills/ with skip-existing semantics, wires it into the existing run-migration pipeline and result screen, and surfaces the count alongside config/mcp/REPL-history.
OAuth credentials are deliberately never migrated (refresh tokens rotate server-side, so two installs sharing one token would fight over who gets refreshed). The previous UX framed this as a limitation: the result screen carried a yellow ⚠ "kimi-cli login not migrated — run /login" line, and the pre-migration summary listed "kimi-cli login (needs /login)" alongside real migratable data classes, making users think a login was about to be transferred and only the last step had failed. Drops both surfaces and short-circuits the pre-migration screen when the only legacy data is `credentials/*.json`. kimi-code's own /login flow handles re-auth on first use, so a dedicated migration notice is redundant. The `report.notices.oauthLoginsRequiringRelogin` JSON field is left intact for debugging.
🦋 Changeset detectedLatest commit: c4371e0 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b58a772e9d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| plan.totalSessions === 0 && | ||
| !plan.hasConfig && | ||
| !plan.hasMcp && | ||
| !plan.hasUserHistory && | ||
| plan.oauthCredentials.length === 0; | ||
| !plan.hasUserHistory; |
There was a problem hiding this comment.
Include skills in pending-migration detection
This nothingToMigrate check now ignores OAuth (intended) but still only considers sessions/config/MCP/history, so a legacy install that contains only ~/.kimi/skills/ is treated as “nothing to migrate.” In that case detectPendingMigration returns null, the first-launch migration UI is skipped, and kimi migrate (migrateOnly) also exits early with “Nothing to migrate,” so the newly added skills migration path never runs for that user segment.
Useful? React with 👍 / 👎.
| await cp(srcPath, tmpPath, { recursive: true, errorOnExist: false, force: true }); | ||
| await rename(tmpPath, tgtPath); | ||
| } catch (err) { | ||
| await rm(tmpPath, { recursive: true, force: true }).catch(() => {}); | ||
| throw err; |
There was a problem hiding this comment.
Skip unsupported skill entries instead of aborting migration
The step intentionally copies every top-level entry in ~/.kimi/skills, but any cp() error is rethrown, which aborts the entire migration run. fs.cp throws on special entries (for example FIFOs with ERR_FS_CP_FIFO_PIPE), so one such item can make the whole migration fail and block unrelated data (sessions/config/history) from being migrated. This should be handled per-entry as a skip/report instead of terminating the run.
Useful? React with 👍 / 👎.
Description
Two small fixes to the kimi-cli → kimi-code first-launch migration:
Copy
~/.kimi/skills/to~/.kimi-code/skills/. The scanneronly reads the new path, so legacy skills were silently lost on
upgrade. Top-level granularity, skip-existing, idempotent.
Stop mentioning OAuth in the migration UI. We never migrate
refresh tokens (they rotate server-side), so the old
⚠ kimi-cli login not migrated — run /loginnotice and thekimi-cli login (needs /login)summary line read like failures.Both are removed; oauth-only installs no longer trigger the
migration screen at all. kimi-code's normal
/loginflow handlesre-auth.
Checklist
gen-changesetsskill, or this PR needs no changeset.gen-docsskill, or this PR needs no doc update.