fix(cli): show migration failure reason#210
Open
lurenjia534 wants to merge 1 commit into
Open
Conversation
🦋 Changeset detectedLatest commit: 8ec2520 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related Issue
Part of #203
Problem
When
kimi migratefails, the migration screen currently drops the thrown error and only renders the genericMigration failedmessage. This leaves users without the immediate failure reason and makes migration issues harder to diagnose.This PR does not claim to fix every possible post-migration provider or connection failure discussed in #203. It only addresses the narrower, reproducible diagnostic issue where the failed migration screen hides the underlying error.
What changed
The migration screen now preserves the rejection reason from the migration runner and renders it on the failure screen as
Reason: ....The formatter intentionally avoids stack traces and does not serialize arbitrary thrown objects. It shows
Error.message, string rejections, primitive values, or a generic object/function fallback so the UI provides useful diagnostics without dumping unrelated object contents.The existing failure-path test now asserts that the rendered screen includes both
Migration failedand the underlying rejection reason.Validation
pnpm --filter @moonshot-ai/kimi-code exec vitest run test/migration/migration-screen.test.tspnpm --filter @moonshot-ai/kimi-code run typecheckpnpm exec oxlint --type-aware apps/kimi-code/src/migration/migration-screen.ts apps/kimi-code/test/migration/migration-screen.test.tspnpm --filter @moonshot-ai/kimi-code run testChecklist
gen-changesetsskill, or this PR needs no changeset.gen-docsskill, or this PR needs no doc update.