-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Migration error handling #8010
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Migration error handling #8010
Changes from all commits
Commits
Show all changes
78 commits
Select commit
Hold shift + click to select a range
d01d373
feat(vscode): detect sessions in old extension
imanolmzd-svg 5742354
feat(vscode): added session types
imanolmzd-svg 3b3813b
feat(cli): add endpoints for inserting a session
imanolmzd-svg cb0f039
feat(vscode): use session types from sdk for parsing
imanolmzd-svg 389db69
feat(kilo-vscode): parsing session project
imanolmzd-svg 35efa92
feat(vscode): parse legacy session details
imanolmzd-svg 722723a
feat(kilo-vscode): refactoring
imanolmzd-svg 01d640c
feat(vscode): parse legacy session messages
imanolmzd-svg a0525c8
feat(vscode): parse legacy session parts
imanolmzd-svg 025ff71
feat(vscode): added testing files and id creation
imanolmzd-svg 515fe87
feat(vscode): merge tool parts on imported session
imanolmzd-svg b1a1bdb
feat(vscode): session message part refactoring
imanolmzd-svg ee84ada
feat(vscode): cover provider-specific reasoning parts on session migr…
imanolmzd-svg 5003b56
feat(kilo-vscode): handle completion result parts
imanolmzd-svg d6f1469
feat: type hardening on session migration
imanolmzd-svg 29fbe67
feat(kilo-vscode): create tool part correctly
imanolmzd-svg 04c4e7e
feat(kilo-vscode): adjust session part processing
imanolmzd-svg da7eb2e
feat(vscode): persist migrated session in kilo.db
imanolmzd-svg a699aed
feat(vscode): add error handling to session migration
imanolmzd-svg 6bd734f
feat(vscode): add directory field to session migration
imanolmzd-svg 604526a
feat(kilo-vscode): display completion check on session migration
imanolmzd-svg d900359
feat(vscode): prevent migrating sessions twice
imanolmzd-svg eab2e4b
feat(cli): use correct project id when inserting migrated session
imanolmzd-svg 5a6b0de
feat(kilo-vscode): Use correct project id for session migration
imanolmzd-svg 7be4ba1
feat(kilo-vscode): load sessions on migration complete
imanolmzd-svg 982ca47
feat(kilo-vscode): ignore environment details user part when migratin…
imanolmzd-svg 8e4ec58
feat(cli): create project details following current backend logic
imanolmzd-svg 309ed8e
feat(kilo-vscode): cleaner messages without environment_details parts
imanolmzd-svg 70e5d51
feat(kilo-vscode): refactoring
imanolmzd-svg 143dd77
feat(kilo-vscode): refactoring and organization
imanolmzd-svg 386596c
feat(kilo-vscode): method renaming to improve clarity
imanolmzd-svg 89d7fee
feat(kilo-vscode): added session migration test strategy
imanolmzd-svg 398872d
test(kilo-vscode): implement legacy migration unit tests for all migr…
imanolmzd-svg d04cba6
style(kilo-vscode): apply prettier formatting across legacy migration…
imanolmzd-svg e5e7b01
Merge branch 'main' into imanol/migration
imanolmzd-svg 9f10736
fix(legacy-migration): filter out non-user/assistant entries before p…
imanolmzd-svg 48634f9
refactor(parts): skip part generation for non-conversational message …
imanolmzd-svg f064555
fix(ids): use semantic kind strings to prevent part ID collisions for…
imanolmzd-svg 23daed6
refactor(session-import): guard against empty worktree in legacy proj…
imanolmzd-svg 9eea8b0
perf(cli): cache MCP listTools results to avoid redundant RPCs per lo…
marius-kilocode 9852be9
fix(agent-manager): add retries to worktree cleanup for macOS .app bu…
marius-kilocode 20b15eb
chore: hide non-English localization files in GitHub PR diffs
kilo-code-bot[bot] cb297a4
feat(vscode): add Browse Marketplace button to MCP settings
kilo-code-bot[bot] a5a73d0
fix(vscode): preserve project directory when opening marketplace from…
kilo-code-bot[bot] c305c1e
feat(vscode): add Browse Marketplace button to agents and skills tabs
markijbema dca9f64
chore: update kilo-vscode visual regression baselines
github-actions[bot] 87bb29b
perf(agent-manager): extend slimPart to strip heavy tool metadata for…
marius-kilocode cfc2b53
Merge branch 'main' into imanol/migration
imanolmzd-svg bf75212
style(legacy-migration): reformat long reasoning push call for readab…
imanolmzd-svg 140ed5b
refactor(legacy-migration): filter non-user/assistant entries before …
imanolmzd-svg 631c78c
Merge branch 'main' into imanol/migration
imanolmzd-svg e7d3692
Merge branch 'main' into imanol/migration
imanolmzd-svg 2617f74
fix(legacy-migration): add `_migrated_` infix to generated IDs
imanolmzd-svg e93413c
refactor(legacy-migration): consolidate conversation parsing into `pa…
imanolmzd-svg d9493c7
fix(parts-builder): remove `toTextWithinMessage` and use `toText` dir…
imanolmzd-svg 26b9d4e
fix(parts-builder): skip provider-specific reasoning when explicit re…
imanolmzd-svg 2360ee7
test(legacy-migration): add coverage for edge cases in parts and tool…
imanolmzd-svg b0605fe
fix(migration): require all items to succeed before marking migration…
imanolmzd-svg 991f0e6
fix(migration): defer disposeGlobal and loadSessions until after erro…
imanolmzd-svg 7c0a5c9
refactor(migration): extract MigrationError component and error selec…
imanolmzd-svg f18d6ed
feat(migration): introduce view-model module for migration state deri…
imanolmzd-svg e9b0582
refactor(legacy-migration): split shared types into dedicated modules
imanolmzd-svg 055fbf4
feat(errors): add migration error normalization utilities
imanolmzd-svg a199585
refactor(migrate): wrap migrate return in typed Result and normalize …
imanolmzd-svg 84f4ade
chore(migration): inline view-model helpers and remove extracted modules
imanolmzd-svg 3bf1d70
feat(i18n): add migration error copy-to-clipboard translations across…
imanolmzd-svg 9402bb3
style(migration): add error box and copy button styles for migration …
imanolmzd-svg 31c1374
Merge branch 'main' into imanol/migration-error-handling
imanolmzd-svg ab5ca21
fix: merge conflict issues resolved
imanolmzd-svg a02cf4f
fix: formatting
imanolmzd-svg 6eead10
Merge branch 'main' into imanol/migration-error-handling
imanolmzd-svg 937045b
i18n(migration): add localized strings for session migration progress…
imanolmzd-svg aca60aa
fix:formatting
imanolmzd-svg 43df5ba
feat(session-import): remove temporary test error from project import
imanolmzd-svg 905a7ad
fix(vscode): remove unused migration progress translations
imanolmzd-svg 0ec9d33
fix: formatting
imanolmzd-svg 956fc7c
fix(migration): track individual session progress instead of grouping…
imanolmzd-svg 5c276bd
fix: formatting
imanolmzd-svg File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
83 changes: 83 additions & 0 deletions
83
packages/kilo-vscode/src/legacy-migration/errors/migration-error.ts
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,83 @@ | ||
| interface ErrorLike { | ||
| message?: unknown | ||
| status?: unknown | ||
| data?: unknown | ||
| body?: unknown | ||
| } | ||
|
|
||
| function isObject(value: unknown): value is Record<string, unknown> { | ||
| return typeof value === "object" && value !== null | ||
| } | ||
|
|
||
| function getText(value: unknown): string | undefined { | ||
| if (typeof value === "string") { | ||
| const text = value.trim() | ||
| return text || undefined | ||
| } | ||
|
|
||
| if (typeof value === "number" || typeof value === "boolean") { | ||
| return String(value) | ||
| } | ||
|
|
||
| return undefined | ||
| } | ||
|
|
||
| function getMessage(value: unknown) { | ||
| if (!isObject(value)) return undefined | ||
| return getText((value as ErrorLike).message) | ||
| } | ||
|
|
||
| function getStatus(value: unknown) { | ||
| if (!isObject(value)) return undefined | ||
| const status = (value as ErrorLike).status | ||
| return typeof status === "number" ? String(status) : getText(status) | ||
| } | ||
|
|
||
| function getBody(value: unknown) { | ||
| if (!isObject(value)) return undefined | ||
|
|
||
| const body = (value as ErrorLike).body | ||
| const text = getText(body) | ||
| if (text) return text | ||
|
|
||
| if (isObject(body)) { | ||
| const msg = getMessage(body) | ||
| if (msg) return msg | ||
| } | ||
|
|
||
| return undefined | ||
| } | ||
|
|
||
| function getData(value: unknown) { | ||
| if (!isObject(value)) return undefined | ||
|
|
||
| const data = (value as ErrorLike).data | ||
| const text = getText(data) | ||
| if (text) return text | ||
|
|
||
| if (isObject(data)) { | ||
| const msg = getMessage(data) | ||
| if (msg) return msg | ||
| } | ||
|
|
||
| return undefined | ||
| } | ||
|
|
||
| export function getMigrationErrorMessage(err: unknown) { | ||
| const message = getMessage(err) | ||
| if (message) return message | ||
|
|
||
| const body = getBody(err) | ||
| if (body) return body | ||
|
|
||
| const data = getData(err) | ||
| if (data) return data | ||
|
|
||
| const status = getStatus(err) | ||
| if (status) return `Request failed (${status})` | ||
|
|
||
| const text = getText(err) | ||
| if (text) return text | ||
|
|
||
| return "Unknown migration error" | ||
| } |
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| export interface MigrationResultItem { | ||
| item: string | ||
| category: "provider" | "mcpServer" | "customMode" | "defaultModel" | "settings" | "session" | ||
| status: "success" | "warning" | "error" | ||
| message?: string | ||
| } |
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this code commented out?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shows the following button - Which deletes legacy settings. I think the cautious move for now is to not have it in place.
Screen.Recording.2026-03-31.at.17.48.54.mov