Repository navigation
fix(vscode): clear unsent drafts on session deletion #11442
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
marius-kilocode
merged 36 commits into
Kilo-Org:main
from
IamCoder18:vscode/cleanup-drafts-on-session-delete
Jul 3, 2026
Merged
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
5df7aa4
fix(vscode): clear unsent drafts on session deletion
IamCoder18 494817d
fix(vscode): prevent draftKey effect from recreating deleted-session …
IamCoder18 f310d46
Merge branch 'main' into vscode/cleanup-drafts-on-session-delete
IamCoder18 152cf66
fix(vscode): forward external session deletions and decouple draft id…
IamCoder18 d4be9ec
fix(vscode): don't re-track deleted sessions and purge per-session mo…
IamCoder18 67691a2
fix(vscode): prune per-session state on every deletion path
IamCoder18 8b7f1ab
merge: upstream main into vscode/cleanup-drafts-on-session-delete
IamCoder18 faa47d0
fix(vscode): drop sessionStatusMap and respondingPermissions on delete
IamCoder18 fbe5f4c
fix(vscode): recover from external session deletes during send
IamCoder18 2db9934
Merge branch 'main' into vscode/cleanup-drafts-on-session-delete
IamCoder18 2a3f0b0
fix(vscode): restore failed draft into current bucket, not stale session
IamCoder18 9fc017c
fix(vscode): only restore failed draft into buckets the send was scop…
IamCoder18 454d35c
fix(vscode): accept :new as restoreFailed candidate when user is back…
IamCoder18 68f70e2
fix(vscode): suppress :new restoreFailed candidate after user-initiat…
IamCoder18 1974ddc
fix(vscode): early-return restoreFailed when user explicitly cleared …
IamCoder18 409ea5f
docs(changeset): note mid-send restore recovery in cleanup-drafts cha…
IamCoder18 b36b740
fix(vscode): clear userClearedSession when user starts a new draft fr…
IamCoder18 74f9bf6
Merge branch 'main' into vscode/cleanup-drafts-on-session-delete
IamCoder18 0601898
fix(vscode): reset userClearedSession on cloud session select and import
IamCoder18 a63517e
fix(vscode): migrate draftSessionID and prune cloud parts on import
IamCoder18 b9febc6
fix(vscode): clear draftSessionID on cloudSessionImportFailed
IamCoder18 0c91183
fix(vscode): guard draftSessionID clear on cloud import failure
IamCoder18 12ee9ef
fix(vscode): guard currentSessionID clear on cloud import failure
IamCoder18 733d11d
fix(vscode): guard cloudPreviewId clear on cloud import failure
IamCoder18 57c09d2
fix(vscode): guard loading clear on cloud import failure
IamCoder18 37bbbd0
fix(vscode): order loading clear before cloudPreviewId clear on failure
IamCoder18 9d3b150
Merge remote-tracking branch 'upstream/main' into vscode/cleanup-draf…
IamCoder18 5eabe93
refactor(vscode): extract cloud-prune helpers and compact session.tsx
IamCoder18 e4f98ca
fix(vscode): move createCloudPrune inside SessionProvider
IamCoder18 80a8ee0
fix(vscode): restore prompt-send contract shapes after cloud-prune re…
IamCoder18 14f6f2d
test(vscode): exercise clearIfOn helper instead of source-grep
IamCoder18 8f251ad
style(vscode): fix Prettier formatting in KiloProvider.ts
IamCoder18 3795ae0
fix(vscode): clear cloud preview state on import failure using raw se…
marius-kilocode d650fb5
Merge origin/main into vscode/cleanup-drafts-on-session-delete
marius-kilocode 33206d7
refactor(vscode): compact session delete cleanup to satisfy max-lines
marius-kilocode 30acec7
refactor(vscode): reduce diff noise vs main
marius-kilocode 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
Some comments aren't visible on the classic Files Changed page.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "kilo-code": patch | ||
| --- | ||
|
|
||
| Free webview memory for deleted VS Code sessions by clearing unsent prompt text, review comments, and pending image attachments that were retained in the per-session draft cache after `sessionDeleted`. |
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
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,21 @@ | ||
| import type { ReviewComment } from "../types/messages" | ||
| import type { ImageAttachment } from "../hooks/useImageAttachments" | ||
|
|
||
| export const drafts = new Map<string, string>() | ||
| export const reviewDrafts = new Map<string, ReviewComment[]>() | ||
| export const imageDrafts = new Map<string, ImageAttachment[]>() | ||
|
|
||
| export function deleteDraftsForSession(id: string) { | ||
| if (!id) return | ||
| const sessionSuffix = `:session:${id}` | ||
| const pendingSuffix = `:pending:${id}` | ||
| const maps = [drafts, reviewDrafts, imageDrafts] | ||
| for (const map of maps) { | ||
| for (const key of map.keys()) { | ||
| if (typeof key !== "string") continue | ||
| if (key.endsWith(sessionSuffix) || key.endsWith(pendingSuffix)) { | ||
| map.delete(key) | ||
| } | ||
| } | ||
| } | ||
| } |
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.
Uh oh!
There was an error while loading. Please reload this page.